Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
initiate the game with some introduction text
function beginGame(game_ID, players) { var txts1 = [ "ACCESSING SYSTEM...", "HELLO [NAME] HOW ARE YOU", "WOULD Y@U *! L?K3 T0 *£..$..", "...¤¤¤..@..?...*#..!........." ]; var txts2 = [ " ", "!!! ...WARNING... !!!", "A HOSTILE ENTITY IS TRYING TO ACCESS YOUR SYSTEM...", "!!! ...WARNING... !!!", "FIND THE KILLCODE FOR THE HOSTILE SYSTEM", "LOOK THROUGH THE FILES IN THE HOSTILE SYSTEM", "THE KILLCODE WILL SHUT DOWN THE HOSTILE SYSTEM...", "...FIND IT BEFORE THEY FIND YOURS...", "..........", "HACKING HOSTILE SYSTEM... INITIATED", "..........", "HACKING COMPLETED SUCCESSFULLY!", "ACCESS GRANTED..." ]; var txts3 = [ " ", "HELLO [OPPONENT] HOW ARE YOU", "FOR HELP NAVIGATING THE SYSTEM TYPE 'HELP'", ]; io.emit('starting game', [game_ID, txts1, txts2, txts3, players]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function introduction (game) {\n out(GAME_INTRODUCTION);\n scenes_tick(game);\n look(game);\n update_statusbar(game);\n}", "function C005_GymClass_Intro_Run() {\n\t\n\t// Paints the background\n\tDrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background.jpg\", 0, 0);\n\tDrawPlayerTransition();\n\n\t// Write the chapter introduction\n\tDrawText(GetText(\"Intro1\"), 450, 100, \"White\");\n\tif (TextPhase >= 1) DrawText(GetText(\"Intro2\"), 450, 200, \"White\");\n\tif (TextPhase >= 2) DrawText(GetText(\"Intro3\"), 450, 300, \"White\");\n\tif (TextPhase >= 3) DrawText(GetText(\"Intro4\"), 450, 400, \"White\");\n\tif (TextPhase >= 4) DrawText(GetText(\"Intro5\"), 450, 500, \"White\");\n\n}", "function C001_BeforeClass_Intro_Run() {\n\t\n\t// Draw the background and player\n\tif (TextPhase <= 2) DrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background1.jpg\", 0, 0);\n\telse DrawImage(CurrentChapter + \"/\" + CurrentScreen + \"/Background2.jpg\", 0, 0);\n\tDrawPlayerTransition();\n\t\n\t// Introduce chapter 1 with each clicks\n\tDrawText(GetText(\"Intro1\"), 450, 50, \"White\");\n\tif (TextPhase >= 1) DrawText(GetText(\"Intro2\"), 450, 150, \"White\");\n\tif (TextPhase >= 2) DrawText(GetText(\"Intro3\"), 450, 250, \"White\");\n\tif (TextPhase >= 3) DrawText(GetText(\"Intro4\"), 450, 350, \"White\");\n\tif (TextPhase >= 4) DrawText(GetText(\"Intro5\"), 450, 450, \"White\");\n\tif (TextPhase >= 5) DrawText(GetText(\"Intro6\"), 450, 550, \"White\");\n\n}", "function intro() {\n\tbackground(50);\n\n\tfill(255);\n\tnoStroke();\n\ttextSize(100);\n\ttextAlign(CENTER, CENTER);\n\ttext('INTRO', width/2, height/2);\n\n\ttextSize(24);\n\ttext('[ press any key to start ]', width/2, height-height/4);\n}", "function C005_GymClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 5) {\n\t\tPlayerClothes(\"Judo\");\n\t\tCommon_SelfBondageAllowed = false;\n\t\tSetScene(CurrentChapter, \"Jennifer\");\t\t\n\t}\n}", "function C001_BeforeClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 6)\n\t\tSetScene(CurrentChapter, \"Classroom\");\n}", "function init() {\n createWelcomeGraphic();\n console.log('WELCOME TO ASSOCIATE MANAGER!');\n console.log('FOLLOW THE PROMPTS TO COMPLETE YOUR TASKS.');\n}", "function C002_FirstClass_Intro_Click() {\n\tTextPhase++;\n\tif (TextPhase >= 5)\n\t\tSetScene(CurrentChapter, \"Mildred\");\n}", "function intro() {\n\t\tif (getyx(y,x) =='Y5X2') {\n\t\talert('Greetings, I am the all powerfull Elodin, son of Steve \\nI am here to guide you on a quest!\\nAre You ready to play?');\n\t\tvar answer = prompt();\n\t\t\tif(answer.toUpperCase() == 'YES'){\n\t\t\t\tbeginWizard.appendChild(beginWizardImg);\n\t\t\t\talert('Fantastic! \\nGet a score of 100 to win the game \\nDont Let your health get to zero or you will die\\nGood Luck and godspeed');\n\n\t\t\t}\n\t\t\telse {\n\t\t\t\talert('Alright your loss, get out of here');\n\t\t\t\treloadPage();\n\t\t\t}\n\t\t}\n}", "function introduction() {\n\tconsole.log(\"Welcome to Coding at Philz! Let's get started! \\n . \\n . \\n\");\n\tconsole.log(\"You are going to have to blend in! Let's hit your closet! \\n . \\n . \\n\")\t\n}", "startGame() {\n this.phrase = new Phrase(this.getRandomPhrase());\n this.addClueToDisplay();\n this.phrase.addPhraseToDisplay();\n }", "function doSetupTitleScreenLevelContinue(){\tLoadGame();}", "function initGame() {\n console.log('Game initiated!');\n\n //Set up everything\n TweenMax.set(ball.elm, {left: ballPos[1], top: 240});\n TweenMax.set(cup0.elm, {left: cupPos[0]});\n TweenMax.set(cup1.elm, {left: cupPos[1]});\n TweenMax.set(cup2.elm, {left: cupPos[2]});\n\n\n //Wait 2 seconds and show intro text.\n var introtext = \"The Piranha Plant is on the lose, do not lose sight of it! <br/><br/> <button class='small kongtext' onclick='startGame(4)'>Start game</button>\"\n TweenMax.delayedCall(2, showMessage, [introtext]);\n\n }", "startGame() {\r\n // Hide start screen overlay\r\n document.getElementById('overlay').style.display = 'none';\r\n\r\n // get a random phrase and set activePhrase property\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhrasetoDisplay();\r\n }", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\r\n document.getElementById('overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function startGame() {\n pairMovieWithSounds();\n randomSounds(movie);\n addPhraseToDisplay();\n keyboardSetup();\n}", "function introduction()\n{\n\tif(lineEventEnd == 1){\n\t\t//smooth title generic\n\t\th1.fadeIn(5000, function(){\n\t\t\t$(this).delay(2000).fadeOut(5000);\n\t\t});\n\n\t\tlineStory(str.msg_intro, 3000, true);\n\t}\n}", "startGame() {\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n }", "function title() {\n //Intro title 1\n if (introState === 0) {\n displayIntroTitle();\n }\n else if(introState === 1) {\n image(imgIntro1, 0, 0,1360,840); //Introduction story image 1\n //Play background music in a loop when loaded\n if (bgMusic.isPlaying() === false) {\n bgMusic.loop();\n }\n }\n else if(introState === 2) {\n image(imgIntro2, 0, 0,1360,840); //Introduction story image 2\n if (bgMusic.isPlaying() === false) {\n bgMusic.loop();\n }\n }\n else if(introState === 3) {\n image(imgIntro3, 0, 0,1360,840); //Introduction story image 3\n if (bgMusic.isPlaying() === false) {\n bgMusic.loop();\n }\n }\n else if(introState === 4) {\n push();\n imageMode(CENTER);\n image(imgIntro4, width/2, height/2+200,250,140); //Introduction story image 4\n pop();\n //Instructions screen\n fill(255); //white\n displayText(`Use the arrow keys to move Antonio!\n 1. Avoid the grey rocks\n 2. Gather 500 points before time runs out!`);\n if (bgMusic.isPlaying() === false) {\n bgMusic.loop();\n }\n }\n else {\n state =`simulation`;\n }\n}", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "startGame() {\r\n $(\"#overlay\").hide();\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function runIntro(name) {\n var welcome_screen = document.getElementById(\"welcome-screen\");\n var welcome_text = document.createElement(\"p\");\n document.getElementById(\"welcome-screen-frame\").style.display = \"none\";\n welcome_screen.style.animation = \"welcome-screen-go-up 2s 1 2s\";\n welcome_screen.style.animationDelay = \"2s\";\n welcome_screen.style.animationFillMode = \"forwards\";\n welcome_screen.appendChild(welcome_text);\n welcome_text.style.fontSize = \"10vh\";\n welcome_text.style.opacity = \"0\";\n welcome_text.style.animation = \"hello-fade-in 2s 1\";\n welcome_text.style.animationFillMode = \"forwards\";\n welcome_text.innerText = \"Hello\" + name + \"!\";\n document.getElementById(\"display-4\").innerHTML = \"Welcome\" + name + \"!\";\n setTimeout(function() {\n document.body.style.overflow = \"auto\";\n }, 4000);\n}", "startGame() {\n overlay.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame(){\n document.querySelector('#overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function displayIntroTitle(){\n push();\n textFont(`Blenny`);\n textAlign(CENTER,CENTER);\n textSize(140);\n fill(breadFill.r, breadFill.g, breadFill.b);\n text(`get this bread`, width/2, height/2);\n pop();\n push();\n textFont(`Blenny`);\n textAlign(CENTER,CENTER);\n textSize(40);\n fill(255);\n text(`press anywhere to continue`, width/2, height/1.5);\n pop();\n}", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\n const overlay = document.getElementById('overlay');\n\n overlay.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "startGame() {\n document.getElementById(\"overlay\").style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame(){\n const overlay = document.querySelector(\"#overlay\");\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\r\n const phrase = this.getRandomPhrase();\r\n this.activePhrase = phrase;\r\n phrase.addPhraseToDisplay();\r\n document.getElementById('overlay').style.display = 'none'; // hide the start screen.\r\n }", "function startGame(){\n\tgamePrompt(\"S.R.S.V: Press Enter to Start and to Continue\",intro);\n}", "startGame(){\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "async playIntro() {\n this.intro = new Intro();\n await this.intro.play();\n this.buildGameComponents();\n }", "function intro_screen(){\r\n\tcontext.font = \"50px Impact\";\r\n\tcontext.fillStyle = \"#0099CC\";\r\n\tcontext.textAlign = \"center\";\r\n\tcontext.fillText(\"GET OUT\", canvas.width/2, canvas.height/2);\r\n\r\n\tcontext.font = \"20px Arial\";\r\n\tcontext.fillText(\"Press Enter To Start ... if you dare\", canvas.width/2, canvas.height/2 + 50);\r\n}", "startGame() {\n $('#overlay').slideUp(1500);\n this.activePhrase = this.getRandomPhrase();\n gamePhrase = new Phrase(this.activePhrase);\n gamePhrase.addPhraseToDisplay(); \n }", "function initScreen() {\n\tstartScreen = \"<p class='text-center introText'>Through this trivia game you'll test your knowledge about Jon,<br> and perhaps learn a thing or three.<a class='btn btn-danger btn-lg btn-block start-button' role='button'>Start Quiz</a></p>\";\n\t$(\".mainArea\").html(startScreen);\n}", "startGame() {\n let overlayElement = document.getElementById('overlay');\n overlayElement.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\n const startScreen = document.getElementById('overlay');\n startScreen.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function drawIntro() {\n\n // 015 creamos el botón exactamente donde se sitúa el texto y lo ponemos más arriba (se sitúa debajo del punto 014)\n fill(255, 0, 0);\n ellipse(startCenterX, startCenterY, startButtonSize, startButtonSize);\n // 014 especificaciones de la pantalla intro\n fill(255);\n noStroke();\n text(\"Would you like to \\nplay a game ?\", 0, 0, width, height -100);\n text(\"YES\", 0, 450, width, 50);\n\n // 016 escribir el código parael botón\n\n //var d = dist(mouse);\n}", "startGame(){\r\n document.querySelector('#overlay').style.display = 'none';\r\n this.activePhrase = new Phrase(this.getRandomPhrase());\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function start()\n{\n\tGame.setup(\"buffer1\", \"buffer2\", \"debugArea\");\n\tvar intro = new IntroState();\n\tGame.start(intro);\n}", "function displayTutorial() {\n push();\n textSize(28);\n textAlign(LEFT);\n // if text is fading in\n if (!tutorialFadeAway) {\n tutorialFontAlpha = lerp(tutorialFontAlpha, 255, 0.05);\n // if text is fading out\n } else {\n tutorialFontAlpha = lerp(tutorialFontAlpha, 0, 0.1);\n }\n fill(255, tutorialFontAlpha);\n text(TEXT_LETTER, width / 12, height / 2);\n // do only once\n if (doOnce) {\n // create a next button\n var $button = $(\"<div class='button' id = 'tutorial-button'></div>\").text(\"next\").button().click(function() {\n tutorialFadeAway = true;\n $('#tutorial-button').remove();\n SOUND_HIGH_PIANO_KEY.play();\n }).hide().fadeIn(500);\n $body.append($button);\n doOnce = false;\n }\n // if the player clicks the next button and the opacity is less than 1\n // go to gameplay\n if (tutorialFadeAway && tutorialFontAlpha <= 1) {\n setTimeout(function() {\n state = \"PLAY\";\n doOnce = true; // reset doOnce\n gameBackground.fadeIn = true; // fade in the background\n showTriggers(); // show the object trigger buttons\n $directionIndicator.show(); // show the direction indicator\n }, 2000);\n }\n pop();\n}", "startGame() {\n const divOverlay = document.querySelector('#overlay');\n divOverlay.style.display = 'none';\n const randomPhrase = this.getRandomPhrase();\n randomPhrase.addPhraseToDisplay();\n this.activePhrase = randomPhrase;\n\n }", "onTutorialDone() {\n this.show();\n this.app.message('The tutorial is always available in the settings menu at the bottom right.',5000)\n }", "startGame(){\r\n const overlay = document.getElementById('overlay');\r\n overlay.style.display='none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "startGame() {\n let startOverlay = document.getElementById('overlay');\n startOverlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\n this.resetGame();\n const overlay = document.getElementById('overlay').style.display = 'none';\n const randomPhrase = game.getRandomPhrase();\n randomPhrase.addPhraseToDisplay();\n this.activePhrase = randomPhrase;\n }", "startGame() {\n let hideScreen = document.getElementById('overlay')\n hideScreen.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "startGame(){\n const overlay = document.getElementById(\"overlay\");\n overlay.style.visibility = 'hidden';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() { \n const startScreen = document.querySelector('#overlay');\n startScreen.style.display = 'none';\n this.activePhrase = this.getRandomPhrase(); \n this.activePhrase.addPhraseToDisplay();\n }", "startGame(){\n document.getElementById(\"overlay\").style.display = \"none\"\n this.activePhrase = new Phrase(this.getRandomPhrase(this.phrases))\n this.activePhrase.addPhraseToDisplay()\n }", "startGame(){\n const overlayDiv = document.querySelector('#overlay');\n overlayDiv.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function gamestart() {\n\t\tshowquestions();\n\t}", "startGame() {\r\n document.getElementById('overlay').style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n splitPhraseArray = this.activePhrase.phrase.split('');\r\n }", "startGame(){\n const overlay = document.getElementById('overlay')\n overlay.style.display = 'none';\n overlay.hidden = true;\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n \n }", "async function intro() {\n const introMessage = `Welcome to the Zombie Apocalypse! Zombies are all around and closing in fast! Please word your actions in a [action] + [Item/Room] format`;\n let startPrompt = await ask(introMessage + \"\\n\" + \"Do you understand?\\n>_\");\n let cleanStart = cleanWords(startPrompt);\n if (cleanStart === \"yes\") {\n start();\n } else {\n console.log(\"Come back when you're ready then!\");\n process.exit();\n }\n}", "startGame() {\r\n document.querySelector('#overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n this.resetGame(); \r\n }", "startGame(){\r\n startScreen.style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase(this.phrases).toLowerCase();\r\n chosenPhrase = new Phrase(this.activePhrase);\r\n chosenPhrase.addPhraseToDisplay()\r\n }", "function displayTitle() {\n // Create elements for display\n push();\n textAlign(CENTER,CENTER);\n textSize(100);\n fill(0,0,0);\n textFont(fontGame);\n // Display the text\n text(\"CLKRT MSTRPC!\",width/2,height/4);\n textSize(30);\n stroke(255,0,0);\n // Display the instructions for the experience\n text(\"Collage without the glue and scissors. Yaaasssss! \\n LEFT ARROW = rotate-L \\n RIGHT ARROW = rotate-R \\n UP ARROW = expand \\n DOWN ARROW = shrink \\n SHIFT = a little magic \\n CLICK on your mouse to stamp \\n and don't stop, EVER ! \\n \\n Start by recording your voice... speak loud or use mic for best result \\n Press any button to record - Say something silly or poetic - press any button to stop \\n Now, press spacebar to begin a chef-d'oeuvre\",width/2,height/2+50);\n pop();\n\n // Check whether the spacebar was pressed to start the game...\n if (keyIsPressed && key === ' ') {\n // ... if it was, change the state to \"GAME\" so the switch statement in draw()\n // will display the game instead\n masterpiece = \"GAME\";\n //Call ambiance music for collage experience\n ambianceSFX.play();\n }\n}", "startGame(){\n document.getElementById(\"overlay\").style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n this.resetGame();\n }", "function startGame() {\n setVars();\n clearInterval(wordAnimation); // Stop animations on how-to page\n getTopics();\n displayTopicChoice();\n $(\".try-again\").addClass(\"d-none\"); // Remove try again button\n $(\".menu1\").addClass(\"d-none\");\n $(\".menu2\").removeClass(\"d-none\");\n $(\".skip-question-btn\").css(\"background-color\", \"#054a91\"); // Reset Skip Button\n $(\"#message-icon\").text(\" \"); // Get rid of lives icon\n}", "startGame(){\n\t\tconst divOverlay = document.getElementById('overlay')\n \t\tif (divOverlay.className === 'lose' || divOverlay.className === 'win'){\n \t\t\tconsole.log('Reset', divOverlay)\n \t\t\tthis.gameReset()\n \t\t}\n\n \t\tthis.createPhrases();\n \t\tdivOverlay.style.display = 'None'\n \t\tthis.activePhrase = this.getRandomPhrase();\n \t\tthis.activePhrase.addPhraseToDisplay();\n \t}", "function Instructions() {\n background(colorList[0]);\n \n textSize(100);\n textAlign(CENTER);\n fill(colorList[2]);\n text(\"How to Play\", width/2, 100);\n\n textSize(50);\n textAlign(LEFT);\n fill(colorList[4]);\n text(\"Hold W to toggle the Head\\nHold s to toggle the middle body\\nHold a to toggle the right arm\\nHold d to toggle the left arm\\nHold z to toggle the right leg\\nHold x to toggle the left leg\\n\\nMove the mouse horizontally to make\\nthe block that's toggled dance\", 150, 425); \n}", "function buildTutorialScreen() {\n //creating tutorial welcome\n let x = width / 2;\n let y = 100 * progScale;\n let s = \"Welcome to the Tutorial!\";\n let title = new DisplayText(x, y, 0, 0, s);\n title.textSize = 70 * progScale;\n allObjects.push(title);\n\n //Explaining movement\n\n //sideways movement\n x = width / 2;\n y = 200 * progScale;\n s = \"Use these Keyboard Keys for Movement:\";\n let textMovement = new DisplayText(x, y, 0, 0, s);\n textMovement.textSize = 45 * progScale;\n allObjects.push(textMovement);\n\n //sideways movement 2\n x = width / 2;\n y = 275 * progScale;\n s = \"A and D OR <- and -> Arrow Keys\";\n let textAD = new DisplayText(x, y, 0, 0, s);\n textAD.textSize = 45 * progScale;\n textAD.textFont = fontBold;\n allObjects.push(textAD);\n\n //Jumping\n x = width / 4;\n y = 400 * progScale;\n s = \"To Jump, press the:\";\n let textjump = new DisplayText(x, y, 0, 0, s);\n textjump.textSize = 45 * progScale;\n allObjects.push(textjump);\n\n //Jumping 2\n x = width / 4;\n y = 475 * progScale;\n s = \"Spacebar\";\n let textSpace = new DisplayText(x, y, 0, 0, s);\n textSpace.textSize = 45 * progScale;\n textSpace.textFont = fontBold;\n allObjects.push(textSpace);\n\n //Wall Jumping\n x = width / 1.33;\n y = 400 * progScale;\n s = \"You can wall-jump\\nby pressing jump\\nwhile on a wall\";\n let textWallJump = new DisplayText(x, y, 0, 0, s);\n textWallJump.textSize = 30 * progScale;\n allObjects.push(textWallJump);\n \n //Pause message\n x = width / 1.33;\n y = 525 * progScale;\n s = \"Press ESC or ENTER\\nto Pause the game\";\n let pauseMessage = new DisplayText(x, y, 0, 0, s);\n pauseMessage.textSize = 25 * progScale;\n pauseMessage.textAlignH = CENTER;\n allObjects.push(pauseMessage);\n\n\n //Player and Blocks display\n //Block\n let w = 500 * progScale;\n let h = 50 * progScale;\n x = width / 2 - w / 2;\n y = 700 * progScale;\n\n let b = new Block(x, y, w, h);\n allObjects.push(b);\n allBlocks.push(b);\n b.setStrokeWeight(0);\n b.setStrokeColor(color(255, 255, 255)); //white stroke\n\n //Player\n w = h * (0.75);\n x = width / 2 - w / 2;\n y = y - w - ((w / 0.75) * 0.75 / 2);\n\n //adjusting x and y based on w being smaller\n //x += ((w / 0.75) - w) / 2;\n //y += ((w / 0.75) - w) / 2;\n\n let p = new Player(x, y, w, w);\n allObjects.push(p);\n p.fillColor = color(255, 190, 0); //Orange\n p.spawnStrokeColor = color(255, 190, 0); //Orange\n p.spawnFillColor = color(255, 190, 0, 0); //Orange with transparency\n p.setStrokeWeight(0);\n\n \n //Continue message\n x = width/2;\n y = 775 * progScale;\n s = \"Click this Button to continue\";\n let continueMessage = new DisplayText(x, y, 0, 0, s);\n continueMessage.textSize = 25 * progScale;\n continueMessage.textAlignH = CENTER;\n allObjects.push(continueMessage);\n \n //tutorial button\n w = 400 * progScale;\n h = 75 * progScale;\n x = (width / 2) - w / 2;\n y = 800 * progScale;\n let startTutorial = function() {\n clearGameObjects(); //clearing menu\n currentLevelSet = tutorialLevels; //setting set of levels to load\n currentLevel = 1; //for display\n currentLevelIndex = 0; //for level indexing\n numberOfDeaths = 0; //so practice deaths don't count\n gameTimer.reset(); //reseting current time on timer\n buildLevel(currentLevelIndex, currentLevelSet); //starting level\n };\n let btnTutorial = new Button(x, y, w, h, startTutorial);\n btnTutorial.displayText = \"Let's Try It!\";\n btnTutorial.strokeWeight = 0;\n btnTutorial.fillColor = color(0, 255, 255); //light blue\n btnTutorial.hoverColor = color(0, 255 / 2, 255 / 2); //darker\n btnTutorial.textSize = 45 * progScale;\n btnTutorial.textColor = color(0, 0, 0); //black\n btnTutorial.textHoverColor = color(255, 255, 255); //white\n allObjects.push(btnTutorial);\n\n //About Levels\n x = width / 2;\n y = 912 * progScale;\n s = \"The following levels will explain the rest...\";\n let textLevels = new DisplayText(x, y, 0, 0, s);\n textLevels.textSize = 30 * progScale;\n allObjects.push(textLevels);\n\n}", "function introScreen() {\n SDPresents = new image(DEMO_ROOT + \"/def/resources/senior.png\");\n presentsScreen = SeniorDads.ScreenHandler.Codef(640,400,name,zIndex++);\n \t\tSDPresents.draw(presentsScreen,0,0);\n \t}", "function init() {\n // Create game stage & initialize stuff\n superSimple.start();\n // Show tutorial\n tutorial.start();\n // when tutorial ends do...\n tutorial.onEnd = function() {\n var a = new After();\n a.after(0, function() {\n superSimple.controller.showMessage(\"Enjoy!\", 40, 2);\n })\n .after(1, function() {\n superSimple.controller.spawnPlayer();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n })\n .after(0.5, function() {\n superSimple.controller.spawnEnemy();\n superSimple.controller.spawnEnemy();\n });\n };\n }", "function start() {\n const logoText = figlet.textSync(\"Employee Database Tracker!\", 'Standard');\n console.log(logoText);\n loadMainPrompt();\n}", "startGame() {\n this.resetGame();\n let startScreen = document.getElementById('overlay');\n startScreen.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function startNewGame(text){\n\n\t//console.log('start new game!');\n\n\ttext.destroy();\n\n\t//not very elegant but it does the job\n\tvar playerName = prompt(\"What's your name?\", \"Cloud\");\n\n\t//store player name in cache to be shown on in-game HUD\n\tlocalStorage.setItem(\"playerName\", playerName);\n\n\tthis.game.state.start('Game');\n}", "startGame(){\n console.log(this.phrase_num);\n document.getElementById('overlay').style.display = 'none';\n \n this.activePhrase = this.getRandomPhrase();\n document.getElementById(\"hint\").textContent = \"Hint: \" + this.activePhrase.hint;\n \n console.log(this.activePhrase);\n this.activePhrase.addPhraseToDisplay();\n\n \n \n }", "function displayMainMenu() {\n push();\n textSize(28);\n fill(255, mainMenuFontAlpha); // changing opacity\n text(\"SPECIAL EPISODE: THE CUBE\", width / 2, height - height / 8);\n textSize(64);\n // if title is fading in\n if (!titleFadeAway) {\n // opacity transition from 0 to 255\n mainMenuFontAlpha = lerp(mainMenuFontAlpha, 255, 0.05);\n // height transition from bottom to the center\n mainMenuFontHeight = lerp(mainMenuFontHeight, height / 2 - height / 8, 0.05);\n // if title is fading out\n } else {\n // opacity transition from 255 to 0\n mainMenuFontAlpha = lerp(mainMenuFontAlpha, 0, 0.05);\n // height transition from center to the bottom\n mainMenuFontHeight = lerp(mainMenuFontHeight, height + height / 8, 0.03);\n }\n // fill the title with changing opacity\n fill(127, 255, 212, mainMenuFontAlpha);\n text(\"QUESTIONABLE\\nLOGIC\", width / 2, mainMenuFontHeight);\n // if the opacity is >= 210 and do this only once\n if (mainMenuFontAlpha >= 210 && doOnce) {\n // create a start button\n var $button = $(\"<div class='button' id = 'title-button'></div>\").text(\"start\").button().click(function() {\n titleFadeAway = true;\n $('#title-button').remove();\n SOUND_LOW_PIANO_KEY.play();\n }).hide().fadeIn(500);\n $body.append($button);\n doOnce = false; // once it's done, don't create any more buttons\n }\n // if player clicks the start button and the opacity is less than 10\n // change to tutorial/letter\n if (titleFadeAway && mainMenuFontAlpha <= 10) {\n state = \"TUTORIAL\"; // to the next state\n doOnce = true; // reset doOnce\n }\n pop();\n}", "function initgame() {\n prompts();\n}", "function welcome() {\r\n\t\tctx.clearRect(0, 0, cw, ch);\r\n\t\tctx.fillStyle = \"white\";\r\n\t\tctx.font = ch*2/15 + \"px Lucida Console\";\r\n\t\tctx.fillText(\"Retro Snaker\", cw/6, ch/2, cw*2/3);\r\n\t\tctx.font = ch*1/25 + \"px Lucida Console\";\r\n\t\tctx.fillText(\"Press \\\"↑ ↓ ← →\\\" to Start\", cw*3/10, 11*ch/15, cw*2/5);\r\n\t}", "function gameStart() {//game start, hide texts\n}", "function C012_AfterClass_Jennifer_StartPlayerHumiliation() {\n\tSetScene(CurrentChapter, \"Humiliation\");\n}", "function AmandaLoad() {\n\n\t// If we must show the intro scene\n\tif (!AmandaIntroDone) {\n\t\tif (CurrentCharacter != null) DialogLeave();\n\t\tSarahIntroType = \"AmandaExplore\";\n\t\tCommonSetScreen(\"Cutscene\", \"SarahIntro\");\n\t\tAmandaInside = true;\n\t\tAmandaIntroDone = true;\n\t}\n\n}", "function startGame()\n{\n //Call to the Instruction Screen UI function that generates the UI for the Instruction Screen\n createInstructionScreenUI();\n\n //Cal to create Instruction function that loads the level data from the gameLevels and append the required texts onto the UI elements\n createLevelInstruction();\n}", "function initialiseGame()\n{\n\tclear();\n\tmainText.draw();\n\tscoreText.draw();\n\t\n\tstartButtonDraw();\n\tdifficultyButtonDraw();\n}", "function C002_FirstClass_Intro_Run() {\n\t\n\t// Paints the background\n\tvar ctx = document.getElementById(\"MainCanvas\").getContext(\"2d\");\n\tDrawImage(ctx, CurrentChapter + \"/\" + CurrentScreen + \"/Background.jpg\", 0, 0);\n\n\t// Write the chapter introduction\n\tDrawText(ctx, \"Chapter 2 - First Class (Click to continue)\", 600, 100, \"White\");\n\tif (TextPhase >= 1) DrawText(ctx, \"Your first class today is math, from 8:00 to 9:00.\", 600, 200, \"White\");\n\tif (TextPhase >= 2) DrawText(ctx, \"The teacher enters, introducing herself has Mildred.\", 600, 300, \"White\");\n\tif (TextPhase >= 3) DrawText(ctx, \"She looks strict, holding some kind of crop in her hand.\", 600, 400, \"White\");\n\tif (TextPhase >= 4) DrawText(ctx, \"Everyone sits down, Mildred walks to you and address you.\", 600, 500, \"White\");\n\n}", "function map_title() {\n current_background = Graphics[\"background2\"];\n actors.push( new TitleCard() );\n actors.push( new Continue(\"Click to play!\", map_level1) );\n playerInstance = new Player(100);\n start_time = 0;\n }", "function loadAllText() {\n // go through all states and setup text\n // ONLY call if these are ScenarioRoom\n \n// copy the array reference from adventure manager so that code is cleajer\n scenarioRooms = adventureManager.states;\n\n scenarioRooms[startScreen].setText(\"Who's the primary Market?\", \"This is a new device you created that is able to project a person’s thoughts as a visual interpretation to others. It offers a new way of communicating to others. You’re about to launch this new technology, but you must choose the primary market, who do you choose?\");\n scenarioRooms[governScreen].setText(\"Where to start?\", \"The local government wants to test out your product. They’re asking you which session \");\n scenarioRooms[secureScreen].setText(\"Good News\", \"The local government does a test run on the Thoughtfull and it does well in the trial run. Now they offer to expand out towards international government relations. They want to start using it as a device to help aid in meetings between nations inorder to propose new ideas. However; the team you're in contact with is concerned that there are flaws in the security protocol within your system. \");\n scenarioRooms[endOneScreen].setText(\"Ending One\", \"By ignoring the request, something goes wrong during the meeting. The head set gets hacked and you are seen as a potential threat to the country. The nations at the meeting are now on bad terms and the US has now lost trading relations with some countries.\");\n scenarioRooms[endTwoScreen].setText(\"Ending Two\", \"By hiring the team of security experts, you not only met the needs of their request, but you also protect against any possible means of sabotage that could occur during the meeting. You are well conpensated for your product and sell it to the government to use now\");\n scenarioRooms[eduScreen].setText(\"Pick an Age Group\",\"Which age group would you like to invest into?\");\n scenarioRooms[eduUpperScreen].setText(\"Extended Features\",\"Device is being mainly used and tested within a group dynamic. More students feel more encouraged to participate in group projects and feel more productive. However; they express how they would like for more features geared towards group related tasks to be included. For example, a way to download previous thought projections and save them to a local computer.\");\n scenarioRooms[eduLowerScreen].setText(\"Extended Features\", \"Device is being used within the classroom as a way to develop better understandings on certain topics discussed in class and as a way to stimulate creativity. The kids are enjoying it, but they express that the headset itself is a little bit restrictive and want the head set to be more free moving.\")\n scenarioRooms[eduLowerAddScreen].setText(\"Additional Extended Features\", \"Additionally primary schools are saying that the UI is a little bit hard for the younger kids to understand. They're asking for there to be a friendlier UI for the kids to interact with\");\n scenarioRooms[budgetScreen].setText(\"Budget Problems\", \"Sponsors are complaining that you’re not making enough money with the headset devices. They suggest to move over to a paid model service that limits functionality and uses curated user ads.\");\n scenarioRooms[sellScreen].setText(\"Ending Three\", \"You sell to a randomly selected company. Because there was no other features added to the base model, the unreliable company you chose uses it to perform illegal activities. When they eventually get caught they put all the fall on you.\");\n scenarioRooms[adScreen].setText(\"Ending Four\", \"Target market no longer can afford your device, now it’s marketed as a tech toy by the upper elite class that stops being relevant by the time another new gadget is introduced.\");\n scenarioRooms[keepScreen].setText(\"Keep the Current Model\", \"By leaving the current model as it is, the budget has become tighter than before. By not implementing a paid model you have to make budget cuts elsewhere.\");\n scenarioRooms[salaryScreen].setText(\"Ending Five\", \"Staff is starting to leave, unpaid interns are not motivated in putting countless hours into working for barely any benefits. As a result the quality of the code drops and version deployments are constantly delayed with bugs.\");\n scenarioRooms[productScreen].setText(\"Cut Production Costs\", \"You went with cutting production costs, as a result the device keeps breaking and becomes a potential hazard to wearers. Malfunctioning hardware is stirring up concern in the mothers anonymous forum especially. In the next week a rumor starts circulating that your company is intentionally causing harm to their children's brains. They demand you recall the product\");\n scenarioRooms[rumorScreen].setText(\"Ending Six\", \"You make a statement about the rumors and take full responsibility for the drop in performance. You personally start putting hours to fix the technology. You release the newer safer model under a different name and sell it to a respectable organization where it is a hit. You get no money compensation for the work and have to remain off the grid the rest of your life after your controversy.\");\n scenarioRooms[ignoreScreen].setText(\"Ending Seven\", \"You ignore the rumors and don’t address them. The mother’s association sues your product for potentially harming their children. You lose the case and are bared from ever working in the industry again.\");\n scenarioRooms[sellAltScreen].setText(\"Ending Eight\", \"You sell the device to another company, but because of the attention you added for the educational features, the technology is able to be reused in a similar area of impact. They get an award and you are credited for the base model, earning a small sum in prize money.\")\n}", "function theBeginning() {\n\n //Game Title track\n game_title.style.display = 'none'; //Remove title when the game begins\n\n //Button track\n intro_btn.style.display = 'none'; //Remove intro button when game begins\n progress_btn.style.visibility = 'visible'; //does not show when choices appear\n choice_A.style.visibility = 'hidden'; //does not show when storyline progresses\n choice_B.style.visibility = 'hidden'; //does not show when storyline progresses \n\n // BG track (Add introduction BG)\n BG.classList = '';\n BG.classList.add('background');\n BG.classList.add('grassPath');\n\n //StoryBox\n story_box.style.display = 'block'; //The box shows up here\n\n //Characters\n character_box.style.display = 'block'; //show the character\n character_box.src = './media/ChaGB1.png'; //for game restart\n character_box.classList.add('characters'); //all characters used will have the same setup\n\n narrator.innerText = 'Just testing mechanics and whatnot. Press \"Roll\" please.';\n progress_btn.innerText = 'Roll';\n\n //replaces the intro btn to progress with the story\n progress_btn.addEventListener('click', herostats);\n\n}", "function init() {\n // Clear screen before prompting user\n clear();\n\n // Display Welcome Message\n console.log(figlet.textSync('Employee\\n Manager', {\n font: 'banner',\n horizontalLayout: 'controlled smushing',\n verticalLayout: 'default',\n width: 80,\n whitespaceBreak: true\n }));\n\n // Call main menu function\n menuSystem.mainMenu();\n}", "function titleScreen() {\n // var testHero = new Hero();\n flavor.style.visibility = 'visible';\n beginGame.style.visibility = 'hidden';\n startButton.style.visibility = 'visible';\n story.textContent = '';\n}", "function SophieLoad() {\n\n\t// If we must show the intro scene\n\tif (!SophieIntroDone) {\n\t\tif (CurrentCharacter != null) DialogLeave();\n\t\tSarahIntroType = \"Sophie\";\n\t\tCommonSetScreen(\"Cutscene\", \"SarahIntro\");\n\t\tSophieInside = true;\n\t\tSophieIntroDone = true;\n\t}\n\n}", "startGame(){\n overlay.classList.remove('win')\n overlay.classList.remove('lose')\n overlay.classList.add('start')\n this.activePhrase = this.getRandomPhrase();\n overlay.style.display = 'none';\n this.activePhrase.addPhraseToDisplay();\n for (let heart of hearts){\n heart.style.display = '';\n }\n keyboard.style.display = '';\n }", "function init(){\n let game_starter = document.getElementById('game-starter');\n let difficulty = this.textContent.toLowerCase();\n game_init(difficulty);\n game_starter.className = 'hide';\n}", "function intro(){\n backgroundMove();\n crateShow();\n image(introImg, width/2, height/2);\n}", "function introduceTest(language) {\n\tif(language === 'spanish') {\n\t\tvar welcome = 'Bienvenidos! Este es el la porción de examen del examen para la ciudadanía estadounidense.';\n\t\tvar text1 = 'El examen es 100 preguntas. Ahora, puede elegir tomar todo, 50, o 20 preguntas.';\n\t\tvar text2 = 'Elige abajo.';\n\t} else {\n\t\tvar welcome = 'Welcome! You are about to take the exam portion of the United States Citizenship Test.';\n\t\tvar text1 = 'The exam is 100 questions long. Right now, you may take all 100 questions, 50 questions or 20 questions.';\n\t\tvar text2 = 'Please choose below.';\n\n\t}\n\n\tvar introduction = {line1: welcome, line2: text1, line3: text2};\n\tvar intro = handlebarsTemplates.renderIntroForm(introduction);\n\n\t$openingScreen.html(intro);\n}", "function textOnScreen() {\n createP('Refresh The Page To Reset');\n createP('Press W to Remove Obstacles');\n createP('Press Q To Increase Number of Obstacles');\n }", "function start() {\n\n\t\t// Shows generic image\n\t\tanswerImage.innerHTML = '<img src=\"assets/images/ironthrone.jpg\" width=\"400px\" height=\"400px\">';\n\n\t\t// Sets lives to 9\n\t\tlives = 9;\n\n\t\t// Randomly chooses a word from the words array. This is the hangmanWord.\n\t\thangmanWord = words[Math.floor(Math.random() * words.length)];\n\t\thangmanWord = hangmanWord.toLowerCase();\n\n\t\t// Splits hangmanWord into an array of individual characters\n\t\thangmanWordLetters = hangmanWord.split(\"\");\n\n\t\t// Stores the length of the hangmanWord\n\t\twordLength = hangmanWordLetters.length;\n\n\t\tconsole.log(hangmanWord);\n\n\t\tfor (var i = 0; i < wordLength; i++) {\n\t\t\tblankWord.push(\"_\");\n\t\t}\n\n\t\tscore.innerHTML = \"<h2> \" + wins + \"</h2>\";\n\t\tlossCount.innerHTML = \"<h2> \" + losses + \"</h2>\";\n\t\tcurrentWord.innerHTML = \"<h1> \" + blankWord.join(\" \") + \"</h1>\";\n\t\tguessesRemaining.innerHTML = \"<h2> \" + lives + \"</h2>\";\n\t\tlettersGuessed.innerHTML = \"<h2> \" + guessedLetters + \"</h2>\";\n\n\t}", "function startGame() {\n renderNewWord();\n startBar();\n }", "function gameStart() {\n middleText.innerText = 'This is a game of Rock, Paper, Scissors. Winner is the first to 5. Go!';\n}", "function startScreen() {\n // variables set up the paragraphs of instruction text\n var gameTitle = \"Revenge of the Bears\"\n var introText = \"These hikers just won't stop running through your woods. What's a bear to do? Try to catch all four! Use the keys below to move the bear. For an extra challenge, try to stay on the trail.\";\n var pressP = \"Press P when you're ready to to play.\"\n var controlKeys = \"A = Left D = Right W = Up S = Down\"\n\n // set background color and add the bear icon\n background(BG_COLOR);\n drawBear(CANVAS_WIDTH / 2, CANVAS_HEIGHT / 6);\n\n // title font and style\n textSize(78);\n fill('black');\n textAlign(CENTER);\n textFont('Chiller');\n text(gameTitle, CANVAS_WIDTH / 2, CANVAS_HEIGHT / 3);\n\n // instruction font and styles\n textSize(26);\n textFont('Garamond');\n text(introText, CANVAS_WIDTH / 5.25, CANVAS_HEIGHT / 2.75, 500, 500); // Text wraps within text box\n textStyle(BOLD);\n text(controlKeys, CANVAS_WIDTH / 2, CANVAS_HEIGHT / 1.65);\n text(pressP, CANVAS_WIDTH / 2, CANVAS_HEIGHT / 1.5); // Text wraps within text box\n}", "function draw() {\n background(0);\n\n if(state === `title`){\n push();\n fill(255);\n textSize(60);\n text(`MADELEINE`, width/2, height/3);\n pop();\n\n madeleine.display();\n }\n else if(state === `instructions`){\n\n push();\n fill(255);\n text(`Welcome to 'Madeleine'.\n\n\n\n\n Survive the levels to pass onto the next challenge.\n Solve the puzzles to surpass them.\n\n When in a level, press SPACEBAR at anytime to open up the Tips Table.\n Certain levels require your input through microphone; choose wisely whether ot not to allow the web page access to your audio :)\n Remember, all levels are timed.\n\n For your own safety, please keep your volume on the medium-lower end.\n Or blast the volume bar up and enjoy bleeding ears; it is your choice, after all.`, width/2, height/2);\n pop();\n }\n\n}", "function startGame() {\n setMessage(\"Select an opponent above\");\n}", "function startGame() {\n\t\n\t// fill the question div with new random question\n\tgenerateQuestion();\n\t\n\t// start the timer\n\tmoveProgressBar();\n}", "function menuGame() {\n // Titles\n push();\n fill(`#54d6`);\n displayText(32, INSTRUCTION_TEXT[0], width / 2.1, height / 5.5);\n displayText(32, INSTRUCTION_TEXT[1], width / 2.1, height / 2.25)\n displayText(32, INSTRUCTION_TEXT[2], width / 2.1, height / 1.5)\n pop();\n\n // MINIGAME 1\n if (minigame1) {\n\n push();\n fill(`#54d6`);\n displayText(56, TITLE_TEXT[0], width / 2.1, height / 15);\n pop();\n\n // Texts\n push();\n fill(`#2d67dc`);\n displayText(28, INSTRUCTION_TEXT[3], width / 2.1, height / 3.5);\n displayText(28, INSTRUCTION_TEXT[4], width / 2.1, height / 1.85);\n displayText(28, INSTRUCTION_TEXT[5], width / 2.1, height / 1.35);\n pop();\n }\n // MINIGAME 2\n else if (minigame2) {\n\n push();\n fill(`#54d6`);\n displayText(56, TITLE_TEXT[1], width / 2.1, height / 15);\n pop();\n\n // Texts\n push();\n fill(`#2d67dc`);\n displayText(28, INSTRUCTION_TEXT[6], width / 2.1, height / 3.5);\n displayText(28, INSTRUCTION_TEXT[7], width / 2.1, height / 1.85);\n displayText(28, INSTRUCTION_TEXT[8], width / 2.1, height / 1.35);\n pop();\n }\n\n // CLICK TO PLAY\n push();\n fill(`#909eba`);\n displayText(24, INSTRUCTION_TEXT[9], width / 2.1, height / 1.1);\n pop();\n}" ]
[ "0.7729682", "0.7574439", "0.7556389", "0.7393537", "0.73116285", "0.7283043", "0.71869636", "0.71119535", "0.7075189", "0.7064663", "0.70578194", "0.6993665", "0.69585156", "0.6957443", "0.69497776", "0.69461256", "0.69443285", "0.69400823", "0.6929269", "0.6928318", "0.69280154", "0.69244415", "0.69200903", "0.69131035", "0.6892019", "0.68885845", "0.6882187", "0.6881085", "0.6877995", "0.68584055", "0.6845282", "0.6840476", "0.68378067", "0.6829234", "0.68262196", "0.68113077", "0.6807139", "0.67934144", "0.6767296", "0.6763272", "0.6762204", "0.6738668", "0.6735782", "0.67128", "0.668938", "0.6686385", "0.6680581", "0.6668752", "0.66667914", "0.6661006", "0.6657631", "0.66571313", "0.66330725", "0.66205174", "0.66196597", "0.66192144", "0.6617531", "0.66168416", "0.6597062", "0.6590373", "0.65884054", "0.6584498", "0.65754426", "0.6572789", "0.65674096", "0.65660733", "0.6505499", "0.6500034", "0.6491633", "0.64759076", "0.6460607", "0.64530456", "0.64378834", "0.64365697", "0.6432494", "0.643089", "0.6418088", "0.64170253", "0.64113784", "0.6409087", "0.63919973", "0.63807833", "0.6380782", "0.63795894", "0.63676673", "0.6367517", "0.63625205", "0.635606", "0.635251", "0.634606", "0.63426673", "0.63425064", "0.6336622", "0.6329937", "0.6329201", "0.6308531", "0.63031876", "0.62901264", "0.6288543", "0.6287436", "0.6275929" ]
0.0
-1
generate a random unique id for each game
function generateGameID(saveNewGame) { var newGameID = ""; var existingGameID = ""; var duplicates = true; Game.find(function(err, gamesfound) { if(err) { console.error(err); return null; } // ensure the game id does not exist in the db already while(duplicates) { newGameID = Math.floor(Math.random() * 10000); let duplicateFound = false; for(let i=0; i<gamesfound.length; i++) { existingGameID = gamesfound[i].gameID; if(existingGameID == newGameID) { duplicateFound = true; break; } } if(!duplicateFound) duplicates = false; } saveNewGame(newGameID); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateId() {\n\treturn Math.random() * 999999;\n}", "function generateID() {\r\n return Math.floor(Math.random() * 100000000);\r\n}", "function genID() {\n return (+new Date() + Math.floor(Math.random() * 999999)).toString(36);\n}", "function generateID() {\n return Math.floor(Math.random() * 100000000);\n}", "function random_id() {\n\treturn ('' + Math.floor((Math.random() * 100000) + 1));\n}", "function id() {\r\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n}", "function getUniqueId(){\n\treturn Math.random().toString(36);\n}", "function createID() {\n return Math.floor(Math.random() * 100000000000);\n}", "function uniqueID() {\n return Math.round(new Date().getTime() * (Math.random() * 100));\n }", "function generateID() {\n return Math.random().toString(36).substr(2, 6)\n}", "function idRandom() {\n return new Date().getTime();\n}", "function createGameID () {\n return \"game\"+(+Date.now());\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function id() {\n return ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n}", "function generateId() {\n\treturn now() + parseInt(Math.random() * 999999);\n}", "static randomID() {\n return Math.round(Math.random() * 1000000) + '';\n }", "generateID() {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n }", "function createId(){\n return Math.round(Math.random()*1000000);\n }", "function uniqueID() \n{\n return (Math.floor((Math.random()*1000000))).toString(32)+''+(new Date().getTime()).toString(32)\n}", "function createId(){\n return Math.floor(Math.random() * 10000)\n}", "function id () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function id() {\n return '_' + Math.random().toString(36).substr(2, 9);\n }", "function generateId() {\n\t\treturn Math.floor(Math.random() * 1000000) + ((new Date).getTime()).toString();\n\t}", "function _generateId() {\n\treturn Math.random().toString(36).substring(2) + (new Date()).getTime().toString(36);\n}", "function generateId() {\n return Math.floor(Math.random() * Date.now()).toString(16);\n}", "function genID() {\n return Math.floor(Math.random() * 0x100000000).toString(16) + Math.floor(Math.random() * 0x100000000).toString(16);\n }", "generateId () {\n return Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15)\n }", "function getUniqueID() {\n return Math.random().toString(36).substr(2, 9)\n}", "function guid() {\n return parseInt(Date.now() + Math.random())\n }", "function guid() {\r\n return parseInt(Date.now() + Math.random());\r\n}", "function makeId() {\n return Math.random().toString(36).substr(2, 5);\n}", "function randomizeId() {\n return Math.floor(Math.random() * 50);\n}", "function randomUsableId(){\n return 'ID_'+(Math.random().toString(36).slice(2))\n}", "function guid() {\r\n\treturn parseInt(Date.now() + Math.random());\r\n}", "function getID() {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function ID() {\n return Math.random().toString(36).substr(2, 10) + Math.random().toString(36).substr(2, 5);\n}", "genPlayerId() {\n // Credit: https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4();\n }", "function generateId() {\n return Math.floor(Math.random() * 10000000) + \"-\" + Math.floor(Math.random() * 10000000)\n}", "function Id() {\n\treturn Math.floor(Math.random() * 99999999999) + 1;\n}", "function makeId() {\n return \"_\" + (\"\" + Math.random()).slice(2, 10); \n }", "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "function getId () {\n return '_' + Math.random().toString(36).substr(2, 9);\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function generateGameID() {\n\tconst id = (Math.floor(Math.random() * 10000) + 10000)\n\t\t.toString()\n .substring(1);\n if ((Math.log(id) * Math.LOG10E + 1 | 0 ) === 4) {\n // 4 digit number\n return Number(id);\n } else {\n // 3 digit number, for now just add 1000 as the 4th digit\n return Number(id) + 1000;\n }\n}", "function makeId() {\n return \"_\" + Math.random().toString(36).substr(2, 9);\n }", "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function genId() {\n return (\n Math.random()\n .toString(36)\n .substring(2, 15) +\n Math.random()\n .toString(36)\n .substring(2, 15)\n );\n}", "function createID(){\n\treturn '_' + Math.random().toString(36).substr(2, 9);\n}", "function getUniqueId(){\n return Math.random().toString(36).substr(2, 5);\n}", "function newID() {\n return (Date.now() + ( (Math.random()*100000).toFixed()));\n}", "function randomID() {\n var id = \"\";\n for ( var i = 1; i <= 10; i++){\n id += (Math.floor(Math.random() * 10) + 1);\n }\n return id;\n }", "function IDgenerator() {\n return Math.random().toString(16).slice(2);\n}", "function generate_id(){\n var id=(Math.floor(Math.random() * 100000000));\n if(id<10000000){\n id=\"0\"+id.toString();\n return id;}\n else{\n id=id.toString();\n return id;}\n}", "static createID() {\n return /*'_' + */Math.random().toString(36).substr(2, 9);\n }", "function generateID() {\n\tvar chunkSize = 1 << 16; // 2^16\n\tvar now = new Date();\n\tvar part1 = new Number(now.getTime() % chunkSize);\n\tvar part2 = new Number(Math.floor(chunkSize*Math.random()));\n\treturn part1.toString(16) + part2.toString(16);\n}", "function randomID(){\n return 'moka-' + Math.random().toString(36).substr(2, 5)\n}", "function generateId() {\n var id = '',\n i = 4;\n\n while (i--) {\n id += (((1 + Math.random()) * 0x10000) | 0)\n .toString(16).substring(1);\n }\n\n return id;\n }", "function id() {\n // eslint-disable-next-line no-bitwise\n return ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n}", "function generoiId() {\n\n let id = '';\n\n for (let i = 0; i < 16; i++) {\n id = id + (Math.floor(Math.random() * 10));\n }\n\n return parseInt(id);\n}", "function uniqId()\n{\n\treturn Math.round(new Date().getTime() + (Math.random() * 100));\n}", "function generateID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000).toString(16).substring(1);\n }\n return s4() + s4() + s4() + s4() + s4() + s4() + s4() + s4();\n}", "function createId() {\n\tvar id = Math.floor( Math.random() * 100000 ) + 1;\n\treturn id;\n}", "function makeId() {\r\n var rtn;\r\n\r\n rtn = String(Math.random());\r\n rtn = rtn.substring(2);\r\n rtn = parseInt(rtn).toString(36);\r\n\r\n return rtn;\r\n}", "function generateId() {\n return new Date().getTime();\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function newid () {\n return Math.floor(Math.random() * 9007199254740992);\n}", "static generateID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000000).toString(16);\n }\n return s4();\n }", "function generateID () {\n return Date.now().toString(16)\n}", "function generateId() {\n return Date.now().toString(36) + \"#\" + Math.random().toString(36).substr(2, 9); \n}", "function generateUniqueId() {\r\n\t\t\tvar characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ';\r\n\t\t\tvar rval = characters.charAt(Math.floor(Math.random() * characters.length)) + Date.now();\r\n\t\t\treturn rval;\r\n\t\t}", "function generateID() {\r\n var issueID = chance.guid();\r\n return issueID;\r\n}", "function generateId() {\n // Generates random whole number between 0 and 100 million.\n return Math.floor(Math.random() * 100000000);\n}", "generateId() {\n return'id' + Date.now().toString() + Math.floor(Math.random(1000)).toString();\n }", "function uniqueId() {\n return `a${Math.random().toString(36).substr(2, 9)}`;\n}", "function uniqueId() {\n return Date.now() + 'xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random()*16|0, v = c === 'x' ? r : (r&0x3|0x8);\n return v.toString(16);\n });\n }", "function newID(){\n id = Math.floor(Math.random()*90+10).toString() + Math.floor(Math.random()*90+10).toString() + Math.floor(Math.random()*90+10).toString()\n console.log(\"ID: \" + id)\n}", "function creatID() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n}", "function generateUniqueID() {\r\n\treturn Date.now();\r\n}", "function randomId() {\n let id = Math.random().toString(36).substr(2, 6);\n console.log(id);\n}", "function _id() {\n\t\tvar S4 = function() {\n\t\t return (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n\t\t};\n\t\treturn (S4()+S4());\n\t}", "function createId() {\r\n return (\r\n Math.floor(Math.random() * 10000000) +\r\n \"-\" +\r\n Math.floor(Math.random() * 10000000)\r\n );\r\n }", "function getRandomIdBase() {\n\t return Math.round(Math.random() * 9);\n\t }", "_id () {\n return (Math.random().toString(16) + '000000000').substr(2, 8)\n }", "function newID(safe) {\r\n\tvar id = Math.floor(Math.random() * 1e10);\r\n\tif (safe) {\r\n\t\twhile (ids.indexOf(id) > -1) {\r\n\t\t\tid = Math.floor(Math.random() * 1e10)\r\n\t\t}\r\n\t}\r\n\tids.push(id);\r\n\treturn id.toString();\r\n}", "function uniqueID() {\n var chars = '0123456789abcdef';\n return 'xxxxxxxxxx'.replace(/./g, function () {\n return chars.charAt(Math.floor(Math.random() * chars.length));\n });\n}", "function uniqid() \n{\n return (Math.floor((Math.random()*1000000))).toString(32)+''+(new Date().getTime()).toString(32)\n}", "function generateId() { // random 6-char string\n\t\tvar letters = [];\n\t\tvar possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n\t\tvar possible_len = possible.length;\n\t\tvar id_length = 6;\n\t\twhile (0 < id_length--) {\n\t\t\tletters.push(possible.charAt(Math.floor(Math.random() * possible_len)));\n\t\t}\n\t\treturn letters.join(\"\");\n\t\t//return String(Math.floor(Math.random() * 1000000)); // 10-based, not 0-padded\n\t}", "function guidGenerator() {\nvar S4 = function() {\nreturn (((1+Math.random())*0x10000)|0).toString(16).substring(1);\n};\nreturn (S4()+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+\"-\"+S4()+S4()+S4());\n}", "function getRandomIdBase() {\n return Math.round(Math.random() * 9);\n}", "function randomId() {\n var t = \"\";\n var p = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for (let i = 0; i < 10; i++) {\n t += p.charAt(Math.floor(Math.random() * p.length));\n }\n return t;\n }", "function makeID() {\n var newId = \"\";\n var idOptions = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n \n for (var i = 0; i < 5; i++) {\n newId += idOptions.charAt(Math.floor(Math.random() * idOptions.length));\n } \n return newId;\n }", "function gid() {\n return '_' + Math.random().toString(36).substr(2, 9);\n }", "function generateUserID() {\n console.log('generating id...');\n let newID;\n do {\n newID = Math.floor(Math.random() * 900000000);\n } while (getIndexOfConnection(newID) !== -1);\n console.log('the id is:' + newID);\n return newID;\n }", "function generateId () {\n let id, tries = 0, max = 10 ** 6\n do {\n id = randomString(8)\n /* istanbul ignore if */\n if (++tries > max) throw new Error('Could not generate unique id')\n } while (db[id])\n return id\n}", "function generateUniqueID () {\n var d = new Date().getTime();\n if (typeof window.performance !== 'undefined' && typeof window.performance.now === 'function') {\n d += window.performance.now(); // use high-precision timer if available\n }\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = (d + Math.random() * 16) % 16 | 0;\n d = Math.floor(d / 16);\n return (c === 'x' ? r : (r & 0x3 | 0x8)).toString(16)\n })\n}", "function createUniqueId() {\n return String((new Date()).valueOf()).slice(-4) + Math.floor(Math.random() * 1000);\n}", "function makeid() {\n var text = \"\";\n var possible = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789\";\n for( var i=0; i < 6; i++ )\n text += possible.charAt(Math.floor(Math.random() * possible.length));\n return text;\n }", "generateId() { \n var id = '';\n while (this._Ids[id] || id.length === 0) { \n var num = Math.floor(Math.random() * 26 + 97);\n id += String.fromCharCode(num);\n }\n this._Ids[id] = id;\n return id;\n }" ]
[ "0.821158", "0.8200816", "0.81211716", "0.80823606", "0.8063689", "0.80398244", "0.8039145", "0.8024361", "0.80029684", "0.7985072", "0.79755396", "0.7974222", "0.7952002", "0.7952002", "0.7952002", "0.7948512", "0.79355925", "0.7925717", "0.79210687", "0.79158324", "0.7907607", "0.7901852", "0.7899138", "0.7862705", "0.78576976", "0.78412515", "0.78396875", "0.78343785", "0.78343517", "0.7834176", "0.7829591", "0.7824701", "0.7810264", "0.7807489", "0.7803417", "0.7801204", "0.77981836", "0.7787657", "0.7786475", "0.7783313", "0.77783835", "0.7769864", "0.7769864", "0.77474505", "0.7739118", "0.7739118", "0.7733099", "0.7728281", "0.77280074", "0.77145815", "0.7710929", "0.77068305", "0.7700288", "0.76933366", "0.76879346", "0.7683989", "0.76808923", "0.7679415", "0.7661711", "0.7655252", "0.7645052", "0.7636395", "0.76334995", "0.7625084", "0.7620021", "0.76195353", "0.7618714", "0.76078385", "0.7600709", "0.760008", "0.7596893", "0.75945866", "0.75916755", "0.75899404", "0.7577556", "0.7551956", "0.75443846", "0.75420123", "0.7541631", "0.75337124", "0.75149876", "0.7487907", "0.74667466", "0.7458326", "0.7455872", "0.7451668", "0.7449416", "0.7445628", "0.74379694", "0.74363506", "0.7436075", "0.7428137", "0.7421123", "0.7394993", "0.7387367", "0.7366093", "0.7363427", "0.7356298", "0.73499674", "0.7349937", "0.73450935" ]
0.0
-1
returns the player based on the ID
function getPlayer(player_ID, foundPlayer) { Player.find({'playerID': player_ID}, function(err, playerfound) { if(err) console.error(err); playerfound = playerfound[0]; foundPlayer(playerfound); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findPlayer(id) {\n var player;\n var result = $.grep(players, function(item) {\n return item._id == id;\n });\n if (result.length == 1) {\n player = result[0];\n }\n return player;\n }", "function playerById(id) {\n\tvar i;\n\tfor (i = 0; i < players.length; i++) {\n\t\tif (players[i].id == id)\n\t\t\treturn players[i];\n\t};\n\t\n\treturn false;\n}", "function playerById(id) {\n\tvar i, len = players.length;\n\tfor (i = 0; i < len; i += 1) {\n\t\tif (players[i].id == id)\n\t\t\treturn players[i];\n\t};\n\t\n\treturn false;\n}", "async getPlayerById(id) {\r\n const row = await sql.get(`SELECT * FROM Players p WHERE p.ID = $id`, {$id: id});\r\n\t\tif(row) {\r\n\t\t\treturn await this.getPlayerInternal(row);\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n }", "function playerById (id) {\n\n for (var i = 0; i < players.length; i++) {\n if (players[i].id === id) {\n return players[i]\n }\n }\n return false\n}", "getPlayer(playerID){\n for (player in this.#players){\n if(playerID===player.valueOf()){\n return player;\n }\n }\n return null;\n }", "function getPlayerById(id) {\n for (var i = 0; i < remotePlayers.length; i++) {\n if (remotePlayers[i].getID() == id) return remotePlayers[i];\n };\n return false;\n }", "function playerById (id) {\n var i\n for (i = 0; i < players.length; i++) {\n if (players[i].id === id) {\n return players[i]\n }\n }\n\n return false\n}", "function playerById (id) {\n var i\n for (i = 0; i < players.length; i++) {\n if (players[i].id === id) {\n return players[i]\n }\n }\n\n return false\n}", "function playerById(id) {\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tif (remotePlayers[i].id == id)\n\t\t\treturn remotePlayers[i];\n\t}\n\n\treturn false;\n}", "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 }", "getPlayerDetails (id) {\n return this._players[id]\n }", "function playerById(id) {\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tif (remotePlayers[i].id == id)\n\t\t\treturn remotePlayers[i];\n\t};\n\n\treturn false;\n}", "function playerById(id) {\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tif (remotePlayers[i].id == id)\n\t\t\treturn remotePlayers[i];\n\t};\n\t\n\treturn false;\n}", "function playerById(id) {\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tif (remotePlayers[i].id == id)\n\t\t\treturn remotePlayers[i];\n\t};\n\t\n\treturn false;\n}", "function find_playerid(id) {\r\n\r\n\tfor (var i = 0; i < player_lst.length; i++) {\r\n\r\n\t\tif (player_lst[i].id == id) {\r\n\t\t\treturn player_lst[i]; \r\n\t\t}\r\n\t}\r\n\tthrow \"Player not found\"\r\n}", "function playerById(id) {\n\tvar i;\n\tfor (i = 0; i < remotePlayers.length; i++) {\n\t\tif (remotePlayers[i].id == id)\n\t\t\treturn remotePlayers[i];\n\t};\n\t//if player not found, return false\n\treturn false;\n}", "function getUserById(id) {\r\n\tvar player = players.find(obj => obj.id == id);\r\n\tif (player) {\r\n\t\treturn player;\r\n\t}\r\n\tlog(2, 'No user could be found');\r\n\treturn undefined;\r\n}", "findPlayerById(playerId)\n {\n return this.players.find(player => player.hasId(playerId));\n }", "function playerById (id) {\n for (var i = 0; i < enemies.length; i++) {\n if (enemies[i].player.name === id) {\n return enemies[i];\n }\n }\n return false;\n}", "getPlayer(game, pid) {\n var i, len, player, ref;\n ref = game.players;\n for (i = 0, len = ref.length; i < len; i++) {\n player = ref[i];\n if (player.pid === pid) {\n return player;\n }\n }\n return null;\n }", "async get(id)\n {\n const resp = await this.sql.tquery(Player)(`\n select * from players\n where id = @id`, {id});\n\n return resp.firstOrNull();\n }", "getOpponent(id) {\n let opponent = null;\n\n this.players.forEach((player) => {\n if (player.id !== id) {\n opponent = player;\n }\n });\n\n return opponent;\n }", "function playerNameFromId(id,gameid) {\n return new Promise((resolve, reject) => {\n db.findOne({ player: id,gameid:gameid}, { name: 1, _id: 0 }, (err, docs) => {\n if (err) console.error(\"There's a problem with the database: \", err);\n else if (docs) console.log(\"player name queried from id\");\n resolve(docs.name);\n });\n });\n}", "function find_playerid(id) {\r\n\r\n\tfor (var i = 0; i < player_lst.length; i++) {\r\n\r\n\t\tif (player_lst[i].id == id) {\r\n\t\t\treturn player_lst[i]; \r\n\t\t}\r\n\t}\r\n\t\r\n\treturn false; \r\n}", "function find_playerid(id) {\n for (var i = 0; i < player_lst.length; i++) {\n if (player_lst[i].id == id) {\n return player_lst[i]; \n }\n }\n \n return false; \n}", "getPlayer( gameId ) {\n return new Promise((resolve, reject) => {\n \t this.find({id: gameId}).then(game => {\n game.getPlayer().then(player => { \n\t\t\t\tresolve(player);\n\t\t\t})\n\t\t })\n\t })\n }", "getPlayer( gameId ) {\n return new Promise((resolve, reject) => {\n \t this.find({id: gameId}).then(game => {\n game.getPlayer().then(player => { \n\t\t\t\tresolve(player);\n\t\t\t})\n\t\t })\n\t })\n }", "async function getPlayer (player) {\n if ('_id' in player && typeof (player._id) !== 'object') {\n player._id = mongoist.ObjectId(player._id)\n }\n return db.player.findOne(player, { password: 0 })\n }", "async function getPlayer(playerId) {\n if (!playersLoaded) {\n return loadPlayers().then(() => players[playerId]).catch((e) => console.log(e));\n }\n\n return players[playerId];\n}", "function getPlayerElement(playerId) {\n\t\t\treturn $('#'+playerId)[0];\n\t\t}", "function getGame(playerId){\n var i;\n var result = null;\n for(i = 0; i < games.length; i++){\n if(games[i].getPlayerId() === playerId){\n result = games[playerId]\n }\n }\n return result;\n }", "function findplayerbyid (ids) {\n for (var i = 0; i < enemies.length; i++) {\n if (enemies[i].id == ids) {\n return enemies[i]; \n }\n }\n }", "function getSongObjectById(id){\n let song = player.songs.filter(songObject => {\n if(songObject.id === id){\n return songObject;\n }\n })\n if(song.length == false){\n throw \"undefined id\";\n }\n song = song[0];\n return song;\n}", "function GetPlayer()\n{\n\treturn document.getElementById(\"player\");;\n}", "function getPlayerNameFromId(id)\n{\n for (var i = 0; i < N_PLAYERS; ++i)\n if (PLAYERS_ARRAY[i]['playerID'] == id)\n return PLAYERS_ARRAY[i]['playerName'];\n\n error( 'Function \\'icdb_data_retrieval_form.js\\'::getPlayerNameFromId(id)'\n + ' was used with invalid id.' );\n}", "function getPlayerFromIdOrName(idOrName) {\n return typeof idOrName === \"string\" ? {\n name: idOrName,\n id: parseInt((0, _kolmafia.getPlayerId)(idOrName))\n } : {\n name: (0, _kolmafia.getPlayerName)(idOrName),\n id: idOrName\n };\n}", "getPlayerByName(playerName) {\n return this.players.find((value) => {\n return (value._player.name === playerName);\n });\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}", "getPlayers(id) {\n return this.getRoom(id).players;\n }", "getPlayerNameById (playerId) {\n return THIS.view.players[playerId].displayName\n }", "find(slackId) {\n const player = this.bots.find(bot => bot.username === slackId);\n\n if(!player) throw new Error('Player not found!');\n\n return player;\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 getPlaylistById(id){\n let playlistById = player.playlists.filter(playlist =>{\n if(playlist.id === id){\n return playlist;\n }\n })\n return playlistById[0];\n }", "function getCardById(id) {\n var tmpCard = GameState.drawPile.cards.find(function (card) {\n return card.id === id;\n });\n if (tmpCard !== undefined) {\n return tmpCard;\n }\n tmpCard = GameState.discardPile.cards.find(function (card) {\n return card.id === id;\n });\n if (tmpCard !== undefined) return tmpCard;\n tmpCard = GameState.players.bot.hand.cards.find(function (card) {\n return card.id === id;\n });\n if (tmpCard !== undefined) return tmpCard;\n tmpCard = GameState.players.human.hand.cards.find(function (card) {\n return card.id === id;\n });\n if (tmpCard !== undefined) return tmpCard;\n}", "function getPlayer(){\n\t\tconsole.log(\"id\"+session.avatorId)\n\t\tvar data = {\"name\": name, \"avatorId\": session.avatorId};\n\t\tusersWS[name].emit(\"player data\", data);\n\t}", "function meGetPlayer(video) {\n var playerID = $(video).parents('.mejs-container').attr('id').split('mep_')[1];\n if (typeof mejs.players[playerID] !== 'undefined') {\n return mejs.players[playerID];\n }\n else {\n playerID = 'mep_' + playerID;\n player = mejs.players[playerID];\n return player;\n }\n }", "getCurrentPlayer() {\n return this.props.players.find(p =>\n p.playerName === this.props.playerName\n );\n }", "getOne(req, res) {\n Player.findById({ _id: req.params.id })\n .then(Player => res.json(Player))\n .catch(err => res.status(400).json(err))\n }", "function getPlayerIndex(id){\n var index = game.players.map(function(o) { return o.id; }).indexOf(id);\n return index;\n console.log(\"index of \" + id + \" is \" + index);\n}", "function retrieve_player(player_name, callback) {\n var player = NBA.findPlayer(player_name);\n if(player === undefined)\n return;\n var player_id = player.playerId;\n var team_id = player.teamId;\n var player_obj = {\n \"first_name\" : player.firstName,\n \"last_name\" : player.lastName,\n \"full_name\" : player.fullName,\n \"player_id\" : player_id,\n \"team_id\" : team_id,\n \"gms\" : 0\n };\n get_team_name(player_obj, callback);\n}", "getPlayer() {\n console.log(\"execute getPlayer with gameId:\" + this.gameId);\n findPlayer({ gameId: this.gameId })\n .then((result) => {\n if (result) {\n this.playerRecord = result;\n this.commHandler.publish(\n // @ts-ignore\n window.phaserIframeElement,\n {\n data: result,\n eventName: EventNames.titleScene_playerDetail\n }\n );\n }\n })\n .catch((error) => {\n console.log(\"ERROR executing findPlayer: \", error);\n });\n }", "function getUserByName(name) {\r\n\tvar player = players.find(obj => obj.name == name);\r\n\tif (player) {\r\n\t\treturn player;\r\n\t}\r\n\treturn {};\r\n}", "getCurrentPlayer() {\n return this.findPlayerByName(this.props.playerName);\n }", "load_player() {\n this.player = this.cookie.get(this.cookie_board_player);\n return this.player;\n }", "function getOthers(id) {\n var players = [];\n Object.keys(io.sockets.connected).forEach(function (socketID) {\n var player = io.sockets.connected[socketID].player;\n if (player && player.id != id) {\n players.push(player);\n }\n })\n return players;\n}", "function getUser(id) {\n // return the one user with that id\n const user = users.find(user => user.id === id);\n return user;\n}", "loadPlayer(botId) {\n //super.loadPlayer(gameName);\n const id = parseInt(botId);\n if (!id) {\n throw 'bad Bot id: ' + id;\n }\n const idx = BotIds.findIndex(i => i === id);\n const name = (idx >= 0 && idx < BotNames.length) ? BotNames[idx] : \"BOT #\" + id;\n this.player = {\n id: id,\n name: name,\n color: 'black',\n bot: true\n };\n return this.player;\n }", "getCurrentPlayer() {\n return this.players[this.currentPlayerIndex]\n }", "function getTrack(playerId){\n\t\treturn mPlayers[playerId].track;\n\t}", "function getPlayer() {\n\t\treturn window.yt.player\n\t\t\t&& window.yt.player.getPlayerByElement\n\t\t\t&& window.yt.player.getPlayerByElement(document.getElementById('player-api'));\n\t}", "inRoom(idPlayer){\n return bdConf.searchRoomWithPlayer(idPlayer)\n }", "function getPlayerGame(user, gameId) {\n var game = games[gameId];\n if (!user || !game.hasPlayer(user.nickname)) {\n game = null;\n }\n return game;\n }", "getPlayerUsingId(id) {\r\n let sql_getPlayer = `SELECT A.id, A.first_name, A.last_name, A.middle_name, A.full_name, \r\n A.email_id, A.phone_no contact_no, B.team_name, C.id umpire_id, A.role_id\r\n FROM user_tb A \r\n LEFT JOIN team_tb B ON (A.team_id = B.id) \r\n LEFT JOIN umpire_tb C ON (A.id = C.user_id) \r\n WHERE A.id = ${id}`;\r\n let result = this.apdao.all(sql_getPlayer);\r\n return result;\r\n }", "getPlayerIdByName (playerName) {\n for (var i = 0; i < THIS.view.players.length; i++) {\n if (playerName === THIS.view.players[i].displayName) return i\n }\n }", "otherPlayer(p) {\n if (p === this.playerID) {\n return this.opponentID;\n } else {\n return this.playerID;\n }\n }", "function whichPlayer(player) {\n if (player == 1) {\n return playerOneName;\n } else if (player == 2) {\n return playerTwoName;\n }\n }", "function getPlayerData(list, playerName) {\n for (let p = 0; p < list.length; p++) {\n const player = list[p];\n if (player.name === playerName) {\n return player;\n }\n }\n // console.log(\"Unable to find player \", playerName, \"in list:\\n\", list);\n}", "function playerById(socketid) {\r\n var remotePlayers = main.session.getRemotePlayers();\r\n for (var i = 0; i < remotePlayers.length; i++) {\r\n if (remotePlayers[i].getSocketID() == socketid)\r\n // HACKY SOLUTION RETURN LASERS HERE\r\n return {players:remotePlayers[i],roomID: main.session.getRoomID(), lasers: [0,0]};\r\n }\r\n\r\n\r\n return false;\r\n}", "getActivePlayerId () {\n return THIS.view.currentPlayer\n }", "get(client) {\n return this.players[client.id];\n }", "getCurrentPlayer() {}", "function getPlayerData(list, playerName) {\n for (let p = 0; p < list.length; p++) {\n const player = list[p];\n if (player.name === playerName) {\n return player;\n }\n }\n console.log(\"Unable to find player \", playerName, \"in list:\\n\", list);\n}", "function getPlayerName(){\r\n //returns player name\r\n return document.getElementById('p-name')\r\n}", "function getCharacter(id) {\n // Returning a promise just to illustrate GraphQL.js's support.\n return Promise.resolve(humanData[id] || droidData[id]);\n}", "getAlivePlayers(id) {\n return this.getRoom(id).players.filter((player) => player.alive === true);\n }", "function getPlayerId(url) {\n for (const i in players) {\n const player = players[i];\n const eId = player.getEid(url);\n if (eId) return i;\n }\n }", "function getPlayerName(player) {\r\n return player.PLAYER;\r\n}", "function npcById (id) {\n for (var i = 0; i < npcs.length; i++) {\n if (npcs[i].id === id) {\n return npcs[i];\n }\n }\n\n return undefined;\n\n}", "function returnObjectById(id){\n\n return selectableObjects.find(object=> object.id == id)\n}", "function getCurrentPlayer (){\r\n return _currentPlayer;\r\n }", "getPlaylistItemWithId(id) {\n let that = this;\n if (that._playlist)\n return that._playlist.getItemWithId(id);\n else\n return undefined;\n }", "get activePlayer() {\n return this.players.find(player => player.active === true);\n }", "function getCharacter(id) {\n console.log('getCharacter called with id: ', id);\n // Returning a promise just to illustrate GraphQL.js's support.\n var humanData = Human.findOne({ 'id': id });\n var droidData = Droid.findOne({ 'id': id });\n return Promise.resolve(humanData || droidData);\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}", "getPlayer(username) {\n return client({\n method: 'GET',\n path: PLAYER_SEARCH_ROOT+'findPlayerByUsername',\n params: {\n username: username\n }\n });\n }", "function getUser(pool, playerid, callback){\n pool.connect(function(err, client) {\n if(err){\n callback && callback(err);\n }\n else{//Get player info\n var queryString = 'SELECT * FROM player WHERE playerid = ' + playerid;\n // console.log(queryString);\n client.query(queryString, function(err, player){\n if(err){\n client.release();\n callback && callback(err, null);\n }\n else {//Get team info for all teams player belongs to\n appendTeamInfo(client, player.rows[0], callback);\n }\n });\n }\n });\n}", "static get(id) {\n return this.map.get(\"username\" + id);\n }", "function getPlayerSlider(playerId) {\n\t\t\treturn $('#'+getPlayerSliderId(playerId))[0];\n\t\t}", "function getCharacter(id) {\n var _a;\n // Returning a promise just to illustrate that GraphQL.js supports it.\n return Promise.resolve((_a = Data_1.humanData[id]) !== null && _a !== void 0 ? _a : Data_1.droidData[id]);\n}", "function pcByID (id) {\n for (var i = 0; i < PCs.length; i++) {\n if (PCs[i].id === id) {\n return PCs[i];\n }\n }\n\n return;\n\n}", "async function getPlayerfullDetails(player_id){\n const player_info = await axios.get(`${api_domain}/players/${player_id}`, {\n params: {\n api_token: process.env.api_token,\n include: \"team\",\n },\n })\n const { fullname, image_path, position_id, common_name, nationality, birthdate, birthcountry, height, weight } = player_info.data.data;\n const { name } = player_info.data.data.team.data;\n \n return{\n id: parseInt(player_id),\n name: fullname,\n image: image_path,\n position: position_id,\n team_name: name,\n common_name: common_name,\n nationality_player :nationality,\n birth_date : birthdate,\n birth_country : birthcountry,\n height: height,\n weight: weight,\n \n };\n}", "async function getPlayerIdByName(player_name){\n const player_data = await axios.get(`${api_domain}/players/search/${player_name}`, {\n params: {\n api_token: process.env.api_token,\n },\n })\n let players_ids = []\n player_data.data.data.map(player => {\n if (player.fullname == player_name)\n players_ids.push(player.player_id)})\n return players_ids;\n}", "getPlayerStats(playerId) {\n return PlayerStat.find({ player: ObjectId(playerId) }).exec();\n }", "function Player (id) {\n this.id = id;\n this.folder = 'opponents/'+id+'/';\n this.base_folder = 'opponents/'+id+'/';\n this.first = '';\n this.last = '';\n this.labels = undefined;\n this.folders = undefined;\n this.size = eSize.MEDIUM;\n this.intelligence = eIntelligence.AVERAGE;\n this.gender = eGender.MALE;\n this.stamina = 20;\n this.scale = undefined;\n this.tags = this.baseTags = [];\n this.xml = null;\n this.persistentMarkers = {};\n this.exposed = { upper: false, lower: false };\n}", "getUser(id){\n return this.users.filter((user)=> user.id === id)[0]; /* FINDING AND RETURNING THE USER WITH SAME ID AND RETURNING IT WHICH WILL BE AT INDEX 0 */\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 }", "getById(id) {\r\n return this._byId[id]\r\n }", "function getOne(id) {\n return skills[id];\n}", "function getGame(gameid){\n var i = 0;\n do{\n if(games[i].gameid == gameid){\n return games[i];\n }\n i++;\n }while(i < games.length);\n return -1;\n\n}" ]
[ "0.85341674", "0.8307689", "0.82971215", "0.8229657", "0.8092259", "0.8091935", "0.80686235", "0.80247504", "0.80247504", "0.80216396", "0.80011976", "0.80006266", "0.79903597", "0.79867655", "0.79867655", "0.7900372", "0.7808206", "0.7727999", "0.7709711", "0.7678013", "0.762184", "0.76035786", "0.74221486", "0.7407832", "0.7351307", "0.73463", "0.7338134", "0.7338134", "0.73318386", "0.71889436", "0.7181607", "0.7126147", "0.7103277", "0.7087266", "0.70863026", "0.707327", "0.70693374", "0.70141846", "0.6983684", "0.69530463", "0.69455355", "0.69298095", "0.6912635", "0.68955237", "0.6869233", "0.67759705", "0.6747616", "0.67257386", "0.65830386", "0.6577893", "0.65451497", "0.6543537", "0.6539371", "0.6523617", "0.64983547", "0.64739347", "0.6469033", "0.643217", "0.6428224", "0.6411503", "0.64039195", "0.64009035", "0.63989854", "0.6396116", "0.63899934", "0.6370848", "0.63694525", "0.63481194", "0.63475347", "0.6335349", "0.6334992", "0.63331455", "0.62986135", "0.6291823", "0.6290245", "0.62829477", "0.62764627", "0.62738633", "0.6268442", "0.62572867", "0.62499785", "0.6241121", "0.6234808", "0.6232978", "0.6231542", "0.6210837", "0.6210036", "0.6201068", "0.6190211", "0.6170928", "0.6157159", "0.61559534", "0.61477834", "0.6143307", "0.6142598", "0.61338365", "0.61272234", "0.6125472", "0.6124635", "0.61197346" ]
0.7277378
29
if the player enters the command HELP outputs an array of text help instructions
function commandHelp(player_ID, executeCommand) { getPlayer(player_ID, function(playerfound) { let currentRoom = playerfound.room; let output = ['Here is a list of commands:', '----------------------', '| - - - command - - -| - - function - - |', '| ' + commands.command1 + ' - - - - - - - | list content of folder |', '| ' + commands.command2 + ' [folder name] | move to folder |', '| ' + commands.command2 + ' [..] - - - - -| go back |', '| ' + commands.command3 + ' [file name] - | open/run file |', '----------------------' ]; executeCommand(output, currentRoom); }); return }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function help() {\n\tvar commandsArray = ['Help: List of available commands',\n\t\t'<span class=\"green\">>about</span>',\n\t\t'<span class=\"yellow\">>contact</span>',\n\t\t'<span class=\"purple\">>projects</span>',\n\t\t'<span class=\"orange\">>skills</span>',\n\t\t'<span class=\"blue\">>experiences</span>',\n\t\t'>help',\n\t\t'>ping',\n\t\t'>time',\n\t\t'>clear',\n\t\t'>say',\n\t\t'>info',\n\t\t'>exit'];\n\tseperator();\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function showHelp() {\n\t//Use figlet npm package to convert text to art/drawing.\n\tfiglet('LIRI help', function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\tvar helpInfo = \"Usage: node liri.js <command> [arguments]\"\n\tvar helpColumns = columnify([{\n\t\tCommand: 'my-tweets',\n\t\tDescription: \"Shows the last 20 tweets from Twitter timeline and when they were created.\"\n\t}, {\n\n\t\tCommand: \"movie-this [movie_name]\",\n\t\tDescription: \"Shows information about the specifid movie. If no movie is specified, Mr. Nobody is displayed by default.\"\n\t}, {\n\n\t\tCommand: \"spotify-this-song [song_name]\",\n\t\tDescription: \"Shows top 10 songs on Spotify that have specified name. If no song is specified, The Sign by Ace of Base is displayed by default.\"\n\t}, {\n\n\t\tCommand: 'do-what-it-says',\n\t\tDescription: \"Shows the top 10 songs on Spotify for the song, 'I want it that way.'\"\n\t}])\n\tconsole.log(\"==================================================================================================\");\n\tconsole.log(helpInfo);\n\tconsole.log(\"==================================================================================================\");\n\tconsole.log(helpColumns);\n}", "function help() {\n console.log(\n \"\\n\" +\n \"STRUCTURE\" +\n \"\\033[38;5;6m\" + \"\\n node liri.js (command) + (search(artist, concert, movie))\\n\" + \"\\033[0m\" +\n \"\\nCOMMAND OPTIONS\" +\n \"\\033[38;5;10m\" +\n \"\\n spotify-this-song\" + \"\\033[0m\" + \" search for artist details\" +\n \"\\033[38;5;10m\" +\n \"\\n concert-this\" + \"\\033[0m\" + \" search for concert details\" +\n \"\\033[38;5;10m\" +\n \"\\n movie-this\" + \"\\033[0m\" + \" search for movie details\" +\n \"\\033[38;5;10m\" +\n \"\\n do-what-it-says\" + \"\\033[0m\" + \" run a search based on what is written in 'random.txt'\"\n )\n}", "function help() {\n var helpmsg =\n '!ouste : déconnecte le bot\\n' +\n '!twss : ajoute la dernière phrase dans la liste des TWSS\\n' +\n '!nwss : ajoute la dernière phrase dans la liste des Non-TWSS\\n' +\n '!chut : désactive le bot\\n' +\n '!parle : réactive le bot\\n' +\n '!eval : évalue la commande suivante\\n' +\n '!dbg : met le bot en debug-mode, permettant de logger toute son activité\\n' +\n '!undbg : quitte le debug-mode\\n' +\n '!help : affiche ce message d\\'aide';\n client.say(channel, helpmsg);\n bot.log('message d\\'aide envoyé');\n}", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "_helpAndError() {\n this.outputHelp();\n // message: do not have all displayed text available so only passing placeholder.\n this._exit(1, 'commander.help', '(outputHelp)');\n }", "function help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "function help() {\n console.log(\"joy \\n\\\n \\n \\\n Usage:\\n \\\n joy new <name>...\\n \\\n joy build \\n \\\n joy serve \\n \\\n joy tidy \\n \\\n joy help \\n \\\n \\n \\\n joy -h | --help \\n \\\n joy --version \\n \\\n \\n \\\n Options: \\n \\\n -h --help Show this screen. \\n \\\n --version Show version.\\n \\\n \");\n}", "function commandHelp(msg) {\n return msg.channel.sendMessage(HELP_MESSAGE);\n}", "commandHelp() {\n if (!this.commands.length) return '';\n const commands = this.prepareCommands();\n const width = this.padWidth();\n return ['Commands:', commands.map(cmd => {\n const desc = cmd[1] ? ` ${cmd[1]}` : '';\n return (desc ? pad(cmd[0], width) : cmd[0]) + desc;\n }).join('\\n').replace(/^/gm, ' '), ''].join('\\n');\n }", "function execHelp(args, msg) {\n if (args.length == 0) msg.channel.send(\"Please provide some more information, try using `!help [topic]`\");\n else msg.channel.send(\"Dont worry i'm here to help you with \" + args + \"!\");\n }", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "function showHelpUsage() {\n let helpString = \"Hei, olen Relluassari! Yritän auttaa sinua relaatioiden ratkonnassa ;) \\n\" +\n \"<<< Koska olen vielä beta, älä pahastu jos en osaa jotain, tai kaadun kesken kaiken >>> \\n\" +\n \" \\n Miten kutsua minut apuun? \\n \" +\n \" TL;DR? Klikkaa tunnettua -> klikkaa tuntematonta -> klikkaa tuntematonta -> ... -> Repeat \\n\" +\n \" \\nEli miten? \\n\" +\n \" 1) Klikkaa graafista tunnettua sanaa \\n\" +\n \" -> Relluassari tekee Wikipediasta, Bingistä, Wiktionarystä ja Ratkojista lähdehaut ko. sanalla. \\n\" +\n \" 2) Kun haku valmis, klikkaa graafista tunnettuun kytkettyä tuntematonta sanaa \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 3) Kun brutetus valmis, klikkaa seuraavaa tunnettuun kytkettyä tuntematonta \\n\" +\n \" -> Relluassari parsii hakutuloksista klikatun pituiset sanat ja brutettaa rellua niillä. \\n\" +\n \" 4) Valitse uusi tunnettu sana lähteeksi ja siirry kohtaan 1) \\n\" +\n \"\\nAdvanced usage: \\n\" +\n \" Menu>Suorita lähdehaku (teemasana) - tekee lähdehaun vain teemasanalla \\n\" +\n \" Menu>Suorita lähdehaku (oma sana) - tekee lähdehaun syöttämälläsi sanalla/sanoilla (esim. usean sanan hakuun Bingistä) \\n\" +\n \" Menu>Parsi hakutulos sanoiksi - parsii hakutuloksesta *kaikkien* näkyvien tuntemattomien pituiset sanat \\n\" +\n \" Menu>Bruteta sanalista - brutettaa rellua sen hetken muistissa olevalla koko sanalistalla \\n\";\n alert(helpString);\n}", "function help() {\n console.log(`Today I Learned\n\n Run locally with:\n\n node ./til.js\n\n Usage:\n\n til add \"something cool i learned today\"\n adds an entry to your TIL DB\n til list\n shows all entries, day by day\n til help\n shows this message\n `)\n process.exit(0);\n}", "function help() {\n\n}", "function helpCommand(arg, messageReceived) {\n let helpContent = '```List of commands:\\n\\n';\n const commands = new Help.Helps();\n\n for (var prop in commands.listOfResponses){\n \n let commandDescription = `!${prop} - ${commands.listOfResponses[prop].description}\\n`;\n //console.log('success2');\n console.log(commandDescription);\n helpContent += commandDescription;\n console.log(helpContent);\n };\n helpContent += '```'\n messageReceived.channel.send(helpContent);\n}", "getHelp ( input, output ) {\n output.standardOutput.writeLine( 'Usage:' );\n this.getUsage().split( '\\n' ).forEach( line => output.standardOutput.writeLine( line ) );\n output.standardOutput.writeLine( '' );\n\n if ( this.getDescription() ) {\n output.standardOutput.writeLine( 'Description:' );\n output.standardOutput.writeLine( this.getDescription() );\n }\n\n output.standardOutput.writeLine( '' );\n }", "printHelpText() {\n const helpText = fs.readFileSync(\n path.join(__dirname, 'cli-help.txt'), 'utf8');\n logHelper.info(helpText);\n }", "function ListHelp() {\n}", "function help(target, context) {\r\n const commands = Object.keys(knownCommands);\r\n\r\n let commandList = \"\";\r\n commands.forEach(command => {\r\n commandList += ` !${command}`;\r\n });\r\n\r\n const message = `We support the following commands: ${commandList}`;\r\n sendMessage(target, context, message);\r\n}", "get help() {\n\t\tlet response = \"\"\n\t\tif (this._description) { \n\t\t\tresponse = this._description; \n\t\t}\n\n\t\tresponse += \" - Usage: \" + this.format;\n\t\tresponse += \" - Ex: \" + this.example;\n\n\t\treturn response;\n\t}", "function help() {\n\tvar message;\n\tmessage = \"The following are valid text commands: N or n to move North, S or s to move South, W or w to move West, E or e to move East, or T or t to take an item at a given location.\";\n\tdocument.getElementById(\"Help\").innerHTML = message;\n}", "helpInformation() {\n let desc = [];\n\n if (this._description) {\n desc = [this._description, ''];\n const {\n argsDescription\n } = this;\n\n if (argsDescription && this._args.length) {\n const width = this.padWidth();\n desc.push('Arguments:');\n desc.push('');\n\n this._args.forEach(({\n name\n }) => {\n desc.push(` ${pad(name, width)} ${argsDescription[name]}`);\n });\n\n desc.push('');\n }\n }\n\n let cmdName = this._name;\n\n if (this._alias) {\n cmdName = `${cmdName}|${this._alias}`;\n }\n\n const usage = [`Usage: ${cmdName} ${this.getUsage()}`, ''];\n let cmds = [];\n const commandHelp = this.commandHelp();\n if (commandHelp) cmds = [commandHelp];\n const options = ['Options:', `${this.optionHelp().replace(/^/gm, ' ')}`, ''];\n return usage.concat(desc).concat(options).concat(cmds).join('\\n');\n }", "function help () {\n return `INSTRUCTIONS:\n Blacksmith is a simple text base game. \n \n As a blacksmith you convert ore and wood into swords and axes. You buy your resources using gold and sell your weapons for gold.\n \n COMMANDS:\n - buy(item)\n - make(item)\n - sell(item)\n - fire()\n - inventory()\n - help()`\n }", "function help() {\n console.log(`\n TO ADD A NOTE:\n node index.js --add <ADD YOUR NOTE HERE> --category <ADD YOUR CATEGORY HERE>\n OR\n node index.js --a <ADD YOUR NOTE HERE> --c <ADD YOUR CATEGORY HERE>\n \n TO DELETE A NOTE:\n node index.js --delete <NOTE ID> \n OR\n node index.js --d <NOTE ID> \n TO LIST NOTES:\n node index.js --list \n node index.js --list <certain category> \n OR\n node index.js --l\n node index.js --l <certain category> \n `);\n process.exit();\n}", "helpText(){\n\n if(this.getStep() === 0 ){\n return ` -== HELP ==-\n The first line is 1 integer, consisting of the number of the number of lines of source code (N).\n The second line is 1 integer, constiting of the number of queries (Q).\n The next N lines consiste of HRML source code, consisting of either an opening tag with zero or more attributes or a closing tag. \n Then the next Q lines contains the queries. \n Each line is a string that references an attribute in the HRML source code.`;\n\n }else if(this.getStep() === 1){\n return 'START';\n }\n }", "function helpCommand(arguments, receivedMessage) {\n if (arguments.length > 0) {\n receivedMessage.channelsend(\"It looks like you might need help with \" + arguments)\n } else {\n receivedMessage.channel.send(\"I'm not sure what you need help with. Try `!help [topic]`\")\n }\n}", "help() {\n return util.call('help')\n }", "function help_menu() {\n console.log('Please use one of the following commands:')\n console.log('Summary: ./pandlss.sh -s <date> <time>')\n console.log('Breakdown: ./pandlss.sh -b <date> <time> <increment>')\n console.log('Breakdown one stock: ./pandlss.sh -b-os <stock> <date> <time> <increment>')\n}", "function do_help(cmd) {\n let helptext = [\n \"sofa-tool make-workset <container_url> <workset_name>\",\n \"sofa-tool add-fragment <workset_url> <fragment_url> <fragment_name>\",\n // \"\",\n // \"\",\n ];\n helptext.forEach(\n (txt) => { console.log(txt); }\n );\n return Promise.resolve(null)\n .then(() => meld.process_exit(meld.EXIT_STS.SUCCESS, \"Help OK\"))\n ;\n}", "function help () {\n program.parse(process.argv)\n if (program.args.length < 1) return program.help()\n}", "static help(session, callback) {\n console.log(\"In giveHelp\");\n callback(session.attributes, Utils.buildSpeechResponse(\"Help\", \"You can say things like. \" +\n \"start player X, \" +\n \"unpause player X, \" +\n \"randomize player X, \" +\n \"stop player X, \" +\n \"pause player X, \" +\n \"previous song on player X, \" +\n \"next song on player X, \" +\n \"synchronize player X with player Y, \" +\n \"un-synchronize player X, \" +\n \"increase volume on player X, \" +\n \"decrease volume on player X, \" +\n \"set volume on player X to one to one hundred, \" +\n \"what's playing on player X, \" +\n \"set player X, \" +\n \"what are my player names, \" +\n \"exit, \" +\n \"help.\",\n \"What do you want to do?\", false, \"help\", null));\n }", "printHelp(obj){\n console.log();\n this.terminal.green(\"Usage: %s [options]\\n\", obj.cmd ? obj.cmd : \"\");\n if( obj.desc ){\n this.terminal.brightBlack(\"\\t%s\\n\", obj.desc);\n }\n if( obj.opts && obj.opts.length > 0 ){\n this.terminal.black(\"\\nOptions:\\n\");\n let opt;\n for( let i = 0; i < obj.opts.length; i++ ){\n opt = obj.opts[i];\n if( !opt.cmd )\n continue;\n\n this.terminal.green(\"%s\\t%s\\n\", opt.cmd, opt.desc ? opt.desc : \"\");\n }\n }\n }", "helpMessage() {\n return \"*!who-knows <skill-name>*\\n\" +\n \"Gibt eine Liste von Kollegen zurück, die den angegebenen Skill beherrschen.\\n\" +\n \"Die Liste wird durch die API von HBT Power bereitgestellt, die Suche ist (noch) case sensitive.\\n\" +\n \" Alias: !wer-weiß, !häää?, !who-knows, wat?\";\n }", "constructor() {\n super('help', ['h']);\n this.setDescription('Do you really need to know how to ask for help?');\n }", "help(text) {\n return this.lib.help(text, __dirname);\n }", "function handleHelp() {\n\n\tvar helpDest = 0;\n\tgame.helpWait--;\n\n\t// get string for current help message\n\tif (game.help == 0) {\n\t\tgame.helpText.text = \"Use LEFT and RIGHT to move\";\n\t}\n\telse if (game.help == 1) {\n\t\tgame.helpText.text = \"Use UP to jump when the bar is full\";\n\t}\n\telse if (game.help == 2) {\n\t\tgame.helpText.text = \"Avoid the cones\";\n\t}\n\telse if (game.help == 3) {\n\t\tgame.helpText.text = \"Collect diamonds for extra points\";\n\t}\n\n\t// skip instructions if player presses Z\n\tif (game.input.keyboard.justPressed(Phaser.Keyboard.Z)) {\n\t\tgame.help = game.helpMax;\n\t}\n\n\t// the left, center, and right positions of help text\n\tvar leftPos = (game.world.width / 2) - 600;\n\tvar centerPos = (game.world.width / 2) - 300;\n\tvar rightPos = (game.world.width / 2);\n\n\t\n\tif (game.helpWait >= 360) {\n\t\t// help messages will begin on right with alpha of 0\n\t\thelpDest = rightPos;\n\n\t\tgame.helpText.alpha = 0;\n\t}\n\telse if (game.helpWait >= 180) {\n\t\t// then help messages will glide to center and their alpha will increase\n\t\thelpDest = centerPos;\n\n\t\tif (game.helpText.alpha < 1) {\n\t\t\tgame.helpText.alpha += 0.02;\n\t\t}\n\t}\n\telse {\n\t\t// then help messages will glide left and fade out\n\t\thelpDest = leftPos;\n\n\t\tif (game.helpText.alpha > 0) {\n\t\t\tgame.helpText.alpha -= 0.02;\n\t\t}\n\n\t\t// once current help message is gone, start the next one\n\t\tif (game.helpX < leftPos + 20) {\n\t\t\tgame.helpX = rightPos;\n\t\t\tgame.helpText.x = game.helpX;\n\t\t\tgame.help++;\n\t\t\tgame.helpWait = 360;\n\t\t}\n\t}\n\n\t// glide current help message to its proper destination\n\tgame.helpX = approach(game.helpX, helpDest, 36);\n\n\t// if we are passed messages, help text should be invisible\n\tif (game.help > game.helpMax) {\n\t\tgame.helpText.alpha = 0;\n\t}\n\t\n\t// keep alpha between 0 and 1\n\tgame.helpText.alpha = clamp(game.helpText.alpha, 0, 1);\n\n\t// update x & y for helpText\n\tgame.helpText.x = game.helpX;\n\tgame.helpText.y = game.helpY;\n}", "function outputHelp(){\n print([\n \"\\nUsage: csslint-rhino.js [options]* [file|dir]*\",\n \" \",\n \"Global Options\",\n \" --help Displays this information.\",\n \" --format=<format> Indicate which format to use for output.\",\n \" --list-rules Outputs all of the rules available.\",\n \" --rules=<rule[,rule]+> Indicate which rules to include.\",\n \" --version Outputs the current version number.\"\n ].join(\"\\n\") + \"\\n\");\n}", "helpInfo () {\n\t\tlet me = this;\n\n\t\treturn [\n\t\t\t$('<h3>').append(\n\t\t\t\tt('Adicionar um novo equipamento à aventura')\n\t\t\t),\n\t\t\tEquipament.helpTypeMeaning()\n\t\t];\n\t}", "function usage(){\n\tmsg.setBodyAsHTML('Bash Help:');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display a Quote: /bash [integer]');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display a Random Quote: /bash random');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Display Help: /bash help');\n\tview.echoSentMessageToDisplay(msg);\n\tmsg.setBodyAsHTML(' Ex: /bash 5273');\n\tview.echoSentMessageToDisplay(msg);\n}", "renderPresenceHelp() {\n var cmds = require('@commands');\n var n = (this.getTotalCharacterCount() / 1000).toFixed(1);\n return cmds.command_char + `help, ${Number.isNaN(n) ? 0 : n}k chars`;\n }", "addImplicitHelpCommand() {\n this.command('help [cmd]', 'display help for [cmd]');\n }", "function displayHelp() {\n /* eslint-disable no-console */\n console.log(\n /* eslint-disable indent */\n`Usage: node generate_full_demo.js [options]\nOptions:\n -h, --help Display this help\n -m, --minify Minify the built demo\n -p, --production-mode Build all files in production mode (less runtime checks, mostly).\n -w, --watch Re-build each time either the demo or library files change`,\n /* eslint-enable indent */\n );\n /* eslint-enable no-console */\n}", "function optionHelp() {\n console.log(\"usage: \" + appName + \" [<argv-options-list>]\" );\n console.log(argvOptionHelp + \", \" + argvOptionHelpWord.concat(\" \".repeat(10)).substring(0,10) + \" \" + argvOptionHelpDescription);\n console.log(argvOptionDebuglevel + \", \" + argvOptionDebuglevelWord.concat(\" \".repeat(10)).substring(0,10) + \" \" + argvOptionDebuglevelDescription);\n //\n console.log(argvOptionTcpaddress + \", \" + argvOptionTcpaddressWord.concat(\" \".repeat(10)).substring(0,10) + \" \" + argvOptionTcpaddressDescription);\n console.log(argvOptionTcpport + \", \" + argvOptionTcpportWord.concat(\" \".repeat(10)).substring(0,10) + \" \" + argvOptionTcpportDescription);\n console.log(argvOptionQuantity + \", \" + argvOptionQuantityWord.concat(\" \".repeat(10)).substring(0,10) + \" \" + argvOptionQuantityDescription);\n console.log(argvOptionUsers + \", \" + argvOptionUsersWord.concat(\" \".repeat(10)).substring(0,10) + \" \" + argvOptionUsersDescription);\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(HELP_DOC);\r\n}", "function getHelpAll() {\n var help = \"\\\n<br/>#a (#app, show available apps) \\\n<br/>#a chess {#app chess, open 6-piece chess app window) \\\n<br/>#a {app} (#app {app}, open given app or url) \\\n<br/>#a1 (#a on, #app on, turn on app) \\\n<br/>#a0 (#a off, #app off, hide app window) \\\n<br/>#ac (#a clear, #app clear, clear any app and hide app window) \\\n<br/>#b (#public, set room as public) \\\n<br/>#c {room} (#create, create and join a new room) \\\n<br/>#e (#erase, erase chatroom content) \\\n<br/>#h (#?, #help, show help) \\\n<br/>#ha (#help all, show help for all commands) \\\n<br/>#hm (#help master, show help for room master) \\\n<br/>#i {user} (#invite, invite a user to current room) \\\n<br/>#j {room} (#join, join an existing room) \\\n<br/>#k {user} (#kick, kick a user out of current room) \\\n<br/>#l (#leave, leave current room, and enter Lobby) \\\n<br/>#m {user} (#master, assign another room user as master) \\\n<br/>#o (#who, list users in current room) \\\n<br/>#p (#passwd, update password) \\\n<br/>#r (#rooms, list online rooms) \\\n<br/>#s {size} (#size, set room max size, 0 means no limit) \\\n<br/>#u (#users, list online users) \\\n<br/>#v (#private, set room as private) \\\n<br/>#v1 (#vid, #vid on, turn on video camera window) \\\n<br/>#v0 (#vid off, turn off video camera window) \\\n<br/>#w (#where, show current room name) \\\n<br/>#x (#exit, #logout, logout) \\\n\";\n return help;\n }", "function help() {\n console.log(`\n notes USAGE: notes \n\n --add | -a <your note> - add an entry to your notes\n --category <category name> - give your note a category\n\n --list | -l <optional category> - list all notes | list all notes in category\n\n --update | u <note id> update note. id required plus at least one option\n --note <note text> - will update the note's text content\n --category <category name> - will update the note's category\n\n --delete | -d <note id> - delete note by id\n `);\n\n process.exit();\n}", "function displayHelp()\n{\n dwscripts.displayDWHelp(HELP_DOC);\n}", "handler_HELP(command, callback) {\n this.send(214, 'See https://tools.ietf.org/html/rfc5321 for details');\n callback();\n }", "function showHelp() {\n console.log(optimist.help().trim());\n process.exit(0);\n}", "function displayHelp()\n{\n // Replace the following call if you are modifying this file for your own use.\n dwscripts.displayDWHelp(HELP_DOC);\n}", "static getHelp({ client, command, prefix, t }) {\n command = typeof command === 'string' ? client.commands.fetch(command) : command;\n if (command.name === 'help') throw new CommandError('commands:help.commandHelp');\n\n const embed = new SimplicityEmbed({ author: client.user, t })\n .setDescription(`commands:${command.name}.description`)\n .setTitle(fixText(command.name), {}, false);\n\n // Add arguments\n const usage = CommandUtils.getUsage({ command, prefix, t });\n if (usage) embed.addField('common:usage', usage, true);\n\n // Add aliases\n if (!isEmpty(command.aliases)) {\n embed.addField('common:aliases', command.aliases.map((a) => `\\`${a}\\``).join(' '), true);\n }\n\n // Add examples\n const examples = getTranslation(`commands:${command.name}.examples`, t, { returnObjects: true });\n if (examples.lenght) {\n const examplesFixed = examples.map((e) => `${prefix}${command.name} ${e}`).join('\\n');\n embed.addField('common:examples', examplesFixed, true);\n }\n\n // Add subcommands\n const subcommands = command.subcommands && command.subcommands.map((sub) => {\n const commandName = `\\`${prefix + command.name} ${sub.name}\\` `;\n return `${commandName} ${t(`commands:${command.name}-${sub.name}.description`)}`;\n });\n\n if (!isEmpty(subcommands)) {\n embed.addField('common:subcommands', subcommands.join('\\n'));\n }\n return embed;\n }", "optionHelp() {\n const width = this.padWidth(); // Append the help information\n\n return this.options.map(({\n flags,\n description,\n bool,\n defaultValue\n }) => `${pad(flags, width)} ${description}${bool && defaultValue !== undefined ? ` (default: ${JSON.stringify(defaultValue)})` : ''}`).concat([`${`${pad('-h, --help', width)} `}output usage information`]).join('\\n');\n }", "function showHelp() {\t\n const helpText = fs.readFileSync('./help.txt',{encoding:'UTF-8'});\n console.log(helpText);\n}", "function help(user, userID, channelID, args, evt) {\n message = 'Available commands:' +\n '\\r\\n`p!ping`: Checks to see if the bot is running' +\n '\\r\\n`p!sub add <pokemon>`: Add a subscription for the specified <pokemon>. You will receive a confirmation DM.' +\n '\\r\\n`p!sub remove <pokemon>`: Removes a subscription for the specified <pokemon>. You will receive a confirmation DM.' +\n '\\r\\n`p!sub list`: Sends a DM with a list of all pokemon you are subscribed to.' +\n '\\r\\n`p!spawn <pokemon>`: Sends a DM to all people subscribed to the specified <pokemon> indicating that one has spawned. If sent as a comment on an image, the uploaded image will also be included in the DM.' +\n '\\r\\n`p!stats`: Sends a DM with some general usage statistics for the bot.'\n\n bot.sendMessage({ to: channelID, message: message });\n}", "function help() {\n\tvar fpath = path.join( __dirname, 'usage.txt' );\n\tfs.createReadStream( fpath )\n\t\t.pipe( process.stdout )\n\t\t.on( 'close', onClose );\n\n\tfunction onClose() {\n\t\tprocess.exit( 0 );\n\t}\n}", "function help() {\n\tvar fpath = path.join( __dirname, 'usage.txt' );\n\tfs.createReadStream( fpath )\n\t\t.pipe( process.stdout )\n\t\t.on( 'close', onClose );\n\n\tfunction onClose() {\n\t\tprocess.exit( 0 );\n\t}\n}", "_displayHelp() {\n document.getElementById(\"bot-invite-link\").href = discotron.config.inviteLink;\n // Query cards\n discotron.Plugin.getAll().then((plugins) => {\n\n for (const pluginId in plugins) {\n const plugin = plugins[pluginId];\n\n const template = document.getElementById(\"template-plugin-help\");\n const pluginCard = document.importNode(template.content, true);\n\n pluginCard.querySelector(\".plugin-help-header\").textContent = plugin.name;\n pluginCard.querySelector(\".plugin-description\").textContent = plugin.description;\n\n for (let i = 0; i < plugin.commands.length; i++) {\n const command = plugin.commands[i];\n\n const commandTemplate = document.getElementById(\"template-command\");\n const commandContainer = document.importNode(commandTemplate.content, true);\n\n let displayedCommand = \"\";\n\n switch (command.triggerType) {\n case \"command\":\n displayedCommand = \"!\" + command.trigger;\n break;\n case \"words\":\n displayedCommand = \"Words: \" + command.trigger.join(\", \");\n break;\n case \"all\":\n displayedCommand = \"(all)\";\n break;\n }\n\n commandContainer.querySelector(\".command\").textContent = displayedCommand;\n\n for (let j = 0; j < command.args.length; j++) {\n const arg = command.args[j];\n if (arg.defaultValue !== undefined) {\n commandContainer.querySelector(\".command-args\").textContent += \"[\" + arg.name + \"]\";\n } else {\n commandContainer.querySelector(\".command-args\").textContent += \"<\" + arg.name + \">\";\n }\n }\n\n if (command.args.length === 0) {\n commandContainer.querySelector(\".command-args\").textContent = \"(no args)\";\n }\n\n commandContainer.querySelector(\".command-description\").textContent = command.help;\n\n pluginCard.querySelector(\".plugin-commands\").appendChild(commandContainer);\n }\n\n\n document.getElementById(\"plugin-list-container\").appendChild(pluginCard);\n }\n }).catch(console.error);\n }", "function help () {\n return `Welcome to Scramble.\nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word.\n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help() {\n bot.chat.send(channel, {\n body: \"Enter: !mix <val> xlm <arg>\"\n });\n}", "function genericHelp(commands) {\n var message = '';\n for (let command in commands) {\n console.log('processing ' + command);\n if (!commands[command].hasOwnProperty('description')) continue;\n message += command + ': ' + commands[command].description + '\\n';\n }\n message += '\\nFor more information about specific commands, use `help <command>`';\n return message;\n}", "addBasicCommands() {\n this.addCommand(new commands.HelpCommand());\n }", "function help(event, response, model) {\n let speech;\n let reprompt;\n\n const helpCount = model.getAttr(\"helpCtr\");\n if (helpCount > 2) {\n speech = speaker.get(\"Help3\");\n }\n else if (helpCount === 2) {\n speech = speaker.get(\"Help2\");\n }\n else {\n speech = speaker.get(\"Help\");\n }\n\n reprompt = speaker.get(\"WhatToDo\");\n\n response.speak(speech)\n .listen(speaker.get(\"WhatToDo\"))\n .send();\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function help () {\n return `Welcome to Scramble. \nThe game where you unscramble letters to make words.\n\nOnce you start the game, you will be given a scrambled word.\nIf you correctly guess the word, you will receive a point.\nIf you guess incorrectly you will receive a strike.\nYou can also pass on a word. \n\nTo start a new game use start().\nTo make guess use guess('word').\nTo skip a word use pass().\nTo show these instructions again use help().`\n}", "function build_help(userID, channelID, message, parameter_set){\n log_event(\"Help requested in channel: \" + channelID)\n HELP_MESSAGE = \"Here are my supported commands:\\n\\n\"\n whitespace_cmd = new Array(COMMAND_SIZE_COL + 1).join('\\xa0');\n whitespace_usg = new Array(USAGE_SIZE_COL + 1).join('\\xa0');\n for(module in command_dict){\n HELP_MESSAGE += \"**\" + module + \":**\\n```\"\n for(command in command_dict[module]){\n HELP_MESSAGE += (command + whitespace_cmd).substring(0, COMMAND_SIZE_COL) \n + \" USAGE: \" + (format_usage(command, false) + whitespace_usg).substring(0, USAGE_SIZE_COL) \n if(command_dict[module][command]['desc'] != null)\n HELP_MESSAGE += \" | \" + command_dict[module][command]['desc']\n HELP_MESSAGE += \"\\n\"\n }\n HELP_MESSAGE += \"```\\n\"\n }\n bot.sendMessage({ to:channelID, message: HELP_MESSAGE })\n}", "function replyPing(){\n message.channel.send('pong! I am Crypto Bot.\\nType: \">help\" for help(without double quotes)') ;\n }", "function onHelpButtonClick() {\n\t\t\talert(\"帮助:\\n\\n\" +\n\t\t\t\t\"##用得开心就好!##\\n\\n\" +\n\t\t\t\t\"\", \"SPRenderQueueTools\"\n\t\t\t);\n\t\t}", "function $help() {\n process.stdout.write(`\nCommands:\n\ndev Run a local development server with HMR\nbuild Generate client and server-side compatible bundles\nlist List the pages in your SSR app\n\nOptions:\n\n--root Project root directory (default: \\`cwd\\`)\n--src Directory to read source files (default: src)\n--public-dir Directory to serve as plain static assets (default: public)\n`);\n}", "function handleHelpRequest(response) {\n var speechOutput = \"You can ask things like who represents Iowa? or Who is Charles Grassley? \"\n + \"When looking for a person, you can also say who is Grassley? or who is Charles? \" \n + \"For more about the supported states, territories, and districts, ask what states are supported. \"\n + \"Which state or congressperson would you like to know about?\";\n var repromptOutput = \"Which state or congressperson would you like to know about?\";\n \n response.ask(speechOutput, repromptOutput);\n}", "static help() {\n console.log(\n`Usage: \n\\nversion [ -v semver ] [-p [ 0 => PATCH, 1 => MINOR, 2 => MAJOR ] ]\nE.g version -v 0.2.3 -p 1 ## 0.3.3\n\nversion [ -f file ] [ -d delimeter ]\n `);\n }", "function help(channel){\n\tchannel.send(\"Welcome to bitchBot, created by Alex.\\nHere are some commands that could be useful:\\n\\n \\\n\t```!pic [Tag a Person]``` - Sends a random, gay photo of the person\");\n}", "function displayHelp()\r\n{\r\n dwscripts.displayDWHelp(helpDoc);\r\n}", "printHelp () {\n let messages = this.div.querySelectorAll('.messages')[0]\n let template = this.div.querySelectorAll('template')[0]\n let messageDiv = document.importNode(template.content, true)\n\n messageDiv.querySelectorAll('.author')[0].textContent = ``\n messageDiv.querySelectorAll('.text')[0].innerHTML =\n `\n <hr>\n <p>You can use this commands in the chatt</p><br>\n <p>/help Show this dialog</p>\n <p>/nick NICK To change nickname</p>\n <p>/r MSG use 'Rövarspråk'</p>\n <p>/e MSG use Encryption</p>\n <p>/a MSG use Anton encryption</p>\n <hr>\n `\n messages.appendChild(messageDiv)\n }", "function showHelpText() {\n ctx.save();\n\n if (lastUsedInput === 'keyboard') {\n setFont(18);\n ctx.fillStyle = 'white';\n ctx.fillText(translation.spacebar + ' ' + translation.select, 28 - fontMeasurement, kontra.canvas.height - 25 + fontMeasurement / 2.5);\n }\n else if (lastUsedInput === 'gamepad') {\n drawAButton(28, kontra.canvas.height - 25);\n setFont(18);\n ctx.fillStyle = 'white';\n ctx.fillText(translation.select, 28 + fontMeasurement * 1.75, kontra.canvas.height - 25 + fontMeasurement / 2.5);\n }\n\n ctx.restore();\n}", "help(cb) {\n this.outputHelp(cb);\n process.exit(1);\n }", "function getHelpCommon() {\n var help = \"\\\n<br/>#a (#app, show available apps) \\\n<br/>#a chess {#app chess, open 6-piece chess app window) \\\n<br/>#a {app} (#app, open given app or url) \\\n<br/>#a1 (#a on, #app on, turn on app) \\\n<br/>#a0 (#a off, #app off, hide app window) \\\n<br/>#ac (#a clear, #app clear, clear any app and hide app window) \\\n<br/>#c {room} (#create, create and join a new room) \\\n<br/>#e (#erase, erase chatroom content) \\\n<br/>#h (#?, #help, show help) \\\n<br/>#hm (#help master, show help for room master) \\\n<br/>#i {user} (#invite, invite a user to current room) \\\n<br/>#j {room} (#join, join an existing room) \\\n<br/>#l (#leave, leave current room, and enter Lobby) \\\n<br/>#o (#who, list users in current room) \\\n<br/>#p (#passwd, update password) \\\n<br/>#r (#rooms, list online rooms) \\\n<br/>#u (#users, list online users) \\\n<br/>#v1 (#vid, #vid on, turn on video camera) \\\n<br/>#v0 (#vid off, turn off video camera) \\\n<br/>#w (#where, show current room name) \\\n<br/>#x (#exit, #logout, logout) \\\n\";\n return help;\n }", "function help () {\n return `Welcome to Scramble. \n The game where you unscramble letters to make words.\n \n Once you start the game, you will be given a scrambled word.\n If you correctly guess the word, you will receive a point.\n If you guess incorrectly you will receive a strike.\n You can also pass on a word. \n \n To start a new game use start().\n To make guess use guess('word').\n To skip a word use pass().\n To show these instructions again use help().`\n }", "outputHelp(cb) {\n if (!cb) {\n cb = passthru => passthru;\n }\n\n process.stdout.write(cb(this.helpInformation()));\n this.emit('--help');\n }", "function listHelpMessage() {\n\n\t// log the message to display\n\tconsole.log(\n\t\t\"-----------------------------------------------\" + \"\\n\" +\n\t\t\"------ gitrc ------\" + \"\\n\" +\n\t\t\"-----------------------------------------------\" + \"\\n\\n\" +\n\t\t\"Easily switch between different gitconfig files\" + \"\\n\\n\" +\n\t\t\"Usage:\" + \"\\n\" +\n\t\t\" gitrc List all profiles\" + \"\\n\" +\n\t\t\" gitrc [name] Switch to profile\" + \"\\n\" +\n\t\t\" gitrc -n [name] Create a new profile\" + \"\\n\" +\n\t\t\" gitrc -d [name] Delete the profile\" + \"\\n\" +\n\t\t\" gitrc -h Display this screen\" + \"\\n\"\n\t);\n\n\t// successful exit\n\tprocess.exit( 0 );\n}", "function printHelpMessage() {\n var options = {\n encoding: 'utf8'\n };\n var message = fs.readFile('./app/helpmessage.txt', options);\n //need ./app/ because node read from where you are\n //running node from, not from where the file sits\n console.log(message);\n // process.stdout.write(message);\n }", "outputHelp(cb) {\n if (!cb) {\n cb = (passthru) => {\n return passthru;\n };\n }\n const cbOutput = cb(this.helpInformation());\n if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n process.stdout.write(cbOutput);\n this.emit(this._helpLongFlag);\n }", "outputHelp(cb) {\n if (!cb) {\n cb = (passthru) => {\n return passthru;\n };\n }\n const cbOutput = cb(this.helpInformation());\n if (typeof cbOutput !== 'string' && !Buffer.isBuffer(cbOutput)) {\n throw new Error('outputHelp callback must return a string or a Buffer');\n }\n process.stdout.write(cbOutput);\n this.emit(this._helpLongFlag);\n }", "function showHelp() {\n console.debug(\"showing map in Alert Panel\")\n\n // Does the user has enough points ?\n if (game.score < 500) {\n console.debug(\"not enough points to show the map\")\n showInstructions(\"sorry you don't have enough points\")\n return\n }\n\n // Remove 500 points\n game.updateScore(-500)\n\n // The maze needs to be wrapped as In-Room Controls do not support multi-lines\n // Each line's width depends on the device: 51 for Touch10 dispay, 31 for Screen display\n xapi.status.get(\"SystemUnit ProductPlatform\").then((product) => {\n console.debug(`running on a ${product}`)\n\n let width = 40 // when the Alert is shown on a Touch 10\n if (product == \"DX80\") {\n console.debug('has no Touch10 attached')\n width = 31 // when the Alert is shown on a screen\n }\n\n // show Alert panel \n xapi.command('UserInterface Message Alert Display', {\n Title: 'With a little help from ... the bot',\n Text: game.buildMapAsWrapped(width, true),\n Duration: 5\n }).then(() => {\n showScore()\n })\n })\n}", "function help() {\r\n common.displayHelp('tsu-amqp');\r\n }", "function listCommands() {\n console.log(`${mainDivider}\\n${\"WELCOME TO LIRI-BOT! HERE'S WHAT I CAN DO!\"}\\n${mainDivider}`)\n console.log(`${\"Use the following commands to run Liri-Bot:\"}\\n${minorDivider}\\n${\"'my-tweets' : To list the last 20 tweets\"}\\n${minorDivider}\\n${\"'spotify-this-song' + 'song name': To lists the Artist, Song Name, Preview Link, and Album\"}\\n${minorDivider}\\n${\"'movie-this' + 'movie title': To lists the Movie Title, Release Year, IMDB Rating, Rotten Tomatoes Rating, Country, Language, Plot, Cast\"}\\n${mainDivider}`);\n}", "function help() {\n res.send(\n {\n \"response_type\": \"ephemeral\",\n \"text\": \"Type `/support` for status accross all filters. Add a case link `https://help.disqus.com/agent/case/347519` or an email `archon@gmail.com` to get specific.\",\n }\n )\n }", "function Help() {\n}", "function Help() {\n}", "async function helpCommand(message) {\n if (message.member.roles.cache.some(role => role.name === \"Committee\")) {\n message.channel.send({ embed: {\n color: 3066993,\n title: \"Admin Command List\",\n fields: [{\n name: \"!list\",\n value: \"Present all pending problems\"\n },\n {\n name: \"!read (id)\",\n value: \"Find a specific problem for verification\"\n },\n {\n name: \"!testcases (id)\",\n value: \"List the test cases for a specific problem\"\n },\n {\n name: \"!init\",\n value: \"Gather players for a game of BlitzProg\"\n },\n {\n name: \"!start\",\n value: \"Start a game of BlitzProg with the current players\"\n },\n {\n name: \"!submit\",\n value: \"Submit your code for the current round and have it tested\"\n },\n {\n name: \"!end\",\n value: \"End the current game of BlitzProg \"\n }\n ]\n }});\n } else {\n message.channel.send({ embed: {\n color: 15158332,\n title: \"Player Command List\",\n fields: [{\n name: \"!init\",\n value: \"Gather players for a game of BlitzProg\"\n },\n {\n name: \"!start\",\n value: \"Start a game of BlitzProg with the current players\"\n },\n {\n name: \"!submit\",\n value: \"Submit your code for the current round and have it tested\"\n },\n {\n name: \"!end\",\n value: \"End the current game of BlitzProg \"\n }\n ]\n }});\n } \n}", "function printHelp() {\n var help = [\n 'Usage: reltoabs base-url source-file [dest-file]',\n '',\n 'Searches through the given source-file replacing any href=\"\" relative links with',\n 'absolute links. It will output it to the given dest-file. If no dest-file is provided',\n 'it will send it to absolute/source-file.',\n '',\n 'Options:',\n ' --help, -h - open this help file then exit.',\n ''\n ].join('\\n');\n\n console.log(help);\n}", "function printHelp() {\n console.log(\"-----------------------------\");\n console.log(\"Here’s a list of commands you can currently use!\");\n console.log(\"-----------------------------\");\n if (currentLoc === \"start\") {\n console.log(\"-----------------------------\");\n console.log(\"createAccount -- > Opens dialog for creating an account.\");\n console.log(\"login -- > Opens a dialog for logging in.\");\n console.log(\"help -- > Show this help info\");\n console.log(\"-----------------------------\");\n console.log(\"quit -- > Shut down the CLI\");\n } else if (currentLoc === \"menu\") {\n console.log(\"-----------------------------\");\n console.log(\"account -- > Show options for closing, modifying and checking if account exists\");\n console.log(\"funds -- > Show options for withdraw/transfer/deposits and fund-requests\");\n console.log(\"-----------------------------\");\n console.log(\"logout -- > Opens a dialog for logging out.\");\n } else if (currentLoc === \"accounts\") {\n console.log(\"-----------------------------\");\n console.log(\"Accounts:\");\n console.log(\"closeAccount -- > Opens a dialog for closing an account.\");\n console.log(\"modifyAccount -- > Opens a dialog for modifying an account.\");\n console.log(\"doesAccountExist -- > Opens a dialog for checking if the account exists.\");\n console.log(\"-----------------------------\");\n console.log(\"return -- > Return to menu\");\n } else if (currentLoc === \"funds\") {\n console.log(\"-----------------------------\");\n console.log(\"Funds:\");\n console.log(\"withdrawFunds -- > Opens a dialog for withdrawing funds.\");\n console.log(\"depositFunds -- > Opens a dialog for depositing funds.\");\n console.log(\"transferFunds -- > Opens a dialog for transferring funds to another account.\");\n console.log(\"-----------------------------\");\n console.log(\"Requests:\");\n console.log(\"requestFunds -- > Opens a dialog for requesting another user for funds.\");\n console.log(\"fundRequests -- > Shows all the requests for the account funds.\");\n console.log(\"acceptFundRequest -- > Opens a dialog for accepting a fund request.\");\n console.log(\"-----------------------------\");\n console.log(\"help -- > Show this help info\");\n console.log(\"-----------------------------\");\n }\n}", "function pickHelp(context) {\n var helpMessage = \"\";\n helpMessage = \"<p>Click on UI elements to find out more about them.<br>Click <b>?</b> to hide this pane.<br>Go <a href='changelog.html' >here</a> to see the list of changes and coming features.</p>\";\n return helpMessage;\n }", "function registerHelpListener (controller, helpInfo) {\n controller.hears('^help ' + helpInfo.command + '$', 'direct_mention,direct_message', function (bot, message) {\n let replyText = helpInfo.text\n\n if (typeof helpInfo.text === 'function') {\n let helpOpts = _.merge({botName: bot.identity.name}, _.pick(message, ['team', 'channel', 'user']))\n\n replyText = helpInfo.text(helpOpts)\n }\n\n bot.reply(message, replyText)\n })\n}", "function help(args, cb) {\n const self = this;\n if (args.command) {\n args.command = args.command.join(' ');\n var name = _.find(this.parent.commands, {_name: String(args.command).toLowerCase().trim()});\n if (name && !name._hidden) {\n if (_.isFunction(name._help)) {\n name._help(args.command, function (str) {\n self.log(str);\n cb();\n });\n return;\n }\n this.log(name.helpInformation());\n } else {\n this.log(this.parent._commandHelp(args.command));\n }\n } else {\n this.log(this.parent._commandHelp(args.command));\n }\n cb();\n}", "function listOptions(){\n let msg = \n`'q' or 'quit' exit the app\n'help' '?' or 'list' display available scripts`\n\n console.log(BLUE, msg)\n}", "function showHelp() {\r\n console.log(\"\\nUsage: \");\r\n console.log(\"\\t phantomjs \" + args[0] + \" <user_number> <user_password>\");\r\n}", "function helpRun(command) {\n return preCommand + \" \" + command;\n}", "function help() {\n console.log(\" \");\n console.log(\n \" ╔════════════════════════════════════════════════════════════════════════╗\"\n .rainbow\n );\n console.log(\n \" ║ ║\"\n .rainbow\n );\n console.log(\n \" ║ Hi my name is LUIRI, like Siri but better, Ill be assisting you... ║\"\n .rainbow\n );\n console.log(\n \" ║ ║\"\n .rainbow\n );\n console.log(\n \" ╠════════════════════════════════════════════════════════════════════════╣\"\n .rainbow\n );\n console.log(\n \" ║ To see your tweets: luiri tweets ║\"\n .red\n );\n console.log(\n ' ║ To track a tweet: luiri twitterTrack \"word\" ║'\n .red\n );\n console.log(\n ' ║ To search for a song: luiri spotify \"song name\" ║'\n .green\n );\n console.log(\n ' ║ To search for a movie: luiri movie \"movie name\" ║'\n .yellow\n );\n console.log(\n \" ║ Saved: luiri saved ║\"\n .blue\n );\n console.log(\n \" ║ To view the log: luiri log ║\"\n .green\n );\n console.log(\n \" ╚════════════════════════════════════════════════════════════════════════╝\"\n .rainbow\n );\n}" ]
[ "0.8331571", "0.81621987", "0.7692364", "0.752256", "0.7520537", "0.74953717", "0.74953717", "0.74818176", "0.7463791", "0.7395625", "0.7340713", "0.73323286", "0.7309701", "0.729556", "0.7288285", "0.7288059", "0.7267721", "0.7247687", "0.72140205", "0.7210171", "0.7201761", "0.71681094", "0.7137909", "0.7122475", "0.7082669", "0.70397496", "0.7024424", "0.70186406", "0.6997665", "0.69938844", "0.698998", "0.6986608", "0.6961266", "0.6954511", "0.69478434", "0.6924428", "0.69200027", "0.691822", "0.68493706", "0.68442446", "0.6842232", "0.68189794", "0.6812966", "0.6798448", "0.679083", "0.6790596", "0.6778322", "0.6770468", "0.6766868", "0.6734285", "0.67188346", "0.67179245", "0.67168736", "0.6714001", "0.66833663", "0.6667459", "0.66660696", "0.66660696", "0.66652447", "0.6664332", "0.66631436", "0.6653905", "0.6651171", "0.6634405", "0.66151553", "0.66151553", "0.66151553", "0.6606479", "0.6593636", "0.6573222", "0.6572353", "0.656812", "0.65441453", "0.6542772", "0.6541314", "0.6510006", "0.6503296", "0.6502812", "0.647819", "0.64729434", "0.645646", "0.6451697", "0.6447198", "0.6442", "0.6442", "0.64304686", "0.6427149", "0.64233094", "0.6419323", "0.64059263", "0.64059263", "0.6395849", "0.6394903", "0.6391283", "0.6387884", "0.63872254", "0.63803697", "0.6374389", "0.6329619", "0.6322321", "0.6311515" ]
0.0
-1
if the player enters the command GOTO
function commandGoto(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { var currentPlayer = playerfound; var currentRoom = currentPlayer.room; var newRoom = null; var roomToGo = parameter.toLowerCase(); // if the user wishes to go back if(parameter == ".." && currentRoom == "/root/users/admin/cloud") { newRoom = "/root/users/admin"; Player.findOneAndUpdate({ 'playerID': player_ID }, { room: newRoom }, { new: true, useFindAndModify: false }, function(err, updatedPlayer) { if(err) console.error(err); if(updatedPlayer) { updatedPlayer.save(function(err) { if(err) console.error(err); currentRoom = newRoom; newRoom = "CHANGED FOLDER"; executeCommand([newRoom], currentRoom); return; }); } }); } if(parameter == ".." && currentRoom != "/root/users/admin/cloud") { Room.find({'name': currentRoom}, function(err, roomfound) { if(err) console.error(err); // set new room to the previous room newRoom = roomfound[0].prevRoom; Player.findOneAndUpdate({ 'playerID': player_ID }, { room: newRoom }, { new: true, useFindAndModify: false }, function(err, updatedPlayer) { if(err) console.error(err); if(updatedPlayer) { updatedPlayer.save(function(err) { if(err) console.error(err); currentRoom = newRoom; newRoom = "CHANGED FOLDER"; executeCommand([newRoom], currentRoom); return; }); } }); }); // if the user types a room to go to } else if(roomToGo != "cloud") { // if players wishes to enter admin folder - they need to type password if(roomToGo == "admin" && currentRoom == "/root/users") { newRoom = "ENTER PASSWORD"; executeCommand([newRoom], currentRoom); return; // if the player typed the correct password - they get access to the admin folder } else if(roomToGo == "auth") { roomToGo = "admin"; } roomToGo = currentRoom + "/" + roomToGo; Room.find({ 'name': roomToGo }, function(err, roomfound) { if(err) console.error(err); roomfound = roomfound[0]; // if the desired room exists - update player room if(roomfound) { newRoom = roomfound.name; Player.findOneAndUpdate({ 'playerID': player_ID }, { room: newRoom, }, { new: true, useFindAndModify: false }, function(err, updatedPlayer) { if(err) console.error(err); if(updatedPlayer) { updatedPlayer.save(function(err) { if(err) console.error(err); currentRoom = newRoom; newRoom = "CHANGED FOLDER"; executeCommand([newRoom], currentRoom); return; }); // if something goes wrong with updating the player room } else { newRoom = "COULD NOT FIND DIRECTORY"; executeCommand([newRoom], currentRoom); return; } }); // if the desired room does not exist } else { newRoom = "COULD NOT FIND DIRECTORY"; executeCommand([newRoom], currentRoom); return; } }); } else { console.log("goto cloud gameid: " + game_ID); Cloud.find({ 'gameID': game_ID }, function(err, roomfound) { if(err) console.error(err); roomfound = roomfound[0]; // if the desired room exists - update player room if(roomfound) { newRoom = roomfound.name; Player.findOneAndUpdate({ 'playerID': player_ID }, { room: newRoom, }, { new: true, useFindAndModify: false }, function(err, updatedPlayer) { if(err) console.error(err); if(updatedPlayer) { updatedPlayer.save(function(err) { if(err) console.error(err); currentRoom = newRoom; newRoom = "CHANGED FOLDER"; executeCommand([ newRoom, "Welcome to the Cloud Service", "* Accessing files will remove them from the cloud", "* Type SHARE [filename] to add files to the cloud" ], currentRoom); return; }); // if something goes wrong with updating the player room } else { newRoom = "COULD NOT FIND DIRECTORY"; executeCommand([newRoom], currentRoom); return; } }); // if the desired room does not exist } else { newRoom = "COULD NOT FIND DIRECTORY"; executeCommand([newRoom], currentRoom); return; } }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "jump() {\n\t\t// \n\t}", "function userTouchedContinue() {\n TileSum.game.state.start('Play');\n }", "go() {\n if (game.pause===true) {\n game.message = '';\n game.pause=false;\n game.generateEntities(false,true);\n game.autoMove();\n console.log('Game Status: ', game.status());\n }\n }", "function continueGame(event)\n {\n toGame();\n }", "function handleKeyDown(e)\n{\n hero.jump();\n}", "jumpOnIt() {\n console.clear()\n console.log(\"You leap into the air and land on the waffle iron. The move is super effective!\");\n console.log(\"The heat from the waffle iron burns your legs.\");\n \n this.answersPush(this.player, \"Jump on it\");\n\n //Health && Check\n if(this.player.isDead(15)) {\n this.endGame(this.player);\n } \n \n }", "function pausePlayer() {\r\n\r\n\tif(currentState == 3 || currentState == 2 ) {\r\n\t\tcurrentState = 2;\t\t\r\n } else {\r\n\r\n\t\treturn;\t\r\n }//fi\r\n\t\t\t\r\n}//end method", "function jump() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"y\", moveTypes.jumping);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function pauseGame()\n {\n toMenu();\n }", "function ProcessBattleMagicMenu() {\r\n if (Control.Query(\"Back\")) {return {ChangeState:\"X\"};}\r\n if (Control.Query(\"Forward\")) {\r\n UseSpell(BattleMagicMenu.Choice(),report = \"Battle\");\r\n\tEnemyMove();\r\n\tif (LoseCondition()) {GameState.BattleReport.push(\"You have died.\");return {ChangeState:\"Loss\"};}\r\n\telse return {ChangeState:\"X\"};\r\n }\r\n BattleMagicMenu.Process();\r\n}", "function jump () {\n jump = true;\n}", "function C005_GymClass_Outro_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\tif (TextPhase >= 2) SaveMenu(\"C007_LunchBreak\", \"Intro\");\n\n}", "function ExitGame() {\n\n if ((flagMenuInstructions == 'default') && (flagChangeCharacter == 'default'))\n window.location.href = \"http://www.google.com\";\n}", "function mousePressed() \n{\n\tjump()\n}", "function control(e) {\n if (e.keyCode == \"38\" || e.keyCode == \"32\") {\n if (!isJump) {\n isJump = true;\n jump();\n }\n }\n }", "function letBotMoveProceed(callback) {\n if ((current_turn === tictactoe.first_player) && (player1.type === 'bot')) {\n var move_made = bot_move();\n callback(current_turn, move_made)\n toggleTurn();\n }\n }", "function StandClick(){\r\n while(player2Point < 17){\r\n Stand();\r\n }\r\n // check if any player is winning\r\n IsGameOver();\r\n}", "function continueExecution() {\n clearBoard();\n hero.positionAtHome();\n hero.setImage('normal');\n hero.setLives(hero.getLives()-1);\n hero.draw();\n isNextLife = true;\n }", "function pauseJump(){\r\n timeline.pause()\r\n timeline2.pause()\r\n timeline3.pause()\r\n}", "function TravelReturn() {\n\tnextMove = OPC.lastPos;\n\tOPC.encounter = \"\";\n\tif(OPC.hpCurrent < OPC.hpMax / 2) {\n\t\tOPC.goal = \"short rest\";\n\t}\n\telse {\n\t\tOPC.goal = \"travel\";\n\t}\n\tTravelMove(nextMove);\n}", "function Step(){\n\t\tplaying = false;\n\t\tBotReady();\n\t}", "function jump(label)\n{\n while (novel.scriptStack.length > 0)\n {\n novel.frame = novel.scriptStack.pop();\n novel_script = novel.scriptStack.pop();\n }\n label = label.replace(/{{(.*?)}}/g, novel_interpolator);\n novel.frame = novel.labels[label];\n /*\n Since this function is called from playNovel() and\n it adds 2 to the frame count, subtract 2 so that\n we jump to the correct point in the script.\n */\n novel.frame -= 2;\n}", "async press(game, data) {\n\t\t// If the game is running and a jump is not in progress already.\n\t\tif (!this._lost && this._jump_time < 0) {\n\t\t\t// Trigger jumping event.\n\t\t\tgame.trigger('jump', { time: data.time });\n\t\t}\n\t}", "function jump(dest,line) {\n\tdebugMsg(\"jump(\"+dest+\",\"+line+\")\");\n\tnextStep=dest;\n\treportPublicVariables();\n\tpostMessage({\"type\":\"step\",\"line\":line});\n}", "function startJump(){\r\n timeline.play()\r\n timeline2.play()\r\n timeline3.play()\r\n}", "function continueGame() {\n // clear modal\n $(\".modal\").removeClass(\"bg-modal\");\n $(\".modal-inner\").removeClass(\"modal-content\").html(\"\");\n // has endgame condition been reached\n if (selectedGlyphs.length === numQuestionsPerGame) {\n endCondition_gameOver();\n } else {\n selectGlyph();\n }\n }", "function novel_menuJump(menuScript, evt)\n{\n if (!evt)\n {\n evt = window.event;\n }\n evt.cancelBubble = true;\n if (evt.stopPropagation)\n {\n evt.stopPropagation();\n }\n novel_clearMenuItems();\n novel.dialog.style.textAlign = \"left\";\n novel.ignoreClicks = false;\n novel_pushScript();\n novel_script = menuScript;\n novel.frame = 0;\n playNovel();\n}", "function joinGameAsPlayer() {\n // check if ingame true\n\n}", "function checkKeyPressDown(e)\r\n{\r\n\tif (e.which == 65 || e.keyCode == 65)\r\n\t{\r\n\t\tPLAYER_ONE.moveLeft();\r\n\t\tleftKey = true;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tif (e.which == 68 || e.keyCode == 68)\r\n\t\t{\r\n\t\t\tPLAYER_ONE.moveRight();\r\n\t\t\trightKey = true;\r\n\t\t}\r\n\t}\r\n\tif (e.which == 32 || e.keyCode == 32)\r\n\t{\r\n\t\tPLAYER_ONE.attack();\r\n\t}\r\n\tif (e.which == 83 || e.keyCode == 83)\r\n\t{\r\n\t\tPLAYER_ONE.playerblock();\r\n\t\tblockKey = true;\r\n\t}\r\n\tif (e.which == 87 || e.keyCode == 87)\r\n\t{\r\n\t\tPLAYER_ONE.jump();\r\n\t\tjumpKey = true;\r\n\t}\r\n}", "function cancelOrBack() {\n if ($(\"#level-up-screen\").css(\"display\") !== \"none\") {\n $(\"#level-up-screen\").hide();\n menuSound.play();\n return;\n } else if ($(\"#battle-screen\").css(\"display\") !== \"none\" && !inFight) {\n $(\"#battle-screen\").hide();\n menuSound.play();\n } else if ($(\"#text-box\").css(\"display\") !== \"none\") {\n $(\"#text-box\").hide();\n $(\"#confirm-box\").hide();\n menuSound.play();\n playerState = \"standing\";\n }\n}", "checkReach(){\n \tif (this.y === 0) winMessage();\n }", "function start(action) {\r\n\t\r\n\t\tswitch (action) {\r\n\t\t\tcase 'go look':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: What are you going to look at??\", 1000);\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'explore':\r\n\t\t\t\texploreship(gameobj.explore);\r\n\t\t\t\tgameobj.explore++;\r\n\t\t\tbreak;\r\n\r\n\t\t\tcase 'sit tight':\r\n\t\t\t\ttextDialogue(narrator, \"Narocube: Good choice we should probably wait for John to get back.\", 1000);\r\n\t\t\t\tgameobj.sittight++;\r\n\t\t\tbreak;\t\r\n\t\t}\r\n}", "function startPlayer() {\r\n\t\r\n\t\r\n\tif(currentState == 0 ) {\r\n\t\talert(\"Please load a trip first.\");\r\n\t\treturn;\t\r\n\t} else if (currentState == 3 ) {\t\t\r\n\t\talert(\"The player is already playing! Please reset first.\");\r\n\t\treturn;\t\r\n\t} else {\r\n\t\tcurrentState = 3;\r\n\t\tupdateDisplay();\r\n\t}//fi\r\n\r\n\t\r\n}//fi", "function protoOnHit(){\n if (player.currentState == jump && player.controls.transform.position[1] < this.owner.controls.transform.position[1]){\n this.owner.changeState(deadEnemy)\n }\n}", "function gameOverWin(){\n\n\tgamePrompt(\"Press and hold cntrl+C to exit the game\",gameOverWin);\n}", "jump(){\r\n if((!this.dying) && (this.player.body.touching.down || (this.playerJumps > 0 && this.playerJumps < gameOptions.jumps))){\r\n if(this.player.body.touching.down){\r\n this.playerJumps = 0;\r\n }\r\n this.player.setVelocityY(gameOptions.jumpForce * -1);\r\n this.playerJumps ++;\r\n this.player.anims.play(\"playerJump_anim\");\r\n }\r\n }", "function goto (game, room) {\n Mobs[game.player].position = room;\n look(game);\n}", "function moveOn() {\r\n stop = true;\r\n}", "function keyPressed(){\n if (keyCode === UP_ARROW){\n stealer.jump();\n }\n else if(keyCode === ENTER && state == `start`){\n state = `diffSelect`;\n }\n else if(state == `diffSelect` && key == '1'){\n difficulty = 1;\n state = `simulation`;\n gameMusic.play();\n }\n else if(state == `diffSelect` && key == '2'){\n difficulty = 2;\n state = `simulation`;\n gameMusic.play();\n }\n else if(state == `diffSelect` && key == '3'){\n difficulty = 3;\n state = `simulation`;\n gameMusic.play();\n }\n }", "continueGame () {\n if (this.pauseTimer > 0) return\n if (this.lives > 0) {\n this.startGame(false)\n }\n }", "function hitMe() {\r\n playerCards();\r\n checkBlackJack();\r\n checkOver();\r\n }", "function repeat() {\n inquirer\n .prompt({\n name: \"gotoMainMenu\",\n type: \"list\",\n message: \"Do you want to go back to main menu ?\",\n choices: [\"Yes\", \"No\"]\n })\n .then(function (choice) {\n if (choice.gotoMainMenu === \"Yes\") {\n start();\n }\n else {\n connection.end();\n }\n });\n}", "function gameOver() {\n game.paused = true;\n statoDolci = 2;\n dolciCompari();\n //restart on click function\n game.input.onTap.addOnce(function () {\n game.paused = false;\n game.state.restart();\n time = 0;\n ordine = 0;\n statoDolci = 1;\n dolciCompari();\n });\n}", "function control(e) {\n if (e.keyCode === 32) {\n if (!isJumping) {\n isJumping = true;\n sautSound.play();\n jump();\n }\n }\n if (e.keyCode === 82) {\n location.reload(true);\n }\n }", "function returnHomeDetection(){\n if (state === 'piano' || state === 'guitar'){\n if(mouseIsPressed){\n if (mouseX > 25 && mouseX < 75 &&\n mouseY > 25 && mouseY < 75){\n state = 'menu';\n }\n }\n }\n}", "function continueGame(){\n removeModal();\n\n if(stopGame){\n addCirclesToHoverBar();\n //clearing all dots of game board\n clearGameBoard();\n clearMessageBoard(); \n changeMessageBoardBG(\"none\"); \n stopGame=false;\n count=30;\n startGame();\n }\n\n if(gamePaused){\n gamePaused=false;\n playGame();\n }\n}", "checkAnimation(){\n if(this.keyboard.D.isDown){\n this.player.play(\"rightWalk\", true);\n }\n if(this.keyboard.A.isDown){\n this.player.anims.playReverse(\"rightWalk\",true);\n }\n if(this.keyboard.W.isDown && this.player.body.blocked.down){ \n this.player.play(\"jumping\",true);\n } \n if(this.keyboard.A.isUp && this.keyboard.D.isUp){ // Not moving x \n this.player.play(\"SS\",true);\n }\n\n this.isPlaying = true;\n }", "function BATTLEITEMMove(p) {\r\n if (GameState.FrameNum % RT) {return;}\r\n if (BattleState.state == \"\") {SeekName(BattleMenu,\"Items\")}\r\n if (BattleState.state == \"ItemMenu\") {if (SeekCursor(BattleItemMenu,p.item)) {PlanStack.pop();}}\r\n}", "function checkNameEntered(){\n startGame();\n \n if(isnameEntered){\n beginPlaying();\n }\n}", "function playerCheckDialogueWalkAway(){\n if ((player.x > dialoguex + dialogueWalkAway) || (player.x < dialoguex - dialogueWalkAway)) {\n dialogueAlreadyEngaged = false; \n dialogueActive = false; \n npcDialogue.setText(''); \n currentDialogue = 0;\n clearDialogueBox();\n }\n}", "function moveK(e) {\r\n // When top arrow is pressed \r\n if(e.isComposing || e.keyCode === 38) {\r\n current.show();\r\n current = current.moveUp();\r\n current.highlight(); \r\n if(current === finish){\r\n finishGame();\r\n } \r\n }\r\n// When right arrow is pressed \r\n else if (e.isComposing || e.keyCode === 39) {\r\n current.show();\r\n current = current.moveRight();\r\n current.highlight();\r\n if(current === finish){\r\n finishGame();\r\n }\r\n }\r\n// When down arrow is pressed \r\n else if (e.isComposing || e.keyCode === 40) {\r\n current.show();\r\n current = current.moveDown();\r\n current.highlight();\r\n if(current === finish){\r\n finishGame();\r\n }\r\n }\r\n// When left arrow is pressed \r\n else if (e.isComposing || e.keyCode === 37) {\r\n current.show();\r\n current = current.moveLeft();\r\n current.highlight();\r\n if(current === finish){\r\n finishGame();\r\n }\r\n }\r\n}", "function endMoveStep (player, playerTarget, hasFire) {\n\t\tif (getCellType(board[player.y][player.x]) == CellType.Bomb) {\n\t\t\tif (playSound2) {\n\t\t\t\tbombSound.play();\n\t\t\t}\n\t\t\tendGame(false);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\n\t\tif (hasFire) {\n\t\t\tcheckPlayer1IceOrGlue();\n\t\t} else if (getCellType(board[player.y][player.x]) == CellType.Ice) {\n\t\t\tcalculatePlayerTargetPos(player, playerTarget, playerTarget.offsetX, \n\t\t\t\tplayerTarget.offsetY, player1.x, player1.y, SLIDE_STEPS_COUNT);\n\t\t}\n\t}", "function checkKeyPressUp(e)\r\n{\r\n\tcheckPlayer();\r\n\tif (e.which == 65 || e.keyCode == 65 || e.which == 68 || e.keyCode == 68 || e.which == 83 || e.keyCode == 83 || e.which == 32 || e.keyCode == 32)\r\n\t{\r\n\t\tif(PlayerFace == WALKING_RIGHT)\r\n\t\t{\r\n\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\trightKey = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(PlayerFace == WALKING_LEFT)\r\n\t\t\t{\r\n\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\tleftKey = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(PlayerFace == BLOCKING_LEFT)\r\n\t\t\t\t{\r\n\t\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\t\tblockKey = false;\r\n\t\t\t\t\t//positionY += 1;\r\n\t\t\t\t\tpositionX -= 1;\r\n\t\t\t\t\tplayerPos();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(PlayerFace == BLOCKING_RIGHT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\t\t\t\tblockKey = false;\r\n\t\t\t\t\t\t//positionY += 1;\r\n\t\t\t\t\t\tpositionX += 5;\r\n\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(PlayerFace == ATTACKING_LEFT)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\t\t\t\tpositionX += 41;\r\n\t\t\t\t\t\t\tplayerPos();\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\tif(PlayerFace == ATTACKING_RIGHT)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\t\t\t\t\t\tpositionX += 41;\r\n\t\t\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "walkAway() {\n console.clear();\n console.log(\"You turn your back to the waffle iron to escape.\");\n console.log(\"The waffle iron's anger grows.\");\n console.log(\"The waffle iron uses 'waffle throw!'\");\n\n this.answersPush(this.player, \"Just walk away.\");\n \n //Health && Check\n if(this.player.isDead(this.player.health)) {\n this.endGame(this.player);\n }\n \n }", "function winCondition(sprite){\n if (playerGroup.length == 1) {\n endNextFrame = 1\n }\n}", "teleport(player, entry, exit) {\n\n if (\n entry.x === player.state.y\n && entry.y === player.state.x\n && exit.triggered === false\n \n ) {\n player.state.x = exit.y;\n player.state.y = exit.x;\n entry.triggered = true;\n }\n\n }", "function Help(){\r\n if(player1Point >=17){\r\n alert(\"Go for Stand\");\r\n }\r\n else{\r\n alert(\"Go For Hit\");\r\n }\r\n}", "status(){\n if(this.facedown.length <= 0){\n inProgress = false;\n console.log(\"GAME OVER\");\n }\n }", "function continueGame() {\n if (currentScene.text.length > currentTextIndex) {\n if (currentScene.text[currentTextIndex] == \"The End.\") {\n addEnding();\n updateStats();\n console.log(\"The game ends.\");\n }\n\n setMainText();\n\n if (graph.AdjList.get(currentScene).length > 0 &&\n currentScene.text.length == currentTextIndex) {\n setNextImages();\n }\n } else if (graph.AdjList.get(currentScene).length <= 0) {\n console.log(\"The game is already over.\");\n }\n}", "function handleWinningMove() {\n printYes();\n}", "function CheckClick () {\n\tif((Input.GetMouseButtonDown(1) || Input.GetKeyDown(playerData.keySettings[14])) && currentHealths[1] >= 1)\t{\n\t\t//if((Input.mousePosition.y < Camera.main.pixelHeight - playerData.topScrollPadding) && (Input.mousePosition.y > playerData.botScrollPadding))\n\t\tif(minimap.pixelRect.Contains(Input.mousePosition)) {\n\t\t\tPlayerTarget(minimap);\n\t\t}\n\t\telse {\n\t\t\tPlayerTarget(Camera.main);\n\t\t}\n\t}\n}", "function goalReached() {\r\n\tif(totalProgressPercent >= 100.00) {\r\n\t\talert(\"You did it!\");\r\n\t\tstop = true;\r\n\t\tbreak;\r\n\t}\r\n}", "function action(direction) {\n var futurePosition = {x: currentPlayer.currentPos.x, y: currentPlayer.currentPos.y }\n var otherPlayerPosition = otherPlayer.currentPos;\n\n switch (direction) {\n case 'up':\n futurePosition.y -= 1;\n break;\n case 'down':\n futurePosition.y += 1;\n break;\n case 'left':\n futurePosition.x -= 1;\n break;\n case 'right':\n futurePosition.x += 1;\n break;\n default:\n return false;\n }\n\n //can move?\n if (futurePosition.x == otherPlayerPosition.x && futurePosition.y == otherPlayerPosition.y) {\n console.log(\"Is trying to step into the other player\", futurePosition);\n return true\n }\n\n //can move?\n if(!canMoveToPosition(futurePosition, obstaclesPositions)) {\n console.log(\"Is trying to move to a obstacle position \", futurePosition);\n return false;\n }\n\n if(!isInsideTheBoard(futurePosition)) {\n console.log(\"Is trying to move outside the board \", futurePosition);\n return false;\n }\n\n //move\n currentPlayer.currentPos = futurePosition\n return true;\n}", "update() {\n if (G.input.isPressed(G.input.ESC)) {\n G.audio.playSE('se/menu-back.mp3');\n G.mode = 'play';\n G.scene = new SceneMusicSelect();\n }\n }", "function maybeExit() {\n\t// 'this' here is Controller instance\n\tif ( this.get( 'select' ) && this.get( 'start' ) ) {\n\t\tstopEvent();\n\t\tsceneBack();\n\t}\n}", "execute(scriptLine)\r\n {\r\n const vscode = require(\"vscode\");\r\n let debugConsole = vscode.debug.activeDebugConsole; \r\n\r\n //gotoPattern to find specific keyword in scriptline\r\n var gotoPattern = /^\\s*GOTO\\s+\\$\\w+\\s*$/;\r\n\r\n debugConsole.appendLine(\"GotoCommand.execute Testing if GOTO command\" + scriptLine);\r\n\r\n if (gotoPattern.test(scriptLine))\r\n {\r\n debugConsole.appendLine(\"GotoCommand.execute Start processing GOTO: \" + scriptLine);\r\n if (this.jumpRequestedHandler != null)\r\n { \r\n //getting label from line and store it to label variable\r\n var label = scriptLine.match(/\\$\\w+/);\r\n if (label != null)\r\n {\r\n debugConsole.appendLine(\"GotoCommand.execute Jump to \" + label);\r\n this.jumpRequestedHandler.processJump(label); \r\n }\r\n else\r\n {\r\n debugConsole.appendLine(\"GotoCommand.execute Jump label not extracted\");\r\n }\r\n }\r\n else\r\n {\r\n debugConsole.appendLine(\"GotoCommand.execute Jump request handler not defined\");\r\n }\r\n }\r\n }", "function gotoPrevious() {\n\tif(typeof previousInventory !== 'undefined') {\n\t\tnextInventory = currentInventory;\n\t\tcurrentInventory = previousInventory;\n\t\tpreviousInventory = undefined;\n\t}\n}", "function sameCommandP(recordedCmd, currentCmd) {\r\n\tif (!currentCmd) return false;\r\n\t// Any two goto steps match\r\n\tif ((recordedCmd.getAction() == getCommands().ACTIONS.GOTO) &&\r\n\t\t(currentCmd.getAction() == getCommands().ACTIONS.GOTO))\r\n\t\treturn true;\r\n\t// Otherwise compare the action, target label, and target type\r\n\tif (recordedCmd.getAction() == currentCmd.getAction() &&\r\n\t\trecordedCmd.getTargetLabel() == currentCmd.getTargetLabel() &&\r\n\t\trecordedCmd.getTargetType() == currentCmd.getTargetType())\r\n\t\treturn true;\r\n\tif ((currentCmd.getAction() == getParserComponent().ParserConstants.YOU) && (\r\n\t\t\tsameCommandP(recordedCmd, currentCmd.nestedCommand)))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function hit()\n {\n //switches to tab\n switchTab(name, number);\n }", "function clicktojump() {\n\tclicktimes=clicktimes+1;\n\t\n\tif (clicktimes<=10) {\n\t\t//jump\n\t\tsheepjump();\n\t}\n\telse {//show tired sheep\n\t $('jump').style.display=\"none\";\n\t\t$('tired').style.display=\"block\";\n\t\tsetTimeout(tiredtojump, 5000); //switch back to normal sheep after 5s\n\t}\n}", "function play() {\n\t\t\n\t\t//this function (defined below) will continue to the next turn\n\t\tadvance();\n\t}", "function resumeGame() {\r\n\tif (!gameOn && result == false && allowResume == true) {\r\n\t\t// console.log(\"resume game\");\r\n\t\tgameOn = true;\r\n\t\t\r\n\t\tanimateEnemy(animateBoxes,locationOfEnemy,currentDirection);\r\n\r\n\t} // if\r\n\r\n\r\n} // resumeGame", "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}", "function loopIt() {\n menu(function(result) {\n if(result) {\n // Move to the bottom left hand corner\n term.moveTo(1, term.height-2);\n //term.blue(\"Please enter command below:\\n\");\n drawLine(); \n loopIt();\n } else {\n process.exit();\n }\n });\n}", "function returnToMain(){\n teleMode = false;\n console.log('reutrn to main');\n fadeAll();\n game.time.events.add(500, function() {\n game.state.start('startScreen');\n }, this);\n}", "checkForGameOver() {\n // game over if misses jump\n if(this.wizard.y > game.config.height) {\n this.gameOver();\n }\n }", "function gotoNext() {\n\tif(typeof nextInventory !== 'undefined') {\n\t\tpreviousInventory = currentInventory;\n\t\tcurrentInventory = nextInventory;\n\t\tnextInventory = undefined;\n\t}\n}", "function checkForEscape(){\n // escape key\n if(keysPressed[\"27\"] && !escape){\n escape = true;\n if(currentScene == \"songSelect\" || currentScene == \"options\"){\n currentScene = \"start\";\n }\n else if(currentScene == \"game\" || currentScene == \"end\"){\n resetValues();\n currentScene = \"start\";\n }\n playBeep();\n }\n else if(!keysPressed[\"27\"] && escape){\n escape = false;\n }\n}", "function C101_KinbakuClub_Discipline_Click() {\n\n\t// Jump to the next animation\n\tTextPhase++;\n\t\t\t\n\t// Jump to lunch on phase 3\n\t//if (TextPhase >= 4) SaveMenu(\"C102_KinbakuDiscipline\", \"Intro\");\n\n}", "function jumpout(){\r\n\ttpaolo.jumping=true;\r\n\ttpaolo.vy=tpaolo.jump;\r\n}", "async execute(client, message, args) {\n if(client.distube.resume(message)) {\n client.distube.resume(message)\n } else if (client.distube.isPlaying) {\n message.channel.send('Song is still playing')\n }\n }", "function pp(){\n if(config.site ==='twitch'){\n $(\".qa-pause-play-button\").click();\n } else if(config.site ==='netflix'){\n return;\n }\n else {\n if(myPlayer.paused){\n myPlayer.play();\n } else {\n myPlayer.pause();\n }\n }\n log(\"play/pause triggered\");\n}", "function exitLevel()\r\n{\r\n\tif(playerLocation == levelExitLocation)\r\n\t{\r\n\t\t\r\n\t}\r\n\t\r\n}", "function gsPLAY(){\r\n gameState = PLAY\r\n ServeScreen.visible= false\r\n StartButton.hide();\r\n InfoButton.hide();\r\n InfoIcon.visible = false;\r\n touches = []\r\n Joey.x = StartGround.x\r\n Joey.changeAnimation(\"Jumping\",Jumping_Joey);\r\n SaveName.hide();\r\n displayName.hide();\r\n NameBar.hide();\r\n title.hide();\r\n \r\n }", "function endReached() {\n stopDriving();\n updateProgressBar(0);\n showInstruction(\"You have reached your destination\");\n document.getElementById(\"step\" + selectedStep).style.backgroundColor = \"white\";\n selectedStep = null;\n }", "function callBackOK() {\n playGame();\n }", "function endgame() {\r\n if (compteur == 0) {\r\n document.location.href = \"level2.html\"\r\n }\r\n}", "jump() {\n // if (this.y <= 0 || this.jumpCounts === 2) { // removed the this.y becasue if the user wants to jump twice that high it should be allowed. just wont have to power to move away from an obstacle\n // if the character has already jumped twice, we stop the player from jumping\n if (this.jumpCounts === 2) {\n console.log(\"HERE?\");\n return;\n }\n\n // add one jump to the count\n this.jumpCounts++;\n // pulls the player up, to get a vertical like feel\n this.y -= 10;\n // remove a value from the velocity so that it emulates the feeling of jumping with already some \"force\" pulling you down\n this.velocity -= 5;\n }", "function returnToStart(){\n\t// makes all buttons unhighlighted\n\tfor (var actionCard: GameObject in actionCardList){\n\t\tactionCard.GetComponent(Button).interactable = true;\t\n\t}\n\texecuteButton.GetComponent(Button).interactable = true;\n\tstartOverButton.GetComponent(Button).interactable = false;\n\ttransform.position = startingPlace.transform.position;\n\tturn(Vector3.Angle(globalForward,startingDirection))(null)(); // pass in null for the \"action card\" of this action\n\t\n}", "jumpTo(step) {\n\t\t// Calculating winner at this point in game\n\t\tlet winnerSquares = this.calculateWinnerSquares(this.state.history[step].squares, true);\n\t\tlet winner = winnerSquares ? this.state.history[step].squares[winnerSquares[0]] : null;\n\t\tlet showTrophy = winner ? true : false;\n\t\tthis.setState({\n\t\t\tstepNumber: step,\n\t\t\tnextPlayer: this.getNextPlayer(step),\n\t\t\twinner: winner,\n\t\t\twinnerSquares: winnerSquares,\n\t\t\tshowTrophy: showTrophy\n\t\t});\n\t}", "function stop() {\n if (rover.xposition < 0 || rover.xposition > 9) {\n console.log('Stop, commands is out of my range!')\n\n }else if (rover.yposition < 0 || rover.yposition > 9 ); {\n console.log('Stop, commands is out of my range!')\n }\n\n}", "function fightOrCave() {\n\n let whereNext = prompt(\"Vart vill du gå nu? Ange fight för att gå och bekämpa monstret eller grottan för att gå till grottan\").toLowerCase();\n\n if (whereNext === \"grottan\"){\n goToCaveSecondTime();\n }\n else if (whereNext === \"fight\") {\n alert(\"Oops, du har ju inte skölden än... Du måste hämta den först. Klicka ok för att gå till grottan.\")\n goToCaveSecondTime();\n }\n else {\n alert(\"Vänligen ange fight eller grottan\")\n fightOrCave()\n }\n\n \n}", "checkNextAction()\n {\n if(currentDialogueHUD.isWriting == true)\n {\n currentDialogueHUD.skipText();\n }\n else\n {\n let nextLine = this.currentDialogue.getNextLine();\n if(nextLine == \"LastLine\")\n {\n let nextAction = this.currentDialogue.NextAction;\n playerNotebook.addDialogueTaken(this.currentDialogue);\n if(nextAction == \"DiscoverEnd\" || nextAction == \"DiscoverMultiple\" || nextAction == \"ConfrontationEnd\")\n {\n let name = this.currentDialogue.Character;\n let theClue = currentDialogueHUD.currentClueTalkingTo;\n if((theClue.discovered == false) || (theClue.discovered == true && theClue.clueType == \"Humans\"))\n {\n playerNotebook.discoverClue(theClue);\n if(theClue.name == \"Puddle\" || theClue.name == \"Chicken\" || theClue.name == \"Key\")\n {\n lastClickedElement.disableInteractive();\n if(theClue.name != \"Puddle\") \n {\n lastClickedElement.visible = false;\n }\n }\n else\n {\n thePlayer.player.anims.play('quiet');\n globalLockdown = false;\n } \n }\n (nextAction == \"DiscoverEnd\" || nextAction == \"ConfrontationEnd\") ? currentDialogueHUD.enableDialogueUI(false): currentDialogueHUD.enableMultiple();\n }\n else if(nextAction == \"DiscoverLetter\" || nextAction == \"DiscoverCellphone\" || nextAction == \"DiscoverPoisoned\" || nextAction == \"DiscoverStandard\")\n {\n let clueName = nextAction.substring(8, nextAction.length);\n let itemClue = playerNotebook.getClue(clueName);\n if(nextAction == \"DiscoverStandard\")\n {\n playerNotebook.discoverClue(itemClue);\n thePlayer.player.anims.play('quiet');\n globalLockdown = false;\n }\n if(!itemClue.discovered)\n {\n this.startDialogue(\"Goatman\"+clueName+\"1xUN\");\n currentDialogueHUD.currentClueTalkingTo = itemClue;\n }\n else\n {\n currentDialogueHUD.enableDialogueUI(false);\n } \n }\n else if(nextAction == \"End\" || nextAction == \"IntroductionEnd\") // We check if the next action is End. If it is we close the dialog.\n {\n if(nextAction == \"IntroductionEnd\")\n {\n globalLockdown = false;\n currentScene.endingBlackWindow.visible = false;\n musicManager.changeTheme('Exploring');\n } \n currentDialogueHUD.enableDialogueUI(false);\n }\n else if(nextAction == \"Multiple\") // We open a multiple dialogue options\n {\n currentDialogueHUD.enableMultiple();\n }\n else if(nextAction == \"LeeMenu\")\n {\n currentDialogueHUD.openParkOptions(false);\n GameManager.canMove = false;\n }\n else if(nextAction == \"GameOver\")\n {\n GameManager.showFinalDialogue(false); \n }\n else if(nextAction == \"VictoryScreen\")\n {\n currentDialogueHUD.enableDialogueUI(false);\n globalLockdown = true;\n musicManager.changeTheme('Win');\n currentPlayerHUD.openSpecialScreen(true, true);\n }\n else if(nextAction == \"LoseScreen\")\n {\n currentDialogueHUD.enableDialogueUI(false);\n globalLockdown = true;\n musicManager.changeTheme('Lose');\n currentPlayerHUD.openSpecialScreen(false, true);\n }\n if(currentDialogueHUD.currentClueTalkingTo != undefined && currentDialogueHUD.currentClueTalkingTo.inDialoguesIndex <2) currentDialogueHUD.currentClueTalkingTo.updateInitialIndex();\n if(nextAction == \"ConfrontationEnd\" || nextAction == \"DiscoverCellphone\"\n || nextAction == \"DiscoverStandard\")\n {\n let theHuman;\n if(nextAction == \"DiscoverCellphone\")\n {\n theHuman = playerNotebook.humans[4];\n }\n else if(nextAction == \"DiscoverStandard\")\n {\n theHuman = playerNotebook.humans[2];\n }\n else\n {\n theHuman = currentDialogueHUD.currentClueTalkingTo;\n } \n // Once we finish the confrontation we advance to the next game state and we set the has been confronted state to true\n playerNotebook.updateGameState(GameManager.stateOfGame+1);\n theHuman.hasBeenConfronted = true;\n }\n }\n else // If is not last line, we continue to the next line\n {\n this.setDialogueText(this.currentDialogue.currentIndex);\n }\n }\n }", "function keyDown(e) {\r\n\t//If the p key is pressed run pauseGame\r\n if (e.keyCode == 80) {\r\n\t pauseGame();\r\n }\r\n}", "function done(){\n messageTab();\n if(swtch == 1)\n {sound.play();}\n reset();\n}", "function keyPressed() {\n if (key == 'a') {\n if (current.target1 != null) { // Make sure a valid option exists.\n current = current.target1; // Advance to next story section\n }\n }\n if (key == 'd') {\n if (current.target1 != null) { // Make sure a valid option exists\n current = current.target2; // Advance to next story section\n }\n }\n}", "function keyPressed(event) {\n var KEY_CODE = event.keyCode;\n var SPACE_BAR = 32;\n switch (KEY_CODE) {\n case SPACE_BAR:\n game.jumpPlayer();\n break;\n }\n}", "function checkingIfGameStops(){\n $scope.socket.on(\"endGame\", function (params) {\n if (params != {}) {\n $scope.$apply(function () {\n giveWinner();//TODO\n //$scope.winnerName=\"Pierre\";// TODO TOCHANGE\n if($scope.currentScreen===\"game\"){\n $scope.current3DPage=\"views/endPage.html\";\n $scope.currentPage=\"endPageContainer\";\n }\n });\n }\n });\n\n }", "function returnToMainMenu() {\r\n\r\n // Reset the game state. \r\n resetGameState();\r\n\r\n // End game flag.\r\n gameHasStarted = false;\r\n\r\n // Reload main menu.\r\n startUp();\r\n}", "function continueGame() {\n \n return confirm(\"Continue to play game?\");\n \n}" ]
[ "0.65422165", "0.6307678", "0.6229932", "0.62173903", "0.6110338", "0.5957146", "0.58858484", "0.58774614", "0.5875076", "0.584217", "0.58387196", "0.5835961", "0.58274984", "0.58265024", "0.58205336", "0.57772803", "0.57387537", "0.57221156", "0.56999695", "0.56862694", "0.5684982", "0.5680618", "0.5645645", "0.5644707", "0.5631686", "0.5626928", "0.5620257", "0.5617555", "0.56057954", "0.560253", "0.55914", "0.5590931", "0.55760586", "0.5561233", "0.5548718", "0.55457807", "0.5544742", "0.55394053", "0.5536972", "0.5525552", "0.5525073", "0.5513676", "0.5506229", "0.5499125", "0.5495317", "0.5492282", "0.5486328", "0.5484837", "0.5478007", "0.5470899", "0.5461672", "0.54542357", "0.5441991", "0.5438616", "0.5437043", "0.5431363", "0.5430604", "0.54303956", "0.54278135", "0.5425857", "0.5421453", "0.541896", "0.5416715", "0.5414788", "0.5405195", "0.5400577", "0.5400405", "0.5394454", "0.53927946", "0.53875077", "0.538444", "0.53795666", "0.5378059", "0.5375863", "0.53676414", "0.536557", "0.536023", "0.53575575", "0.5353562", "0.53535277", "0.53530943", "0.53502166", "0.5344386", "0.534266", "0.5341633", "0.53406036", "0.53333235", "0.53333044", "0.5332611", "0.53320324", "0.53317946", "0.532723", "0.5326931", "0.5326926", "0.5325723", "0.5317472", "0.531279", "0.53097886", "0.5308541", "0.53041273" ]
0.56238174
26
if the player enters the command LIST
function commandList(game_ID, player_ID, executeCommand) { getPlayer(player_ID, function(playerfound) { var currentPlayer = playerfound; var currentRoom = currentPlayer.room; var folders = []; var items = []; if(currentRoom == "/root/users/admin/cloud") { Cloud.find({'gameID': game_ID}, function(err, roomfound) { if(err) console.error(err); roomfound = roomfound[0]; // look a the nextrooms of the current room for(let i=0; i<roomfound.nextRooms.length; i++) { // put <dir> in front of all room/folder names let r = roomfound.nextRooms[i]; r = r.split("/"); r = r[r.length-1]; r = "<dir> " + r; folders[i] = r; } // look through each items in the current room for(let j=0; j<roomfound.items.length; j++) { let it = roomfound.items[j]; // if file is the hidden file, and the player has permission to view if(it == "some files are hidden" && currentPlayer.hiddenFiles) { it = "diary.txt"; } if(it == "hidden file" && currentPlayer.hiddenFiles) { it = "credits.txt"; } // put <file> in front of all items/files it = "<file> " + it; items[j] = it; } // concatenate the rooms and items var list = folders.concat(items); executeCommand(list, currentRoom); }); } else { Room.find({'name': currentRoom}, function(err, roomfound) { if(err) console.error(err); roomfound = roomfound[0]; // look a the nextrooms of the current room for(let i=0; i<roomfound.nextRooms.length; i++) { // put <dir> in front of all room/folder names let r = roomfound.nextRooms[i]; r = r.split("/"); r = r[r.length-1]; r = "<dir> " + r; folders[i] = r; } // look through each items in the current room for(let j=0; j<roomfound.items.length; j++) { let it = roomfound.items[j]; // if file is the hidden file, and the player has permission to view if(it == "some files are hidden" && currentPlayer.hiddenFiles) { it = "diary.txt"; } if(it == "hidden file" && currentPlayer.hiddenFiles) { it = "credits.txt"; } // put <file> in front of all items/files it = "<file> " + it; items[j] = it; } // concatenate the rooms and items var list = folders.concat(items); executeCommand(list, currentRoom); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "enterList_if(ctx) {\n\t}", "function video_chat_lobby()\n{\n\ttrace(\"video_chat_lobby()\");\n\tif ( $('#room-list').length ) {\n\t\tchat_room_list();\n\t}\n}", "function checkList(){\n\n\n\n}", "function listOptions(){\n let msg = \n`'q' or 'quit' exit the app\n'help' '?' or 'list' display available scripts`\n\n console.log(BLUE, msg)\n}", "function commandDisplayer() {\n $(\"#available-options\").empty();\n $(\"#available-options\").append(\"<li>Possible Commands:</li>\")\n if(userCommands.length > 0) {\n for(var idx = 0; idx < userCommands.length; idx++) {\n $(\"#available-options\").append(\"<li>\" + userCommands[idx] + \"</li>\")\n }\n }\n}", "function listCommands() {\n console.log(`${mainDivider}\\n${\"WELCOME TO LIRI-BOT! HERE'S WHAT I CAN DO!\"}\\n${mainDivider}`)\n console.log(`${\"Use the following commands to run Liri-Bot:\"}\\n${minorDivider}\\n${\"'my-tweets' : To list the last 20 tweets\"}\\n${minorDivider}\\n${\"'spotify-this-song' + 'song name': To lists the Artist, Song Name, Preview Link, and Album\"}\\n${minorDivider}\\n${\"'movie-this' + 'movie title': To lists the Movie Title, Release Year, IMDB Rating, Rotten Tomatoes Rating, Country, Language, Plot, Cast\"}\\n${mainDivider}`);\n}", "function showChat(){\n showListChat();\n}", "function showChat(){\n showListChat();\n}", "function validCommand() {\n console.log(\"\\n\" + \"Please enter a valid command from the following list:\");\n console.log(\"concert-this\");\n console.log(\"spotify-this-song\");\n console.log(\"movie-this\");\n console.log(\"do-what-it-says\" + \"\\n\");\n}", "function playListAction(res){\n\n\tclient.playlist.listAction(function(data){\n\t\tcallbackResult(res,data);\n\t});\n\n}", "function showList(){\n\treturn inquirer.prompt([{\n name: \"home\",\n message: \"Please select from below\",\n type: \"list\",\n choices: ['View Products For Sale', 'View Low Inventory', 'Add To Inventory', 'Add Product', 'Exit']\n }]) // To catch any errors that might happen in this section\n .catch(function(err) {\n console.log(err);\n });\n}", "isUserList() {}", "enterListmaker(ctx) {\n\t}", "function printCommandList(mapper) {\n console.log(\"-----------------------------------------------\");\n console.log(\"The following commands are accepted: \")\n var accepted_commands = Object.keys(mapper);\n\n if (accepted_commands.length == 0) {\n console.log(\"No commands have been defined!\");\n console.log(\"-----------------------------------------------\");\n return\n }\n\n for (var i = 0; i < accepted_commands.length; ++i) {\n console.log(\"\\t\" + accepted_commands[i]);\n }\n console.log(\"-----------------------------------------------\");\n}", "function ready() {\n return Object.keys(self.players.list).length == 2;\n }", "function listCommands() {\n console.log(\n 'List of commands available:\\n' +\n '[-help] - Lists all the available commands.\\n' +\n '[Github URL] - Lists the commits for the provided GitHub URL.\\n' +\n '[Github URL] [nocache] - Lists the commits for the provided GitHub URL, ignoring cached values.\\n' +\n '[exit] - Ends Application\\n'\n )\n}", "listAction() {}", "list() {\n }", "function add() {\n rl.question(`What do you want to add to the list?\\n`, answer => {\n let list = `${box}${answer}`\n lists.push(list);\n return menu();\n });\n}", "execute(client, data) {\n var adminCommands = [\"start\", \"stop\", \"reset\"];\n var userCommands = [\"getList\"];\n if (!data.args[0]) {\n var commands = \"\";\n adminCommands.forEach(element => {\n commands += `${element}, `;\n });\n commands = commands.substring(0, commands.length - 2);\n client.sendMessage(Bot.translate(\"plugins.poll.missingargs\", {\n commandlist: commands\n }));\n }\n var cmd = data.args[0];\n switch (cmd) {\n case \"start\":\n if(pfunction.hasPermission(data)) {\n if (data.args.length == 1) {\n client.sendMessage(Bot.translate(\"plugins.poll.startUsage\"));\n return false;\n }\n if (!pfunction.isPollActive()) {\n var arg = [];\n var prevArg = \"\";\n var voteItems = \"\";\n var notTheSame = true;\n data.args.forEach(element => {\n if (!adminCommands.includes(element) && !userCommands.includes(element)) {\n if(element != prevArg) {\n arg.push(element);\n voteItems += `${element} | `;\n prevArg = element;\n } else {\n notTheSame = false;\n }\n }\n });\n if(notTheSame) {\n voteItems = voteItems.substring(0, voteItems.length - 3);\n if (pfunction.startVote(arg)) {\n client.sendMessage(Bot.translate(\"plugins.poll.pollstarted\", {\n votelist: voteItems\n }));\n }\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.sameValues\"));\n pfunction.resetVote();\n }\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.pollRunning\"));\n }\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.permissions\"));\n }\n break;\n case \"stop\":\n if(pfunction.hasPermission(data)) {\n if(pfunction.isPollActive()) {\n var winner = pfunction.getWinner();\n var res = winner.split(\"|\");\n client.sendMessage(Bot.translate(\"plugins.poll.pollstopped\"));\n client.sendMessage(Bot.translate(\"plugins.poll.winner\", {\n name: res[0],\n votes: res[1]\n }))\n pfunction.resetVote();\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.pollNotRunning\"));\n }\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.permissions\"));\n }\n break;\n case \"reset\":\n if(pfunction.hasPermission(data)) {\n pfunction.resetVote();\n client.sendMessage(Bot.translate(\"plugins.poll.voteReseted\"));\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.permissions\"));\n }\n break;\n case \"getList\":\n if(pfunction.isPollActive()) {\n client.sendMessage(\"Vote List: \");\n client.sendMessage(pfunction.getList());\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.pollNotRunning\"));\n }\n break;\n default:\n if (!adminCommands.includes(cmd) && !userCommands.includes(cmd)) {\n if (pfunction.isPollActive()) {\n if(!pfunction.hasUserVoted(data.user)) {\n if(pfunction.isItemInList(cmd)) {\n if(pfunction.placeVote(cmd, data.user)) {\n if(settings.showUserVoting) {\n client.sendMessage(Bot.translate(\"plugins.poll.uservoted\", {\n user: data.user\n }))\n }\n } else {\n client.sendMessage(Bot.sendMessage(\"plugins.poll.somethingsWrong\"));\n }\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.itemNotInList\", {\n item:cmd\n }));\n }\n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.alreadyVoted\", {\n user: data.user\n }))\n } \n } else {\n client.sendMessage(Bot.translate(\"plugins.poll.pollNotRunning\"));\n return false;\n }\n }\n break;\n }\n\n }", "showListDialog() {\n if (this.listDialogModule && !this.isReadOnlyMode && this.viewer) {\n this.listDialogModule.showListDialog();\n }\n }", "function view() {\n if (lists.length <= 0) {\n console.log(`The list is empty.`);\n } else {\n lists.forEach((list, index) => {\n console.log(`${index} ${list}\\n`)\n });\n }\n return menu();\n}", "function ListHelp() {\n}", "function showHelp(){\n showListHelp();\n}", "function listHelpMessage() {\n\n\t// log the message to display\n\tconsole.log(\n\t\t\"-----------------------------------------------\" + \"\\n\" +\n\t\t\"------ gitrc ------\" + \"\\n\" +\n\t\t\"-----------------------------------------------\" + \"\\n\\n\" +\n\t\t\"Easily switch between different gitconfig files\" + \"\\n\\n\" +\n\t\t\"Usage:\" + \"\\n\" +\n\t\t\" gitrc List all profiles\" + \"\\n\" +\n\t\t\" gitrc [name] Switch to profile\" + \"\\n\" +\n\t\t\" gitrc -n [name] Create a new profile\" + \"\\n\" +\n\t\t\" gitrc -d [name] Delete the profile\" + \"\\n\" +\n\t\t\" gitrc -h Display this screen\" + \"\\n\"\n\t);\n\n\t// successful exit\n\tprocess.exit( 0 );\n}", "function addListenerMyListEnterNewList() {\n\t\t$(\".sidebar\").find(\".myList-newInput\").keydown(function(e) {\n\t\t\tif (e.which == \"13\") {\n\t\t\t\te.preventDefault();\n\n\t\t\t\tif (checkMyListInput() == true) {\n\t\t\t\t\taddMyListItem( $(this).val() );\n\t\t\t\t\t$(\".myList-newForm\").hide();\n\t\t\t\t\t$(\".myList-newButton\").show();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateList();\n\t}\n}", "enterList_for(ctx) {\n\t}", "function do_SITELIST(){\r\n socket.send(\"SITELIST\\n\");\r\n}", "function broadcastList() {\n var userList = userHandler.getUsers();\n io.emit(\"user list\", userList);\n}", "execute(message,args){\n if(this.enabled && allowedAdmins.includes(message.author.id)){\n var ServerList = 'Here are some of the servers im in: ';\n var charcount = 0;\n var chosenServer = '';\n for(var i = 0;i < IMPORTEDBOT.bot.guilds.cache.size;i++){\n chosenServer = IMPORTEDBOT.bot.guilds.cache.random().name;\n if (!ServerList.includes(chosenServer)) {\n if(chosenServer.length + charcount > 1900){\n return;\n }\n charcount = charcount + chosenServer.length;\n ServerList = `${ServerList}\\n- ${chosenServer}` \n }\n }\n COLLECTOR.Add(ServerList);\n }\n else{\n Collector.Add(\"This command is currently DISABLED\");\n }\n }", "async function helpCommand(message) {\n if (message.member.roles.cache.some(role => role.name === \"Committee\")) {\n message.channel.send({ embed: {\n color: 3066993,\n title: \"Admin Command List\",\n fields: [{\n name: \"!list\",\n value: \"Present all pending problems\"\n },\n {\n name: \"!read (id)\",\n value: \"Find a specific problem for verification\"\n },\n {\n name: \"!testcases (id)\",\n value: \"List the test cases for a specific problem\"\n },\n {\n name: \"!init\",\n value: \"Gather players for a game of BlitzProg\"\n },\n {\n name: \"!start\",\n value: \"Start a game of BlitzProg with the current players\"\n },\n {\n name: \"!submit\",\n value: \"Submit your code for the current round and have it tested\"\n },\n {\n name: \"!end\",\n value: \"End the current game of BlitzProg \"\n }\n ]\n }});\n } else {\n message.channel.send({ embed: {\n color: 15158332,\n title: \"Player Command List\",\n fields: [{\n name: \"!init\",\n value: \"Gather players for a game of BlitzProg\"\n },\n {\n name: \"!start\",\n value: \"Start a game of BlitzProg with the current players\"\n },\n {\n name: \"!submit\",\n value: \"Submit your code for the current round and have it tested\"\n },\n {\n name: \"!end\",\n value: \"End the current game of BlitzProg \"\n }\n ]\n }});\n } \n}", "function runList() {\n var query = \"SELECT * FROM products\";\n connection.query(query, function(err, res) {\n console.table(res);\n orderPrompt();\n });\n \n\n}", "enterObjectList(ctx) {\n\t}", "function updateRoomPlayersList(room) {\n _room.in(room.id).emit('update-player-list', room);\n}", "function list() {\n return toggleList;\n }", "function displayListOptions() {\n inquirer.prompt([\n {\n type: \"rawlist\",\n message: \"Please select any one of the following options\",\n choices: [\"View Products for Sale\", \"View Low Inventory\", \"Add to Inventory\", \"Add New Product\"],\n name: \"selectedOption\"\n }\n ]).then(function (inqRes) {\n selectedAction(inqRes.selectedOption);\n });\n}", "function updateAllowedCommands(cmdList) {\n\tconsole.log(\"Updating command list\");\n\t$(\"#commandList\").empty();\n\t$.each(cmdList, function(i) {\n\t\taddCommandLink(\"commandList\", cmdList[i]);\n\t});\n}", "function showList() {\n \n if (!!tabLista.length) {\n getLastTaskId();\n for (var item in tabLista) {\n var task = tabLista[item];\n //addTaskToList(task);\n }\n syncEvents();\n }\n \n }", "displayList() {\n\n let emps = \"\";\n this.employees.forEach(emp => emps += emp.name + \"\\n\");\n\n inquirer\n .prompt([\n {\n type: \"list\",\n name: \"choice\",\n message: emps,\n choices: [\n \"Continue\"\n ]\n }\n ])\n .then( () => {\n this.showMenu();\n });\n }", "function commandOptionListener(updateFn, cmd) {\n player.arl(\"playing\", updateFn, cmd == \"playPause\");\n song.arl(\"loved\", updateFn, cmd == \"loveUnloveSong\");\n updateFn();\n }", "function checklist() {\n\t\n\tvar check = user.indexOf(rand); //Using indexOf, it checks the array user to see if the rand value has been used before in the list. Will define the check variable.\n\t\n\t//The if statement will only activate if check is equal to -1 which will only happen if indexOf does not\n\t//detect the use of the same value in the list. Will add to the list.\n\tif (check == -1)\n\t{\n\t\tconsole.log('pushed'); //Writes in the log and tells us that this if statement has been activated with the message 'pushed'.\n\t\tuser.push(rand);\n\t}\n\t//The else statement will activate if check is anything but -1.\n\telse\n\t{\n\t\tconsole.log('rerolled'); //Writes in the log and tells us that this else statement has been activated with the message 'rerolled'.\n\t\ttime--; //Will decrement if the else statement is activated. used to make sure that user is at the right length.\n\t\tRandVal() //Will call to RandVal() to create a new value for rand.\n\t}\n}", "exitList_if(ctx) {\n\t}", "function list(l) {\n\tdaList[arguments[0] - 1] = arguments[1];\t\n\t// if(arguments[0] -1 == size){\n\t\tif (updateFlag == 1){\n\t\t\toutlet(0, daList);\n\t\t}\n\t// }\t\t\n}", "function shMatch(list){\n let counter = 0;\n \n while (counter < list.length){\n resultsUser.innerHTML += '<li>' + list[counter] + '</li>';\n counter ++;\n }\n hdShow('show');\n }", "function selectBotFromList(){\n var parentUl = $('.user-content').children('ul');\n var users = parentUl.children('li');\n var user = users.get(0);\n\n // Clear message contents..\n $('#messages').html('');\n\n // Set user to select..\n for(var i = 0; i < users.length; i++) {\n user = users.get(i);\n user.setAttribute(\"style\", \"\");\n }\n users.get(1).setAttribute(\"style\", \"background-color: #eee;\");\n selectedIndex = 1;\n\n disableActionButton();\n var oneUser = {\n id : \"BOT\",\n contact_id: \"BOT\",\n username : \"CHAT BOT\",\n email : \"CHATEMAIL\",\n img : \"/images/bot.png\"\n };\n\n selectFlag = \"BOT\";\n userSelected = oneUser;\n\n showUserInfo(oneUser);\n connectChatBot();\n\n curConvId = \"BOT\";\n}", "function cmd_list() {\n $.ajax({\n url: \"cmd_query/load_list_cmd.php\", // fichier ou se trouve le tab\n success:\n function(retour){\n $('#cmd_list_output').html(retour); // rafraichi toute ta Tbody\n }\n });\n\n }", "player_declared(args) {\n\n }", "function showList() {\n\t\t\t$state.go('^');\n\t\t}", "function showList() {\n\t\t\t$state.go('^');\n\t\t}", "function addListAfterKeypress(event){\n if (input.value.leght>0 && event.which === 13){\n createListElement();\n }\n}", "function sayWhoseCommands( client, channel, tags ) {\n\tif ( tags.badges !== null ) {\n\n\t\tif ( tags.badges.broadcaster === \"1\" ) {\n\n\t\t\tclient.say(channel, \"Command List for the Streamer\");\n\n\t\t} else if ( tags.badges.moderator === \"1\" ) {\n\n\t\t\tclient.say(channel, \"Command List for the Moderators\");\n\n\t\t} else if ( tags.badges.vip === \"1\" ) {\n\n\t\t\tclient.say(channel, \"Command List for the VIPs\");\n\t\t}\n\t}\n}", "function list() {\n return E('ul#todo-list') . has(model.list . if(visible) . as(todoView));\n }", "function commandHelp(player_ID, executeCommand) {\n\n getPlayer(player_ID, function(playerfound) {\n let currentRoom = playerfound.room;\n\n let output = ['Here is a list of commands:',\n '----------------------',\n '| - - - command - - -| - - function - - |',\n '| ' + commands.command1 + ' - - - - - - - | list content of folder |',\n '| ' + commands.command2 + ' [folder name] | move to folder |',\n '| ' + commands.command2 + ' [..] - - - - -| go back |',\n '| ' + commands.command3 + ' [file name] - | open/run file |',\n '----------------------'\n ];\n\n executeCommand(output, currentRoom);\n }); \n return \n}", "function listHandler(config) {\n return function(bot, message) {\n return bot.startPrivateConversation(message.user).then(function (convo) {\n return processSubscriptionListCommand(bot, config, message).then(function(response) {\n convo.say(response);\n }).catch(function(error) {\n convo.say(\"I'm sorry, but an error occurred processing this subscription command\");\n winston.error(JSON.stringify(error));\n });\n });\n };\n}", "function habilitoLista (){\n\t\t\t$scope.verListado = true;\n\t\t}", "function getListPlayer(listUsers){\r\n dbPlayer = listUsers;\r\n}", "startGame(){\r\n for(var x = 0; x < this.currentPlayer.length; x++){\r\n this.playersOnline.push(this.currentPlayer[x]);\r\n if(this.playersOnline[x] === this.currentPlayer[x]){\r\n return [`Players Online: ${this.online}\\n`];\r\n }\r\n }\r\n }", "function playerswitch() {}", "function gotList(thelist) {\n \n println(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n println(i + \" \" + thelist[i]);\n }\n}", "function updateMissionUserList(){\n var userString = \"\";\n var mission = clientGame.missions[clientGame.missionNumber];\n\n if(clientUser.clientId == mission.leader.clientId){\n $(\"#startTeamSelection\").show();\n } else {\n $(\"#startTeamSelection\").hide();\n }\n userString += \"<li class='list-group-item list-group-item-warning'>Leader: \"+ mission.leader.username +\"</li>\";\n for(var i = 0; i < mission.selectedUsers.length; i++){\n userString += \"<li class='list-group-item'>\"+ mission.selectedUsers[i].username +\"</li>\";\n }\n\n $(\"#currentMissionUserList\").html(userString);\n}", "function btn() {\n let ism = prompt('ism kiriting');\n document.getElementById('ul').innerHTML += '<li>' + ism + '</li>'\n}", "function isInWordlist() {\n return wordlist.includes(playerGuess.value.substring(0, 5).toUpperCase());\n}", "function addListAfterKeypress(event) {\n\tif (inputLength() > 0 && event.keyCode /* event.which */ === 13) {\n\t\tcreateList();\n\t}\n}", "function updateLobby(){\n var $startButton = $('#startButton');\n\n $('#numPlayers').html(clientGame.users.length);\n\n if(clientUser.isHost){\n $startButton.show();\n $('#lobbyCode').html(clientUser.room);\n $('#lobbyDisplay').show();\n }\n\n if(clientGame.users.length >= MIN_PLAYERS && clientUser.isHost){\n $startButton.prop('disabled', false);\n } else {\n $startButton.prop('disabled', true);\n }\n\n var lobbyContent = \"\";\n\n for(var i = 0; i < clientGame.users.length; i++){\n if(clientGame.users[i].clientId == clientUser.clientId){\n lobbyContent += \"<li class='list-group-item list-group-item-success'>\"+ clientGame.users[i].username +\"</li>\";\n } else{\n lobbyContent += \"<li class='list-group-item'>\"+ clientGame.users[i].username +\"</li>\";\n }\n }\n\n $('#userList').html(lobbyContent);\n}", "function gotList(thelist) {\n println(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n println(i + \" \" + thelist[i]);\n }\n}", "function startGameCommand() {\n newHandCommand(deck, dealer, player);\n changeIsVisible(\"welcome\", false);\n}", "function displayActions() {\n var field, action, actionList;\n actionList = document.querySelector(\"#help > ul\");\n clearContent(actionList);\n for (field in player) {\n if (player[field] instanceof Function) {\n action = document.createElement(\"li\");\n action.textContent = field;\n actionList.appendChild(action);\n }\n }\n}", "function emitPlaylist(event){ if (event.which == 13) {addPlaylist();}}", "function listUsersButton() {\n listUsers();\n $listUsers.toggle();\n }", "function gotList(thelist) {\n print(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n print(i + \" \" + thelist[i]);\n }\n}", "function selectFunction(){\n inquirer.prompt([\n {\n type: \"rawlist\",\n message: \"Please select what you would like me to search for you\",\n choices: commands,\n name: \"selection\",\n }\n ]).then(function(answer){\n liriCommand(answer.selection)\n })\n}", "function updateList(newList) {\n newList = JSON.parse(newList);\n let newUsers = newList.filter((u) => !list.includes(u));\n\n list = newList;\n\n // Update the client list\n asideClients.innerHTML = \"\";\n list.forEach((client) => {\n asideClients.appendChild(elt(\"p\", {}, client));\n });\n\n for (let game of document.querySelectorAll(\".game:not(.join)\")) {\n sock.emit(\"punto\", { action: \"data\", game: game.dataset.gameid });\n }\n }", "toggleList() {}", "function gotList(thelist) {\n print(\"List of Serial Ports:\");\n // theList is an array of their names\n for (let i = 0; i < thelist.length; i++) {\n // Display in the console\n print(i + \" \" + thelist[i]);\n }\n}", "function listQueue(res) {\n if (queue.isEmpty()) {\n res.send('Nobody! Like this: []');\n } else {\n res.send('Here\\'s who\\'s in the queue: ' + _.pluck(queue.get(), 'name').join(', ') + '.');\n }\n }", "function getList() {\n if (storage.get(ListName) != null) {\n masterList = storage.get(ListName);\n showList(masterList);\n }\n}", "function ls() {\n process.stdin.on(\"data\", data => {\n const userInput = data.toString().trim();\n if (userInput === \"ls\") {\n fs.readdir(\"./\", \"utf8\", (err, files) => {\n if (err) {\n throw err;\n } else {\n console.log(\"\\nCurrent directory filesnames:\");\n process.stdout.write(files.join(\"\\n\"));\n process.stdout.write(\"prompt > \");\n }\n });\n }\n });\n}", "function addCommandList(commandList)\n {\n var i;\n\t\t\n for(i =0; i < commandList.length; i++)\n {\n addCommand(commandList[i]);\n }\n }", "function list()\n{\n var inst = _getInstance(this);\n logger.info(\"ROV Module: list(\" + inst.id + \")\");\n\n var prom = Q.defer();\n inst.waitingPromise[inst.createId] = prom;\n\n if (inst.server == null) {\n prom.reject(\"ROV server instance is not running.\");\n return (prom.promise);\n }\n inst.createId++;\n inst.server.stdin.write(\"list\" + os.EOL);\n\n return (prom.promise);\n}", "function parseCommand(text){\n var words = text.split(\" \");\n for(var i=0; i < words.length; i++){\n if (words[i] in commandList){\n processCommand(words[i]);\n break;\n }\n }\n}", "function checkPlayer() {\n return (gInfo.playerList[gInfo.currentPlayer].uid==currentUID);\n}", "async list() { }", "function gotList(thelist) {\n println(\"List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n println(i + \" \" + thelist[i]);\n }\n}", "function listShows(event, response, model) {\n let speech = speaker.get(\"ShowList\");\n\n const activeQuestion = model.getActiveQuestion();\n \n speech += \" \" + speaker.getQuestionSpeech(activeQuestion, 'reprompt');\n response.speak(speech)\n .listen(speaker.getQuestionSpeech(activeQuestion, 'reprompt'));\n\n response.send();\n}", "function PlayerList(name) {\r\n this.name = name;\r\n this.list = [];\r\n this.get();\r\n}", "function start(){\n switch(lCmd){\n case 'my-tweets':\n Tweets();\n break;\n case 'spotify-this-song':\n SpotifyCall(inputs);\n break;\n case 'movie-this':\n Movie(inputs);\n break;\n case 'do-what-it-says':\n Do();\n break;\n default:\n console.log(\"my-tweets, spotify-this-song, movie-this and do-what-it-says are the only commands accepted. Check your input.\");\n break;\n \n }\n}", "function CameraCommand_Hints_ProcessListItem()\n{\n\t//still hasnt reached max?\n\tif (this.nListItem < this.ListItems.length)\n\t{\n\t\t//get current item\n\t\tvar item = this.ListItems[this.nListItem++];\n\t\t//interested in showing anything?\n\t\tif (item.ShowOverlay || item.ShowLaser)\n\t\t{\n\t\t\t//has message?\n\t\t\tif (item.TutorialMessage && !item.TutorialMessageShown)\n\t\t\t{\n\t\t\t\t//no item trigger data display rect yet?\n\t\t\t\tif (item.TriggerData && item.TriggerData.DisplayRect == null)\n\t\t\t\t{\n\t\t\t\t\t//get the html object\n\t\t\t\t\tvar theHTMLTarget = item.TargetObject.GetHTMLTarget(item.Event, item.Data);\n\t\t\t\t\t//now calculate the rect from this\n\t\t\t\t\t//Note: Sometimes the object isnt yet visible because it needs some other action on it (like opening a combobox).\n\t\t\t\t\t//\t\tSince we need to show the message while we are doing these extra steps we will use the target object instead.\n\t\t\t\t\titem.TriggerData.DisplayRect = Position_GetDisplayRect(theHTMLTarget ? theHTMLTarget : item.TargetObject.HTML);\n\t\t\t\t}\n\t\t\t\t//show message\n\t\t\t\t__SIMULATOR.DisplayMessage(item.TutorialMessage, item.MessageType, item.TriggerData);\n\t\t\t\t//and never show it again\n\t\t\t\titem.TutorialMessageShown = true;\n\t\t\t}\n\t\t\t//reset the camera\n\t\t\tthis.Camera.DeactivateMiniActions();\n\t\t\t//ensure object is visible\n\t\t\tthis.Camera.ActivateMiniActions(item.TargetObject);\n\t\t\t//get the html object\n\t\t\tvar theHTMLTarget = this.GetItemHTMLTarget(item);\n\t\t\t//no html target?\n\t\t\tif (theHTMLTarget != null)\n\t\t\t{\n\t\t\t\t//want to display overlay?\n\t\t\t\tif (item.ShowOverlay)\n\t\t\t\t{\n\t\t\t\t\t//add an overlay command\n\t\t\t\t\tthis.Camera.Commands.push(new CameraCommand_Overlay(this.Camera, theHTMLTarget, null, item.OverlayColour));\n\t\t\t\t}\n\t\t\t\t//want to display Laser?\n\t\t\t\tif (item.ShowLaser)\n\t\t\t\t{\n\t\t\t\t\t//create a new laser command and add it to the command queue\n\t\t\t\t\tthis.Camera.Commands.push(new CameraCommand_Laser(this.Camera, theHTMLTarget, null, item.LaserColour));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t//assume we want to display the help message\n\t\tvar bShowMessage = true;\n\t\t//get current parameter\n\t\tvar params = __SIMULATOR.StateManager.CurrentState.ControlSettings;\n\t\t//valid?\n\t\tif (params)\n\t\t{\n\t\t\t//in \"demonstration mode\"\n\t\t\tif (Get_Bool(params[__NEMESIS_ParamName_LessonAutoPlayCamera], false))\n\t\t\t{\n\t\t\t\t//no message\n\t\t\t\tbShowMessage = false;\n\t\t\t}\n\t\t}\n\t\t//still showing message?\n\t\tif (bShowMessage)\n\t\t{\n\t\t\t//only one item?\n\t\t\tif (this.ListItems.length == 1)\n\t\t\t{\n\t\t\t\t//using the same format as us?\n\t\t\t\tvar bShowDataLaser = this.Camera.CameraData.Parameters.bShowDataLaser;\n\t\t\t\tvar bShowDataOverlay = this.Camera.CameraData.Parameters.bShowDataOverlay;\n\t\t\t\tvar bShowActionLaser = this.Camera.CameraData.Parameters.bShowActionLaser;\n\t\t\t\tvar bShowActionOverlay = this.Camera.CameraData.Parameters.bShowActionOverlay;\n\t\t\t\t//we we are showing the data and the action and we only have one item then no need to repeat it\n\t\t\t\tbShowMessage = !((bShowDataLaser || bShowDataOverlay) && (bShowActionLaser || bShowActionOverlay));\n\t\t\t}\n\t\t\t//only display if we got anything different from previous\n\t\t\tif (bShowMessage)\n\t\t\t{\n\t\t\t\t//create a temp message for concatenation\n\t\t\t\tvar tutMsg = Tut_GetBlankMessage();\n\t\t\t\t//get the message\n\t\t\t\ttutMsg.HTMLContent = this.Camera.GetCurrentHintMessages();\n\t\t\t\t//display final message\n\t\t\t\t__SIMULATOR.DisplayMessage(tutMsg, __MSG_TYPE_CAMERA);\n\t\t\t}\n\t\t}\n\t\t//all done\n\t\tthis.State = __CAMERA_CMD_STATE_FINISHED;\n\t}\n}", "function addListAfterKeypress(event) {\n\t\t// Event.keycode looks for keypress. #13 is the enter button\n\t\tif (inputLength() > 0 && event.keyCode === 13) {\n\t\t\tcreateListElement(activeList, input.value);\n\t\t}\n}", "function listenForReadingListAddition() {\n rl.question(\"Selection: \", function(selection) {\n if (selection !== null) {\n if (selection === `new` ) newBookSearch();\n if (selection === `list` ) readingListView();\n if (selection === `main` ) mainMenu();\n if (selection === `q` ) {\n console.log(\"\\nAdios!\\n\");\n process.exit();\n }\n if (selection === `1` ) {\n addBook(1);\n readingListView();\n }\n if (selection === `2` ) {\n addBook(2);\n readingListView();\n }\n if (selection === `3` ) {\n addBook(3);\n readingListView();\n }\n if (selection === `4` ) {\n addBook(4);\n readingListView();\n }\n if (selection === `5` ) {\n addBook(5);\n readingListView();\n }\n let arr = ['new','list','main','q','1','2','3','4','5'];\n if (!arr.includes(selection)) {\n console.log(`\\nInvalid entry. Please try again.\\n`);\n listenForReadingListAddition();\n }\n }\n });\n}", "function loadPlayerList() {\n playerArray.forEach(addPlayerToUIList);\n }", "function displayplayer(usernamelist){\n console.log(usernamelist)\n for (let a in usernamelist){\n if (!(document.querySelector(\"#playerlist\").contains(document.querySelector(\"#\"+a)))) {\n let element = document.createElement(\"p\");\n element.innerHTML = a;\n element.id = a;\n document.querySelector(\"#playerlist-list\").prepend(element)\n cursors[a] = new Cursor(a);\n }\n };\n $(\"#playerlist-list > p\").each((index, elem) => {\n if (!(elem.id in usernamelist)){\n document.getElementById(elem.id).remove()\n };\n });\n}", "function PromotionList() {\r\n ListAction.apply(this, arguments);\r\n }", "function commandsListRover(rover, commandsList) {\n for (var i = 0; i < commandsList.length; i++) {\n var command = commandsList[i];\n switch (command) {\n case 'f':\n moveForward(rover);\n break;\n case 'b':\n moveBackward(rover);\n break;\n case 'l':\n turnLeft(rover);\n break;\n case 'r':\n turnRight(rover);\n break;\n default:\n console.log('Valid commands are: \"f\", \"b\", \"l\" or \"r\".');\n break;\n }\n }\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function checkName(availability) {\n\n var playerList = $(\"#playerList\");\n playerList.html(\"\");\n var newHTML = \"\";\n\n if (availability !== \"false\") {\n\n availability = JSON.parse(availability);\n\n if (availability.length == 0) {\n playerList.html(\"<h2 style='color: white;'><b>There are no games available. Please consider hosting one.</b></h2>\");\n }\n console.log(availability);\n hostList = availability;\n\n newHTML = \"<ul style='list-style-type: none'>\";\n for (var i = 0; i < availability.length; i++) {\n\n console.log(availability[i]);\n newHTML += \"<li><button class='hostList' data-index='\" + i + \"' onclick='selectHost(this)'>\" + availability[i] + \"</button></li>\";\n\n }\n\n newHTML += \"</ul>\";\n playerList.append(newHTML);\n\n }\n\n else {\n playerList.html(\"<h1 style='color: white;'><b>Name is unavailable. Please select another.</b></h1>\");\n }\n\n}", "function gotList(thelist) {\n\n console.log(\"Got List of Serial Ports:\");\n // theList is an array of their names\n for (var i = 0; i < thelist.length; i++) {\n // Display in the console\n console.log(i + \" \" + thelist[i]);\n }\n}" ]
[ "0.6310657", "0.6184701", "0.6003998", "0.5883592", "0.5855878", "0.58499706", "0.5846292", "0.5846292", "0.58232415", "0.5752916", "0.56765145", "0.5667428", "0.5656054", "0.56545323", "0.5630354", "0.55969584", "0.5582601", "0.5566575", "0.5534941", "0.5531951", "0.55262357", "0.55095816", "0.5497072", "0.54853326", "0.5463106", "0.5450289", "0.5441889", "0.5430317", "0.54197747", "0.5419584", "0.5413853", "0.5410127", "0.540852", "0.53680533", "0.53627574", "0.535981", "0.5352036", "0.53506535", "0.53469324", "0.532909", "0.53261834", "0.532222", "0.53167796", "0.53164804", "0.53135407", "0.5312036", "0.5310053", "0.5308483", "0.5305976", "0.5305976", "0.5290346", "0.5284249", "0.52825767", "0.5262912", "0.52580553", "0.5249684", "0.5241589", "0.52349395", "0.52306664", "0.5227089", "0.52270764", "0.52224976", "0.5210947", "0.52092725", "0.52074754", "0.51979643", "0.51956654", "0.51912737", "0.51911557", "0.51779425", "0.51778275", "0.5173057", "0.51729196", "0.5165537", "0.51645494", "0.5162972", "0.5161202", "0.51476985", "0.5146729", "0.5146543", "0.5133848", "0.5128179", "0.512745", "0.5125294", "0.5124292", "0.5124149", "0.51227206", "0.512161", "0.51177895", "0.51075584", "0.51066685", "0.51024747", "0.50795066", "0.5073099", "0.50720847", "0.50720847", "0.50720847", "0.50720847", "0.5069278", "0.50680345" ]
0.5496751
23
if a player enters the command OPEN
function commandOpen(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { var currentPlayer = playerfound; var currentRoom = currentPlayer.room; var file = null; if(currentRoom == "/root/users/admin/cloud") { Cloud.find({'gameID': game_ID}, function(err, roomfound) { if(err) console.error(err); // look through each items in the current room to find the desired file/item for(let i=0; i<roomfound[0].items.length; i++) { if(parameter.toLowerCase() == "credits.txt") { file = "credits.txt"; } else if(roomfound[0].items[i].toLowerCase() == parameter.toLowerCase()) { file = roomfound[0].items[i]; break; } } Cloud.findOneAndUpdate({ 'gameID': game_ID }, { $pull: { items: { $in: [file] } } }, { new: true, useFindAndModify: false }, function(err, updatedgame) { if(err) console.error(err); executeCommand([(file) ? "OPENING " + parameter : "NO SUCH FILE"], currentRoom); }); }); } else { Room.find({'name': currentRoom}, function(err, roomfound) { if(err) console.error(err); // look through each items in the current room to find the desired file/item for(let i=0; i<roomfound[0].items.length; i++) { if(parameter.toLowerCase() == "diary.txt") { file = "diary.txt"; } else if(parameter.toLowerCase() == "credits.txt") { } else if(roomfound[0].items[i].toLowerCase() == parameter.toLowerCase()) { file = roomfound[0].items[i]; // if the desired file/item is database, edit it by exchanging the opponent username and password if(file == "database.txt") { editFile(file, currentPlayer); } break; } } executeCommand([(file) ? "OPENING " + parameter : "NO SUCH FILE"], currentRoom); }); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onOpen() {\n this.sendPacket({\n op: Constants.OPCodes.DISPATCH,\n d: {\n server_id: this.voiceConnection.channel.guild.id,\n user_id: this.client.user.id,\n token: this.voiceConnection.authentication.token,\n session_id: this.voiceConnection.authentication.sessionID,\n },\n }).catch(() => {\n this.emit('error', new Error('Tried to send join packet, but the WebSocket is not open.'));\n });\n }", "isGameOpen() {\n return this.gameState === GAME_OPEN;\n }", "async open() {\n\t\tif (this.lock_status_id === 4) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(2);\n\t\tawait this.await_event('status:OPENED');\n\t}", "function joinGameAsPlayer() {\n // check if ingame true\n\n}", "function playingTheMachine() {\n return opponentInfo.name == \"Stockfish\";\n }", "function OpenBranch(){\n\tloadPlayer();\n \tLookPlayerBranch(PlayerLevel , ProID , BranchID);\n//\tuiallcl.show15();\n}", "function stand(player) {\n player.turnOver = true;\n}", "access() {\n this.emit(\"Player.Environment.Interacted\", \"You opened the \"+this.Target.name+\".\");\n this.Target = this.Target.Item;\n this.emit(\"Player.Environment.Updated\", this.Target.Item);\n }", "get isOpen() { return this._state === Win.STATE_OPEN; }", "function makePlayerOp(event){\n console.log(event.player + ' connected');\n var Canary = Packages.net.canarymod.Canary;\n Canary.ops().addPlayer(event.player.name);\n}", "startMatch(data){\n //assign a player to be O, this will be the second player to join a match\n if(game.id === data.id)\n {\n game.waiting = true\n game.player = \"o\"\n game.playerPieceText.setText(\"You are O\")\n game.opponent = data.challenger\n game.turnStatusText.setText(game.opponent + \"'s turn\")\n game.opponentKey = data.challengerkey\n Client.connectedToChat({\"opponent\": game.opponent});\n }\n else\n {\n game.waiting = false\n console.log(\"no longer waiting!\")\n game.player = \"x\"\n game.playerPieceText.setText(\"You are X\")\n game.opponent = data.username\n game.opponentKey = data.userkey\n game.turnStatusText.setText(\"Your Turn\")\n Client.connectedToChat({\"opponent\": game.opponent});\n }\n console.log(\"you are challenged by \" + game.opponent)\n console.log(\"you are challenged by key \" + game.opponentKey)\n\n }", "function open_player(player){\n\t//console.log('open_player');\n\tif(hap_settings.autoUpdateWindowData){\n\t\tif(player)hap_players[0] = player;//get player reference\n\t\tupdatePlayerData(true);\n\t}\n\thap_players[0] = jQuery('#componentWrapper').css('display','block').html5audio(hap_settings);//show player before init\n\tif(!html5Support)hap_players[0].embedFlash();\n\thap_players[0].find('.popup_open').css('display','block');\n}", "function defineCurrentPlayer(player) {\n if(player == 'X') {\n return 'X';\n } else {\n return 'O';\n }\n }", "function is_playing(player)\n{\n\tif(player['OPP'])\n\t\treturn true;\n\treturn false;\n}", "function win() {\r\n if(playerHasSword===true && playerHasSelfConfidence===true && playerHasShortBlade===true && playerHasWD40===true && currentlocation===10) {\r\n var msg = \"You crawl through the ductwork and see your target. Quickly jumping down, you wound him with the short blade. He lashes out and strikes you back while drawing his sword. You draw the Sword of Aquilius and attack. After a brief battle, LaFontanue knocks the sword from your hand and prepares to run your through. At the last second, you extend your hidden blade and plunge it into his throat, killing him. Your mission is complete. Congratulations.\";\r\n updateText(msg);\r\n }\r\n }", "function pfOpen(){\n\tif (siteManager.sManager.checkMode() === 'S'){\n\t\tspawnPF('S', 0);\n\t}\n\telse {\n\t\tspawnPF('K', 0);\n\t}\n\tcloseThreepack();\n}", "function openSocket() {\n\tsocket.send(\"Player connecting...\");\n}", "isMeQuestLeader() {\n return this.getCurrentPlayer().playerName === this.state.gameState.questLeader;\n }", "function playWallShouldOpen() {\n return true;\n}", "function playerswitch() {}", "function startGame() {\n setMessage(\"Select an opponent above\");\n}", "function handleOpen() {\n setOpen(true);\n }", "function selectPlayer() {\n if (this == selectPlayers.onePlayer) {\n playerMode = 'one';\n }\n else if (this == selectPlayers.twoPlayer) {\n playerMode = 'two';\n }\n}", "function handleOpen() {\n setOpen(true)\n }", "function partida(){\n if (contadorUser >= nRondas || contadorPc >= nRondas){\n //declarar ganador \n openWinner()\n \n } \n}", "function switchPlayer(){\n\t\tif (player === 'X') {\n\t\t\tplayer = 'O'\n\t\t}else{\n\t\t\tplayer = 'X'\n\t\t}\n\t\tdisplay.innerText = `Player:${player}'s turn`\n\t}", "function Play(){\n\t\tDebug.Log(\"Playing?\");\n\t\tplaying = true;\n\t\tBotReady();\n\t}", "function playersOnClick () {\n module.exports.internal.stateManager.showState('main-branch', 'pick-a-player')\n}", "get openStart() { return (this.open & 1 /* Open.Start */) > 0; }", "function togglePlayer() {\n if (activePlayer === \"X\") {\n activePlayer = \"O\";\n nonActivePlayer =\"X\";\n } else {\n activePlayer = \"X\";\n nonActivePlayer = \"O\";\n } //if active player is x then it changegs to O & vice versa\n }", "function battleMapOptionsMenuOpenStateChangeStarter() {\n store.dispatch( {\n type: OPTIONS_OPEN,\n payload: {\n isOptionsPanelOpened: true,\n isGamePaused: true,\n manualPaused: true\n }\n });\n }", "function open() {\n state = 'open';\n czarTimerEnd = false;\n clearInterval(czarTimerInterval);\n roundTimerEnd = Date.now() + (1000 * game.roundTime);\n roundTimerInterval = setInterval(checkRoundTime, 100);\n io.to(game.id).emit('roundStatus', status());\n }", "startMultiplayer()\n {\n document.getElementById(\"chat-box\").style.visibility = \"visible\";\n document.getElementById(\"open-box\").style.visibility = \"visible\";\n \n if(game.firstPlay === true)\n {\n\n if(game.challengingFriend)\n {\n Client.makeNewPlayer({\"name\":game.username, \"gametype\":game.gametype, \"userkey\":game.userkey, \"friend\":game.friend.username});\n }\n else\n {\n makeClient();\n Client.makeNewPlayer({\"name\":game.username, \"gametype\":game.gametype, \"userkey\":game.userkey});\n }\n console.log(\"firstPlay!\")\n game.firstPlay = false\n game.waiting = true\n }\n else\n {\n game.askForRematch()\n }\n }", "function onOpen(evt) {\n\t\tconnected = true;\n\t\t$('.connectionState').text(\"Connected\");\n\t\t$('.connectionState').addClass('connected');\n\t}", "function player() {\n if (game % 2 == 0) {\n return 'O';}\n else {\n return 'X';}\n }", "onOpen() { }", "handlePlayerLoaded(player) {\n super.handlePlayerLoaded();\n game.send_command('player_ready', {});\n\n // This will make the new local player visible\n // to others connected people\n player.updateLocalPlayer();\n }", "function checkWinner() {\n if(playerPosition <= 0) {\n alert('Player 1 Wins!')\n } else if(compPosition <= 0) {\n alert('Computer Wins!')\n }\n }", "function startGame() {\n setMessage(player1 + ' gets to start.');\n}", "function myChangePlayer(src) {\r\n\t// if (!debugMuteAll) { console.log('asked for changing player!'); }\r\n\tif (!globData.compareMode) {\r\n\t\tif (globFunc.menuView.hidden) {\r\n\t\t\tglobFunc.menuView.show();\r\n\t\t\tglobFunc.menuView.resize();\r\n\t\t} else {\r\n\t\t\tglobFunc.menuView.hide();\r\n\t\t}\r\n\t\t//\r\n\t\tif (src.innerHTML == 'Change Player') {\r\n\t\t\tglobData.singleSelectMode = true;\r\n\t\t\tsrc.innerHTML = 'Close Selection';\r\n\t\t} else {\r\n\t\t\tglobData.singleSelectMode = false;\r\n\t\t\tsrc.innerHTML = 'Change Player';\r\n\t\t}\r\n\t}\r\n}", "function player() {}", "function onOpen(evt) {\n console.log(\"Connected to server\");\n}", "function nameModuleOpen(condition) {\n let pvpModal = document.querySelector('.pvpModal');\n let playButt = document.querySelector('.playButt');\n pvpModal.style.cssText =\"transition: all 0.4s ease; -webkit-transform: scale(1); -webkit-filter: blur(0px) grayscale(0%);\"\n \n playButt.addEventListener('click', nameModuleClose);\n playButt.addEventListener('click', PlayerX);\n // stopped in process of figuring best way to\n // send names to each factory - one for x and one for o\n }", "function onopen(callback){\n mySocket.onopen = function () {\n mySocket.send(\"join \" + chatroom); //enter the desired chatroom\n mySocket.onmessage = test;\n }\n callback();\n }", "function handlePlayerChange() {\n currentPlayer = currentPlayer === \"X\" ? \"O\" : \"X\";\n //updating interface\n statusDisplay.innerHTML = currentPlayerTurn();\n}", "function Start(){\n\topenFlag = 1;\n\tselectedFlag = 0;\n}", "onOpen() {\n const {dataStore, activeUserId, activeTeamId} = this.slack.rtmClient;\n const user = dataStore.getUserById(activeUserId);\n const team = dataStore.getTeamById(activeTeamId);\n this.log(this.formatOnOpen({user, team}));\n }", "async win(game, data) {\n\t\tthis._won = true;\n\t}", "onOpen() {\n\t\t}", "function whoWon(){\n\tif(gameOver() == true){\n\t\tmodal.style.display = \"block\";\n\t\t$(\".modalContent\").removeClass(\"closeModal\");\n\t\t$(\".modalContent\").addClass(\"openModal\");\n\n\t\tif(playerScores[0] > playerScores[1]){\n\t\t\t$(\".modalBody\").empty().append(\"Player 1 has won!\");\n\t\t\t// $(\".modalBody\").append(\"Player 1 has won!\");\n\t\t} \n\n\t\telse if(playerScores[1] > playerScores[0]){\n\t\t\t$(\".modalBody\").empty().append(\"Player 2 has won!\");\n\t\t\t// $(\".modalBody\").append(\"Player 2 has won!\");\n\t\t} \n\n\t\telse{\n\t\t\t$(\".modalBody\").empty().append(\"It's a draw...\");\n\t\t\t// $(\".modalBody\").append(\"It's a draw...\");\n\t\t}\n\t}\n}", "function checkNameEntered(){\n startGame();\n \n if(isnameEntered){\n beginPlaying();\n }\n}", "function onPlayerReady(){\n\t\tg_isPlayerReady = true;\n\t\t\n\t}", "function isOpen(){\n\t\t\tif(open)\n\t\t\t\t return \"menu is open\";\n\t\t\telse\n\t\t\t\t return \"menu is closed\";\n\t}", "function onPlayerReady(e) {\n}", "function joinGame(msg) {\n game.addPlayer(this, msg.username, (msg.color) ? msg.color : Constants.TANK.BLUE, msg.fireToggle);\n}", "function onopen() {\n\tconsole.log ('connection open!');\n\t//connection.send('echo\\r\\n'); // Send the message 'Ping' to the server\n}", "playerSwitchComplete(){\n this.switchPlayer();\n }", "open() {\n\t\treturn true;\n\t}", "function onOpen() {\n FormApp.getUi().createMenu('TSFormBot')\n .addItem('🕜 Enable Bot', 'TSFormBot.enableBot')\n .addToUi();\n}", "function open(userInput) {\n if (actions.open && interactable.includes(userInput)) {\n // open an interactable\n actions.open = false;\n\n writeToTerminal(\"you tried opening the \" + userInput);\n whatDoesThisDo();\n } else if (actions.open && !interactable.includes(userInput)) {\n // open an interactable FAILS\n actions.open = false;\n writeToTerminal(\"you can't open that.\");\n }\n}", "function lobbyPing(){\n \n \tsendMessage(\"get\",{\n \t\tkey: \"lobbyPing\",\n \t\tgameHash: GAME_HASH,\n \t\tplayerId: PLAYER_ID\n \t}, lobbyPingCallback);\n }", "function onNewPlayer (data) {\n \n}", "winGame() {\n gameWon();\n }", "function JoinGame() {\n\t// Your code goes here for joining a game\n\tprint(\"Complete this method in Multiplayer.js\");\n}", "async function inGame({Match, status_string}) {\r\n\tlet liveMatch = await getData('getmatchplayerdetails', true, [Match]).catch(err => log('red', err)),\r\n\t\tfriendsList = await getData('getfriends', true, [config.username]).catch(err => log('red', err)),\r\n\t\tplayerData = liveMatch.find(obj => obj.playerName === config.username),\r\n\t\tmaxPartySize = liveMatch.length / 2,\r\n\t\tpartyCount = 1;\r\n\tliveMatch.forEach(player => {\r\n\t\tif (player.taskForce !== playerData.taskForce) return;\r\n\t\tif (friendsList.find(obj => obj.name === player.playerName)) {partyCount++;}\r\n\t});\r\n\trpc.setActivity({\r\n\t\tdetails: queue[playerData.Queue][0],\r\n\t\tstate: `Party (${partyCount} / ${maxPartySize})`,\r\n\t\tstartTimestamp,\r\n\t\tlargeImageKey: removeAllSpaces(playerData.GodName.replace(/_/g, '')).toLowerCase() + '_jpg',\r\n\t\tlargeImageText: playerData.GodName.replace(/_/g, ' '),\r\n\t\tsmallImageKey: queue[playerData.Queue][1] + '_png',\r\n\t\tsmallImageText: queue[playerData.Queue][1].replace(/^\\w/, c => c.toUpperCase()),\r\n\t\tinstance: false\r\n\t}).catch(err => log('red', err));\r\n\tif (currentActivity !== status_string) {\r\n\t\tlet god = playerData.GodName.replace(/_/g, ' ');\r\n\t\tlet gamemode = queue[playerData.Queue][1].replace(/^\\w/, c => c.toUpperCase());\r\n\t\tlog('green', `RPC: God=${god} Gamemode=${gamemode}`);\r\n\t\tcurrentActivity = status_string;\r\n\t\tif (config.getAPIUseData) getDataUsed();\r\n\t}\r\n}", "check_GameOver() {\n if (this.model.winner == 0) {\n if (this.currentPlayerBot == 0) {\n this.scene.undo_play = false;\n this.state = 'WAIT_UNDO';\n }\n else\n this.state = 'CHANGE_PLAYER';\n }\n else{\n this.state = 'GAME_OVER';\n this.scene.showGameMovie = false;\n this.view.incWinsPlayer(this.model.winner);\n }\n }", "function winPlayerOpen(options)\n{\n\t// if it is already open, return now\n\tif( winPlayerLoader )\treturn;\n\t// handle the default options\n\toptions\t\t= options || {\t'chrome': \tfalse,\n\t\t\t\t\t'position':\t'se',\n\t\t\t\t\t'size':\t\t'small',\n\t\t\t\t\t'stayInFront':\ttrue\n\t\t\t\t\t};\n\t// get winopts for the window\n\tvar winopts\t\t= new air.NativeWindowInitOptions();\n\n\tif(options.chrome == false){\n\t\twinopts.systemChrome\t= air.NativeWindowSystemChrome.NONE;\n\t\t// TODO should i make this transparent? level of transparency\n\t\twinopts.transparent\t= true;\n\t}\n\tif(options.size\t== \"small\"){\n\t\tvar win_size\t= {\tw:\t320*2/3,\n\t\t\t\t\th:\t240*2/3\n\t\t};\n\t}else if(options.size\t== \"medium\"){\n\t\tvar win_size\t= {\tw:\t320*2,\n\t\t\t\t\th:\t240*2\n\t\t};\n\t}\n\tif( filecookie.has('nochromewin_size') )\n\t\tvar win_size\t= filecookie.get('nochromewin_size');\n\n\tif( filecookie.has('nochromewin_pos') )\n\t\toptions.position\t= filecookie.get('nochromewin_pos');\n\tvar coord\t= winPlayerCoordFromPosition(options.position, win_size);\n\tvar win_x\t= coord.x;\n\tvar win_y\t= coord.y;\n\n\t// create a new window\n\tvar bounds\t= new air.Rectangle(win_x, win_y,win_size.w, win_size.h);\t\n\tloader\t\t= air.HTMLLoader.createRootWindow( true, winopts, true, bounds );\n\t// set it always in front\n\tif(options.stayInFront)\tloader.stage.nativeWindow.alwaysInFront\t= true;\t\n loader.load( new air.URLRequest('app:/html/player_window.html') );\n\tloader.addEventListener(air.Event.COMPLETE, winPlayerOnComplete);\n\tloader.stage.nativeWindow.activate();\n\t\n\twinPlayerLoader\t= loader;\n}", "function onPlayerReady(event) {\r\n playerReady = true;\r\n\r\n }", "function StandClick(){\r\n while(player2Point < 17){\r\n Stand();\r\n }\r\n // check if any player is winning\r\n IsGameOver();\r\n}", "function whoIsActive() { // Player.js (179) if (move)\n if (player1Active) {\n activePlayer = 2;\n notActivePlayer = 1;\n setActivePlayer(player2, player1, powerDiv2); // Info.js (21) Set attributes to the active player to use them by replacing weapon\n setActiveBoard(notActivePlayer, activePlayer); //Info.js (27) Add a class for a playerDiv of the active player to display current information about game flow\n displayMessageOnBoard(activePlayer); // Info.js (32) Display random message on active player's div\n } else {\n activePlayer = 1; \n notActivePlayer = 2;\n setActivePlayer(player1, player2, powerDiv1);\n setActiveBoard(notActivePlayer, activePlayer,);\n displayMessageOnBoard(activePlayer);\n }\n\n}", "open() {\n this.open = true;\n alert(\"You have openned the backpack.\");\n }", "function openedCard() {\n\tvar len = openedCards.length;\n\tif (len == 2) {\n\t\tunmatched();\n\t}\n}", "function checkPlayer() {\n return (gInfo.playerList[gInfo.currentPlayer].uid==currentUID);\n}", "isGameover() {\n if (this.player1Pieces === 0 || this.player2Pieces === 0) {\n let message = this.player2Pieces === 0 ? 'Player 1 won!' : 'Player 2 won!';\n this.currentPlayerUI.innerHTML = message;\n this.currentPlayerUI.style.color = \"grey\";\n return true;\n }\n return false;\n }", "function C007_LunchBreak_Natalie_OpenGag() {\r\n CurrentTime = CurrentTime + 60000;\r\n PlayerLockInventory(\"DoubleOpenGag\");\r\n}", "function playerWin() {\n game.isPlayersTurn = false;\n holdButtonFunctons = true;\n updateLED('WIN!');\n blinkLED(3);\n setTimeout(function() {\n holdButtonFunctons = false;\n startGame();\n }, 4000);\n}", "status(){\n if(this.facedown.length <= 0){\n inProgress = false;\n console.log(\"GAME OVER\");\n }\n }", "function startGameCommand() {\n newHandCommand(deck, dealer, player);\n changeIsVisible(\"welcome\", false);\n}", "function show() {\n Onyx.set(ONYXKEYS.IS_CHAT_SWITCHER_ACTIVE, true);\n}", "function onOpen(){\n console.log( \"Connected through Spacebrew as: \" + sb.name() + \".\" );\n}", "function processKey(){\n for(var i = 0; i<platforms.length; i++){\n var p = platforms[i];\n if(p.type == 6){\n if(keyFound){\n platforms[i].open = true;\n }\n }\n }\n}", "function gotOpen() {\n print(\"Serial Port is Open\");\n}", "function checkPlayerCondition() {\r\n\r\n\tif (player.health < 1) {\r\n\t\tplayer.lives--;\r\n\t\tplayer.initCheckpoint();\r\n\t}\r\n\r\n\tif (player.y > 1350) {\r\n\t\t\r\n\t\tSounds.yell.play();\r\n\t\tplayer.lives--;\r\n\t\tplayer.grounded = true;\r\n\t\tplayer.airborne = false;\r\n\t\tplayer.jumping = false;\r\n\t\tplayer.velY = 0;\r\n\t\tplayer.health = 3;\r\n\t\t\r\n\t\tif (player.lives > 0) {\r\n\t\t\tplayer.init(-25, 546);\r\n\t\t}\r\n\r\n\t\r\n\t}\r\n\t\r\n\tif (player.lives < 1) {\r\n\t\tplayer.init(-200,-200);\r\n\t\tgameOver = true;\r\n\t}\r\n\r\n}", "function playerOneMadeChoice() {\n console.log(\"this is the player 1 choice: \", player1.choice);\n player1.choice ? true : false;\n }", "function gameOverFN(player) {\n player.setTint(0xff0000);\n player.setVelocityX(0);\n cop.setVelocityX(0);\n copLobby.setVelocityX(0);\n cam1.setVelocityX(0);\n verhaftet.play();\n player.anims.stop();\n cop.anims.stop();\n copLobby.anims.stop();\n gameOver = true;\n}", "function pveModuleOpen() {\n let selection = document.querySelector('.pveSelect');\n let pve = document.querySelector('.pveModal');\n let pvePlay = document.querySelector('.pvePlay');\n \n // styles for different elements\n playStyleModal.style.cssText = 'display: none; ';\n pvpModal.style.cssText = 'display: none;';\n pve.style.cssText = 'display: grid;';\n gameContainer.style.cssText = 'transition: all 0.4s ease; -webkit-transform: scale(1); -webkit-filter: blur(0px) grayscale(0px); background-color: transparent;'\n body.style.cssText = 'background-color: white;'\n first.value = null;\n second.value = null;\n // event listener to start game vs computer\n pvePlay.addEventListener('click', selectOption);\n\n \n\n }", "async openPlayer(playerId) {\n const playerStats = await this._getPlayerStats(playerId);\n this.cache.get('playerStats').open(playerId, playerStats);\n\n const playerGames = await this._getPlayerGames(playerId);\n this.cache.get('playerGames').open(playerId, playerGames);\n\n const playerSets = await this._getPlayerSets(playerId);\n this.cache.get('playerSets').open(playerId, playerSets);\n\n const playerAvatars = await this._getPlayerAvatars(playerId);\n this.cache.get('playerAvatars').open(playerId, playerAvatars);\n }", "function gotOpen() {\n print(\"Serial Port is Open\");\n}", "function gameOver() {\n if (gameState == \"win\") {\n console.log(\"You win!!\");\n $(\"#gameOverDialog\").dialog(\"open\");\n $(\"#gameOverDialog\").text(\"You win. You successfully avoided too much harmful content.\");\n } else if (gameState == \"lose\") {\n console.log(\"You lose!!\");\n $(\"#gameOverDialog\").dialog(\"open\");\n $(\"#gameOverDialog\").text(\"You lose. You were unable to avoid harmful content.\");\n }\n}", "function winMsg(player) {\n\twin = true;\n\n\tif (player == \"I\") {\n\t\tfirstPlayerScore = firstPlayerScore + 1;\n\t\t$('#firstPlayerScore').text(`Player 1: ${firstPlayerScore}`);\n\t\t$('.successmsg').text('**Congratulations, Player 1 have won**');\n\n} else {\n\n\t\tsecondPlayerScore = secondPlayerScore + 1;\n\t\t$('#secondPlayerScore').text(`Player 2: ${secondPlayerScore}`);\n\t $('.successmsg').text('**Congratulations, Player 2 have won**');\n\t}\nresetGame();\n}", "function suivant(){\n if(active==\"idee\"){\n reunion_open();\n }else if (active==\"reunion\") {\n travail_open();\n }else if (active==\"travail\") {\n deploiement_open();\n }\n }", "asWin(player,drawer,room){\n socket.emit(\"win\",{player : player,drawer: drawer,room: room})\n }", "function gotOpen() {\n print(\"Serial Port is open!\");\n}", "function openCard(event) {\n if (event.target.classList.contains('open', 'show') || event.target.classList.contains('fa') || event.target.classList.contains('deck')) {}\n else {\n countMoves();\n event.target.classList.add('open', 'show');\n addToOpenCards(event.target);\n }\n }", "checkInteractValidity() {\n if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_top_mid_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown) {\n \n if(roomProgress <= 2000)\n this.coin0.alpha = 1.0;\n roomProgress = 2005;\n \n //this.coin0.alpha = 1.0;\n this.room2_activity1A.alpha = 1.0;\n\t\t// this.resetArrows();\n this.room2_characterMoveable = false;\n this.checkActivityOpened(true, false, false, false, false, false);\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_bot_left_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2005) {\n if(roomProgress <= 2010)\n roomProgress = 2010;\n\n this.room2_activity2A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, true, false, false, false, false);\n \n } else if (this.room2_key_E.isDown && roomProgress < 2005) {\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_top_left_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2010) {\n if(roomProgress <= 2015)\n roomProgress = 2015;\n\n this.room2_activity3A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, true, false, false, false);\n\n } else if (this.room2_key_E.isDown && roomProgress < 2010){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_bot_mid_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2015) {\n if(roomProgress <= 2020)\n roomProgress = 2020;\n\n this.room2_activity4A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, false, true, false, false);\n\n } else if (this.room2_key_E.isDown && roomProgress < 2015){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n\n }\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_top_right_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2020) {\n if(roomProgress <= 2025)\n roomProgress = 2025;\n\n this.room2_activity5A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, false, false, true, false);\n }\n else if (this.room2_key_E.isDown && roomProgress < 2020){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_bot_right_info, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown && roomProgress >= 2025) {\n if(roomProgress <= 2030)\n roomProgress = 2030;\n console.log(roomProgress); \n this.room2_activity6A.alpha = 1.0;\n this.resetArrows();\n this.checkActivityOpened(false, false, false, false, false, true);\n }\n else if (this.room2_key_E.isDown && roomProgress < 2025){\n this.room2_activityLocked.alpha = 1.0;\n this.room2_characterMoveable = false;\n }\n\n } else if (Phaser.Geom.Rectangle.ContainsPoint(this.coin0_zone, this.room2_character_north)) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y-75;\n if(this.coin0.alpha == 1.0) this.room2_E_KeyImg.alpha = 1.0;\n if(this.room2_key_E.isDown) {\n if(this.coin0.alpha == 1.0) this.collectCoin(0);\n //this.coin0.alpha = 0.0;\n }\n }\n else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_hole_zone_nextRoom, this.room2_character_north)) {\n if(roomProgress >= 2500) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if (this.room2_key_E.isDown) {\n if (roomProgress <= 3000)\n\t\t roomProgress = 3000;\n\t\t this.scene.start(\"Account_Eqn\");\n\t\t //this.scene.start(\"winners_Room\");\n }\n }\n\n\n }\n\n else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_hole__zone_activity, this.room2_character_north)) {\n if(roomProgress >= 2030) {\n this.room2_E_KeyImg.x = this.room2_character_north.x;\n this.room2_E_KeyImg.y = this.room2_character_north.y+75;\n this.room2_E_KeyImg.alpha = 1.0;\n if(this.room2_key_E.isDown) {\n if(roomProgress <= 2100)\n roomProgress = 2100;\n\t\t this.scene.start(\"BB_ActRoom\");\n }\n }\n }\n\t else if (Phaser.Geom.Rectangle.ContainsPoint(this.room2_exitDoor, this.room2_character_north)){\n\t this.room2_E_KeyImg.x = this.room2_character_north.x+75;\n\t this.room2_E_KeyImg.y = this.room2_character_north.y;\n\t this.room2_E_KeyImg.alpha = 1.0;\n\t if (this.room2_key_E.isDown) {\n\t\t this.scene.start(\"Course_Intro\");\n\t }\n\t }\t\n\n else {\n this.hideActivities();\n this.room2_E_KeyImg.alpha = 0.0;\n }\n }", "isOpen() {\n return this.session.isOpen() && this.sender.isOpen() && this.receiver.isOpen();\n }", "function playDoor(door)\n{\n numCloseDoors--;\n if (numCloseDoors === 0) {\n gameOver('win');\n } else if (isBot(door)) {\n gameOver();\n }\n\n}", "async win (){\n if(this.state.turn){\n await this.setState({winner: this.state.player1Name});\n this.updateMineFieldChange();\n //Alert who has won and suggestion of restarting the game\n if(window.confirm(this.state.player1Name + ' has won the game, do you wish to restart it?')){\n }\n }\n else{\n await this.setState({winner: this.state.player2Name});\n this.updateMineFieldChange();\n //Alert who has won and suggestion of restarting the game\n if(window.confirm(this.state.player2Name + ' has won the game, do you wish to restart it?')){\n }\n }\n return;\n }", "enter(client) {\n super.enter(client);\n\n console.log(\"Controller client entering\");\n\n this.receive(client, 'ding', () => {\n console.log(\"sending ding to players\");\n this.experiences.player.sendDing();\n });\n\n this.receive(client, 'startRound', () => {\n console.log(\"starting round\");\n this.experiences.player.startRound();\n });\n\n /*if(this.isReadyToPlay() && !this.playing) {\n // start game\n this.playing = true;\n\n console.log(\"Telling controller client to start\");\n this.send(client, \"startGame\");\n }*/\n }", "function openMpOnPlaying(playing) {\n if (playing && miniplayer === null) openMiniplayer();\n }", "function UserFirst() {\n if (!gameOver && !oneOption) {\n oneOption = true;\n computer = \"O\";\n user = \"X\";\n canPlay = true;\n currentState.whichPlayerPlayed = userWinValue;\n setMessage(\"You are X's\");\n }\n}" ]
[ "0.63416505", "0.626903", "0.62628955", "0.6251449", "0.6141463", "0.60351443", "0.5936138", "0.5887451", "0.58764553", "0.5876015", "0.586056", "0.5827418", "0.580879", "0.5806332", "0.577368", "0.57591", "0.5739467", "0.57374024", "0.57241887", "0.5679674", "0.5677445", "0.56755525", "0.5670103", "0.5665019", "0.56453925", "0.5631121", "0.56259066", "0.5624199", "0.56197685", "0.56118286", "0.559277", "0.55892694", "0.5586721", "0.5578131", "0.5564397", "0.5564354", "0.555715", "0.5555897", "0.5554343", "0.55462873", "0.5541212", "0.554033", "0.5534414", "0.55273604", "0.55263454", "0.55227786", "0.5505046", "0.5503585", "0.5501142", "0.54992706", "0.5494736", "0.54942614", "0.5490311", "0.5485162", "0.54850334", "0.54847395", "0.5484331", "0.54823005", "0.5471076", "0.54701746", "0.5465067", "0.5441986", "0.54399943", "0.542979", "0.54291016", "0.542766", "0.54239357", "0.54222894", "0.54206353", "0.5405235", "0.54039234", "0.5393017", "0.53913325", "0.53813875", "0.5377965", "0.5375802", "0.5365422", "0.5364762", "0.5359602", "0.5359574", "0.53582144", "0.5356248", "0.53561336", "0.5354835", "0.53488696", "0.5346422", "0.53462917", "0.5344026", "0.5343644", "0.53427756", "0.534231", "0.5340301", "0.5340295", "0.53381", "0.53338814", "0.53336805", "0.5333079", "0.5330682", "0.5326067", "0.5324996", "0.5323761" ]
0.0
-1
console.log("The Hello World Code!".replaceBetween(4, 9, "Hi")); edit the given file by exchanging the username and password
function editFile(file, currentPlayer) { let fs = require('fs'); // read the given file fs.readFile('./public/files/' + file, 'utf-8', function(err, data){ if (err) throw err; // change username and password to correct values let username = currentPlayer.opponent; let password = currentPlayer.opponentPassword; let user_start = data.indexOf('<USERNAME>') + 10; let user_end = data.indexOf('</USERNAME>'); data = data.replaceBetween(user_start, user_end, username); let pass_start = data.indexOf('<PASSWORD>') + 10; let pass_end = data.indexOf('</PASSWORD>'); data = data.replaceBetween(pass_start, pass_end, password); // data = data.replace('[USER]', username); // data = data.replace('[PASS]', password); // write/return the new changed file fs.writeFile('./public/files/' + file, data, 'utf-8', function (err) { if (err) throw err; }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "stringReplace(username) \n{\n var input =\"Hello <<username>> , how are you?\";\n var output = input.replace(/<<username>>/g,username); \n console.log(output+\" : Replace string using Regex \")\n\n var output1=\"\";\n while(username.length<3 || !isNaN(username)) {\n var read = require('readline-sync');\n var name=read.question(\"Enter your name : \");\n }\n output1=output1+input.substring(0,6)+username+\"\"+input.substring(19,input.length);\n console.log(output1+\" : hard-code\");\n}", "function append_user(datafile, username, password){\n fs.appendFileSync(datafile, `${username}:${password}:\\n`);\n}", "function replaceInString(string, content, {\n start,\n end\n}) {\n return string.substring(0, start) + content + string.substring(end);\n}", "function editFile(path) {\n fs.readFile(path, 'utf-8', function (err, data) {\n if (err) {\n log.error(\"Read file error:\" + err);\n } else {\n if (data.indexOf(oldName)) {\n var re = new RegExp(oldName, \"g\");\n if (data.indexOf(oldName) !== -1) {\n fs.writeFile(path, data.replace(re, newName), function (err) {\n if (err) {\n log.error('Modify file failure' + err);\n } else {\n log.info('Modify file success' + path);\n }\n });\n }\n }\n }\n });\n}", "function writePassword() {}", "function replace(){\n editColumn('2','4'); //FIRST NAMES: template column number (starts with \"1), array item (starts with \"0\");\n Logger.log('**********************************');\n editColumn('3','3'); //LAST NAME: template column number (starts with \"1), array item (starts with \"0\");\n Logger.log('**********************************');\n editColumn('4','1'); //TEAM: template column number (starts with \"1), array item (starts with \"0\");\n}", "function replaceStr(firstString, secondString) {\n var replaceString = firstString.replace(\"Vasile\", secondString);\n console.log(replaceString);\n}", "function greetUser() {\n // Get user name:\n var userInfo = os.userInfo();\n var userName = userInfo.username;\n\n // Define userAge:\n var userAge = notes.userAge\n\n // Define greeting:\n var greeting = `Hello there, ${userName}! You are ${userAge} years old! \\n`;\n\n // Append greeting to file using appendFile method:\n fs.appendFile('greetings.txt', greeting, (err) => {\n if (err) throw err;\n console.log(\"The data was appeneded to the file!\");\n })\n}", "function logInBox(string) {\n for (let index = 0; index < 5; index += 1) {\n if (index === 0 || index === 4 ) {\n console.log(`+${'+'.padStart(string.length + 3, '-')}`);\n } else if (index === 1 || index === 3) {\n console.log(`|${'|'.padStart(string.length + 3, ' ')}`);\n } else {\n console.log(`| ${string} |`);\n }\n } \n}", "function secretData(input) {\n input.forEach( element => {\n let line = element.replace(/(\\*[A-Z][a-zA-Z]*)(?=\\s|\\t|$)|(\\+[0-9-]{10})(?= |\\t|$)|(![0-9a-zA-Z]+)(?= |\\t|$)|(_[0-9a-zA-Z]+)(?= |\\t|$)/gm,\n (find) => '|'.repeat(find.length));\n console.log(line);\n })\n}", "function _3writePassword(password) {\n console.log(\"writing password\")\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n \n}", "function repFile(file, inString, outString) {\n replace({\n regex: inString,\n replacement: outString,\n paths: [file,],\n recursive: true,\n silent: true,\n })\n}", "function writePassword(passwordLength, includedLowercase, includedUppercase, includedNumbers, includedSpecialCharacters ) {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "replaceLines(startRow, endRow, lines) {\n if (!this.transaction || !this.editBuilder) {\n return;\n }\n const _range = new vscode.Range(new vscode.Position(startRow, 0), new vscode.Position(endRow, 0));\n const trimedLines = lines.map(line => line.trimRight());\n this.editBuilder.replace(_range, trimedLines.join(\"\\n\") + \"\\n\");\n }", "function foo({\n cwd,\n projectDir,\n inputs\n}){\n const filePath = multiline(`\n ${projectDir}\n ${DIR}\n ${FILE}\n `, '/')\n const content = readFileSync(filePath).toString()\n const heading = getHeading(today(), content)\n const text = inputs.join(' ')\n\n const newContent = `\n ${heading}\n\n ${text}\n `.trim()\n\n const contentToWrite = inject(\n `\\n${newContent}`,\n '# LOG',\n content\n )\n writeFileSync(filePath, contentToWrite) \n}", "function writeEdit(day, month, msg){\n let data = fs.readFileSync('Edits.txt', 'utf-8');\n if(day < 10){\n data += '0'\n }\n\n data += day;\n data += '-';\n if(month < 10){\n data += '0'\n }\n data += month;\n data += ': ';\n data += msg;\n data += '\\r\\n';\n\n console.log(data);\n fs.writeFileSync('Edits.txt', data);\n \n}", "function modifyAccount() {\n console.log(\"\\nMODIFY ACCOUNT\");\n console.log(\"-----------------------------\");\n console.log(user.name + \", (ID: \" + user.id + \")\");\n console.log(\"-----------------------------\");\n\n input = readline.question(\"Do you want to modify a 'name' or 'password'? (or 'quit' to go back)\\n>> \");\n if (input === \"name\") {\n input = readline.question(\"Ok, type in new name of at least 5 letters (or 'quit' to go back):\\n>> \");\n\n // More checks if needed, only letters, firstname, lastname....\n if (input.length < 5) {\n console.log(\"Name must contain at least 5 letters. Try again.\");\n modifyAccount();\n } else if (input === \"quit\") {\n modifyAccount();\n } else {\n const newName = input;\n\n console.log(\"Current name: \" + user.name + \" -> New name: \" + newName + \".\");\n\n input = readline.question(\"To proceed with change, type in your \"+\n \"current password (or 'quit' to go back):\\n>> \");\n\n if (input === user.password) {\n user.name = newName;\n\n // Read data from accountDetails, add it to allUsers\n allUsers = JSON.parse(fs.readFileSync(\"./accountDetails.json\", \"utf8\"));\n\n // Change old name to new user.name\n const newAllUsers = allUsers.map((x) =>\n x.id === user.id ?\n {...x, name: user.name} :\n x,\n );\n // Saving newAllUsers back to accountDetails.json file\n fs.writeFileSync(\"./accountDetails.json\", JSON.stringify(newAllUsers), \"utf8\", (err) => {\n if (err) {\n console.log(\"Could not save userData to file!\");\n }\n });\n\n console.log(\"Name changed. Hello \" + user.name + \"!\");\n } else if (input === \"quit\") {\n modifyAccount();\n } else {\n console.log(\"Wrong password, try again.\");\n modifyAccount();\n }\n }\n } else if (input === \"password\") {\n input = readline.question(\"Ok, type in new password (6-20 letters, at least one or more lower \" +\n \"and upper case letters + one numeric digit. Or type 'quit' to go back):\\n>> \");\n\n while ((!checkPassword(input) && input != \"quit\")) {\n input = readline.question(\"Password too weak. Password must have length \" +\n \"of 6-20 letters and have to contain one upper- and one lowercase letter, plus one \" +\n \"numeric digit.\\n Please give us password for this account:\\n>> \");\n }\n\n if (input === \"quit\") {\n currentLoc = \"account\";\n } else {\n const newPassword = input;\n input = readline.question(\"To proceed with change, type in your \"+\n \"old password (or 'quit' to go back):\\n>> \");\n\n while ((input !== user.password) && (input !== \"quit\")) {\n input = readline.question(\"Old password was wrong, try again.\\nTo proceed with change, type in your \"+\n \"old password (or 'quit' to go back):\\n>> \");\n }\n if (input === \"quit\") {\n currentLoc = \"account\";\n } else {\n user.password = newPassword;\n\n // Read data from accountDetails, add it to allUsers\n allUsers = JSON.parse(fs.readFileSync(\"./accountDetails.json\", \"utf8\"));\n\n const newAllUsers = allUsers.map((x) =>\n x.id === user.id ?\n {...x, password: user.password} :\n x,\n );\n // Saving newAllUsers back to accountDetails.json file\n fs.writeFileSync(\"./accountDetails.json\", JSON.stringify(newAllUsers), \"utf8\", (err) => {\n if (err) {\n console.log(\"Could not save userData to file!\");\n }\n });\n\n console.log(\"Password changed.\");\n }\n }\n } else if (input === \"quit\") {\n currentLoc = \"account\";\n } else {\n currentLoc = \"account\";\n }\n}", "function appendReloadClientCode (file, next) {\n fs.readFile(file, 'utf8', function (err, contents) {\n if (err) {\n next(null)\n }\n var reloadClientCode = reloadReturned.reloadClientCode()\n\n contents += '\\n\\n<!-- Inserted by Reload -->\\n<script>' + reloadClientCode + '</script>\\n<!-- End Reload -->\\n'\n\n next(contents)\n })\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // Reset variables\n passwordLength = 0;\n selectedCharacters = \"\";\n includeLowercase = false;\n includeUppercase = false;\n includeNumbers = false;\n includeSpecialChar = false;\n}", "function replaceAt(content, index, oldString, newString) {\n logger.debug(`Replacing ${oldString} with ${newString} at index ${index}`);\n return (\n content.substr(0, index) +\n newString +\n content.substr(index + oldString.length)\n );\n}", "function on_customer_password(username) {\n console.debug(\"Changing password for: \" + username);\n }", "async changeCode(filePath) {\n let code\n code = await readFile(filePath, 'utf8')\n code = replaceStyleInJs(code, '')\n outputFileSync(filePath, code)\n return\n }", "function injectNewScript(file, content) {\n // Make both items an array of lines.\n const lines = file.split('\\n');\n const contentLines = content.split('\\n');\n\n // Will store the index positions for the open and close <script> tags.\n let open;\n let close;\n\n lines.forEach((line, i) => {\n // Test each line to find the opening <script...> tag\n if (reScriptOpen.test(line)) {\n open = i + 1; // Add one so the index includes the matched <script>\n return;\n }\n // Test each line to find the closing </script> tag\n if (reScriptClose.test(line)) {\n close = i - 1; // Take one away to ensure inclusion of </script>\n return;\n }\n });\n\n // Everything up to and including the opening <script> tag.\n const top = lines.slice(0, open);\n // Everything from (inclusively) the </script> tag to EOF.\n const bottom = lines.slice(close);\n\n // Combine the three arrays and append the newline Vue files need.\n return [...top, ...contentLines, ...bottom].join('\\n');\n}", "function writePassword() {\n document.querySelector(\"#password\").innerHTML = password;\n\n }", "function login(username) {\n // Create your logic\n console.log(`${username}, Logged in successfully....`);\n}", "function printWelcome (welcomeText) {\n lineNum(8)\n println(welcomeText)\n line()\n}", "function writePassword() {\n var password = generatePassword();\n}", "function activate(context) {\n let disposable = vscode.commands.registerCommand('extension.sayHello', () => __awaiter(this, void 0, void 0, function* () {\n // The code you place here will be executed every time your command is executed\n config = JSON.parse(fs.readFileSync(__dirname + '/config.json', 'utf-8').toString());\n let pName = config.userName || '';\n let user_name = yield vscode.window.showInputBox({ value: pName });\n if (pName == user_name || user_name == null || user_name == undefined) {\n }\n else {\n config.userName = user_name;\n fs.writeFileSync(__dirname + '/config.json', JSON.stringify(config), 'utf8');\n vscode.window.showInformationMessage('用户名更改成功');\n setTimeout(() => {\n // 关闭弹出框\n vscode.commands.executeCommand(\"workbench.action.closeMessages\");\n }, 800);\n }\n }));\n // 统计字数\n let count = vscode.commands.registerCommand('count', () => {\n let editor = vscode.window.activeTextEditor;\n if (!editor) {\n return;\n }\n ;\n var selection = editor.selection;\n var text = editor.document.getText(selection);\n // Display a message box to the user\n vscode.window.showInformationMessage('Selected characters: ' + text.length);\n });\n // 记录文件保存信息\n let saveInfo = vscode.commands.registerCommand('writeLog', () => {\n // 执行文件保存命令\n vscode.commands.executeCommand(\"workbench.action.files.save\");\n /**\n * 判断文件类型,判断是否是js 文件\n * 1. 得到文件名字,判断后缀,\n * 2. 如果是js 文件,判断 首行是否有注释,没有则插入,有则修改\n */\n let fN = dm.fileName;\n if (JsType.exec(fN)) {\n // 判断是否有注释\n let _exit = 0;\n let f_info = {\n user_name: config.userName,\n create_time: format(new Date()),\n last_modify: config.userName,\n modify_time: format(new Date()),\n line_count: dm.lineCount\n };\n for (let i = 0; i < dm.lineCount; i++) {\n let lineText = dm.lineAt(i);\n if (lineText.text == '/***') {\n let wse = new vscode.WorkspaceEdit();\n wse.replace(dm.uri, new vscode.Range(i + 3, 0, i + 8, 0), getFileInfo(wlog.slice(3, wlog.length), f_info));\n wp.applyEdit(wse);\n _exit = 1;\n break;\n }\n ;\n }\n if (_exit === 0) {\n let wse = new vscode.WorkspaceEdit();\n wse.insert(dm.uri, new vscode.Position(0, 0), getFileInfo(wlog, f_info));\n wp.applyEdit(wse);\n }\n }\n else {\n }\n });\n context.subscriptions.push(disposable);\n context.subscriptions.push(saveInfo);\n context.subscriptions.push(count);\n}", "function WritePassword(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n\n}", "function findAndReplaceTextEditor(ed, pattern, value) {\n var logstash_filter = ed.getValue()\n var lines = logstash_filter.split('\\n')\n\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i]\n\n lines[i] = line.replace(pattern, value)\n\n }\n\n logstash_filter = lines.join('\\n')\n ed.setValue(logstash_filter, -1)\n}", "function writePassword() {\n\tvar password = generatePassword();\n\tvar passwordText = document.querySelector(\"#password\");\n\n\tpasswordText.textContent = password;\n}", "function writePassword() {\n var password = generatePassword(\"@password\");\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword(generatedPassword) {\n console.log(\"Generated Password: \" + generatedPassword);\n var newPassword = document.querySelector(\"#password\");\n newPassword.innerText = generatedPassword;\n\n}", "async function simulateAdminUser() {\n var admin = createUser(ADMIN, \"name_admin\", \"#2\", \"IT\");\n var fname = \"resource.txt\";\n var data = \"Ufff.... I am admin user. I'm writing this file.\";\n\n var err, result;\n [err, result] = await to(admin.writeFile(fname, data));\n if(err || !isSuccess(result)) {\n console.log(err);\n return;\n }\n\n [err, result] = await to(admin.readFile(fname));\n if(err) {\n console.log(err);\n return;\n }\n console.log(\"File data : \" + result);\n}", "function writePassword() {\n let password = generatePassword(passwordlength).join(\"\");\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function changePassword(){\n\tlogincontroller.logincheck(name,password,(err,data)=>{\n \tif(err) throw err;\n \telse{\n \t\tconsole.log(\"\\n------------------------Change Password--------------------------------\\n\\n\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n\tvar oldpass = readline.question(\"Enter your old password => \");\n\tconsole.log(\"------------------------------------------------------------------------------\")\n\tvar newpass = readline.question(\"Enter your new password => \");\n\tconsole.log(\"------------------------------------------------------------------------------\\n\")\n \t\tif(oldpass === data[0].password){\n \t\t\tmailcontroller.updatepassword(data[0].emailid,newpass,(err)=>{\n \t\t\t\tif(err) throw err;\n \t\t\t\telse\n \t\t\t\t\tconsole.log(\"\\n---------Password Changed successfilly!----------\");\n \t\t\t\t\tpassword = newpass;\n \t\t\t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n \t\t\t\t\thomeUI();\n \t\t\t})\n \t\t}else\n \t\t{\n \t\t\tconsole.log(\"\\n-----------Old Password does not match!------------------\");\n \t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n \t\t\thomeUI();\n \t\t}\n \t}\n\t\n \t});\n}", "set line(linep) {\n if (linep && linep.indexOf('~') !== -1) {\n // eslint-disable-next-line no-throw-literal\n throw '~ cannot be used in line of file commands. ~ is reserved for sed in the rpc-service';\n }\n this.line_base64 = window.btoa(unescape(encodeURIComponent(linep || '')));\n }", "function writePassword() {\n var password = start(); \n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.innerHTML = password;\n}", "function writePassword() {\n var password = pwCriteria();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n}", "function writePassword() { \n var charactersToInclude = passwordSpecifications();\n var finalPassword = [];\n for (let i = 0; i < passwordLength; i++) {\n var arrayLength = charactersToInclude.length;\n var randomNumber = Math.floor(Math.random() * arrayLength);\n finalPassword.push(charactersToInclude[randomNumber]);\n }\n passwordTextArea.innerHTML = finalPassword.join(\"\");\n}", "function liriHelps(){\n\tconsole.log(\"Oh, did you forget what I can do?\" + \n\t\t\"\\nmy-tweets <- This shows tweets from my programmer's account.\" + \n\t\t\"\\nspotify-this-song <- This lets me look up information on a song.\" + \n\t\t\"\\nmovie-this <- I use this to show you facts about a movie.\" + \n\t\t\"\\ndo-what-it-says <- It's a surprise! No peeking!\" + \n\t\t\"\\nhelp <- Shows this list of commands. If you forget what I can do, just ask for help!\");\n\tfs.appendFile(\"log.txt\", \" (%) Show all of Liri's commands: my-tweets, spotify-this-song, movie-this, do-what-it-says, and help.\");\n}", "function passwordWriter() {\n let passwordText = document.querySelector(\"#password\");\n passwordText.value = password; \n}", "replace(_lines, start) {\n const lines = typeof _lines === 'string' ? [_lines] : _lines;\n return this.setLines(lines, {\n start,\n end: start + lines.length,\n strictIndexing: false,\n });\n }", "function update(str1,str2){\n chatter[chatpoint] = \" \\n> \" + str1; chatter[chatpoint] += \"\\n> \" + str2; chatpoint ++ ; if( chatpoint >= chatmax ){ chatpoint = 0; }\n return write();\n}", "async function injectIntoTemplate(templatePath, injections) {\n let template = await readFile(templatePath, 'utf8');\n injections.forEach(({ target, value }) => {\n template = template.replace(`__${target}__`, value);\n });\n await writeFile(templatePath, template);\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n // .join('') to remove commas from final output \n passwordText.value = pass.join('');\n\n }", "function updateLogFile(logData) {\n // uses fs library to manipulate files. This command appends to a file named log.txt and adds data passed by the aove functions along with a divider\n fs.appendFile(\"log.txt\", logData + divider, function (err) {\n\n // If the code experiences any errors it will log the error to the console.\n if (err) {\n return console.log(err);\n }\n\n // Otherwise, it will print: \"log.txt was updated!\"\n console.log(\"log.txt was updated!\");\n });\n}", "function logText() {\n fs.appendFile(\"log.txt\", newInput + \"\\n\", function (err) {\n if (err) {\n console.log(err);\n }\n })\n}", "function writePassword() {\n\n\n // you can create a function named generatePassword that creates the password\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n // Find the id in HTML called password to determine where it should be placed\n var passwordText = document.querySelector(\"#password\");\n // Use the element found in the HTML to display the value of the password variable\n passwordText.value = password;\n return;\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n }", "function writePassword() {\n var password = generatePasswordContent();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function main() {\r\n // user.userLogin(\"sporkina@hotmail.com\", \"sporks\");\r\n}", "function writePassword() {\n var password = generatePassword().join(\"\");\n // console.log(password);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = newGeneratedPassword; \n\n}", "function writePassword() {\n generatePassword()\n var passwordText = document.querySelector(\"#password\");\n passwordText.textContent = password\n\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $('.insertusername').html(wgUserName); }", "function writePassword() {\n var password = generatePassword(confirmedCount, yesUpper, yesLower);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function UserInput(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n}", "function UserNameReplace() {\n if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n}", "function writePassword() {\n var password = \"\";\n for (var i = 0; i <= userLength; i++) {\n password = password + finalOptions.charAt(Math.floor(Math.random() * Math.floor(finalOptions.length - 1)));\n }\n document.getElementById(\"password\").value = password;\n }", "function invokeScript()\r\n{\r\n var path = \"C:\\\\Users\\\\aluhrs\\\\Desktop\\\\HelloWorld.txt\";\r\n\r\n if(host.namespace.Debugger.Utility.FileSystem.FileExists(path)){\r\n readFile(path);\r\n }else{\r\n writeFile(path);\r\n }\r\n\r\n}", "function writePassword() {\n var userPassword = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = userPassword;\n }", "function writePassword() {\n var criteria = passwordCriteria();\n var password = generatePassword(criteria);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function buildHtml(title, description, fileselect, uploaderName) {\r\n var header = '';\r\n //var body = '<h1>Hello World! retest</h1>';\r\n var currentPath = process.cwd();\r\n\r\n\r\n var fs = require('fs'); //Filesystem \r\n\r\n var content = fs.readFileSync(currentPath + '/public/activities/test/dummypage.html',\"utf-8\");\r\n \r\n var content2 = content.replace('Dummy Results##1title', title);\r\n var content3 = content2.replace('Description##1', description);\r\n var content4 = content3.replace(\"https://studybreaks.com/wp-content/uploads/2017/08/books.jpg\", fileselect);\r\n var content4 = content4.replace(\"Example content####Uploadername\", 'Activity by: ' + uploaderName);\r\n //console.log(content4);\r\n\r\n\r\n return content4;\r\n}", "encodeLine(username, password) {\n username = username.substring(0, 255);\n password = password.substring(0, 255);\n return btoa(\"\\u0000\" + username + \"\\u0000\" + password); // base64 encode\n }", "function writePassword() {\n var passwordLen = getpasswordLength();\n var options = getPasswordOptionSet();\n\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = makePassword(passwordLen, options);\n\n\n}", "function replaceRange(value, start, end) {\n\t\t\tvar byteAnchor = context.byteAnchor,\n\t\t\t\tbytePos = context.bytePos;\n\n\t\t\tcontext.anchor = start;\n\t\t\tcontext.pos = end;\n\t\t\t\n\t\t\tif (value == \"\\t\") {\n\t\t\t\tcommandInsertTab();\n\t\t\t} else {\n\t\t\t\tcontext.selection = value;\n\t\t\t}\n\n\t\t\tcontext.byteAnchor = byteAnchor;\n\t\t\tcontext.bytePos = bytePos;\n\n\t\t\tcacheContent = null;\n\t\t}", "function sayHello(first_name, last_name){\n console.log(`Hellow there ${first_name} ${last_name}!`)\n}", "function writePassword() {\n // Password created from generate Password function\n var password = generatePassword();\n // // Input text in password section\n var passwordText = document.querySelector(\"#password\");\n // Value to include is equal to the password variable\n passwordText.value = password;\n}", "function examples(string, dir){\n var lines = string.split(\"\\n\");\n var snippet;\n for(var i = 0; i<lines.length; i++){\n var l = lines[i];\n if(l.includes(\"[Full Example]\")){\n var end = l.indexOf(\"[Full Example]\") + \"[Full Example]\".length;\n var link = l.substring(end)\n link = link.substring(link.indexOf(\"(\")+1, link.indexOf(\")\"));\n if(link.startsWith(\"/\")) link = link.substring(1);\n \n var code = fs.readFileSync(link, {encoding: \"utf-8\"})\n snippet = \"```js\\n\" + code +\"\\n```\";\n if(lines[i-1] && lines[i-1].startsWith(\"```\")){\n lines[i-1] = undefined;\n for(var j = i-2; i>=0; j--){\n var p = lines[j];\n lines[j] = undefined;\n if(p.startsWith(\"```\")) break;\n }\n }\n lines[i] = snippet + \"\\n\" + lines[i];\n }\n }\n\n var final = \"\";\n for(var l of lines){\n if(typeof l === \"string\") final += l + \"\\n\";\n }\n\n final = final.trim();\n\n fs.writeFileSync(dir, final);\n\n\n return final;\n}", "function firstFourLines(file, options) {\n file.excerpt = file.content.split('\\n').slice(0, 4).join(' ');\n}", "function encrypt (str) {\n\t const reversed = str.split(\"\").reverse().join(\"\");\n\t var replaced1 = reversed.replace(/a/g,\"0\");\n\t var replaced2 = replaced1.replace(/e/g,\"1\");\n\t var replaced3 = replaced2.replace(/i/g,\"2\");\n\t var replaced4 = replaced3.replace(/o/g,\"2\");\n\t var replacedFinal = replaced4.replace(\"u\",\"3\");\n\t console.log(`${replacedFinal}aca`);\n\n}", "function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword(charLength, charactersType);\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.textContent = password;\n \n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = PassEmpty.join(\"\");\n}", "function generateReadMe(fileName, data) {\n fs.writeFile(fileName, data, function(err) {\n if (err){\n return console.log(err)\n }\n else {\n console.log(\"Input succesful\")\n }\n }\n )}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n var charSet =( userLower ? charsLower : '' )\n +( userUpper ? charsUpper : '' )\n +( userNums ? charsNumbers : '' )\n +( userSpecial ? charsSpecial : '' )\n\n passwordText.value = password;\n\n}", "function writePassword() {\n\tvar passwordText = document.querySelector('#password');\n\n\tpasswordText.value = finalPassword;\n}", "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n generatePassword()\n }", "function ChangePassword() {\n\t}", "function writePassword(password) {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function setUsername() {\n\tlet name = document.getElementById(\"name\").value.toLocaleLowerCase();\n\tlet firstFour = \"\";\n\tif (name.length >= 4) {\n\t\tfirstFour = name.substr(0, 4);\n\t} else {\n\t\tlet length = 4 - name.length;\n\t\twhile (length) {\n\t\t\tfirstFour = firstFour + \"a\";\n\t\t\tlength = length - 1;\n\t\t}\n\t\tfirstFour = name + firstFour;\n\t}\n\tlet employeeId = document.getElementById(\"employeeId\").value.toLocaleLowerCase();\n\tlet secondFour = \"\";\n\tif (employeeId.length >= 4) {\n\t\tsecondFour = employeeId.substr(0, 4);\n\t} else {\n\t\tlet length = 4 - employeeId.length;\n\t\twhile (length) {\n\t\t\tsecondFour = secondFour + length;\n\t\t\tlength = length - 1;\n\t\t}\n\t\tsecondFour = employeeId + secondFour;\n\t}\n\tlet username = firstFour + secondFour;\n\tdocument.querySelector(\"#username\").value = username;\n\tlet password = secondFour + firstFour;\n\tdocument.querySelector(\"#password\").value = password;\n}", "function encryptorMin(word) {\n word = word.replace(/a/gi, '4');\n word = word.replace(/e/gi, '3');\n word = word.replace(/i/gi, '1');\n word = word.replace(/s/gi, '5');\n word = word.replace(/o/gi, '0');\n console.log(word);\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").html(wgUserName);\n }", "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");//id selector = html line 22 \n\n passwordText.value = password;\n\n \n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n \n //By using the query selector method - I mapped the #password in the index.html to display the password\n //This replaces the placeholder text \"Your Secure Password\" with our newly generated password.\n \n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n}", "function reWrite(textToWrite) {\n fs.writeFile('index.html', textToWrite, function (err) {\n if (err) {\n console.log(err);\n }\n else {\n console.log('write success');\n }\n });\n}", "function multipleScript()\r\n{\r\n //getting the note after login\r\n var noteCurrent = document.getElementById(\"msgDiv\").textContent;\r\n \r\n\r\n //main stuff happens here\r\n if(noteCurrent.trim() != noteSuccessLogIn)\r\n {\r\n count++;\r\n if(count==username.length)\r\n {\r\n clearInterval(scriptInterval);\r\n \r\n //reloading the page to start it all over again if anything interrupted the connection\r\n location.reload();\r\n\r\n // just comment out the reload and use alert if you don't want automatic reloads\r\n // alert(\"All your IDs have been cycled through once.\\nIf you think not, just reload the page!\");\r\n return 0;\r\n }\r\n document.querySelector('input[name=username]').value = username[count];\r\n document.querySelector('input[name= password]').value = password[count];\r\n document.getElementById('logincaption').click();\r\n }\r\n}", "function RunOnEveryPage(){\n var regex = \"User CP</strong></a>\";\n var revised = \"User CP</strong></a>\";\n revised = \"User CP</strong></a>\"+\n \" &mdash; <a href='http://www.hackforums.net/managegroup.php?gid=\"+GroupID+\"'><strong>\"+GroupName+\" Members</strong>\"+\n \"</a> &mdash; <a href='http://www.hackforums.net/managegroup.php?action=joinrequests&gid=\"+GroupID+\"'><strong>\"+GroupName+\" Requests</strong></a>\";\n // Set string\n $(\"#panel\").html($(\"#panel\").html().replace(regex,revised));\n}", "function UserInput(output) {\n document.getElementById(\"password\").passwordText = output;\n}", "function lemurlog_DoWriteLogFile(fileName, text) {\n lemurlog_WriteLogFile(fileName, text);\n lemurlog_checkAutoUpload();\n}", "function writePassword() {\r\n\r\n var password = generatePassword(),\r\n passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}", "function writePassword() {\n var password = generatePassword();\n\n // Password text variable\n var passwordText = document.querySelector(\"#password\");\n\n // Add password text to generate password\n passwordText.value = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n }" ]
[ "0.62037545", "0.53616905", "0.52396667", "0.50990146", "0.5084172", "0.49879867", "0.498514", "0.48903754", "0.48853266", "0.4776267", "0.47360915", "0.47262654", "0.47111598", "0.47035947", "0.46851814", "0.46804005", "0.46784398", "0.46781746", "0.46480966", "0.464793", "0.46460438", "0.46284407", "0.46267122", "0.46249712", "0.46148068", "0.4605309", "0.45820898", "0.45655435", "0.45593634", "0.45476687", "0.4524585", "0.44935578", "0.44738767", "0.4466515", "0.44578445", "0.44568953", "0.4456367", "0.44533575", "0.4452399", "0.44500706", "0.44430068", "0.44412035", "0.44219646", "0.44082502", "0.44060898", "0.4406083", "0.4404787", "0.44040003", "0.44011068", "0.44009587", "0.44007358", "0.4400208", "0.43999884", "0.43948573", "0.43908966", "0.43904716", "0.4385228", "0.43835926", "0.43801844", "0.43784073", "0.43771356", "0.4375499", "0.43743518", "0.43703786", "0.43693045", "0.43668804", "0.43666726", "0.43618065", "0.4361558", "0.43595484", "0.43584365", "0.43512884", "0.43431622", "0.43414205", "0.4336694", "0.4336392", "0.4334575", "0.43341514", "0.43339643", "0.43337277", "0.43307504", "0.43302372", "0.43265274", "0.43253586", "0.43252057", "0.4323785", "0.43222928", "0.43215632", "0.4321351", "0.43183288", "0.4315599", "0.43142483", "0.43124178", "0.43115038", "0.4309579", "0.43092468", "0.43055695", "0.43017763", "0.43006888", "0.43006295" ]
0.66550815
0
if the player enters the command SHOW
function commandShow(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { let currentPlayer = playerfound; let currentRoom = currentPlayer.room; var output; // if the player stands in the admin folder if(currentRoom == "/root/users/admin") { // I made it possible to easily add other admin commands switch(parameter) { case "HIDDEN-FILES": Player.findOneAndUpdate({ 'playerID': player_ID }, { hiddenFiles: true }, { new: true, useFindAndModify: false }, function(err, updatedPlayer) { if(err) console.error(err); if(updatedPlayer) { updatedPlayer.save(function(err) { if(err) console.error(err); output = "SHOWING " + parameter; }); } }); break; // if player enters a wrong admin command default: output = "INPUTERROR > COMMAND NOT FOUND: " + parameter; break; } // if player is not standing in the admin folder } else { output = "YOU NEED ADMIN PERMISSION FOR THIS ACTION"; } executeCommand([output], currentRoom); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function show() {\n Onyx.set(ONYXKEYS.IS_CHAT_SWITCHER_ACTIVE, true);\n}", "function show() {\n\t\tif (self.shown && self.valid) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (!self.shown) {\n\t\t\t$(\"#\" + self.targetDivId).append(\"<div id='\" + self.targetDivId + \"-video'></div><p>Press the TAB key to pause/play.<br/>Press ALT-LeftArrow to skip back 5 seconds</p>\");\n\t\t\t\n\t\t\tif (dataManager.gameVideos != undefined) {\n\t\t\t\t\n\t\t\t\tdataManager.viewer.setNetEventHighlighting(false);\n\t\t\t\tvar player = new StatPlayer({\n\t\t\t\t\tid: self.targetDivId + \"-video\", \n\t\t\t\t\tdataManager: dataManager,\n\t\t\t\t\tdrawGameState: true,\n\t\t\t\t\tmode: StatPlayer.LIVE_VIEW_MODE,\n\t\t\t\t\texistingViewer: dataManager.viewer,\n\t\t\t\t\tcondenseChecked: false,\n\t\t\t\t\trestoreVideoTime: true,\n\t\t\t\t\tisServer: false\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$(\".newLink\").click(function () {\n\t\t\t\t\tplayer.persistTime();\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tvar firstLevelGrouping = dataManager.groupings[dataManager.game.associatedEvent];\n\t\t\t\tvar firstLevelGroupingType = dataManager.groupingTypes[firstLevelGrouping.myType];\n\t\t\t\tvar associateMessage = \"There is no video associated to this \" + firstLevelGroupingType.name;\n\t\t\t\t\n\t\t\t\tassociateMessage += \"<br/><br/><a href='../video/videos.htm?season=\" + firstLevelGrouping.ourSeason + \"&returnTo=\" + firstLevelGrouping.associatedEvent + \"'>Click here</a> to associate a video to it.\";\n\t\t\t\t\n\t\t\t\t$(\"#\" + self.targetDivId + \"-video\").append(associateMessage);\n\t\t\t}\n\t\t}\n\t\t\n\t\tself.shown = true;\n\t\tself.valid = true;\n\t}", "show() { return this.tellModule(\"show\") }", "show() {\n this.visible = true;\n if (this.config.pauseGame) {\n ns.game.paused = true;\n }\n }", "function show() {\n window.extensions.KJSLINT.KomodoAdaptor.showCommandPanel();\n }", "static showGame() {\n document.getElementById('js-player-selection').style.display = 'none';\n document.getElementById('js-game-info').style.display = 'block';\n }", "function show() {\n\t\tinit(username, socketId);\n\t}", "show(game){\n super.show(game)\n // go away when not active\n if(game.game_state !== \"active\"){\n this.clear();\n return\n }\n this._INFO_ID.innerText = game.id;\n if (game.active)\n this._INFO_LIVES.innerText = game.lives;\n else\n this._INFO_LIVES.innerText = game.game_state;\n this._make_visible(this._HTML_BODY)\n }", "show(player) {\n MarchingOrder.utils.Chat.whisper(player, this.html);\n }", "isShown() { return (Handler.activeInstances[this.handler.label]) ? true : false; }", "function showGameStatus() {\n document.getElementById(\"pairs_clicked\").innerHTML =\n memoryGame.pairsClicked;\n document.getElementById(\"pairs_guessed\").innerHTML =\n memoryGame.pairsGuessed;\n }", "showInfo() {\n let venusInfo;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // Venus infos\n venusInfo = createGraphics(280, 250);\n venusInfo.fill(green.r, green.g, green.b);\n venusInfo.background(20, 220);\n venusInfo.textSize(10);\n venusInfo.textFont(globalFont);\n venusInfo.textAlign(LEFT);\n venusInfo.text(this.info, 10, 20, 260, 250);\n texture(venusInfo);\n\n // Calling the superclass Planet.js' showInfo method\n super.showInfo();\n pop();\n }\n }\n }", "function handleShow(game) {\n return game ? boardToSlack(game) : \"No active game!\";\n}", "get isShow() {\n return this.isStage(STAGE.shown);\n }", "function showText() {\n\tfiglet('Twitch', function(err, data) {\n\t if (err) {\n\t console.log('Something went wrong...');\n\t console.dir(err);\n\t return;\n\t }\n\t console.log(data);\n\t console.log(' Twitch streamers status '.inverse + '\\r\\n');\n\t //console.log('loading...');\n\t});\n}", "function advertise_status()\n{\n\n\t if(earthnc_getUrlVariable('em'))\n\t {\n\n\t\tshow('advert_inner');\n\t }\n\t else\n\t {\n\n\t\t show('advert_inner');\n\n\t }\n\n}", "function screen() {\r\n var y = document.getElementById(\"game\");\r\n if (hunger > 0 && health > 0 && happiness > 0) {\r\n y.style.display = \"block\";\r\n } else if (hunger === 0 || health === 0 || happiness === 0) {\r\n y.style.display = \"none\";\r\n }\r\n }", "show() {\n\t\tconsole.log(`Pokemon '${this.name}', level: ${this.level}`);\n\t}", "function show(a,b,c,d,e){\n var p = document.getElementById(c);\n var k = document.getElementById(d);\n if(b==2){\n if(e == a){ /*&& (player.squad[0].MO == a|| player.squad[1].MO == a))*/\n console.log(\"debug\");\n p.style.display='inline';\n k.style.display='none';\n }\n\n }\n \n}", "function showStats() {\n // Hide in-game information\n hide(\"#in-game\");\n\n // Update stats\n $(\"#num-correct\").text(numCorrect);\n $(\"#num-incorrect\").text(numIncorrect);\n $(\"#num-unanswered\").text(numUnaswered);\n\n // Unhide post-game information\n unhide(\"#post-game\");\n }", "askForInfo(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"PLAYERS\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"CPUUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"RAMUSAGE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "function show()\n{\n update();\n}", "function handleCommand(sentence) {\n if (sentence == 'show kb') {\n alert(storage.getKnowledgeBaseAsText());\n } else if (sentence == 'show transcript') {\n alert(storage.getTranscript());\n } else {\n return false; // was not a command\n }\n}", "function showMenu() {\n if(newGame) {\n $('#main').show();\n }\n else {\n $('#end').show();\n }\n}", "function isIpodShown(){\n\treturn $('#fond_splayer').css('display') == 'block';\n}", "function saveCCStatePlayer1() {\n textTrackToShow = 0;\n for (var i = 0; i < myPlayer.textTracks().length; i++) {\n //console.log(\"Texttrack \" + i + \" showing? \" + myPlayer.textTracks()[i].mode);\n if ((myPlayer.textTracks()[i].mode) == \"showing\") {\n textTrackToShow = i;\n }\n }\n }", "async onWhoisCommand(player, targetPlayer) {\n const results = await this.database_.whois(targetPlayer.ip, targetPlayer.serial);\n if (!results.length) {\n return await alert(player, {\n title: `Who is ${targetPlayer.name}?!`,\n message: `No results were found for ${targetPlayer.name}. This might be their ` +\n `first playing session, or they're really good at hiding.`\n });\n }\n\n const dialog = new Menu(`Who is ${targetPlayer.name}?!`, [\n 'Nickname',\n 'IP match',\n 'Serial match',\n 'Last seen',\n ]);\n\n for (const result of results) {\n let nickname = '';\n if (!result.registered)\n nickname += `{BEC7CC}${result.nickname}`;\n else\n nickname += result.nickname;\n\n if (result.hits > 1)\n nickname += ` {90A4AE}(${format('%d', result.hits)}x)`;\n\n let ip = '';\n if (result.ipDistance < 3)\n ip += `{FFEE58}`;\n else if (result.ipDistance === 4)\n ip += `{BEC7CC}`;\n\n ip += result.ipMatch;\n\n let serial = '';\n if (result.serial === targetPlayer.serial)\n serial += `{FFEE58}match`;\n else\n serial += `{BEC7CC}no match`;\n\n if (result.serialCommon)\n serial += ` {FF7043}(common)`;\n\n const lastSeen = fromNow({ date: result.lastSeen });\n\n dialog.addItem(nickname, ip, serial, lastSeen);\n }\n\n await dialog.displayForPlayer(player);\n }", "function displaySpotify() {\n if (process.argv[3]) {\n spotifySong = process.argv[3];\n }\n spotify\n .search({ type: 'track', query: spotifySong })\n .then(function (response) {\n\n dataOutPut = \"\\n\" + commandRequest + \"\\n---------------------------------------------------------------------------------------------------------------------------------\" +\n \"\\nArtist(s): \" + response.tracks.items[0].artists[0].name + \"\\n\" +\n \"\\nSong: \" + response.tracks.items[0].name + \"\\n\" +\n \"\\nPreview: \" + response.tracks.items[0].preview_url + \"\\n\" +\n \"\\nAlbum: \" + response.tracks.items[0].album.name + \"\\n\" +\n \"---------------------------------------------------------------------------------------------------------------------------------\";\n logOutPut();\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function showHelp() {\n console.debug(\"showing map in Alert Panel\")\n\n // Does the user has enough points ?\n if (game.score < 500) {\n console.debug(\"not enough points to show the map\")\n showInstructions(\"sorry you don't have enough points\")\n return\n }\n\n // Remove 500 points\n game.updateScore(-500)\n\n // The maze needs to be wrapped as In-Room Controls do not support multi-lines\n // Each line's width depends on the device: 51 for Touch10 dispay, 31 for Screen display\n xapi.status.get(\"SystemUnit ProductPlatform\").then((product) => {\n console.debug(`running on a ${product}`)\n\n let width = 40 // when the Alert is shown on a Touch 10\n if (product == \"DX80\") {\n console.debug('has no Touch10 attached')\n width = 31 // when the Alert is shown on a screen\n }\n\n // show Alert panel \n xapi.command('UserInterface Message Alert Display', {\n Title: 'With a little help from ... the bot',\n Text: game.buildMapAsWrapped(width, true),\n Duration: 5\n }).then(() => {\n showScore()\n })\n })\n}", "function displayPlayer() {\n\t$player = $('#player');\n\t$player.empty()\n\t\t.append(addHeader('PLAYER'))\n\t\t.append(`Health : ${player.health.now} / ${player.health.max}`)\n\t\t.append(`<br>Energy : ${player.energy.now} / ${player.energy.max}`)\n\t\t.append(`<br>Weight : ${player.weight.now} / ${player.weight.max}`);\n\n\tif(player.primary === 'None')\n\t\t$player.append('<br><br>Primary : None');\n\telse $player.append(`<br><br>Primary : ${itemLink(player.primary)}`);\n\t\n\tif(player.secondary === 'None')\n\t\t$player.append('<br>Secondary : None');\n\telse $player.append(`<br>Secondary : ${itemLink(player.secondary)}`);\n}", "show() {}", "handShowing() {\n\t\tif ($('#hand:visible').length > 0) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "async show() {\n \n }", "function showMissionOjbective() {\n game.GUI.showNotification('Your mining station is under attack!');\n game.GUI.showMinimapNotification({\n x: 800,\n y: 1750,\n });\n }", "function heroInfo(){\nconsole.log('Dont show');\n\n}", "show() {\n\n }", "show() {\n if (!this[$visible]) {\n this[$visible] = true;\n this[$updateVisibility]({ notify: true });\n }\n }", "function gameStatus(dachi){\n if(dachi.energy >= 100 && dachi.fullness >= 100 && dachi.happiness >= 100){\n console.log(\"Win\");\n $(\".reaction\").text(\"You won !\");\n $(\"#feed\").hide();\n $(\"#play\").hide();\n $(\"#work\").hide();\n $(\"#sleep\").hide();\n $(\"#restart\").show();\n } else if (dachi.fullness <= 0 || dachi.happiness <= 0){\n console.log(\"Loss\");\n $(\".reaction\").text(\"You lost !\");\n $(\"#feed\").hide();\n $(\"#play\").hide();\n $(\"#work\").hide();\n $(\"#sleep\").hide();\n $(\"#restart\").show();\n }\n }", "function Insomniac(position,game){\n return game.play({position,action:\"show\",players:[position]});\n}", "function __showTitleScreen() {\n var HUDEl = canvasModalWidget.get2DCanvasEl();\n\n // clear the 2D canvas before drawing our stats!\n canvasModalWidget.clearHUDCanvas();\n\n __HUDContext.font = '14px \"Verdana\"';\n __HUDContext.fillStyle = 'rgba(255, 255, 255, 1.0)'; // Set the font colour\n __HUDContext.fillText('Pong', 135, 100);\n\n __HUDContext.fillStyle = 'rgba(204, 229, 255, 1.0)';\n __HUDContext.fillText('GL', 170, 100);\n\n __HUDContext.fillStyle = 'rgba(255, 204, 204, 1.0)';\n __HUDContext.font = '10px \"Verdana\"';\n\n // display the right messaging\n if (__isGamePaused() === true && __hasGameStarted) {\n __HUDContext.fillText('Press Space Bar/Click to unpause...', 70, 115);\n }\n else { // game intro messaging\n __HUDContext.fillText('Press Space Bar/Click to start...', 80, 145);\n }\n\n // show the 2D HUD Canvas\n canvasModalWidget.showHUDCanvas();\n }", "function showPlayerCave() {\n lime.scheduleManager.callAfter(function () {\n playerImgCave.setHidden(false);\n lime.scheduleManager.callAfter(function () {\n playerImgCave.setHidden(true);\n }, this, 4000)\n }, this, 3000)\n\n }", "function showWhenReady() {\n var seconds = self.video.time();\n if (parseFloat(seconds) > startPoint) {\n $loading.remove();\n self.show(callback);\n self.video.removeEvent(\"playback\", showWhenReady);\n }\n }", "function logPlayerStatus() {\n console.table(getPlayerStatus());\n}", "function showTeamMembers() {\n if (scoreBoard.value == false) {\n areTeamMembersVisible.value = true;\n self.areTeamMembersVisible = areTeamMembersVisible;\n $log.log('team members are now visible');\n }\n }", "function display_user() {\r\n show(user);\r\n hide(admin);\r\n}", "function displayStatus() {\n Reddcoin.messenger.getconnectionState(function(data){\n Reddcoin.viewWalletStatus.getView(data);\n\n Reddcoin.messenger.getReleaseVersion( function(data) {\n Reddcoin.viewWalletStatus.getView(data);\n });\n });\n}", "function gsSERVE(){\r\n gameState = SERVE\r\n InfoScreen.visible = false;\r\n CancelButton.hide();\r\n NextButton.hide();\r\n PreviousButton.hide();\r\n nextIcon.visible =false;\r\n previousIcon.visible = false;\r\n StartButton.show();\r\n displayName.show();\r\n }", "function showHelp() {\n console.log(\"showing map in Alert Panel\")\n\n // Width depends on device\n // [TODO] check device\n xapi.status.get(\"SystemUnit ProductPlatform\").then((product) => {\n console.debug(`running on a ${product}`)\n \n let width = 51 // when the Alert is shown on a Touch 10\n if (product == \"DX80\") {\n console.debug('has no Touch10 attached')\n width = 31 // when the Alert is shown on a screen\n }\n\n // show Aletr panel \n xapi.command('UserInterface Message Alert Display', {\n Title: 'With a little help from ... the bot',\n Text: game.buildMapAsWrapped(width, true),\n Duration: 5\n })\n })\n}", "function showGUI (e) {\r\n \r\n clearTimeout(logoTimeout);\r\n\r\n // Hide logo and info after 3s\r\n logoTimeout = setTimeout(function(){\r\n $('#player-logo')\r\n .add('#presentation-info').removeClass('show')\r\n }, 5000);\r\n\r\n if ( EM.compatibility.getDevice() === \"tablet\" ){\r\n $('#buttonsPanel')\r\n .add('#player-logo')\r\n .add('#presentation-info')\r\n .add('.leftButton')\r\n .add('.rightButton')\r\n .add('#menu-container').addClass('show tablet');\r\n\r\n $('#timelinebutton').addClass('show hometablet');\r\n\r\n } else {\r\n $('#buttonsPanel')\r\n .add('.leftButton')\r\n .add('.rightButton')\r\n .add('#menu-container')\r\n .add('#timelinebutton').addClass('show');\r\n\r\n // Click is triggering tap, and we want to disable logo and info\r\n // visibility to once, so it won't trigger on clicks\r\n if ( !limitShowInDesktop ){\r\n $('#player-logo').add('#presentation-info').addClass('show');\r\n limitShowInDesktop = true;\r\n }\r\n }\r\n\r\n }", "function singlePlayer(){\n toggleDisplayBlock('mode'); \n toggleDisplayNone('modePlay');\n toggleDisplayNone('startmultiplayer');\n toggleDisplayBlock('startsingleplayer'); \n toggleDisplayBlock('computerturn'); \n toggleDisplayNone('OpponentTurn'); \n toggleDisplayBlock('quit'); \n toggleDisplayNone('quitonline'); \n tab_highs();\n}", "function display_admin() {\r\n show(admin);\r\n hide(user);\r\n}", "function showStatus() {\n\t$('#status').show();\n}", "function playingTheMachine() {\n return opponentInfo.name == \"Stockfish\";\n }", "function showHelp() {\n\tvar missions, history, population, village;\n\tmissions = $(\"#missions\");\n\thistory = $(\"#history\");\n\tpopulation = $(\"#population\");\n\tvillage = $(\"#village\");\n\n\tif(missions) {missions.css(\"display\",\"none\");}\n\tif(history) {history.css(\"display\",\"none\");}\n\tif(population) {population.css(\"display\",\"none\");}\n\tif(village) {village.css(\"display\",\"none\");}\n\n\t$(\"#help\").css(\"display\",\"block\")\n}", "function showMeTheDescription(target) {\n if (target.equipment) return socket.emit('generalMessage', {playerDescription: target.description, name: target.username, equipment: target.equipment});\n socket.emit('generalMessage', {feedback: target.description});\n }", "show() {\n if (!this.facingCamera || !this.initialized) {\n this.updateVisibility(true);\n }\n }", "function displayWin() {\n $(\"#winner-message\").show();\n }", "function displayInterface(){\n\t$('.user-info').css('display', 'block');\n\t$('.user-tracks').css('display', 'block');\n\t$('.current-user').css('display', 'block');\n\t$('.data-display').css('visibility', 'visible');\n\tsetTimeout(() => {\n\t\t$('.user-info').css('opacity', '1');\n\t\t$('.user-tracks').css('opacity', '1');\n\t\t$('.current-user').css('opacity', '1');\n\t\t$('.data-display').css('opacity', '1');\n\t\tif(g_cache.user_history.length > 1){\n\t\t\t$('.back-button').css('transform', 'translate3d(0px, 0px, 0px)');\n\t\t\t$('.back-button').css('opacity', '1');\n\t\t}else{\n\t\t\t$('.back-button').css('transform', 'translate3d(-50px, 0px, 0px)');\n\t\t\t$('.back-button').css('opacity', '0');\n\t\t}\n\t}, 100);\n}", "async onShow() {\n\t}", "function debugPlayer(){\n\tcurrentPlayer = gameSession.getCurrentPlayer();\n\tTi.API.info('Current player is '+currentPlayer.name+' with '+currentPlayer.score+' score, '+currentPlayer.lives+' lives and '+currentPlayer.consecutiveCorrect+' consecutive corrects');\n}", "function displayScene() {\n var para = document.querySelector (\"#descrip\");\n para.textContent = \"You are in the \" + player.currLoc.name + \"-\" + \"\\n\" + \n player.currLoc.description + \".\" + \"\\n\" +\n \"The items you can take are: \" + player.currLoc.items \n}", "showState(e){\n let nextPlayer = 3-(e.currentPlayer);\n if(nextPlayer == 1){\n //red\n $(this.$parentElem).find(\".infoField\").removeClass(\"alert-warning\");\n $(this.$parentElem).find(\".infoField\").addClass(\"alert-danger\");\n }else{\n //yellow\n $(this.$parentElem).find(\".infoField\").removeClass(\"alert-danger\");\n $(this.$parentElem).find(\".infoField\").addClass(\"alert-warning\");\n\n }\n $(this.$parentElem).find(\".infoField\").text(\"Spieler Nr. \" + nextPlayer + \" ist an der Reihe\");\n }", "function current_player_show(){\n\t\n\tif ( player1 === true ) {\n\t\tcurrent_player.removeClass(\"sox\")\n\t\tcurrent_player.addClass(\"snowy\")\n\t} else if ( player1 === false ) {\n\t\tcurrent_player.removeClass(\"snowy\")\n\t\tcurrent_player.addClass(\"sox\")\n\t }\n\n}", "show(game){\n super.show(game)\n let end_text;\n let color;\n // Should not show on active\n if(game.game_state === \"active\") throw new Error('Should not show on active games');\n\n if(game.game_state == 'won'){\n end_text = `Winner: Password was \"${game.password}\"`;\n color = ' is-success';\n } else if (game.game_state == 'lost'){\n end_text = `Game Over: Password was \"${game.password}\"`;\n color = ' is-danger';\n }\n this._clean();\n this._make_visible(this._HTML_BODY);\n this._END_BANNER.className = this._END_BANNER.className += color;\n this._END_BANNER.innerText = end_text;\n }", "function menu(msg) {\n let player = getObj('player', msg.playerid);\n CustomStatusMarkers.Wizard.show(player);\n }", "show() {\n if (this.curriculum === Curriculum.QUICK_ORIENTATION ||\n this.curriculum === Curriculum.TOUCH_ORIENTATION) {\n // If opening the tutorial from the OOBE, automatically show the first\n // lesson.\n this.updateIncludedLessons_();\n this.showLesson_(0);\n } else {\n this.showMainMenu_();\n }\n this.isVisible = true;\n }", "function IsShowPage(name){\n\tif(gDevice.devType == devTypeEnum.DEV_IPC){\n\t\treturn 1;\n\t}\n\t\n\tif(name == \"chn_live\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif(((gDevice.devState[i].Abilities>>AbilityTypeEnum.OSD) & 1) == 1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"chn_sp\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif(((gDevice.devState[i].Abilities>>AbilityTypeEnum.COVER) & 1) == 1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"main_stream_set\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i) || (gVar.bC0_0305_3120101 && gDevice.isSleep(i))){\t\n\t\t\t\tif((((gDevice.devState[i].Abilities>>AbilityTypeEnum.MAINSTREAM) & 1) == 1 &&gDevice.devState[i].NewDevAbilityModeFlag != 1) ||(gDevice.devState[i].NewDevAbilityModeFlag == 1&&((gDevice.devState[i].Abilities>>AbilityTypeEnum.NOSUPMAINSTREAMPARAM) & 1) == 0)){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"substream\" || name == \"sub_stream_set\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif((((gDevice.devState[i].Abilities>>AbilityTypeEnum.SUBSTREAM) & 1) == 1&&gDevice.devState[i].NewDevAbilityModeFlag != 1) || (gDevice.devState[i].NewDevAbilityModeFlag == 1&&((gDevice.devState[i].Abilities>>AbilityTypeEnum.NOSUPSUBSTREAMPARAM) & 1) == 0)){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"mobistream\" || name == \"mobile_stream_set\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif((((gDevice.devState[i].Abilities>>AbilityTypeEnum.SNAPSTREAM) & 1) == 1&&gDevice.devState[i].NewDevAbilityModeFlag != 1) || (gDevice.devState[i].NewDevAbilityModeFlag == 1&&((gDevice.devState[i].Abilities>>AbilityTypeEnum.NOSUPMOBILESTREAMPARAM) & 1) == 0)){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"chn_yt\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(/*gDevice.isOnline(i)*/1)\t\n\t\t\t\tif(/*((gDevice.devState[i].Abilities>>10) & 1) == 1*/1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"alarm_mv\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i) || gDevice.isSleep(i))\t\n\t\t\t\tif((gDevice.devState[i].Abilities>>AbilityTypeEnum.MOTIONSET) & 1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Img_Ctrl\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif(gDevice.devState[i].Abilities>>AbilityTypeEnum.IMAGE&1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Capture_Set\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"GoodsLost_Legacy\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\tif(gDevice.devType == devTypeEnum.DEV_HDVR){\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT)){//switch\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT) && gDevice.hasIntelligentAbilities(i,PageIntelligentEnum.SOD)){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Perimeter_Line\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\tif(gDevice.devType == devTypeEnum.DEV_HDVR){\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT)){//switch\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT) && gDevice.hasIntelligentAbilities(i,PageIntelligentEnum.LCD)){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Perimeter_Zone\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\tif(gDevice.devType == devTypeEnum.DEV_HDVR){\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT)){//switch\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT) && gDevice.hasIntelligentAbilities(i,PageIntelligentEnum.PID)){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Human_Detection\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\tif(gDevice.devType == devTypeEnum.DEV_HDVR){\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT)){//switch\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT) && gDevice.hasIntelligentAbilities(i,PageIntelligentEnum.PD)){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Face_Detection\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\tif(gDevice.devType == devTypeEnum.DEV_HDVR){\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT)){//switch\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT) && gDevice.hasIntelligentAbilities(i,PageIntelligentEnum.FD)){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"People_Cross_Counting\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i)){\n\t\t\t\tif(gDevice.devType == devTypeEnum.DEV_HDVR){\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT)){//switch\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tif(gDevice.hasAbility(i,AbilityTypeEnum.INTELLIGENT) && gDevice.hasIntelligentAbilities(i,PageIntelligentEnum.CC)){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"sysinf_smart\"){//HDVR\n for (var i = gDevice.loginRsp.AnalogChNum; i<gDevice.loginRsp.ChannelNum; i++){\n if(gDevice.isOnline(i)){\n return 1;\n }\n }\n return 0;\n }else if(name == \"alarm_pir\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif((gDevice.devState[i].Abilities>>AbilityTypeEnum.PIR) & 1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"flood_lightmulchn\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif((gDevice.devState[i].Abilities>>AbilityTypeEnum.WHITE_LIGHT) & 1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"AF_controls\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\tif((gDevice.devState[i].Abilities>>AbilityTypeEnum.AFOCUS) & 1){\n\t\t\t\t\treturn 1;\n\t\t\t\t}\n\t\t}\n\t\treturn 0;\n\t}else if(name == \"Alarm_ODSwitch\"){\n\t\tfor (var i=0; i<gDevice.loginRsp.ChannelNum; i++){\n\t\t\tif(gDevice.isOnline(i))\t\n\t\t\t\treturn 1;\n\t\t}\n\t\treturn 0;\n\t}\n\treturn 1; \n\n}", "function showResult(scope) {\n\t/** To show the result */\n ( scope.showresult == true )?scope.hide_show_result = true:scope.hide_show_result = false; \n}", "showAll() {\n if (app.startHP > 0) {\n $('.card-unmatched').css('opacity', 1);\n setTimeout(function () {\n $('.card-unmatched').css('opacity', 0);\n }, 2000);\n app.startHP -= 5;\n $('#hp').html('HP: ' + app.startHP);\n } else app.checkLose();\n }", "function showChatWizContainer() {\n\t\t\t\tlogger.debug(\"showChatWizContainer\");\n\t\t\t\tsendPostMessage({\"lpEmbChatWiz\": \"LPNVPF\", \"CMD\" : \"CONTROL\", \"value\" : \"SHOW_CONTAINER\"});\n\t\t\t}", "function showPlayer(){\n\t\t$(this).prev('.wpaudio-container').find('.wpaudio-slide').fadeIn();\n\t}", "function status() {\n console.log(`Active : ${game.active}`)\n console.log(`Points : ${game.points}`)\n console.log(`Strikes : ${game.strikes} out of ${game.maxStrikes}`)\n console.log(`Passes : ${game.passes} out of ${game.maxPasses}`)\n console.log(`Words : ${game.words}`)\n console.log(`Word : ${game.word}`)\n console.log(`Scrambled : ${game.scrambled}`)\n }", "async displayInfo(currentPlayer, targetPlayer) {\n const player = targetPlayer || currentPlayer;\n const information = await this.database_.getAccountInformation(player.account.userId);\n if (!information) {\n return alert(player, {\n title: 'Account information of ' + player.name,\n message: 'The information could not be retrieved. Note that this feature is not ' +\n 'available on the staging and local servers.',\n });\n }\n\n const display = new Menu('Account information of ' + player.name, [\n 'Property',\n 'Value',\n ]);\n\n display.addItem('Username', information.username);\n display.addItem('E-mail', information.email);\n display.addItem('Registered', formatDate(information.registered, true));\n display.addItem('Level', information.level);\n display.addItem('Karma', format('%d', information.karma));\n display.addItem('----------', '----------');\n\n // The financial information of an account is only accessible by the player themselves, or\n // by Management members who have ways of getting it anyway.\n const canAccessFinancialInformation =\n currentPlayer.isManagement() || player === currentPlayer;\n\n if ((information.vip || information.donations > 0) && canAccessFinancialInformation) {\n const donations = format('%$', information.donations).replace('$', '') + ' euro';\n\n display.addItem('VIP', information.vip ? 'Yes' : 'No');\n display.addItem('Donations', donations);\n display.addItem('----------', '----------');\n }\n\n display.addItem('Sessions', information.sessions);\n\n await display.displayForPlayer(currentPlayer);\n }", "information() {\n if (this.over()) {\n this.info.innerHTML = 'Joueur ' + this.activePlayer.id + ' vous avez gagné !';\n this.info.classList.add('alert-success');\n this.alert.classList.remove('show');\n } else {\n this.info.innerHTML = `C'est à vous de jouez : joueur ` + this.activePlayer.id;\n }\n\n player1.description();\n player2.description();\n }", "function _sh_overview_showing(){\n\tin_overview = true;\n\twrap_plane_clone.visible = true;\n\tpaused_preserve = (paused == undefined) ? false : paused;\n\tresume();\n}", "function show() {\n const toShow = document.querySelector(\".show\");\n const showBlock = document.querySelector(\".currentDisplay\");\n showBlock.innerHTML = (toShow.innerHTML)\n}", "function showPresenceExamples(msg) {\n showPresenceConsole(msg);\n\n document.querySelector('.presence').classList.remove('two');\n document.querySelector('.presence strong').textContent = msg.occupancy;\n document.querySelector('.presence span').textContent = 'player';\n\n if (msg.occupancy > 1) {\n document.querySelector('.presence span').textContent = 'players';\n document.querySelector('.presence').classList.add('two');\n }\n }", "function displayLost() {\n\tif (!modeGOT) {\n\t\t$txt.style.color = \"orange\";\n\t\t$txt.innerHTML = \"Essaie encore\".toUpperCase();\n\t\t$ostMain.pause();\n\t\t$ostGameover.play();\n\t}\n}", "function checkshowParts(args){\n\tvar p = args[0];\n\tvar checked = args[1];\n\t\n\tviewerParams.showParts[p] = checked;\n\tviewerParams.updateOnOff[p] = true;\n}", "function showPlayerControls() {\n\tif(!controlsVisible) {\n\t\t$(\".playerArea\").show(200, \"swing\");\n\t\tcontrolsVisible = true;\n\t}\n}", "function mostrarHoteles() {\n if (mostraStatus) {\n mostrarHotelesActivados();\n } else {\n mostrarHotelesDesactivados();\n }\n}", "function on_paint()\n{\n var scoped = entity_get_prop(entity_get_local_player(), \"CCSPlayer\", \"m_bIsScoped\");\n\n if (ui_is_menu_open() || !entity_is_alive(entity_get_local_player()) || !entity_get_local_player()) return;\n ui_set_value(\"Visual\", \"SELF\", \"Chams\", \"Configure\", 0);\n ui_set_value(\"Visual\", \"SELF\", \"Chams\", \"Visible override\", scoped ? false : true);\n}", "function respond(show){\n let lastErrId = '';\n // if the venue has a show, reply with message containing show name\n if(show != null){\n let message = '@' + username + ' ' + show;\n checkThenPost(message);\n } else {\n // if there is no show or something went wrong, reply with error message\n let message = somethingWrong;\n checkThenPost(message);\n }\n return;\n }", "function shown(model) {\n return bool_flag_exists(/* InternalPowerEnabled */0, model);\n }", "function ShowName(){\r\n SaveName.hide();\r\n displayName.html(\"HELLO \"+NameBar.value())\r\n displayName.position(100,height/2-190);\r\n displayName.style('color',col)\r\n displayName.style('color', 'white');\r\n displayName.style('font-size', '100px');\r\n NameBar.hide();\r\n StartButton.show();\r\n title.hide();\r\n InfoButton.show();\r\n gameState = \"NAMEHIDE\"\r\n\r\n}", "function showWhatToExpect() {\n $(\"#start-screen\").hide();\n $(\"#what-to-expect\").show();\n $(\"#tips\").hide();\n $(\"#question-display\").hide();\n $(\"#question-result-display\").hide();\n $(\"#test-result-display\").hide();\n }", "showInfo() {\n let saturnInfo;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // Saturn infos\n saturnInfo = createGraphics(280, 250);\n saturnInfo.fill(green.r, green.g, green.b);\n saturnInfo.background(20, 220);\n saturnInfo.textSize(10);\n saturnInfo.textFont(globalFont);\n saturnInfo.textAlign(LEFT);\n saturnInfo.text(this.info, 10, 20, 260, 250);\n texture(saturnInfo);\n\n // Calling the superclass Planet.js' showInfo method\n super.showInfo();\n pop();\n }\n }\n }", "function displayWin() {\n\tif (modeGOT) {\n\t\t$txt.style.color = \"skyblue\";\n\t\t$txt.innerHTML = \"Frog King\".toUpperCase();\n\t\t$gotOstMain.pause();\n\t} else {\n\t\t$txt.style.color = \"green\";\n\t\t$txt.innerHTML = \"Bravo !\".toUpperCase();\n\t\t$ostMain.pause();\n\t}\n\t$ostWin.play();\n}", "function showInfoConsole(){\n var msg = clc.xterm(221);\n console.clear;\n console.info(\" Transmission Node Rest Made by \"+msg('RaulGF92')+\" \");\n console.info(\" ---------------------------------------------------------\");\n console.info(\" | [Transmission Node Rest] is listenning on PORT \"+clc.red('8888')+\" |\");\n console.info(\" ---------------------------------------------------------\");\n console.info(\" Server transmission Info: (change:\"+change+\") \");\n console.info(\"\");\n console.info(server);\n}", "function showlog(status) { }", "function displayHelpText() {\n console.log();\n console.log(' Usage: astrum figma [command]');\n console.log();\n console.log(' Commands:');\n console.log(' info\\tdisplays current Figma settings');\n console.log(' edit\\tedits Figma settings');\n console.log();\n}", "async showActive() {\n await this.model.read({ completed: false }, (data) => {\n this.view.render('showEntries', data);\n });\n }", "function showChat() {\n\tmenuHideAll();\n\t$('#chat').show();\n\tmenuResetColors();\n\tmenuSetColor('chatBox');\n}", "onLoad(evt) {\n show(evt, option);\n }", "function showButtons() {\n // when users are not connected, we want start game button disabled\n // document.getElementById('start-game').style.display = 'inline';\n\n document.getElementById('button-invite').style.display = 'inline';\n // document.getElementById('button-preview').style.display = 'inline';\n document.getElementById('grab-username').style.display = 'inline';\n document.getElementById('username').style.display = 'inline';\n document.getElementById('invite-to').style.display = 'inline';\n\n // document.getElementById('end-call').style.display = 'none';\n\n // ensure that local media removes on firefox\n $('#local-media > video').remove();\n }", "showTileBeforeHiding() {\n const openTiles = this.getNumberOfOpenTiles();\n if (openTiles == 2) {\n setTimeout(() => {\n this.channel.push(\"hide\", {}).receive(\"ok\", response => {\n this.setState(response.game);\n });\n }, 1000);\n }\n this.hasGameEnded();\n }", "function displayHelp() {\n if (!paused) {\n start();\n }\n modal.style.display = 'block';\n}", "function message() {\r\n var z = document.getElementById(\"dead\");\r\n if (hunger > 0 && health > 0 && happiness > 0) {\r\n z.style.display = \"none\";\r\n } else if (hunger === 0 || health === 0 || happiness === 0) {\r\n z.style.display = \"block\";\r\n }\r\n }", "function win() {\r\n if(playerHasSword===true && playerHasSelfConfidence===true && playerHasShortBlade===true && playerHasWD40===true && currentlocation===10) {\r\n var msg = \"You crawl through the ductwork and see your target. Quickly jumping down, you wound him with the short blade. He lashes out and strikes you back while drawing his sword. You draw the Sword of Aquilius and attack. After a brief battle, LaFontanue knocks the sword from your hand and prepares to run your through. At the last second, you extend your hidden blade and plunge it into his throat, killing him. Your mission is complete. Congratulations.\";\r\n updateText(msg);\r\n }\r\n }", "function Info() {\n\t//Loads team editor scene\n\tApplication.LoadLevel(\"Info\");\n}" ]
[ "0.62580127", "0.61857796", "0.61606866", "0.6134515", "0.6127856", "0.61219954", "0.6091818", "0.596918", "0.59690094", "0.5949557", "0.5934529", "0.5898142", "0.5892443", "0.58857393", "0.5884956", "0.5881502", "0.58754617", "0.58293945", "0.58037513", "0.5799376", "0.57992345", "0.5787951", "0.57481515", "0.57463044", "0.5712481", "0.5695579", "0.5689565", "0.5688563", "0.5682307", "0.5681467", "0.56810766", "0.5672455", "0.56630206", "0.5657235", "0.56478727", "0.5645688", "0.56389785", "0.56291467", "0.56213295", "0.5619296", "0.560782", "0.56007975", "0.558568", "0.55759245", "0.55756307", "0.5563785", "0.556286", "0.555816", "0.55427766", "0.5536573", "0.55337924", "0.5520192", "0.5519334", "0.55151594", "0.551352", "0.5501446", "0.54954606", "0.5495343", "0.5495146", "0.54884666", "0.5481518", "0.54784894", "0.54778093", "0.5475919", "0.5475906", "0.54743975", "0.54661906", "0.5462002", "0.545807", "0.5453886", "0.54477316", "0.54432905", "0.5443021", "0.5436567", "0.54352945", "0.54249126", "0.5423376", "0.5422143", "0.54173845", "0.5411137", "0.540882", "0.5408819", "0.5408572", "0.5406948", "0.5398942", "0.53885007", "0.5388015", "0.5386469", "0.53855973", "0.53793484", "0.53782195", "0.53751755", "0.53745884", "0.5373282", "0.5371501", "0.53712595", "0.5369799", "0.53687125", "0.5367984", "0.53669155" ]
0.55785173
43
if the player enters the command KILL SYSTEM
function commandKillcode(game_ID, player_ID, parameter, executeCommand) { getPlayer(player_ID, function(playerfound) { let currentRoom = playerfound.room; let output = null; if(currentRoom == "/root") { if(parameter == "SYSTEM") { output = "SYSTEM SHUTDOWN"; // if the player is not standing in the root } else { output = "CANNOT KILL THAT, I CAN ONLY KILL THE SYSTEM"; } } executeCommand([(output) ? output : "READ THE INSTRUCTIONS MORE CAREFULLY"], currentRoom); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "kill()\n {\n // Say some shit u died whataver\n\n }", "kill() {\r\n clearInterval(this.marketChecker);\r\n clearInterval(this.spin);\r\n throw new error(\"Killed script\");\r\n }", "function unlock(_word) {\n\n\n if (player.inventory.includes('key')) {\n currentState.locked = false\n console.log(\"You unlocked the padlock! Now quickly make your way into the tunnel and make your way to Paradise Cove\")\n } else {\n console.log(\"You don't have a key to do that\")\n\n }\n}", "witchKill() {\n this.expCounter += 15;\n }", "poisonPill(){\n\t\tclearInterval(this.timer30min);\n\t\tclearInterval(this.timer1min);\n\t\tthis.comics.poisonPill();\n\t}", "kill() {\n this.dead = true;\n }", "kill(){\n if(!this.duringSinkingAnimation){\n this.creature.playSound('kill', 80);\n const delay = this.creature.kill();\n\n if(delay === 0){\n this.duringSinkingAnimation = true;\n }else if( delay > 0){\n this.sinkDelay = delay;\n this.duringSinkingAnimation = true;\n }else{\n //negative delay here is a special case where the cell shouldn't sink or die after the creature was killed. If killing a creature would replace it with another creature for example, that kill function should return a negative delay\n }\n }\n }", "handler_KILL(command, callback) {\n this._server.logger.info(\n {\n tnx: 'kill',\n cid: this.id,\n user: (this.session.user && this.session.user.username) || this.session.user\n },\n 'Client tried to invoke KILL'\n );\n\n this.send(500, 'Can not kill Mom');\n callback();\n }", "function afterWait(args) {\n\t\tvar killer = args[0];\n\t\tvar victim = args[1];\n\t\tif ( !killer.isValid || !victim.isValid ) {\n\t\t\treturn;\n\t\t}\n\t\tvar mobKiller = killer.vnum != -1;\n\t\tvar mobVictim = victim.vnum != -1;\n\t\tif ( mobKiller && mobVictim ) {\n\t\t\treturn;\n\t\t}\n\t\t/**Mob kills player**/\n\t\tif ( mobKiller && !mobVictim ) {\n\t\t\tif ( victim.mobDeaths >= 75 ) {\n\t\t\t\tvictim.unlockAchievement(9800);\n\t\t\t}\n\t\t}\n\t\t/**Player kills mob**/\n\t\tif ( !mobKiller && mobVictim ) {\n\t\t\t//Do something here...\n\t\t}\n\t\t/**Player kills player**/\n\t\tif ( !mobKiller && !mobVictim ) {\n\t\t\t// Death stuff\n\t\t\tif ( victim.playerDeaths >= 100 ) {\n\t\t\t\tvictim.unlockAchievement(9801);\n\t\t\t}\n\t\t\t// Increment kill streak if victim over level 30\n\t\t\tvar killStreak = killer.quest(killer.name+\"_KILL_STREAK\");\n\t\t\tif ( victim.level >= 30 ) {\n\t\t\t\tkiller.qval(killer.name+\"_KILL_STREAK\",++killStreak);\n\t\t\t}\n\t\t\tif ( victimLegendPos > 0 && victimLegendPos < 9 ) {\n\t\t\t\tkiller.send(\"You have killed a legend!\");\n\t\t\t\tkiller.unlockAchievement(9816);\n\t\t\t\tkiller.addFeatPoints(9-victimLegendPos);\n\t\t\t}\n\t\t\t// Kill streak awards\n\t\t\tif ( killStreak == 3 ) {\n\t\t\t\tkiller.unlockAchievement(9811);\t\t\t\t\t\t// Streaker (Has a title)\n\t\t\t}\n\t\t\tif ( killStreak == 5 ) {\n\t\t\t\tkiller.unlockAchievement(9812);\t\t\t\t\t\t// Deathly Sequence\n\t\t\t}\n\t\t\tif ( killStreak == 8 ) {\n\t\t\t\tkiller.unlockAchievement(9813);\t\t\t\t\t\t// Bloody Rampage\n\t\t\t}\n\t\t\tif ( killStreak == 11 ) {\n\t\t\t\tkiller.unlockAchievement(9814);\t\t\t\t\t\t// Running Riot\n\t\t\t}\n\t\t\tif ( killStreak == 15 ) {\n\t\t\t\tkiller.unlockAchievement(9815);\t\t\t\t\t\t// Invincible\n\t\t\t}\n\t\t\t// Kill awards\n\t\t\tif ( killer.killCount() >= 10 ) {\n\t\t\t\tkiller.unlockAchievement(9804);\t\t\t\t\t\t// Title pack 1\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 20 ) {\n\t\t\t\tkiller.unlockAchievement(9805);\t\t\t\t\t\t// Title pack 2\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 35 ) {\n\t\t\t\tkiller.unlockTitle(\"Impaler\",\"normal\",\"pk\",9806);\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 50 ) {\n\t\t\t\tkiller.unlockAchievement(9808);\t\t\t\t\t\t// Title pack 3\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 75 ) {\n\t\t\t\tkiller.unlockTitle(\"Ripper\",\"normal\",\"pk\");\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 110 ) {\n\t\t\t\tkiller.unlockTitle(\"Warmonger\",\"normal\",\"pk\");\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 200 ) {\n\t\t\t\tkiller.unlockAchievement(9809);\t\t\t\t\t\t// Title pack 4\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 350 ) {\n\t\t\t\tkiller.unlockAchievement(9806);\t\t\t\t\t\t// Title pack 5\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 500 ) {\n\t\t\t\tkiller.unlockAchievement(9807);\t\t\t\t\t\t// Title pack 6\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 750 ) {\n\t\t\t\tkiller.unlockTitle(\"Legion of Death\",\"normal\",\"pk\");\n\t\t\t\tkiller.addFeatPoints(10);\n\t\t\t}\n\t\t\tif ( killer.killCount() >= 1000 ) {\n\t\t\t\tkiller.unlockAchievement(9810);\n\t\t\t}\n\t\t\t// Koradin's PK Quests\n\t\t\tvar crossRaceQuests = getQuestsByTag(\"Cross-Race PK\",killer);\n\t\t\tfor (var _autoKey in crossRaceQuests) {\n\t\t\t\tvar quest = crossRaceQuests[_autoKey];\n\t\t\t\tif ( killer.race != victim.race ) {\n\t\t\t\t\tquest.updateTask(killer, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar sameRaceQuests = getQuestsByTag(\"Same-Race PK\",killer);\n\t\t\tfor (var _autoKey in sameRaceQuests) {\n\t\t\t\tvar qst = sameRaceQuests[_autoKey];\n\t\t\t\tif ( killer.race == victim.race ) {\n\t\t\t\t\tqst.updateTask(killer, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t//Send messages\n\t\t\tif ( killStreak > 1 ) {\n\t\t\t\tgetCharCols(killer);\n\t\t\t\tif ( victim.level < 30 ) {\n\t\t\t\t\tkiller.send(bld+red+victim.name+\" is too wimpy to count toward your kill streak.\"+nrm);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tkiller.send(bld+red+\"You have a running streak of \"+intToText(killStreak)+\" kills!\"+nrm);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t/**Player dies**/\n\t\tif ( !mobVictim ) {\n\t\t\tvictim.deletePval(\"NEWBIE_KIT\",true); // reset need for newbie kit\n\t\t\tif ( ( victim.mobDeaths + victim.playerDeaths ) >= 275 ) {\n\t\t\t\tvictim.unlockAchievement(9802);\n\t\t\t}\n\t\t\tvar oldStreak = victim.quest(victim.name+\"_KILL_STREAK\");\n\t\t\tvictim.qval(victim.name+\"_KILL_STREAK\",0);\t// Wipe kill streak\n\t\t\tgetCharCols(victim);\n\t\t\tif ( oldStreak ) {\n\t\t\t\tvictim.send(bld+red+\"\\nYou have lost your kill streak!\"+nrm);\n\t\t\t}\n\t\t\t// If player is manor owner/allowed, keep NOQUIT for 6 tics.\n\t\t\tvar allowed = false;\n\t\t\tfor (var _autoKey in global.manors) {\n\t\t\t\tvar manor = global.manors[_autoKey];\n\t\t\t\tif (victim.id == manor.ownerUserId || arrContains(manor.allowedUsers, victim.id)) {\n\t\t\t\t\tallowed = true;\n\t\t\t\t\tvar mr = manor;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (allowed == true) {\n\t\t\t\tvictim.affect(constants.AFF_NOQUIT,5,0,0);\n\t\t\t\tvictim.send(\"You died while responsible for the \"+mr.name+\" near \"+mr.area+\", and cannot logout.\");\n\t\t\t}\n\t\t}\n\t}", "killMenu() {\n isReady = false;\n API.showCursor(false);\n API.setHudVisible(true);\n API.setChatVisible(true);\n API.setCanOpenChat(true);\n API.callNative(\"_TRANSITION_FROM_BLURRED\", 3000);\n }", "kill() {\n\t\tthis.body.setAwake(false)\n\t\tthis.agent.alive = false\n\t}", "function Start () {\r\n\tif(destroyDelay > 0){\r\n\t\tInvoke(\"Kill\", destroyDelay);\r\n\t}else{\r\n\t\tInvoke(\"Kill\", timeOut);\r\n\t}\r\n\t\r\n}", "kill() {}", "function killSomething(something){\n something.kill(); //calling kill() on a phaser object makes it invisible and inactive\n}", "function killCharacter(character) {\n\n}", "function SarahKickPlayerOut() {\n\tDialogLeave();\n\tSarahRoomAvailable = false;\n\tCommonSetScreen(\"Room\", \"MainHall\");\n}", "function stageCleared() {\n if (killCount >= 10) {\n goToMenu('win');\n }\n}", "_killswitch() {\n return;\n }", "kill(player) {\n player.alive = false;\n\n return player;\n }", "function leaveCommand(player, message) {\n\troom.kickPlayer(player.id, \"Bye !\", false);\n}", "kill() {\n this.emit(\"kill\");\n }", "kill(){\r\n this.lives--;\r\n this.livesLost++;\r\n if(this.lives<0){\r\n this.gameOver = true;\r\n }else{\r\n this.resetBoard();\r\n }\r\n }", "function C007_LunchBreak_Natalie_Ungag() {\r\n CurrentTime = CurrentTime + 60000;\r\n ActorRemoveInventory(\"TapeGag\");\r\n if (ActorHasInventory(\"Ballgag\")) {\r\n ActorRemoveInventory(\"Ballgag\");\r\n PlayerAddInventory(\"Ballgag\", 1);\r\n }\r\n if (ActorHasInventory(\"ClothGag\")) {\r\n ActorRemoveInventory(\"ClothGag\");\r\n PlayerAddInventory(\"ClothGag\", 1);\r\n }\r\n C007_LunchBreak_Natalie_IsGagged = false;\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "function autoKill(unit) {\n\t\t\tif (unit.position[0] === 0) {\n\t\t\t\tunit.alive = false;\n\t\t\t}\n\t\t}", "checkForKill(x, y, bomb) {\n\t\t// Vorfilterung um nicht jedes Mal die Liste durch zu iterieren\n\t\tif (!(this.gameMap.isPlayerAtPosition(x, y)) && !(this.gameMap.isBombAtPosition(x, y))) {\n\t\t\treturn;\n\t\t}\n\t\tfor (var manId in this.men) {\n\t\t\tvar man = this.men[manId];\n\t\t\tif (man.indest == false && Math.abs(man.getXPosition() - x) < 0.7 && Math.abs(man.getYPosition() - y) < 0.7) {\n\t\t\t\tif (bomb.getBomberId() in this.men)\n\t\t\t\t\tthis.men[bomb.getBomberId()].addScore((Object.keys(this.men).length - 1) * (c.SCORE_KILL + Math.round((man.getScore() * c.SCORE_KILLP) / 100)));\n\t\t\t\tman.setAction(c.DIES);\n\t\t\t\tthis.makeNoise(c.SOUND_KEY_DIES, -1);\n\t\t\t\tman.setDirection(c.MOVE_DOWN);\n\t\t\t\tthis.gameMap.cleansPlayerFromMap(man.getId());\n\t\t\t\tfor (var i = 1; i < 6; i++) {\n\t\t\t\t\tsetTimeout(this.setAnim.bind(this), c.TIME_FACTOR * (500 + i * 200), i, man);\n\t\t\t\t}\n\t\t\t\tsetTimeout(this.deletePlayer.bind(this), c.TIME_FACTOR * 1700, manId);\n\t\t\t\tif (this.men.hasOwnProperty(bomb.getBomberId())) {\n\t\t\t\t\tthis.chat(man.getName() + \" killed by \" + (this.men[bomb.getBomberId()].name == man.getName() ? \"him/herself\" : this.men[bomb.getBomberId()].name) + \"!\");\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tthis.chat(man.getName() + \" killed by unknown!\");\n\t\t\t\t}\n\t\t\t\twinston.info(\"[player] '%s' killed\", man.getName());\n\t\t\t\tthis.commit();\n\t\t\t}\n\t\t}\n\t}", "function memberKicked( member, room, by, reason ) {\n}", "function killLogic(){\n log.info( '[Kill] Shutting down' )\n process.exit(0);\n}", "function C012_AfterClass_Amanda_KickedOut() {\n\tGameLogAdd(\"KickedOutFromDorm\");\n\tGameLogSpecificAddTimer(CurrentChapter, \"Player\", \"AmandaAndSarahInBed\", 1);\n\tif (CurrentActor == Common_PlayerLover) {\n\t\tActorChangeAttitude(-5, 0);\n\t\tC012_AfterClass_Amanda_BreakUp();\n\t}\n\tCurrentActor = \"\";\n}", "function pacKill(ghost){\n console.log('can pac kill')\n for( let i=0; i<16; i++) {\n clearInterval(caughtIdOne)\n clearInterval(caughtIdTwo)\n clearInterval(caughtIdThree)\n clearInterval(caughtIdFour)\n }\n // so pacMan can kill ghost\n if(gridSquare[pacIndex] === gridSquare[ghost.ghostIndex]) {\n scoreNumber = scoreNumber + 200\n infoBox.innerHTML = 'Ghost \\n +200 Points'\n gridSquare[ghost.ghostIndex].classList.remove('ghostFlee')\n gridSquare[ghost.ghostIndex].classList.remove(ghost.ghostClass)\n gridSquare[ghost.ghostIndex].classList.remove('ghostDead')\n ghost.lastDirection = -ghost.lastDirection\n gridSquare[ghost.ghostIndex].classList.remove('ghostDead')\n ghost.ghostIndex = ghost.ghostIndex - ghost.directionMove\n gridSquare[ghost.ghostIndex].classList.add('ghostDead')\n ghost.bias = 3\n }\n }", "function kickedFromRoom( room, by, reason ) {\n}", "function killedPlayer(clientId){\n activeUsers[clientId].user.dead = true;\n io.emit('log message', clientId + ' has been eliminated');\n activeUsers[clientId].user.inventory.ammo = 0;\n activeUsers[clientId].user.inventory.health = 0;\n activeUsers[clientId].user.points += (10*60 - gameTime);\n livingPlayers--;\n io.emit('log message', livingPlayers + ' players remaining');\n\n\n}", "function C007_LunchBreak_Natalie_PlayerNoEgg() {\r\n CurrentTime = CurrentTime + 120000;\r\n PlayerUnlockInventory(\"VibratingEgg\");\r\n PlayerClothes(\"Clothed\");\r\n}", "kill(sprite) {\n for (let i = 0; i < sprite.length; i++) {\n let c = Phaser.Math.Distance.Chebyshev(this.x, this.y, sprite[i].x, sprite[i].y);\n if (sprite[i].active) {\n if (c < 60) {\n sprite[i].setActive(false).setVisible(false);\n sprite[i].alive = false;\n //sprite[i].setTexture('ghost');\n console.log('Hidden');\n console.log(sprite[i].x, sprite[i].y);\n this.createDeadBody(sprite[i].x, sprite[i].y);\n console.log('I killed someone', sprite[i].id);\n this.scene.registry.values.sceneData.serverConnection.kill(sprite[i].id);\n this.scene.registry.values.sceneData.gamePlayScene.scene.manager.getScene('voting_scene').removePlayerById(sprite[i].id);\n break;\n }\n }\n }\n }", "gotKilledHeroTank() {\n\n //Move completely to another scene.\n\n engine.stopRenderLoop();\n\n var scene = Game.scenes[Game.activeScene];\n\n Game.activeScene = END_MENU_SCENE_VALUE;\n //Stop playing the game music\n if (soundEnabled) {\n if (scene.assets) {\n if (scene.assets['gameMusic']) {\n scene.assets['gameMusic'].stop();\n }\n }\n }\n\n scene.dispose();\n\n\n //Free the user from the pointer lock\n document.exitPointerLock();\n\n\n\n\n\n //Render the death menu\n startDeathMenu();\n\n return;\n\n\n }", "function theyCantKick() {\n message.channel.send(`${message.author}, you are not aloud to kick members.`);\n }", "function kill(msg, suffix) {\n checkIfAdmin(msg)\n\n\n if (msg.author === \"\") {\n return msg.channel.send(wrap(`Enter a name`))\n }\n let user = msg.guild.members.find((data, key) => data.displayName === suffix)\n\n\n if (user != undefined) {\n user.setMute(true)\n user.setDeaf(true)\n msg.channel.send(wrap(`${user.displayName} got killed!`))\n } else {\n msg.channel.send(wrap(\"User not found.\"))\n }\n\n\n\n}", "splashWater() {\n this.newLine();\n console.log(\"You turn on the sink and throw a load of water at the Waffle Iron.\");\n console.log(\"The water creates a fire and explodes.\");\n console.log(\"The explosion reaches to you and defeats you.\");\n this.answersPush(this.player, \"Splash water\");\n \n //Kills the user\n if(this.player.isDead(this.player.health)) {\n this.endGame(this.player);\n }\n \n }", "function unlock_market() {\n marketLockedForPlayer = null;\n marketCategoryChosen = false\n\n console.log(\"market unlocked\")\n}", "function C012_AfterClass_Amanda_PlayerCollared() {\n\tLeaveIcon = \"\";\n\tCommon_PlayerOwner = CurrentActor;\n\tCommon_ActorIsOwner = true;\n\tPlayerLockInventory(\"Collar\");\n\tCurrentTime = CurrentTime + 50000;\n\tEventSetGenericTimer();\n}", "function lossCheck() {\n if (playerChar === \"roy\"){\n if (roy.health <= 0){\n alert(\"You lose!\")\n reset();\n \n }\n }\n\n if (playerChar === \"ridley\"){\n if (ridley.health <= 0){\n alert(\"You lose!\")\n reset();\n }\n }\n\n if (playerChar === \"cloud\"){\n if (cloud.health <= 0){\n alert(\"You lose!\")\n reset();\n }\n }\n\n if (playerChar === \"incineroar\"){\n if (incineroar.health <= 0){\n alert(\"You lose!\")\n reset();\n }\n }\n}", "function C007_LunchBreak_Natalie_BadUngag() {\r\n PlayerUnlockInventory(\"ClothGag\");\r\n}", "function kick(event){\n if(iHost.indexOf(roomIn) == -1){\n\n } else {\n var x = event.target.value;\n socketio.emit(\"kick\", {userToKick: x});\n }\n }", "dragonKill() {\n this.expCounter += 100;\n }", "skeletonKill() {\n this.expCounter += 10;\n }", "coolantOff() {\n this.sendMessage('command', this.options.port, 'gcode', 'M9');\n }", "function enemyKilled() {\n player.gold = player.gold + currentEnemy.details.reward; //give gold\n dropGold(currentEnemy.details.reward); //make a gold drop effect\n currentEnemy.destroy(); // kill enemy\n player.enemiesKilled++; //update kill count\n if(enemies.length>0){ //if there are more enemies in the group\n newChallenger(enemies); // Make a new enemy\n }\n else { //otherwise, if enemies are all gone\n enemies.destroy(); //destroy current enemies\n newEnemyGroup(enemyData); //make a new group of enemies\n newChallenger(enemies); //choose one as a challenger\n }\n}", "checkIfDeadPlayerNearby(){\n\t\tif(!this.player.dead){\t\t\t\t\t\n\t\t\tif(Math.abs(Phaser.Point.distance(this.player.position, this.otherPlayer.position)) < 64 && this.otherPlayer.dead){\n\t\t\t\tthis.player.resurrectText.setText(\"Press Resurrect Key\");\n\t\t\t\tif(this.player.keys.Resurrect.isDown){\t\n\t\t\t\t\tthis.player.resurrecting = true;\n\t\t\t\t\tthis.resurrectTimer.add(3500, this.resurrectPlayer, this, this.otherPlayer, this.player);\t\n\t\t\t\t\tthis.resurrectTimer.start();\t\n\t\t\t\t\tthis.player.resurrectText.setText(Math.floor(this.resurrectTimer.duration/1000) + 1);\t\t\n\t\t\t\t} else {\n\t\t\t\t\tthis.resurrectTimer.stop();\n\t\t\t\t\tthis.player.resurrecting = false;\n\t\t\t\t}\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tthis.player.resurrectText.setText(\" \");\n\t\t\t}\t\t\n\t\t}\n\t}", "function C012_AfterClass_Jennifer_KickedOut() {\n\tGameLogAdd(\"KickedOutFromDorm\");\n\tif (CurrentActor == Common_PlayerLover) {\n\t\tActorChangeAttitude(-5, 0);\n\t\tC012_AfterClass_Jennifer_BreakUp();\n\t}\n\tCurrentActor = \"\";\n}", "function killScript(){\r\n $(\"#event-log\").html(\"Killing script.\");\r\n ls.kill();\r\n}", "weaponHit(body1, body2) {\n this.kill();\n }", "promptTargetForKillChoice() {\n if (this.currentTarget.cards.length <= 0) {\n this.endTurn();\n return\n }\n if (this.currentPlayer.isComputer) {\n let announcement = computerPlayerMessage(`${this.action}`);\n this.currentPlayer.renderControls(announcement);\n let killForm = loseCardSelector('action', this.currentTarget);\n this.currentTarget.renderControls(killForm);\n killForm.addEventListener('submit', (e) => {\n e.preventDefault();\n killForm.remove();\n this.domState = this.domState.refresh();\n this.killIdx = this.domState.killIdx;\n this.endTurn();\n })\n } else {\n let announcement = computerPlayerMessage(`Choosing influence to lose`);\n this.currentTarget.renderControls(announcement);\n setTimeout(() => {\n this.killIdx = this.currentTarget.randKillIdx()\n this.endTurn();\n }, 1000)\n }\n }", "kill () {\n\n\t\tlet target = Math.floor( (1 - this.elitism) * this.Dudes.length );\n\t\twhile (this.Dudes.length > target)\n\t\t{\n\t\t\tthis.Dudes.pop();\n\t\t}\n\n\t}", "function raise(){\n clearTimeout(shield.coolDown);\n shield.dropped = false;\n}", "async unlock() {\n\t\tif (this.lock_status_id === 2) {\n\t\t\treturn;\n\t\t}\n\t\tawait this.send_command(1);\n\t\tawait this.await_event('status:UNLOCKED');\n\t}", "kill() {\n //calc size of hitbox (- a treshold)\n let mx_left = this.position.pix_x + 0.25 * tileSize;\n let mx_right = mx_left + tileSize - 0.25 * tileSize;\n let my_up = this.position.pix_y + 0.25 * tileSize;\n let my_down = my_up + tileSize - 0.25 * tileSize;\n\n //same for players\n let px_left;\n let px_right;\n let py_up;\n let py_down;\n board.players.forEach(player => {\n px_left = player.position.pix_x + 0.25 * tileSize;\n px_right = px_left + tileSize - 0.25 * tileSize;\n py_up = player.position.pix_y + 0.25 * tileSize;\n py_down = py_up + tileSize - 0.25 * tileSize;\n\n //check if hitboxes overlap\n //When monsters left edge is to the left of players right side\n //and at the same time the monsters right side is not totaly left of players left side\n //When at the same time the montsters upper bond is below the player's lower bound\n //but the monsters lower bound is higher than the players upper bound, then they overlap\n if (mx_left < px_right && mx_right > px_left &&\n my_up < py_down && my_down > py_up) {\n player.die();\n }\n });\n }", "function killNPCs() {\n var EightBitter = EightBittr.ensureCorrectCaller(this),\n group, thing, i;\n\n // Characters: they must opt out of being killed with .nokillonend, and\n // may opt into having a function called instead (such as Lakitus).\n group = EightBitter.GroupHolder.getCharacterGroup();\n for (i = group.length - 1; i >= 0; --i) {\n thing = group[i];\n\n if (!thing.nokillend) {\n thing.EightBitter.killNormal(thing);\n thing.EightBitter.arrayDeleteThing(thing, group, i);\n } else if (thing.killonend) {\n thing.killonend(thing);\n }\n }\n\n // Solids: they may opt into being deleted\n group = EightBitter.GroupHolder.getSolidGroup();\n for (i = group.length - 1; i >= 0; --i) {\n thing = group[i];\n\n if (thing.killonend) {\n if (thing.killonend instanceof Function) {\n thing.killonend(thing, group, i);\n } else {\n thing.EightBitter.arrayDeleteThing(thing, group, i);\n }\n }\n }\n }", "async kill() {\n // This currently doesn't do anything.\n }", "hitEnemy(bullet, enemy) {\n \n //this.weapon.bullets.kill();\n //this.meteors.remove(this.meteors, true);\n bullet.kill();\n console.log(\"Hit\");\n\n }", "kill(reason) {\n if (reason) Common.out('kill(): ' + reason);\n this.releaseAll();\n this.saveAll();\n bot.destroy();\n process.exit();\n }", "minus1Life() {\n console.log(\"entered\")\n if (this.lifesGroup.getTotalUsed() == 0) {\n console.log(\"game over\")\n this.scene.scene.stop();\n this.scene.music.stop();\n console.log(this.scene.pontos)\n this.scene.scene.start(\"GameOver\",{points: this.scene.pontos})\n\n } else {\n console.log(\" a tirar vida\")\n let heartzito = this.lifesGroup.getFirstAlive();\n heartzito.active = false;\n heartzito.visible = false;\n //heartzito.killAndHide()\n console.log(this.lifesGroup.getTotalUsed())\n }\n\n }", "function SarahStartUnlockQuest() {\n\tSarahUnlockQuest = true;\n\tDialogLeave();\n}", "unlock() {\n if (this.game.player.buyCheck(100, \"htmls\")) {\n this.show();\n this.locked = false;\n } else {\n // error message\n }\n }", "endLevel() {\n this.inputAccepted = false; //Disable input.\n //Kill all zombies currently active.\n for (const z of this.activeZombies) {\n if (z.isZombieAlive()) {\n this.killZombie(z);\n }\n }\n //Remove all food.\n this.disableFood();\n\n }", "function playerHitEnemy(bullets, enemyGroup1) {\n enemyGroup1.kill();\n enemyHolder--;\n if(enemyHolder === 0){\n waveOne = true;\n }\n score++;\n // enemyGroup1.remove(baddy1);\n bullets.kill();\n}", "function stepMissle() {\n\tfor(var i in GAME_OBJECTS[\"missles\"]) {\n\t\tvar missle = GAME_OBJECTS[\"missles\"][i];\n\t\tvar isPlayer = missle.hasClass('alt');\n\t\tvar position = missle.position();\n\t\tvar ypos = position.top / SCALE;\n\t\tvar xpos = position.left / SCALE;\n\t\tif((isPlayer && ypos <= 0) || (!isPlayer && ypos >= HEIGHT)) {\n\t\t\tmissle.remove();\n\t\t\tGAME_OBJECTS[\"missles\"].splice(i, 1);\n\t\t} else {\n\t\t\tif(hasHitEnemy(xpos, ypos)) {\n\t\t\t\tmissle.remove(); // take it off the screen\n\t\t\t\tGAME_OBJECTS[\"missles\"].splice(i, 1);\n\t\t\t\tif(SOUNDS_ON) {\n\t\t\t\t\tSOUNDS[\"kill\"].pause();\n\t\t\t\t\tSOUNDS[\"kill\"].currentTime=0;\n\t\t\t\t\tSOUNDS[\"kill\"].play();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function knock(){\n\tif(dbg){\n\t\tdebug(\"Knocking\");\n\t}\n\tknocked = true;\n\tsend_event(EVENT_KNOCK,\"\")\n\tend_turn();\n}", "function hit() {\n\t//Do nothing if player is invincible\n\tif (invincible || !alive) return;\n\n\tif (!started) {\n\t\tif (player.body.y > height) {\n\t\t\t//Place him on the platform\n\t\t\tplayer.setPosition(width / 2, height - height * 0.5);\n\n\t\t\tif (multiplayer) {\n\t\t\t\tmqttClient.publish(\n\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\tstatus: 'respawn'\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}\n\n\thealth--;\n\n\t/**\n\t * If player is about to die\n\t */\n\tif (health === 0) {\n\t\t//Remove the last heart\n\t\thealthObjects[0].classList.add('c-game-overlay__heart--dead');\n\t\tdie();\n\n\t\t/**\n\t\t * If player is not about to die\n\t\t */\n\t} else {\n\t\t//Remove heart\n\t\thealthObjects[health].classList.add('c-game-overlay__heart--dead');\n\n\t\t/**\n\t\t * If player fell of the platform\n\t\t */\n\t\tif (player.body.y > height) {\n\t\t\t//Place him on the platform\n\t\t\tplayer.setPosition(width / 2, height - height * 0.5);\n\n\t\t\t//Set invincible\n\t\t\tinvincible = true;\n\n\t\t\t//If multiplayer send respawn status\n\t\t\tif (multiplayer) {\n\t\t\t\tmqttClient.publish(\n\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\tstatus: 'respawn'\n\t\t\t\t\t})\n\t\t\t\t);\n\t\t\t}\n\t\t\t//Remove invicibility after 2.25 seconds\n\t\t\tsetTimeout(() => {\n\t\t\t\t(invincible = false), (gracePeriodAlpha = false);\n\t\t\t\tplayer.alpha = 1;\n\t\t\t}, 2250);\n\n\t\t\t/**\n\t\t\t * If player got hit by an object\n\t\t\t */\n\t\t} else {\n\t\t\t//Set invincible\n\t\t\tinvincible = true;\n\n\t\t\t//Remove invincibility after 1 second\n\t\t\tsetTimeout(() => {\n\t\t\t\t(invincible = false), (gracePeriodAlpha = false);\n\t\t\t\tplayer.alpha = 1;\n\t\t\t}, 1500);\n\t\t}\n\t}\n}", "function CheatDorm() {\n\n\t// If the player isn't grounded, she can be released by using *\n\tif ((KeyPress == 42) && !GameLogQuery(CurrentChapter, \"\", \"EventGrounded\")) {\n\t\tPlayerReleaseBondage();\n\t\tif (PlayerHasLockedInventory(\"ChastityBelt\")) { PlayerUnlockInventory(\"ChastityBelt\"); PlayerAddInventory(\"ChastityBelt\", 1); }\n\t\tif (PlayerHasLockedInventory(\"VibratingEgg\")) { PlayerUnlockInventory(\"VibratingEgg\"); PlayerAddInventory(\"VibratingEgg\", 1); }\n\t}\n\n}", "function playerInvulnerabilityStop() {\n playerInvulnerability = false; \n player.alpha = 1; \n}", "die(){\n this.alive = false;\n this.unstageUnit();\n }", "function badgeHandler(player, badge) {\n badge.kill();\n won = true;\n}", "function badgeHandler(player, badge) {\n badge.kill();\n won = true;\n}", "function kick() {\n if (Player.health <= 0) {\n return;\n }\n Player.health -= 10 - (10 * Player.addMods());\n Player.damageMods();\n document.getElementById(\"armor-message\").innerText = \"\"\n //this is to keep the health bars current\n Player.hits++;\n update();\n}", "function endHijack() {\n\thijack = false;\n\tpromptPos = 0;\n}", "function trickplayKeyLocked() {\r\n\tunlockTrickplayKey = false;\r\n}", "checkIfCharacterIsDead() {\n if (this.character.dead) {\n this.endBoss.killedCharacter = true;\n }\n }", "function _kill(cm, from, to, ring, text) {\n if (text == null) text = cm.getRange(from, to);\n\n if (ring == \"grow\" && lastKill && lastKill.cm == cm && posEq(from, lastKill.pos) && cm.isClean(lastKill.gen))\n growRingTop(text);\n else if (ring !== false)\n addToRing(text);\n cm.replaceRange(\"\", from, to, \"+delete\");\n\n if (ring == \"grow\") lastKill = {cm: cm, pos: from, gen: cm.changeGeneration()};\n else lastKill = null;\n }", "function kill(thing) {\r\n\tthing.y = -50;\r\n\tthing.kill();\r\n}", "function SarahUnlock() {\n\tCharacterRelease(Sarah);\n\tSarahUnlockQuest = false;\n\tSarah.Stage = \"200\";\n\tCharacterSetActivePose(Sarah, null);\n}", "function MV_Kill(handle) {\n var voice;\n var flags;\n var callbackval;\n\n if (!MV_Installed) {\n MV_SetErrorCode(MV_NotInstalled);\n return (MV_Error);\n }\n\n //flags = DisableInterrupts();\n\n voice = MV_GetVoice(handle);\n if (!voice) {\n //RestoreInterrupts( flags );\n MV_SetErrorCode(MV_VoiceNotFound);\n return (MV_Error);\n }\n\n callbackval = voice.callbackval;\n\n MV_StopVoice(voice);\n\n //RestoreInterrupts( flags );\n\n if (MV_CallBackFunc) {\n MV_CallBackFunc(callbackval);\n }\n\n return (MV_Ok);\n}", "function C012_AfterClass_Amanda_LockChastityBelt() {\n\tPlayerLockInventory(\"ChastityBelt\");\n\tPlayerRemoveInventory(\"ChastityBelt\", 1);\n\tCurrentTime = CurrentTime + 50000;\n}", "function abortMission() {\n console.log(\"Exiting Manager Mode\");\n connection.end();\n}", "function MaidQuartersMaidUngagPlayer() {\n\tif (MaidQuartersMaid.CanInteract()) {\n\t\tif (!MaidQuartersMaidReleasedPlayer) {\n\t\t\tReputationProgress(\"Dominant\", -1);\n\t\t\tMaidQuartersMaidReleasedPlayer = true;\n\t\t}\n\t\tInventoryRemove(Player, \"ItemMouth\");\n\t} else MaidQuartersMaid.CurrentDialog = DialogFind(MaidQuartersMaid, \"CantReleasePlayer\");\n}", "_killMyself() {\n this.state.timeout = null;\n this.close({ notification: this.state.notification, by: 'timeout' });\n }", "function TriggerKeptPlaying()\n{\n // Each time the player touches the screen, add to the ticker \n _ticksUntilReset += _tickTouchBoost;\n\n // ensure we never get too high a number \n if( _ticksUntilReset > _maximumTicks ){\n _ticksUntilReset = _maximumTicks;\n }\n}", "function MobGotKilled(mob) {\n if (mob.object.removed) {\n if (mob.times > 0) {\n bullets.push(new Bullet(mob.object, 'pickup'));\n mob.times--;\n }\n\n if (mob.times == 0) {\n totalMobs--;\n mob.times--;\n }\n }\n}", "function spaceButton() {\n if (!player.alive) {\n game.reset();\n }\n}", "function C012_AfterClass_Amanda_LockCollarAmanda() {\n\tActorSetOwner(\"Player\");\n\tPlayerRemoveInventory(\"Collar\", 1);\n\tC012_AfterClass_Amanda_CalcParams();\n\tActorSetPose(\"Kneel\");\n\tCurrentTime = CurrentTime + 50000;\n}", "function onStopGameMessage(message) {\n\n }", "death(currentPlayer, consequence, channel){//Kills the player\n this.players = this.players.filter(player => {return player.id !== currentPlayer.id})\n channel.send(consequence.description).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\n }", "function C012_AfterClass_Amanda_RopePlayer() {\n\tPlayerLockInventory(\"Rope\");\n\tPlayerRemoveInventory(\"Rope\", 1);\n\tCurrentTime = CurrentTime + 50000;\n}", "function CastleAxeKillsBowser(bowser) {\n bowser.nofall = false;\n TimeHandler.addEvent(CastleAxeContinues, 35, mario);\n}", "removeCharacter() {\n\t\t\tif (this.sndKeyDelete) this.sndKeyDelete.play();\n\t}", "function C007_LunchBreak_Natalie_PlayerRelease() {\r\n PlayerUnlockAllInventory();\r\n}", "function hideMultiPlayerStatScreen(){\n console.log(\"hideMultiPlayerStatScreen\");\n //clear all the healthbars\n multiGraphics.clear();\n //Call kill on all Phaser Text Objects of all players\n for (var player in statScreen.MultiPlayer){\n if(statScreen.MultiPlayer.hasOwnProperty(player)){\n statScreen.MultiPlayer[player][\"CharacterName\"].kill();\n for (var attrString in statScreen.MultiPlayer[player][\"AttributeStrings\"]){\n if(statScreen.MultiPlayer[player][\"AttributeStrings\"].hasOwnProperty(attrString)){\n statScreen.MultiPlayer[player][\"AttributeStrings\"][attrString].kill();\n }\n }\n }\n\n }\n}", "function C007_LunchBreak_Natalie_Untie() {\r\n if (ActorHasInventory(\"Rope\")) {\r\n CurrentTime = CurrentTime + 120000;\r\n ActorRemoveInventory(\"Rope\");\r\n PlayerAddInventory(\"Rope\", 1);\r\n if (C007_LunchBreak_Natalie_TwoRopes) {\r\n CurrentTime = CurrentTime + 120000;\r\n PlayerAddInventory(\"Rope\", 1);\r\n C007_LunchBreak_Natalie_TwoRopes = false;\r\n }\r\n C007_LunchBreak_Natalie_IsRoped = false;\r\n }\r\n C007_LunchBreak_Natalie_TimeLimit()\r\n}", "function shellInvalidCommand()\n{\n _StdIn.putText(\"Invalid Command. \");\n if (_MCPMode)\n {\n _StdIn.putText(\"Want me to slow down your power cycles for you?\");\n }\n else\n {\n _StdIn.putText(\"Type 'help' for user designed help.\");\n }\n}", "checkKills(f1, f2) {\n\n // if f2 is already dying, exit\n if (f1 === f2 || f2.action === Fighter.ACTIONS.DIE)\n return;\n\n // kill distance is different for fighters and dino's\n let killDistance = null;\n if (f1.action === Fighter.ACTIONS.FIGHT)\n killDistance = game.killDistance;\n else if (f1.isDino && !f2.isDino)\n killDistance = game.dinoKillDistance;\n\n if (killDistance === null) return;\n\n let dx = Math.abs(f1.position.x - f2.position.x);\n let dy = Math.abs(f1.position.y - f2.position.y);\n if (dx <= killDistance && dy <= killDistance) {\n f1.kills++;\n f2.action = Fighter.ACTIONS.DIE;\n f2.progress = 99;\n }\n }", "killInvisible() {\n for (let i in currentGame.allEnemies) {\n if (currentGame.allEnemies[i].x >= 505) {\n delete currentGame.allEnemies[i];\n }\n }\n }", "function checkBounds(player1){\n if(player1.body.y > 759){\n trampDude.killPlayer1()\n trampDude.insertAnyText('OOOPS!', player2.body.x -50 , player2.body.y - 50, 'rgb(20, 230, 198)', 'fadeText')\n player1.kill();\n trampDude.restartPlayer1()\n }\n}" ]
[ "0.63820946", "0.6276242", "0.6207397", "0.61224204", "0.6101286", "0.6062093", "0.6054462", "0.6012674", "0.5998262", "0.59848994", "0.59321314", "0.5906972", "0.5881292", "0.5878454", "0.5876686", "0.5808292", "0.579453", "0.5757914", "0.5732763", "0.5726679", "0.5725017", "0.5718548", "0.5695124", "0.56871414", "0.5662748", "0.5631622", "0.5604009", "0.5602922", "0.5587486", "0.5583943", "0.5581908", "0.5564024", "0.5563661", "0.5562183", "0.5547015", "0.55461097", "0.5529658", "0.55242455", "0.5519606", "0.5518998", "0.55153793", "0.5502106", "0.5493306", "0.54917365", "0.5479477", "0.54695135", "0.5450588", "0.54335004", "0.5432988", "0.54220235", "0.5407854", "0.5403486", "0.53985316", "0.5392177", "0.5391528", "0.5387457", "0.5382445", "0.5380978", "0.53734696", "0.5372192", "0.5369281", "0.5360504", "0.5351118", "0.534933", "0.53471863", "0.5332073", "0.5330059", "0.5323185", "0.5323122", "0.5318902", "0.5311391", "0.5311391", "0.5310711", "0.53063565", "0.53055173", "0.5298328", "0.52904034", "0.5287278", "0.5282706", "0.5276728", "0.52667236", "0.5263859", "0.52489644", "0.524884", "0.5245168", "0.52421397", "0.52420455", "0.5240907", "0.52400273", "0.523951", "0.52345854", "0.52231526", "0.5221511", "0.522036", "0.52164346", "0.5207526", "0.5207469", "0.52021635", "0.52017075", "0.51958084" ]
0.6593383
0
arrow function returns expression provided after
speak () { this.clickHandler() return `${super.speak()} Meow, I am a ${this.species}` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "operator(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return _ => interpret(ast, fn, _);\n }", "ArrowFunctionExpression(path) {}", "function createAdder(arg) {\n return arg1 => arg + arg1;\n}", "arrow() {\n const RickAndMorty = 'Rick and Morty';\n return () => RickAndMorty;\n }", "function evaluateArrowFunctionExpression(options) {\n const { node, environment, evaluate, stack, statementTraversalStack, reporting, typescript } = options;\n const arrowFunctionExpression = hasModifier(node, typescript.SyntaxKind.AsyncKeyword)\n ? async (...args) => {\n // Prepare a lexical environment for the function context\n const localLexicalEnvironment = cloneLexicalEnvironment(environment);\n // Define a new binding for a return symbol within the environment\n setInLexicalEnvironment({ env: localLexicalEnvironment, path: RETURN_SYMBOL, value: false, newBinding: true, reporting, node });\n // Define a new binding for the arguments given to the function\n // eslint-disable-next-line prefer-rest-params\n setInLexicalEnvironment({ env: localLexicalEnvironment, path: \"arguments\", value: arguments, newBinding: true, reporting, node });\n // Evaluate the parameters based on the given arguments\n evaluateParameterDeclarations(Object.assign(Object.assign({}, options), { node: node.parameters, environment: localLexicalEnvironment }), args);\n // If the body is a block, evaluate it as a statement\n if (typescript.isBlock(node.body)) {\n evaluate.statement(node.body, localLexicalEnvironment);\n // If a 'return' has occurred within the block, pop the Stack and return that value\n if (pathInLexicalEnvironmentEquals(node, localLexicalEnvironment, true, RETURN_SYMBOL)) {\n return stack.pop();\n }\n // Otherwise, return 'undefined'. Nothing is returned from the function\n else\n return undefined;\n }\n // Otherwise, the body is itself an expression\n else {\n return evaluate.expression(node.body, localLexicalEnvironment, statementTraversalStack);\n }\n }\n : (...args) => {\n // Prepare a lexical environment for the function context\n const localLexicalEnvironment = cloneLexicalEnvironment(environment);\n // Define a new binding for a return symbol within the environment\n setInLexicalEnvironment({ env: localLexicalEnvironment, path: RETURN_SYMBOL, value: false, newBinding: true, reporting, node });\n // Define a new binding for the arguments given to the function\n // eslint-disable-next-line prefer-rest-params\n setInLexicalEnvironment({ env: localLexicalEnvironment, path: \"arguments\", value: arguments, newBinding: true, reporting, node });\n // Evaluate the parameters based on the given arguments\n evaluateParameterDeclarations(Object.assign(Object.assign({}, options), { node: node.parameters, environment: localLexicalEnvironment }), args);\n // If the body is a block, evaluate it as a statement\n if (typescript.isBlock(node.body)) {\n evaluate.statement(node.body, localLexicalEnvironment);\n // If a 'return' has occurred within the block, pop the Stack and return that value\n if (pathInLexicalEnvironmentEquals(node, localLexicalEnvironment, true, RETURN_SYMBOL)) {\n return stack.pop();\n }\n // Otherwise, return 'undefined'. Nothing is returned from the function\n else\n return undefined;\n }\n // Otherwise, the body is itself an expression\n else {\n return evaluate.expression(node.body, localLexicalEnvironment, statementTraversalStack);\n }\n };\n arrowFunctionExpression.toString = () => `[Function: anonymous]`;\n // Make sure to use the Function that is contained within the Realm. Otherwise, 'instanceof' checks may fail\n // since this particular function comes from the executing context.\n Object.setPrototypeOf(arrowFunctionExpression, getFromLexicalEnvironment(node, environment, \"Function\").literal);\n return arrowFunctionExpression;\n}", "parseExpression() {\n return this.maybeCall(() => {\n return this.maybeBinary(this.parseAtom(), 0);\n });\n }", "function sum(a) {\n return (b) => {\n return (c) => {\n return a + b + c\n }\n }\n}", "function lambda(o) {\n return function () {\n return o;\n };\n }", "function sum3(a) {\r\n return (b) => {\r\n return (c) => {\r\n return a + b + c;\r\n }\r\n }\r\n}", "handler(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return (_, event) => {\n const datum = event.item && event.item.datum;\n return interpret(ast, fn, _, datum, event);\n };\n }", "function pure(x){\n\tvar z = x;\n\treturn function(y){\t\t\n\t\treturn z + y;\t\t\n\t}\t\n}", "function n(e){return function(){return e}}", "function $return_val(arg) {\n return function() {\n return arg;\n }\n }", "function $return(value) {\n return function() { return value }\n}", "function Xb(){return function(v){return v}}", "function a(e){return function(t){return i(t,e)}}", "function a(e){return function(t){return i(t,e)}}", "parseExpression() {\n\t\treturn this.maybeCall(() => {\n\t\t\tlet atom = this.parseAtom();\n\t\t\tif (atom) {\n\t\t\t\treturn this.maybeBinary(atom, 0);\n\t\t\t}\n\t\t});\n\t}", "function e(e){return (0, F[e.operation])(...e.parameters)}", "function r(t){return function(){return t}}", "function multiplier2(factor){\n return x => x * factor; \n}", "ap (aFn) { \n //return this.fmap(aFn.value)\n return aFn.chain(fn => Right.of(fn(this.value)))\n }", "ParenthesizedExpression() {\n this._eat('(');\n const expression = this.Expression();\n this._eat(')');\n return expression;\n }", "function makeAdder(x){\n return function(y){\n return x+ y ;\n }\n}", "function upfrontFoo(x,y) {\n var sum = x + y;\n return function() { return sum }\n}", "function always2(x) { return function(y, z) { return x; }; }", "function arrowFunction(){\r\nconst sumTest = (a,b) => a+b;\r\nsumTest(2,4);\r\n}", "function expression(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n }", "function sum2(a, b) {\n const c = a + b;\n\n return function () {\n console.log(c);\n };\n}", "function expression$2(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n }", "function primaryExpr(stream, a) {\n var x = stream.trypopliteral();\n if (null == x)\n x = stream.trypopnumber();\n if (null != x) {\n return x;\n }\n var varRef = stream.trypopvarref();\n if (null != varRef) return a.node('VariableReference', varRef);\n var funCall = functionCall(stream, a);\n if (null != funCall) {\n return funCall;\n }\n if (stream.trypop('(')) {\n var e = orExpr(stream, a);\n if (null == e)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression after (.');\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ) after expression.');\n return e;\n }\n return null;\n }", "function primaryExpr(stream, a) {\n var x = stream.trypopliteral();\n if (null == x)\n x = stream.trypopnumber();\n if (null != x) {\n return x;\n }\n var varRef = stream.trypopvarref();\n if (null != varRef) return a.node('VariableReference', varRef);\n var funCall = functionCall(stream, a);\n if (null != funCall) {\n return funCall;\n }\n if (stream.trypop('(')) {\n var e = orExpr(stream, a);\n if (null == e)\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected expression after (.');\n if (null == stream.trypop(')'))\n throw new XPathException(XPathException.INVALID_EXPRESSION_ERR,\n 'Position ' + stream.position() +\n ': Expected ) after expression.');\n return e;\n }\n return null;\n }", "function callMeMaybe() {\r\n return () => { console.log('arrow function: ', this)}\r\n}", "function num(number) {\n return () => number;\n}", "function makeAdder(x) {\n return function(y){\n return x + y;\n };\n}", "function getExpression(_, ctx) {\n var k = 'e:' + _.$expr;\n return ctx.fn[k]\n || (ctx.fn[k] = Object(__WEBPACK_IMPORTED_MODULE_3_vega_util__[\"d\" /* accessor */])(Object(__WEBPACK_IMPORTED_MODULE_1__expression__[\"e\" /* parameterExpression */])(_.$expr, ctx), _.$fields, _.$name));\n}", "function accumulator(sum) {\n return function (arg) {\n return (sum += arg);\n };\n}", "evaluate(expr) {\n const result = compile(this.get_('eval.env'), expr).flatMap((f) => f());\n if (fail.match(result)) throw result.get();\n else return result.get();\n }", "function Addition(x){\r\n // it is return some reference no name of function just a refernce\r\n return function (y){\r\n return x+y;\r\n };\r\n}", "function expression(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}", "function expression(args, code, ctx) {\n // wrap code in return statement if expression does not terminate\n if (code[code.length-1] !== ';') {\n code = 'return(' + code + ');';\n }\n var fn = Function.apply(null, args.concat(code));\n return ctx && ctx.functions ? fn.bind(ctx.functions) : fn;\n}", "function o(e){return function(){return e}}", "function plus( b ) { return function( a ) { return a + b; }; }", "function addition(x){\n return function(y){\n return x+y\n }\n}", "Evaluate() {}", "function ArrowFunctionExpression(node, print) {\n\t if (node.async) this.push(\"async \");\n\n\t if (node.params.length === 1 && t.isIdentifier(node.params[0])) {\n\t print.plain(node.params[0]);\n\t } else {\n\t this._params(node, print);\n\t }\n\n\t this.push(\" => \");\n\n\t var bodyNeedsParens = t.isObjectExpression(node.body);\n\n\t if (bodyNeedsParens) {\n\t this.push(\"(\");\n\t }\n\n\t print.plain(node.body);\n\n\t if (bodyNeedsParens) {\n\t this.push(\")\");\n\t }\n\t}", "function ArrowFunctionExpression(node, print) {\n\t if (node.async) this.push(\"async \");\n\n\t if (node.params.length === 1 && t.isIdentifier(node.params[0])) {\n\t print.plain(node.params[0]);\n\t } else {\n\t this._params(node, print);\n\t }\n\n\t this.push(\" => \");\n\n\t var bodyNeedsParens = t.isObjectExpression(node.body);\n\n\t if (bodyNeedsParens) {\n\t this.push(\"(\");\n\t }\n\n\t print.plain(node.body);\n\n\t if (bodyNeedsParens) {\n\t this.push(\")\");\n\t }\n\t}", "function getAdd() {\n let baz = 0;\n return function () {\n baz += 1;\n return baz;\n };\n}", "evalSingleOperandFn(fn) {\n const { viewText } = this.state\n const inputValue = parseFloat(viewText)\n // evaluate immediately\n const newValue = CalculatorOperations[fn](null, inputValue)\n this.setState({\n viewText: String(newValue),\n prevValue: newValue\n }\n )\n }", "function curryFunction(a,b){\n const c = a+b\n return function (d){\n console.log(c+d)\n }\n}", "function arrowFn() {\n alert(\"hello from the return of the second sayHi\");\n\n }", "function moreMath (x) {\n return function (y) {\n return x + y;\n };\n}", "function foo5(a /* : number */, a2 /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + a2 + 1\n })\n}", "function multiplier(y) {\n return (x) => {\n return x * y;\n };\n}", "function ArrowFunctionExpression(node, print) {\n if (node.async) this.push(\"async \");\n\n if (node.params.length === 1 && t.isIdentifier(node.params[0])) {\n print.plain(node.params[0]);\n } else {\n this._params(node, print);\n }\n\n this.push(\" => \");\n\n var bodyNeedsParens = t.isObjectExpression(node.body);\n\n if (bodyNeedsParens) {\n this.push(\"(\");\n }\n\n print.plain(node.body);\n\n if (bodyNeedsParens) {\n this.push(\")\");\n }\n}", "function show() {\n return x => x + arguments[0];\n}", "function createAddition(y) {\n return function (x) {\n return x + y;\n };\n}", "function aa() {\n return function() {}\n }", "function callFunctionBody(expr) {\n return (\n '(function f() {\\n'\n + 'Object.defineProperties(arguments, {1: { writable: false },\\n'\n + ' 2: { configurable: false },\\n'\n + ' 3: { writable: false,\\n'\n + ' configurable: false }});\\n'\n + 'return (' + expr + ');\\n'\n + '})(0, 1, 2, 3);');\n}", "function foo4(a /* : number */) /* : string => boolean => Foo */ {\n return s => b => ({\n moom: b,\n soup: s,\n nmb: a + 1\n })\n}", "function always0(x) { return function() { return x; }; }", "function makeAdder(x) {\n return function(y) {\n return x + y;\n };\n}", "function makeAdder(x) {\n\treturn function(y) {\n\t\treturn x + y;\n\t};\n}", "function foo(n){\n var f = (...args) => args[0] + n;\n return f(10);\n}", "function add(x){\n return function(y){\n return x + y\n }\n}", "function makefunc(x) {\r\n// return function() { return x; }\r\n// return new Function($direct_func_xxx$);\r\n return new Function(\"return x;\")\r\n}", "function arrowFunctions()\n{\n let getId = () => 123;\n console.log(getId()); //123\n\n let getId2 = _ => 456; \n console.log(getId2()); //456\n\n let getId3 = prefix => prefix+456; \n console.log(getId3('ID: ')); //ID: 456\n\n let getId4 = (prefix,suffix) => prefix+456+suffix; \n console.log(getId4('ID: ', '!!')); //ID: 456!!\n\n let getId5 = (prefix,suffix) => {\n console.log('executing arrow 5');\n let m = prefix+456+suffix; \n return m; //when using with {}, return statement is required.\n };\n console.log(getId5('ID: ', '!!')); //ID: 456!!\n\n\n}", "function makeAdder(x) {\n return function (y) {\n return x + y;\n };\n}", "function plus(x) {\n return function(y) {\n return x+y;\n }\n\n}", "function getExpression(_, ctx) {\n var k = 'e:' + _.$expr;\n return ctx.fn[k]\n || (ctx.fn[k] = (0,vega_util__WEBPACK_IMPORTED_MODULE_3__.accessor)((0,_expression__WEBPACK_IMPORTED_MODULE_1__.parameterExpression)(_.$expr, ctx), _.$fields, _.$name));\n}", "function creaSumador(x) {\n return function(y) {\n return x + y;\n };\n }", "function identity(x) {\n\t var c = new Function('y', 'return function(){return y}')\n\t return c(x)\n\t}", "function identity(x) {\n\t var c = new Function('y', 'return function(){return y}')\n\t return c(x)\n\t}", "function exp(value) {\n return (Array.isArray(value))\n ? value[0](\n exp(value[1]),\n exp(value[2])\n )\n : value;\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "function identity(x) {\n var c = new Function('y', 'return function(){return y}')\n return c(x)\n}", "event(ctx, expr) {\n const ast = expr.ast, fn = ctx.functions;\n return event => interpret(ast, fn, undefined, undefined, event);\n }", "function eta(f){ \r\n var args = slice(arguments, 1)\r\n return function(){\r\n return f.apply(null, args)\r\n }\r\n}", "function constantly(x) {\n return () => x;\n}", "function arrowFunc(name) {\n return 'Hello ' + name;\n}", "function evaluateAsExpression({ node, environment, evaluate, statementTraversalStack }) {\n return evaluate.expression(node.expression, environment, statementTraversalStack);\n}", "function Fn($1) { return function($2) { return Function_ ([$1, $2]); }; }", "function sum(a) {\n return function(b) {\n return a+b\n }\n}", "function parseArrowExpression(startTokenIndex) {\n parseFunctionBody(true);\n const endTokenIndex = state.tokens.length;\n state.scopes.push(new Scope(startTokenIndex, endTokenIndex, true));\n state.scopeDepth--;\n}", "function arrowFunction(){\n es5Function();\n console.log(\"-------------\");\n es6Function();\n console.log(\"-------------\");\n es6FunctionInOneLine();\n console.log(\"-------------\");\n ex6FunctionWithArgs(1);\n console.log(\"-------------\");\n console.log(ex6FunctionReturnValue());\n console.log(\"-------------\");\n setTimeout(()=> console.log(\"Timeout\"), 1000)\n}", "Expression() {\n return this.AssignmentExpression();\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }", "function genTernaryExp (el) {\n return el.once ? genOnce(el) : genElement(el)\n }" ]
[ "0.6622033", "0.661406", "0.659269", "0.6370205", "0.62305", "0.6176875", "0.6139968", "0.61093456", "0.6104766", "0.60463506", "0.5998106", "0.59761685", "0.59663945", "0.5950608", "0.5947862", "0.5909767", "0.5909767", "0.58714384", "0.58372635", "0.583663", "0.582215", "0.57933384", "0.5784959", "0.57844764", "0.57708645", "0.5757885", "0.5748015", "0.5744486", "0.5741612", "0.5733839", "0.5725524", "0.5725524", "0.56910205", "0.5683721", "0.5682474", "0.56817496", "0.56676453", "0.56649446", "0.5656462", "0.5655439", "0.5655439", "0.5636206", "0.5634288", "0.5629855", "0.56278306", "0.5621952", "0.5621952", "0.5617472", "0.56158185", "0.56132126", "0.56124794", "0.5601907", "0.56014353", "0.55976737", "0.558797", "0.55816233", "0.55769044", "0.55750054", "0.5574783", "0.55723405", "0.55681515", "0.55558604", "0.55349684", "0.5530814", "0.55285937", "0.552198", "0.5518197", "0.55163044", "0.55158365", "0.550598", "0.55049944", "0.5503306", "0.5503306", "0.5487611", "0.5486039", "0.5486039", "0.5486039", "0.5486039", "0.5486039", "0.5486039", "0.5486039", "0.5486039", "0.5484263", "0.5484086", "0.5470266", "0.54522985", "0.5451572", "0.5450063", "0.543711", "0.5427426", "0.5418663", "0.5418213", "0.5417973", "0.5417973", "0.5417973", "0.5417973", "0.5417973", "0.5417973", "0.5417973", "0.5417973", "0.5417973" ]
0.0
-1
Core Game Objects Category object
function Category(name, color, i, idName) { this.idName = idName; this.name = name; this.color = color; this.index = i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Category() {\n}", "function JAFTING_Category() { this.initialize(...arguments); }", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "get category() {\n\t\treturn this.__category;\n\t}", "function Category(){\n\n\tconsole.log(\"Initialize Category Class\");\n\n}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "function createGameCategoryAll(){\n\tGames.forEach(game => game.categories.push(\"Games\"));\n\tGameCategories.push(\"Games\");\n}", "get type() {\n\t\treturn \"category\";\n\t}", "function useCategoryBase() {\n const category = useSelector((state) => state[typeStore.CATEGORY]);\n const dispatch = useDispatch();\n\n let categoryObj = {};\n category.map((item) => (categoryObj[item.id] = item));\n\n // func handle\n const getListCategory = async (obj = {}) => {\n const { message, categories } = await baseAPI.getAll(url_api.CATEGORY, obj);\n if (message === 'OK') {\n dispatch({\n type: typeAction.CATEGORY.GET,\n payload: { category: [...categories] },\n });\n } else messageAnt.warn(message);\n };\n return {\n category,\n categoryObj,\n getListCategory,\n };\n}", "function nCategory(t){this.category=new category(t),this.built=!1,this.build=null}", "function cat() {\r\n return cat.meow\r\n}", "function createObjects(){\n\tHangMan.gameReady = true;\n\tHangMan.namesObj = Object.create(gameObj);\n\tHangMan.colorsObj = Object.create(gameObj);\n\tHangMan.statesObj = Object.create(gameObj);\n\tHangMan.namesObj.words = namesArr;\n\tHangMan.colorsObj.words = colorsArr;\n\tHangMan.statesObj.words = statesArr;\n\tHangMan.categories = categories;\n\tfor(i = 0 ; i < HangMan.categories.length ; i++){\n\t\tsetObject(HangMan.categories[i]);\n\t}\n\tvar catIndex = Math.floor(Math.random() * categories.length);\n\t$('#category option:eq(' + catIndex + ')').prop('selected', true)\n\tchangeCategory();\n\tloadObject(categories[catIndex]);\n}", "category () {\n if (this.categoryId) {\n return BacklogItemCategories.findOne(this.categoryId)\n }\n }", "categ(state,data)\n {\n return state.category=data\n }", "function showCategory(category) {\n NEAR_FIELD_OBJECTS.scene.children.forEach(child => {\n if (child.userData == category)\n child.visible = true\n })\n}", "getCategory(_parameters) {\n\t\treturn new Category(_parameters);\n\t}", "card_getCategory(card){\n return card.category;\n }", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function Category() {\n this.id;\n\n this.name;\n this.descripstion;\n\n this.createdDate;\n this.modifiedDate;\n this.deletedDate;\n\n this.parentCategoryId;\n this.childCategories;\n}", "function createGlobalCategories() {\n return [\n\t//ROOT CATEGORY:\n\tconstants.ROOT_CATEGORY,\n\t\n\t//TOP-LEVEL CATEGORIES:\n\t//(they should have root as their only parent)\n\tnew Category([categories.ROOT], categories.RAW),\n\t//new Category([categories.ROOT], categories.FOOD),\n\t\n\t//SUB-CATEGORIES:\n\tnew Category([categories.RAW], categories.FOOD),\n\tnew Category([categories.RAW], categories.CONSUMABLE),\n\t\n ];\n}", "getcategory(state){\n return state.category\n }", "function Cat(name){\n this.name = name;\n this.sound = 'Meow'\n}", "function Category(category_data) {\r\n $.extend(this, category_data);\r\n }", "function setCategory(cat) {\n\tcategory = cat;\n\tdisplayPic(1);\n}", "function Cat(){ this.name = 'MrPurr'; }", "function Cat(){ this.name = 'MrPurr'; }", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "get gameObject() {}", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "function createGameCategories(){\n\tGameCategories = new Set();\n\tGames.map(game => game.categories).flat().forEach(function(subcategory){\n\t\tGameCategories.add(subcategory);\n\t});\n\tGameCategories = Array.from(GameCategories); //turn the set into an array\n}", "function CatAndMouse() {\r\n}", "function Window_ItemCategory() {\n this.initialize.apply(this, arguments);\n}", "function makeCat() {\n VCAT = new Catgirl();\n return VCAT;\n}", "function Cat(){}", "static convertToBMICategoryObject(obj) {\n return new BMICategory(obj[\"minRange\"], obj[\"maxRange\"], obj[\"category\"], obj[\"healthRisk\"]);\n }", "createFromObjects(layerName, gid, spriteClass, group) {\n parent.stage.createFromObjects(layerName, gid, null, null, true, false, group, spriteClass, true);\n }", "function addCategory(category) {\n categories[category] = []\n originals[category] = []\n}", "function setCategoryColors(category) {\n var color;\n switch (category) {\n case 'football':\n case 'nfl':\n case 'ncaaf':\n case 'nflncaaf':\n category = 'football';\n break;\n case 'basketball':\n case 'nba':\n case 'ncaam':\n case 'college_basketball':\n category = 'basketball';\n break;\n case 'baseball':\n case 'mlb':\n category = 'baseball';\n break;\n case \"realestate\":\n case \"disaster\":\n case \"demographics\":\n case \"crime\":\n case \"weather\":\n case \"politics\":\n category = 'realestate';\n break;\n case \"finance\":\n case \"money\":\n category = 'finance';\n break;\n case \"entertainment\":\n case \"celebrities\":\n case \"actor\":\n case \"musician\":\n case \"music\":\n case \"director\":\n category = 'entertainment';\n break;\n default:\n category = 'default';\n break;\n }\n var atomicClass = friendlyIframeWindow.document.getElementsByClassName(\"widget_ad\")[0];\n atomicClass.id = wideWidget ? category + '-wide' : category;\n\n }", "function newCat(name) {\n\tconsole.log(this); // this refers to the global-object i.e. Window\n\treturn {\n\t\tname : name,\n\t\ttalk : function() {\n\t\t\tconsole.log(this); // this refers to the object containing the \"talk\" method\n\t\t\tconsole.log(this.name + \" says Meoow\");\n\t\t},\n\t};\n}", "function Cat(){ }", "constructor() {\n /**\n * Array of subcategories. Can be empty.\n * @member {Array.<module:models/Category>} categories\n */\n this.categories = undefined\n\n /**\n * The localized description of the category.\n * @member {String} description\n */\n this.description = undefined\n\n /**\n * The id of the category.\n * @member {String} id\n */\n this.id = undefined\n\n /**\n * The URL to the category image.\n * @member {String} image\n */\n this.image = undefined\n\n /**\n * The localized name of the category.\n * @member {String} name\n */\n this.name = undefined\n\n /**\n * The localized page description of the category.\n * @member {String} page_description\n */\n this.page_description = undefined\n\n /**\n * The localized page keywords of the category.\n * @member {String} page_keywords\n */\n this.page_keywords = undefined\n\n /**\n * The localized page title of the category.\n * @member {String} page_title\n */\n this.page_title = undefined\n\n /**\n * The id of the parent category.\n * @member {String} parent_category_id\n */\n this.parent_category_id = undefined\n\n /**\n * The URL to the category thumbnail.\n * @member {String} thumbnail\n */\n this.thumbnail = undefined\n }", "function gameObject(type, name, texture, value, size)\n{\n\tthis.type=type; //ex: fruit, hand, powerup\n\tthis.name=name; //ex: apple, orange, watermelon\n\tthis.texture = texture;\n\tthis.hasJoint=false; // check to see if this is attached to anything\n\tthis.joint=null;\n\tthis.value = value;\n\tthis.size = size;\n\tthis.collide = false; //Need this for the fruit merging. When 2 fruits collide they call the MergeFruit function more than once, causing too many new fruits to spawn.\n}", "addObject(obj) {\n var className = Object.keys(obj)[0];\n var object = Object.values(obj)[0];\n this.addToScene(className, object);\n }", "function tech() { categoryChoice = TECHNOLOGY;\n getNews()\n}", "function Cat( cat_name ) {\n var name = cat_name;\n this.getName = function() {\n return name;\n };\n }", "constructor() {\n\t\tthis.categories = [];\n\t}", "constructor(name, category, server) {\n\t\tthis.id = current_room_id;\n\t\tcurrent_room_id++\n\t\tthis.name = name;\n\t\tthis.category = category;\n\t\t// TODO implementar list de jogadores como arvore binaria pelo ID\n\t\tthis.players = [];\n\t\t// list com IDs do usuarios que ja desenharam\n\t\tthis.alreadyDraw = [];\n\t\t// lista com IDs do usuario que ja acertaram\n\t\tthis.alreadyGuessed = [];\n\t\t// timer que ira chamar as funcoes de mudanca de estado (referencia salva para poder cancelar se necessario)\n\t\tthis.timer = null;\n\n\t\t// game cycle properties\n\t\tthis.stage = \"initial\"\n\t\tthis.currentDrawer = -1;\n\t\tthis.currentDrawing = null;\n\t\t\n\t\t// create room topics\n\t\tthis.topics = {\n\t\t\tstatus: server.connection.channels.get(\"/rooms/\"+this.id),\n\t\t\tcanvas: server.connection.channels.get(\"/rooms/\"+this.id+\"/canvas\"),\n\t\t\tchat: server.connection.channels.get(\"/rooms/\"+this.id+\"/chat\"),\n\t\t\tanswers: server.connection.channels.get(\"/rooms/\"+this.id+\"/answers\"),\n\t\t} \n\n\n\t}", "function hideCategory(category) {\n NEAR_FIELD_OBJECTS.scene.children.forEach(child => {\n if (child.userData == category)\n child.visible = false\n })\n}", "function getCat(){\n var cat = {\n\tname: nameList[getRandomInt(0,nameList.length-1)],\n\tage: getRandomInt(0,100),\n\tcolor: getColor()\n };\n return cat;\n}", "function Cat(name) {\n this.name = name; \n }", "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "constructor(category) {\n\t\tthis.Cat = category;\n\t\tthis.cats = [\"Art\",\"Science\",\"Sport\",\"Literature\"];\n\t\tthis._Books = [];\n\t\t//myShelf._Books.push(new Book());\n\t}", "function addToCateg () {\n\n\t\tfor(var i=0;i<whichCateg;i++){\n\t\t\tif(cathegory == Object.getOwnPropertyNames(categ.categName)[i])\n\t\t\t\t{console.log(\"this is working BUT\");\n\t\t\t\t\tconsole.log(\"cathegory \" + cathegory);\n\t\t\t\t\t// BUT CANT AUTOMATED////////\n\t\t\t\t\tObject.keys(categ.categName[cathegory].push(Name));\t\n\t\t\t\t}\n\t\t}\n\t}", "function randomCategory() {\n const keys = Object.keys(originals)\n return keys[Math.floor(Math.random() * keys.length)]\n}", "function loadClothing () {\n clothingChoices = {\n 'male': [\n new Clothing('hat', 'hat', EXTRA_ARTICLE, 'head', \"player/male/hat.png\", false, 0),\n new Clothing('headphones', 'headphones', EXTRA_ARTICLE, 'head', \"player/male/headphones.png\", true, 1),\n new Clothing('jacket', 'jacket', MINOR_ARTICLE, UPPER_ARTICLE, \"player/male/jacket.png\", false, 2),\n new Clothing('shirt', 'shirt', MAJOR_ARTICLE, UPPER_ARTICLE, \"player/male/shirt.png\", false, 3),\n new Clothing('t-shirt', 'shirt', MAJOR_ARTICLE, UPPER_ARTICLE, \"player/male/tshirt.png\", false, 4),\n new Clothing('undershirt', 'shirt', IMPORTANT_ARTICLE, UPPER_ARTICLE, \"player/male/undershirt.png\", false, 5),\n\n new Clothing('glasses', 'glasses', EXTRA_ARTICLE, 'head', \"player/male/glasses.png\", true, 6),\n new Clothing('belt', 'belt', EXTRA_ARTICLE, 'waist', \"player/male/belt.png\", false, 7),\n new Clothing('pants', 'pants', MAJOR_ARTICLE, LOWER_ARTICLE, \"player/male/pants.png\", true, 8),\n new Clothing('shorts', 'shorts', MAJOR_ARTICLE, LOWER_ARTICLE, \"player/male/shorts.png\", true, 9),\n new Clothing('kilt', 'skirt', MAJOR_ARTICLE, LOWER_ARTICLE, \"player/male/kilt.png\", false, 10),\n new Clothing('boxers', 'underwear', IMPORTANT_ARTICLE, LOWER_ARTICLE, \"player/male/boxers.png\", true, 11),\n\n new Clothing('necklace', 'jewelry', EXTRA_ARTICLE, 'neck', \"player/male/necklace.png\", false, 12),\n new Clothing('tie', 'tie', EXTRA_ARTICLE, 'neck', \"player/male/tie.png\", false, 13),\n new Clothing('gloves', 'gloves', EXTRA_ARTICLE, 'hands', \"player/male/gloves.png\", true, 14),\n new Clothing('socks', 'socks', MINOR_ARTICLE, 'feet', \"player/male/socks.png\", true, 15),\n new Clothing('shoes', 'shoes', EXTRA_ARTICLE, 'feet', \"player/male/shoes.png\", true, 16),\n new Clothing('boots', 'shoes', EXTRA_ARTICLE, 'feet', \"player/male/boots.png\", true, 17),\n ],\n female: [\n new Clothing('hat', 'hat', EXTRA_ARTICLE, 'head', \"player/female/hat.png\", false, 0),\n new Clothing('headphones', 'headphones', EXTRA_ARTICLE, 'head', \"player/female/headphones.png\", true, 1),\n new Clothing('jacket', 'jacket', MINOR_ARTICLE, UPPER_ARTICLE, \"player/female/jacket.png\", false, 2),\n new Clothing('shirt', 'shirt', MAJOR_ARTICLE, UPPER_ARTICLE, \"player/female/shirt.png\", false, 3),\n new Clothing('tank top', 'shirt', MAJOR_ARTICLE, UPPER_ARTICLE, \"player/female/tanktop.png\", false, 4),\n new Clothing('bra', 'bra', IMPORTANT_ARTICLE, UPPER_ARTICLE, \"player/female/bra.png\", false, 5),\n\n new Clothing('glasses', 'glasses', EXTRA_ARTICLE, 'head', \"player/female/glasses.png\", true, 6),\n new Clothing('belt', 'belt', EXTRA_ARTICLE, 'waist', \"player/female/belt.png\", false, 7),\n new Clothing('pants', 'pants', MAJOR_ARTICLE, LOWER_ARTICLE, \"player/female/pants.png\", true, 8),\n new Clothing('shorts', 'shorts', MAJOR_ARTICLE, LOWER_ARTICLE, \"player/female/shorts.png\", true, 9),\n new Clothing('skirt', 'skirt', MAJOR_ARTICLE, LOWER_ARTICLE, \"player/female/skirt.png\", false, 10),\n new Clothing('panties', 'underwear', IMPORTANT_ARTICLE, LOWER_ARTICLE, \"player/female/panties.png\", true, 11),\n\n new Clothing('necklace', 'jewelry', EXTRA_ARTICLE, 'neck', \"player/female/necklace.png\", false, 12),\n new Clothing('bracelet', 'jewelry', EXTRA_ARTICLE, 'arms', \"player/female/bracelet.png\", false, 13),\n new Clothing('gloves', 'gloves', EXTRA_ARTICLE, 'hands', \"player/female/gloves.png\", true, 14),\n new Clothing('stockings', 'socks', MINOR_ARTICLE, 'legs', \"player/female/stockings.png\", true, 15),\n new Clothing('socks', 'socks', MINOR_ARTICLE, 'feet', \"player/female/socks.png\", true, 16),\n new Clothing('shoes', 'shoes', EXTRA_ARTICLE, 'feet', \"player/female/shoes.png\", true, 17),\n ]\n };\n}", "function Cat(name, color){\r\n this.name = name\r\n this.color = color\r\n}", "function CoreGame(){\n\t\t//console.log(this);\n\t\tthis.initialize();\n\t}", "function getCategoryId(id) {\n console.log(\"Catgory Id\", id);\n ipcRenderer.send(\"categoryId\", id);\n}", "function findCategory(category) {\n return originals[category]\n}", "function GameObject(data, parent)\n {\n CoreObject.call(this, parent);\n data = data || {};\n this.name = data.name;\n this.type = data.type;\n this.data = data;\n this._scene = this.getScene();\n this._game = this.getGame();\n this._gameModel = this.getGameModel();\n }", "function Cat(){\n}", "function Cat(){\n}", "function init(){\n buildCategoryImageList();\n }", "function showAllCategories(){\n NEAR_FIELD_OBJECTS.scene.children.forEach(child => {\n child.visible = true\n })\n}", "function Category(){\n\tthis.id; // eg \"home\"\n\tthis.name; // eg \"Accueil\"\n\tthis.articles_ids = [];\n\tthis.articles = [];\n\tthis.fetch_url;\n\tthis.last_update;\n\n\tif (typeof Category.initialized == \"undefined\" ) {\n\t\tCategory.prototype.loadOnline = function () {\n\t\t\t// Fetch 1 category and its articles\n\t\t\t// @todo : check timestamps\n\t\t\tvar articles_ids = [];\n\t\t\t$(this.articles).each(function(i, art) {\n\t\t\t\tarticles_ids.push(art.id);\n\t\t\t});\n\n\t\t\tvar current_category = new Category();\n\t\t\tvar that = this;\n\n\t\t\t$.ajax(this.fetch_url, {\n\t\t\t\tdataType: 'json', // data will be parsed in json automagically\n\t\t\t\ttype: \"GET\",\n\t\t\t\tdata: articles_ids,\n\t\t\t\tcache: false,\n\t\t\t\tsuccess: function(json) {\n\t\t\t\t\t// update list for given category\n\t\t\t\t\tjson = json.objects[0];\n\t\t\t\t\tif(json.name && that.id == json.name /*&& json.timestamp >= last_update*/) {\n\t\t\t\t\t\t// add current_category.* = *\n\t\t\t\t\t\tthat.id = json.name; // @todo : Fix naming conventions for human-readable title (translated) and fixed id/name\n\t\t\t\t\t\tthat.last_update = json.timestamp;\n\n\t\t\t\t\t\t$(json.articles).each(function(i, art) {\n\t\t\t\t\t\t\tarticle = new Article();\n\t\t\t\t\t\t\t// @todo : check timestamp too (by the server, so we need to send it in the post data too)\n\t\t\t\t\t\t\tif(typeof art == \"number\") {\n\t\t\t\t\t\t\t\tarticle.load(art);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tarticle.id = art.id;\n\t\t\t\t\t\t\t\tarticle.title = art.title;\n\t\t\t\t\t\t\t\tarticle.text = art.text;\n\t\t\t\t\t\t\t\tarticle.subhead = art.text; // @todo FIXME : Should be corrected immediately after reading this\n\t\t\t\t\t\t\t\tarticle.picture = art.picture;\n\t\t\t\t\t\t\t\tarticle.date = art.date;\n\t\t\t\t\t\t\t\tarticle.author = art.author;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tthat.articles.push(article);\n\t\t\t\t\t\t\tthat.articles_ids.push(article.id);\n\n\t\t\t\t\t\t\tarticle.save(article.id);\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t// show articles\n\t\t\t\t\t\tthat.showArticles();\n\t\t\t\t\t\t// update local data for category\n\t\t\t\t\t\tthat.saveLocal();\n\t\t\t\t\t} else { \n\t\t\t\t\t\tconsole.log(\"Error while loading category updates.\"); \n\t\t\t\t\t\tapp.errorOrNoInternet();\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\terror: function() {\n\t\t\t\t\tapp.errorOrNoInternet();\n\t\t\t\t}\n\t\t\t});\n\t\t};\n\n\t\t// Storage fetch\n\t\tCategory.prototype.loadLocal = function(id) {\n\t\t\tvar category = $.jStorage.get('categories['+id+']');\n\t\t\tif(category) {\n\t\t\t\tthis.name = category.name;\n\t\t\t\tthis.articles = [];\n\t\t\t\t$(category.articles_ids).each(function(i, article_id) {\n\t\t\t\t\tarticle = new Article();\n\t\t\t\t\tarticle.load(article_id);\n\t\t\t\t\tthis.articles.push(article);\n\t\t\t\t\tthis.articles_ids.push(article.id);\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn this;\n\t\t};\n\n\t\t// Save in local storage for faster refresh\n\t\tCategory.prototype.saveLocal = function() {\n\t\t\t//@TODO : if category already saved test \n\t\t\t$(this.articles).each(function (i, art) {\n\t\t\t\tart.save();\n\t\t\t});\n\t\t\t$.jStorage.set('categories['+this.id+']', this);\n\t\t};\n\n\t\t// Linked to interface\n\t\tCategory.prototype.refresh = function() {\n\t\t\t// First load the local copy if exists\n\t\t\tthis.loadLocal();\n\t\t\t// Then try to update local with distant version\n\t\t\tif(app.is_connected()) {\n\t\t\t\tthis.loadOnline();\n\t\t\t}\n\t\t};\n\n\t\tCategory.prototype.showArticles = function () {\n\t\t\tcategory = this;\n\t\t\t$(this.articles).each(function (i, art) {\n\t\t\t\tart.showItem(category);\n\t\t\t});\n\t\t};\n\n\t\tCategory.initialized = true;\n\t}\n}", "function Game() {\n // Module constants and variables\n var _this = this;\n _this.gameObjects = {};\n /**\n * Initialize the Game and call the custom init function if a custom\n * init function is connected to the Game.\n *\n * @function init\n * @param {number} FPS The game's frames per second.\n * @param {object} ctx The 2D context of the game canvas.\n * @param {object} canvas The game canvas.\n */\n function init(FPS, ctx, canvas) {\n _this.FPS = FPS;\n _this.ctx = ctx;\n _this.canvas = canvas;\n // Call the custom init function if it is defined\n if (_this.customInit) {\n _this.customInit(_this.ctx);\n }\n }\n /**\n * Reset the Game and call the custom reset function if a custom reset\n * function is connected to the Game.\n *\n * @function reset\n */\n function reset() {\n // Clear all the GameObjects\n Object.keys(_this.gameObjects).forEach(function (type) {\n _this.gameObjects[type] = [];\n });\n // Call the custom reset function if it is defined\n if (_this.customReset) {\n _this.customReset();\n }\n }\n /**\n * Delete a conrete GameObject from the Game if it is flaged for\n * removal.\n *\n * @private\n * @function handleDelete\n * @param {object} gameObject The concrete GameObject.\n * @param {string} type The concrete GameObject's type.\n */\n function handleDelete(gameObject, type) {\n if (gameObject.canDelete()) {\n _this.gameObjects[type].splice(\n _this.gameObjects[type].indexOf(gameObject),\n 1\n );\n }\n }\n /**\n * Update the Game and call the custom update function if a custom\n * update function is connected to the Game.\n *\n * @function update\n */\n function update() {\n // Call the custom update function if it is defined\n if (_this.customUpdate) {\n _this.customUpdate(_this.FPS, _this.canvas);\n }\n // Update all of the GameObjects and handle GameObject deletion\n Object.keys(_this.gameObjects).forEach(function (type) {\n _this.gameObjects[type].forEach(function (obj) {\n obj.update(_this.FPS);\n handleDelete(obj, type);\n });\n });\n }\n /**\n * Render the Game and call the custom render function if a custom\n * render function is connected to the Game.\n *\n * @function render\n */\n function render() {\n // Clear the canvas prior to rendering\n _this.ctx.clearRect(0, 0, _this.canvas.width, _this.canvas.height);\n // Call the custom render function if it is defined\n if (_this.customRender) {\n _this.customRender(_this.ctx, _this.canvas);\n }\n // Render all of the GameObjects in order of their render priority\n $.map(_this.gameObjects, function (value) {\n return value;\n }).sort(function (gameObjA, gameObjB) {\n return gameObjA.getDrawPriority() - gameObjB.getDrawPriority();\n }).forEach(function (obj) {\n obj.render(_this.ctx);\n });\n }\n /**\n * Return the Game's collection of GameObjects specified by type, if the\n * collection of GameObjects do not exist for the specified type return\n * an empty array.\n *\n * @function getGameObjects\n * @param {string} type The Type of GameObjects to return.\n * @return {object} The GameObjects.\n */\n function getGameObjects(type) {\n return _this.gameObjects[type] || [];\n }\n /**\n * Add a concrete GameObject with a specific type to the Game.\n *\n * @function addGameObject\n * @param {object} gameObject The concrete GameObject.\n * @param {string} type The concrete GameObject's type.\n */\n function addGameObject(gameObject, type) {\n // If array of specific objects doesn't exist then create it\n if (Object.keys(_this.gameObjects).indexOf(type) < 0) {\n // Create an new array of items\n _this.gameObjects[type] = [];\n }\n _this.gameObjects[type].push(gameObject);\n }\n /**\n * Connect a custom Init function to the Game.\n *\n * @function connectCustomInit\n * @param {function} customInit The custom init function.\n */\n function connectCustomInit(customInit) {\n _this.customInit = customInit;\n }\n /**\n * Connect a custom reset function to the Game.\n *\n * @function connectCustomReset\n * @param {function} customReset The custom reset function.\n */\n function connectCustomReset(customReset) {\n _this.customReset = customReset;\n }\n /**\n * Connect a custom update function to the Game.\n *\n * @function connectCustomUpdate\n * @param {function} customUpdate The custom update function.\n */\n function connectCustomUpdate(customUpdate) {\n _this.customUpdate = customUpdate;\n }\n /**\n * Connect a custom render function to the Game.\n *\n * @function connectCustomRender\n * @param {function} customRender The custom render function.\n */\n function connectCustomRender(customRender) {\n _this.customRender = customRender;\n }\n /**\n * Abstract function that defines the Game's mouse click event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function mouseClickEvent\n * @throws {Error} Abstract function.\n */\n function mouseClickEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's mouse release event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function mouseReleaseEvent\n * @throws {Error} Abstract function.\n */\n function mouseReleaseEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's mouse movement event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function mouseMoveEvent\n * @throws {Error} Abstract function.\n */\n function mouseMoveEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's keyboard press event. This\n * function needs to be overriden.\n *\n * @abstract\n * @function keyPressEvent\n * @throws {Error} Abstract function.\n */\n function keyPressEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n /**\n * Abstract function that defines the Game's keyboard release event.\n * This function needs to be overriden.\n *\n * @abstract\n * @function keyReleaseEvent\n * @throws {Error} Abstract function.\n */\n function keyReleaseEvent() {\n throw new Error(\"Cannot call abstract function!\");\n }\n // Functions returned by the module\n return {\n init: init,\n reset: reset,\n update: update,\n render: render,\n addGameObject: addGameObject,\n keyPressEvent: keyPressEvent,\n mouseMoveEvent: mouseMoveEvent,\n getGameObjects: getGameObjects,\n mouseClickEvent: mouseClickEvent,\n keyReleaseEvent: keyReleaseEvent,\n mouseReleaseEvent: mouseReleaseEvent,\n connectCustomInit: connectCustomInit,\n connectCustomReset: connectCustomReset,\n connectCustomRender: connectCustomRender,\n connectCustomUpdate: connectCustomUpdate\n };\n }", "function gameObject() {\n\tthis.type = 'generic';\n\tthis.character = '&nbsp;';\n}", "static mapState(state) {\n let {categories} = state.core.category;\n return {\n categories\n };\n }", "function gameObj() {\n this.gamenum=0;\n this.init = function() {\n this.items=[];\n this.times=[];\n this.firsttime=[];\n this.category=\"\";\n this.starttime=0;\n this.countdown=timeperlist;\n }\n this.init();\n }", "function initObject(){\n\tmyplayer = new Player(img, 0, 0, 30, 50);\n\tanimals.push(new Animal(animalImgUp, 0, 800, 30, 50));\n\tanimals.push(new Animal(animalImgDown, 1000, 0, 30 ,50));\n\tanimals.push(new Animal(animalImgLeft, 600, 500, 30, 50));\n\tanimals.push(new Animal(animalImgRight, 100, 600, 30, 50));\n\tmyGame = new Game();\n}", "constructor(data, name=null, category) {\n\t\tthis.data = data;\n\t\tif(name){\n\t\t\tthis.name = name;\n\t\t} else {\n\t\t\tthis.name = null;\n\t\t}\n\t\tthis.category = category; // => auto, pointScoring, movement, penalties, endGame (((WRITE CATEGORIES)))\n\t\tthis.given = !!data; // If user supplies stat\n\t}", "function addProductCategory(){\r\n\t var categoryId = 0;\r\n\t var categoryName,categoryOptions ;\r\n\r\n\t productCategoriesArray.push(new ProductCategory(categoryId,categoryName,categoryOptions));\r\n iterateProductCategoriesArray();\r\n }", "get subCategory () {\n\t\treturn this._subCategory;\n\t}", "function mouseOverCategory(d) {\n if (timer_draw) timer_draw.stop();\n mouse_hover_active = true;\n hover_type = 'category';\n current_hover = d;\n let id = d.id;\n\n //Draw the edges from threat category to the elements\n edges_elements.forEach(l => {\n l.opacity = l.target.id === id ? 0.5 : 0;\n });\n\n //Draw the edges from the threat category to the threats\n edges_concepts.forEach(l => {\n l.opacity = l.target.id === id ? 0.5 : 0;\n });\n\n //Draw the ICH circles\n elements.forEach(n => {\n n.opacity = n.threat_categories.indexOf(id) >= 0 ? 1 : 0.1;\n });\n ICH_num = elements.filter(n => n.threat_categories.indexOf(id) >= 0).length;\n\n //Draw connected threat categories\n threats.forEach(n => {\n n.opacity = n.id === id ? 1 : 0.1;\n });\n\n //Draw connected threats\n concepts.forEach(n => {\n n.opacity = n.threat_category === id ? 1 : 0.1;\n });\n\n //Draw it all\n drawCanvas();\n } //function mouseOverElement", "function placeClues() {\n\tvar game;\n \tgame = Game.instance;\n \t //get available clue data\n \t var currentClueDataArray = [];\n currentClueDataArray = getAvailableClues();\n //create array of objects and add to screen\n var clueLabelArray = [];\n for (var i = 0; i < currentClueDataArray.length; i++) {\n \tclueLabelArray[i] = new clueType(currentClueDataArray[i]);\n \tclueLabelArray[i].x = (i * 60) + 20 - (Math.floor(i/6) * 360);\n \tclueLabelArray[i].y = (Math.floor(i/6) * 60) + 80;\n \tif (clueLabelArray[i].available == 1) {\n \t\tgame.currentScene.addChild(clueLabelArray[i]);\n \t}\n }\n}", "getRoomCategoryForShared() {\n return this \n }", "getCategory() {\n return AWSS3Provider.CATEGORY;\n }", "function getCategoryId (id) {\n window.categoriaid = id //Guardo el id de la categoria en global\n }", "function GameObjectHandler (pGivenApp)\r\n{\r\n\tvar _this = this;\r\n\tthis.objectTypes = new Array();\r\n\tvar app = pGivenApp;\r\n\t\r\n\tvar gameObjectsArray = new Array();\r\n\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t{\r\n\t\tgameObjectsArray[i] = new GameObject(i, _this, app);\r\n\t}\r\n\t\r\n\tvar objectCount = 0;\r\n\tvar lastNewPosition = 0;\t// Tracks where the last new object was created. Used to decrease time in finding an empty space.\r\n\t\r\n\t// Called to add a new object type.\r\n\tthis.addType = function (pType, pModule)\r\n\t{\r\n\t\t_this.objectTypes.push({type: pType, module: pModule});\r\n\t\treturn _this.objectTypes.length - 1;\r\n\t}\r\n\t\r\n\t// Called to retrieve an object type index.\r\n\tfunction getType(pType)\r\n\t{\r\n\t\t// Loops through the array until it finds a type that matches by name.\r\n\t\tfor (var i = 0; i < _this.objectTypes.length; i++)\r\n\t\t{\r\n\t\t\tif (_this.objectTypes[i].type == pType) break;\r\n\t\t}\r\n\t\tif (i >= 0 && i < _this.objectTypes.length) return _this.objectTypes[i];\r\n\t\treturn null;\r\n\t}\r\n\t\r\n\t// Called to instantiate a new object.\r\n\tthis.create = function (pType, pPosition)\r\n\t{\r\n\t\t// Get the type.\r\n\t\ttype = getType(pType);\r\n\t\tif (type == null) return;\r\n\t\tvar index = lastNewPosition;\r\n\t\t// If the index is invalid, reset it.\r\n\t\tif (index < 0 || index >= GameObjectHandlerConstants.maxObjects || gameObjectsArray[index].active)\r\n\t\t{\r\n\t\t\tindex = -1;\r\n\t\t}\r\n\t\t// If the index is -1, go ahead and find the first empty space after that.\r\n\t\tif (index <= -1)\r\n\t\t{\r\n\t\t\tfor (index = 0; index < GameObjectHandlerConstants.maxObjects; index++)\r\n\t\t\t{\r\n\t\t\t\tif (!gameObjectsArray[index].active)\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// If we didn't find any empty spaces, return null.\r\n\t\tif (index >= GameObjectHandlerConstants.maxObjects) return null;\r\n\t\t// Otherwise, create and return the object.\r\n\t\tlastNewPosition = index + 1;\r\n\t\tvar module = new type.module(gameObjectsArray[index]);\r\n\t\tgameObjectsArray[index].init(pType, module, pPosition);\r\n\t\tobjectCount++;\r\n\t\treturn gameObjectsArray[index];\r\n\t}\r\n\t\r\n\t// Called to destroy an object.\r\n\tthis.destroy = function (pIndex)\r\n\t{\r\n\t\tif (pIndex < 0 || pIndex >= GameObjectHandlerConstants.maxObjects) return;\r\n\t\tif (!gameObjectsArray[pIndex].active) return;\r\n\t\tgameObjectsArray[pIndex].destroy(false);\r\n\t\tlastNewPosition = pIndex;\r\n\t\tobjectCount--;\r\n\t}\r\n\t\r\n\t// Called to retrieve an object with a given index.\r\n\tthis.get = function (pIndex)\r\n\t{\r\n\t\tif (pIndex < 0 || pIndex >= GameObjectHandlerConstants.maxObjects) return null;\r\n\t\treturn gameObjectsArray[pIndex];\r\n\t}\r\n\t\r\n\t// Called to retrieve the number of active objects.\r\n\tthis.countAll = function()\r\n\t{\r\n\t\treturn objectCount;\r\n\t}\r\n\t\r\n\t// Called to update all objects.\r\n\tthis.updateAll = function()\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tgameObjectsArray[i].update();\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Called to check collisions for all objects.\r\n\tthis.collideAll = function()\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tfor (var j = 0; j < GameObjectHandlerConstants.maxObjects; j++)\r\n\t\t\t{\r\n\t\t\t\t// Don't collide an object with itself...\r\n\t\t\t\tif (i == j) continue;\r\n\t\t\t\tgameObjectsArray[i].collide(gameObjectsArray[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Called to draw all objects.\r\n\tthis.drawAll = function(pPaused, spriteList, drawQueue, showHitBoxes)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tgameObjectsArray[i].draw(pPaused, spriteList, drawQueue, showHitBoxes);\r\n\t\t}\r\n\t}\r\n\t\r\n\t// Called to destroy all objects.\r\n\tthis.destroyAll = function(pIsStarting)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tgameObjectsArray[i].destroy(pIsStarting);\r\n\t\t}\r\n\t\tobjectCount = 0;\r\n\t}\r\n\t\r\n\t// Called to run a custom loop. If the rule executes to true on any object, the function returns true; false otherwise.\r\n\tthis.customBooleanLoop = function(pRule)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tif (pRule(gameObjectsArray[i])) return true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t// Called to run a custom loop. If the rule executes to true on an object, the function returns that object; null otherwise.\r\n\tthis.customObjectLoop = function(pRule)\r\n\t{\r\n\t\tfor (var i = 0; i < GameObjectHandlerConstants.maxObjects; i++)\r\n\t\t{\r\n\t\t\tif (pRule(gameObjectsArray[i])) return false;\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n}", "init() {\n this.category = this.inputs.getProp('category');\n }", "function chooseCategory(input) {\n\t var category = data[input];\n\t return category;\n\t }", "function AuctionHouse() { \r\n // Category dropdowns registry. The id is the dropdown field name.\r\n this.auctionHouseCategories = \r\n {\r\n food:\r\n {\r\n Category:\r\n {\r\n id: 'cat',\r\n All: '',\r\n Meat: 'meat',\r\n Seafood: 'seafood',\r\n Insects: 'insect',\r\n Plants: 'plant'\r\n }\r\n },\r\n mats:\r\n {\r\n Category:\r\n {\r\n id: 'cat',\r\n All: '',\r\n \"Minerals &amp; Ores\": 'minerals & ores',\r\n Organics: 'organics',\r\n Dragonmade: 'dragonmade'\r\n }\r\n },\r\n app:\r\n {\r\n Category:\r\n {\r\n id: 'cat',\r\n All: '',\r\n Head: 'head',\r\n Body: 'body',\r\n Wings: 'wings',\r\n Legs: 'legs',\r\n Tail: 'tail',\r\n \"Extras & Accents\": 'extras'\r\n }\r\n },\r\n dragons:\r\n {\r\n Breed:\r\n {\r\n id: 'breed',\r\n All: '',\r\n Fae: '1',\r\n Guardian: '2', \r\n Mirror: '3', \r\n Pearlcatcher: '4', \r\n Ridgeback: '5',\r\n Tundra: '6',\r\n Spiral: '7',\r\n Imperial: '8',\r\n Snapper: '9',\r\n Wildclaw: '10',\r\n Skydancer: '13'\r\n },\r\n Gender:\r\n {\r\n id: 'gender',\r\n All: '',\r\n Male: '0',\r\n Female: '1'\r\n },\r\n \"Primary Gene\":\r\n {\r\n id: 'primegene',\r\n All: '',\r\n Basic: '0',\r\n Iridescent: '1',\r\n Tiger: '2',\r\n Clown: '3',\r\n Speckle: '4'\r\n },\r\n \"Secondary Gene\":\r\n {\r\n id: 'secgene',\r\n All: '',\r\n Basic: '0',\r\n Shimmer: '1',\r\n Stripes: '2',\r\n \"Eye Spot\": '3',\r\n Freckle: '4',\r\n Seraph: '5'\r\n },\r\n \"Tertiary Gene\":\r\n {\r\n id: 'tertgene',\r\n All: '',\r\n Basic: '0',\r\n Circuit: '1',\r\n Gembond: '4',\r\n Underbelly: '5'\r\n }\r\n },\r\n battle:\r\n {\r\n Element:\r\n {\r\n id: 'cat',\r\n All: '',\r\n \"Non-Elemental\": '0',\r\n Earth: '1',\r\n Fire: '11',\r\n Wind: '3',\r\n Water: '4',\r\n Shadow: '7',\r\n Light: '8',\r\n Lightning: '5',\r\n Ice: '6',\r\n Nature: '10',\r\n Plague: '2',\r\n Arcane: '9'\r\n }\r\n },\r\n skins:\r\n {\r\n Breed:\r\n {\r\n id: 'cat',\r\n All: '',\r\n Fae: '1',\r\n Guardian: '2', \r\n Mirror: '3', \r\n Pearlcatcher: '4', \r\n Ridgeback: '5',\r\n Tundra: '6',\r\n Spiral: '7',\r\n Imperial: '8',\r\n Snapper: '9',\r\n Wildclaw: '10',\r\n Skydancer: '13'\r\n },\r\n Gender:\r\n {\r\n id: 'cat2',\r\n All: '',\r\n Male: '0',\r\n Female: '1'\r\n }\r\n },\r\n other:\r\n {\r\n Category:\r\n {\r\n id: 'cat',\r\n All: '',\r\n Trinkets: 'trinkets',\r\n \"Holiday Items\": 'holiday items',\r\n Chests: 'chests',\r\n \"Dragon Eggs\": 'dragon eggs',\r\n \"Specialty Items\": 'specialty items'\r\n }\r\n }\r\n }\r\n \r\n forceSelect('#super-container div', function(sel) {\r\n var links = $(sel[1]).find('div a');\r\n \r\n $(links[0]).attr('id', 'search_food');\r\n $(links[1]).attr('id', 'search_mats');\r\n $(links[2]).attr('id', 'search_app');\r\n $(links[3]).attr('id', 'search_dragons');\r\n $(links[4]).attr('id', 'search_fam');\r\n $(links[5]).attr('id', 'search_battle');\r\n $(links[6]).attr('id', 'search_skins');\r\n $(links[7]).attr('id', 'search_other');\r\n });\r\n}", "function Cat() {\n this.name = \"Ola\";\n this.age = 20;\n}", "designCategory(id, objects_hash, tree){\n\t\tthis.objects_hash = objects_hash\n\t\tif(this.rank <= 3){\n\t\t\tvar treeData = tree.getNodeAndChildren(id, tree.traverseBF); //searches in the Configurable Client Tree for the child node\n\t\t\tvar options = treeData['children'];\n\t\t\tthis.current_category = options[0].category;\n\t\t\tvar data_for_next = this._checkIfToHide(options[0]);\n\t\t\tif(data_for_next){\n\t\t\t\tthis.lensTable.showNextCategory(data_for_next);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else if(this._isFocoCategory(\"Solo_Montura\") || this._isFocoCategory(\"Neutra\")){\n\t\t\tthis.lensTable.showNextCategory({'next_category': null,'button_id':'','button_type':'','category_position':4})\n\t\t\tthis._hide4thTitle();\n\t\t\treturn;\n\t\t}else if(this.rank == 4){\n\t\t\tvar options = this._getPrescriptionOptions();\n\t\t}else{\n\t\t\tthis._addPrescriptionFillIns();\n\t\t\tthis._givePopulatedBodyFields();\n\t\t\tthis._enable5thTitle();\n\t\t\tthis._enable5thBody();\n\t\t\tthis.lensTable.showNextCategory({'next_category': null,'button_id':'','button_type':'','category_position':5});\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tthis._populateWithOptions(options);\n\t}", "function Cat(name, color){\n this.name = name;\n this.color = color;\n}", "componentDidMount() {\n this.getCategorys()// get frist class category because the default state parentId is '0'\n \n }", "static applyCategoryInfoToInstance(category, categoryInfo) {\n category.id = categoryInfo.id;\n category.title = categoryInfo.title;\n category.photoCount = categoryInfo.photo_count;\n category.selfLink = categoryInfo.links.self;\n category.photosLink = categoryInfo.links.photos;\n }", "[consts.CATEGORY_ADD](state, catObj) {\n let insCategoryObj = {\n id: catObj[\"id\"],\n pid: catObj[\"pid\"],\n dt: catObj[\"dt\"],\n idleaf: catObj[\"idleaf\"],\n kwrds: catObj[\"keyWords\"][\"keyWords\"],\n kwrdson: catObj[\"keyWords\"][\"keyWordsSelfOn\"],\n orderby: catObj[\"order\"][\"orderby\"],\n auto_numerate: catObj[\"order\"][\"autoNumerate\"],\n user_fields_on: catObj[\"userFields\"][\"userFieldsOn\"],\n uflds: catObj[\"uflds\"],\n num: parseInt(catObj[\"num\"]),\n chkd: false\n };\n for (let itm in catObj[\"names\"])\n insCategoryObj[\"name_\" + itm] = catObj[\"names\"][itm].name;\n\n //Categories add 1\n state.itemsCount++;\n\n //Set leaf id if it is root category\n if (catObj[\"pid\"] == -1) state.idLeaf = catObj[\"idleaf\"];\n\n Vue.set(state.list, state.list.length, insCategoryObj);\n }", "function Category({ categories }) {\n const { name, _id } = categories;\n\n return (\n <div className=\"col-lg-6 col-sm-12 category\" key={_id}>\n <img\n src={require(`../../assets/${name}category.jpg`)}\n alt={name}\n className=\"category-box\"\n />\n <div className=\"category-text\">\n <Link to={`/category/${_id}`}>\n <button className=\"btn btn-lg btn-outline-dark categorybtn\">{name}</button>\n </Link>\n </div>\n </div>\n );\n}", "function Cat(name) {\n this.name = name;\n}", "function Cat(name) {\n this.name = name;\n}", "function Cat(name) {\n this.name = name;\n}", "function getCategoryObject(str) {\n\n var ans = GAME.categories.filter(function(elem,index){\n return GAME.categories[index].idName == str;});\n return ans[0];\n}", "function Cat(){ this.name = 'tom'; }" ]
[ "0.69561833", "0.6500427", "0.6318129", "0.6287976", "0.61936593", "0.6173432", "0.6072899", "0.6072899", "0.6072899", "0.6072899", "0.59907544", "0.5961028", "0.592927", "0.5913261", "0.58879286", "0.586033", "0.5824812", "0.57867956", "0.57675856", "0.5720246", "0.56740785", "0.56053364", "0.5598208", "0.5596894", "0.55626476", "0.5537886", "0.553375", "0.55162", "0.5515665", "0.5515665", "0.54779774", "0.54779774", "0.54779774", "0.54779774", "0.54674256", "0.54482883", "0.5442332", "0.54419225", "0.5436586", "0.5425588", "0.541215", "0.5406224", "0.54044384", "0.5391926", "0.5377051", "0.53723246", "0.5360958", "0.53592837", "0.53542066", "0.5352203", "0.53496194", "0.5338821", "0.5338627", "0.5333816", "0.5331316", "0.53140926", "0.5298934", "0.52806646", "0.5267391", "0.52638113", "0.5261076", "0.5239067", "0.52126724", "0.5207084", "0.5198048", "0.5193788", "0.5193729", "0.5193729", "0.519197", "0.5190274", "0.518952", "0.5182623", "0.5182116", "0.51756287", "0.5173856", "0.516827", "0.5167951", "0.5162405", "0.51505566", "0.5145616", "0.51452756", "0.51399904", "0.51244056", "0.51221645", "0.5113648", "0.51096326", "0.5108603", "0.510295", "0.51017714", "0.5101277", "0.51005566", "0.5086711", "0.5085784", "0.50853384", "0.50847757", "0.50825334", "0.50825334", "0.50825334", "0.50816333", "0.50696313" ]
0.51968944
65
Called from set.js input idName of category, return categoryObject
function getCategoryObject(str) { var ans = GAME.categories.filter(function(elem,index){ return GAME.categories[index].idName == str;}); return ans[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }", "function getCategoryById(id) {\n return categoryHandler.GetCategoryById(id);\n }", "function Category(data) {\n \n if (!data) {\n throw 'Invalid data for Category';\n }\n \n this.id = data.Id;\n this.name = data.Name;\n \n }", "function getCategory(catId) {\n\n /* Locate a record within the global categoryList array based on the */\n /* category name */\n let result = categoryList.find(\n (category) => category.category.toLowerCase() === catId.toLowerCase());\n\n // If no result is found, result is false\n if (!result) {\n result = false;\n }\n\n return result; // return the result\n}", "function GetCategoryByID(id) {\n return categories.filter(function (obj) {\n return obj.id == id;\n })[0];\n}", "function setSelectedCategory(id) {\n FilterFactory.set('category', id);\n }", "function Category() {\n this.id;\n\n this.name;\n this.descripstion;\n\n this.createdDate;\n this.modifiedDate;\n this.deletedDate;\n\n this.parentCategoryId;\n this.childCategories;\n}", "function GetCategoryById(id) {\n return $resource(_URLS.BASE_API + 'get_category_by_id/' + id + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "async function getCategory(catId) {\n let categoryObjResponse= await axios.get(`http://jservice.io/api/category`, {params: {id: catId}})\n categoryObj = {\n title: categoryObjResponse.data.title,\n clues: categoryObjResponse.data.clues,\n showing: null\n };\n return categoryObj;\n}", "function Category(name, color, i, idName) {\n this.idName = idName;\n this.name = name;\n this.color = color;\n this.index = i;\n}", "function chooseCategory(input) {\n\t var category = data[input];\n\t return category;\n\t }", "category () {\n if (this.categoryId) {\n return BacklogItemCategories.findOne(this.categoryId)\n }\n }", "addCategory(categoryName) {\n\t\t\t/* This category will be added to the store; the object must take on the correct form, as below */\n\t\t\tvar newCategory = {\n\t\t\t\tcategoryId: '',\n\t\t\t\tname: categoryName,\n\t\t\t\titems: []\n\t\t\t}\n\n\t\t\tthis.$http.post('category/create', {\n\t\t\t\tname: categoryName,\n\t\t\t\tmenuId: JSON.parse(localStorage.menu).menuId\n\t\t\t}, {\n\t\t\t\theaders: {Authorization: JSON.parse(localStorage.user).token}\n\t\t\t}).then((res) => {\n\t\t\t\tif(res.status == 200 || res.status == 201) {\n\t\t\t\t\tnewCategory.categoryId = res.body.createdCategoryId;\n\t\t\t\t\tthis.$store.commit('addCategory', newCategory);\n\t\t\t\t\tthis.displayFlashMsg('New category \"' + categoryName + '\" was successfully added to your menu!', 'success');\n\t\t\t\t}\n\n\t\t\t}).catch((res) => {\n\t\t\t\tthis.handleApiError(res);\n\t\t\t});\n\t\t}", "function getCategory(id){\n return _categoryProducts.filter(category=>category.id===id*1)[0];\n}", "function getCategory(id) {\n $.get(\"/api/categories/\" + id, function (data) {\n if (data) {\n name.text(data.name);\n desc.text(data.description);\n }\n });\n }", "categ(state,data)\n {\n return state.category=data\n }", "function getCategoryId (id) {\n window.categoriaid = id //Guardo el id de la categoria en global\n }", "findCategory(name) {\n return this.categories.find(category => {\n return category.id.toLowerCase() === name.toLowerCase();\n });\n }", "function findCategory(){\n return _.find(categories, function(c){\n return c.name == categoryName;\n });\n }", "async getCategory(_, { id }, context) {\n // 1. check auth\n const user = isAdmin(context);\n try {\n const category = await Category.findById(id);\n return category;\n } catch (error) {\n throw new Error(error);\n }\n }", "setSelectedCategoryId(state, categoryId) {\n state.selectedCategoryId = categoryId;\n }", "findById(name) {\n let sqlRequest = \"SELECT name, created, modified, todo FROM category WHERE name=$name\";\n let sqlParams = {$name: name};\n return this.common.findOne(sqlRequest, sqlParams).then(row =>\n new Category(row.name, row.created, row.modified, row.todo));\n }", "function getCategoryByID(id) {\n\n\t\t\t\t\tvar deferred = $q.defer();\n\t\t\t\t\tvar category = _.findWithProperty(cache, \"id\", id);\n\n\t\t\t\t\tif (category) {\n\t\t\t\t\t\tdeferred.resolve(ng.copy(category));\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tdeferred.reject();\n\t\t\t\t\t}\n\n\t\t\t\t\treturn( deferred.promise );\n\n\t\t\t\t}", "async getCategorybyId (id) {\n const response = await fetch(`http://jservice.io/api/category?id=${id}`)\n const json = await response.json()\n return json\n }", "function getCategoryId(id) {\n console.log(\"Catgory Id\", id);\n ipcRenderer.send(\"categoryId\", id);\n}", "function findCategory(category) {\n return originals[category]\n}", "function getCategory(obj) {\n var id = obj.id;\n for (i in cats) {\n for (j = 0; j < cats[i].length; j++) {\n if (id == cats[i][j]) {\n return i;\n }\n }\n }\n}", "async _fetchOrCreateCategory() {\n const categoryUuid = CategoryImportJobParams.getCategoryUuid(this.params)\n if (categoryUuid) {\n return CategoryManager.fetchCategoryAndLevelsByUuid(\n {\n surveyId: this.surveyId,\n categoryUuid,\n draft: true,\n includeValidation: false,\n },\n this.tx\n )\n }\n\n const category = Category.newCategory({\n [Category.keysProps.name]: CategoryImportJobParams.getCategoryName(this.params),\n })\n return CategoryManager.insertCategory({ user: this.user, surveyId: this.surveyId, category, system: true }, this.tx)\n }", "[consts.CATEGORY_ADD](state, catObj) {\n let insCategoryObj = {\n id: catObj[\"id\"],\n pid: catObj[\"pid\"],\n dt: catObj[\"dt\"],\n idleaf: catObj[\"idleaf\"],\n kwrds: catObj[\"keyWords\"][\"keyWords\"],\n kwrdson: catObj[\"keyWords\"][\"keyWordsSelfOn\"],\n orderby: catObj[\"order\"][\"orderby\"],\n auto_numerate: catObj[\"order\"][\"autoNumerate\"],\n user_fields_on: catObj[\"userFields\"][\"userFieldsOn\"],\n uflds: catObj[\"uflds\"],\n num: parseInt(catObj[\"num\"]),\n chkd: false\n };\n for (let itm in catObj[\"names\"])\n insCategoryObj[\"name_\" + itm] = catObj[\"names\"][itm].name;\n\n //Categories add 1\n state.itemsCount++;\n\n //Set leaf id if it is root category\n if (catObj[\"pid\"] == -1) state.idLeaf = catObj[\"idleaf\"];\n\n Vue.set(state.list, state.list.length, insCategoryObj);\n }", "createWithId(Category) {\n let sqlRequest = \"INSERT into category (name, created, modified, todo) \" +\n \"VALUES ($name, $created, $modified, $todo)\";\n let sqlParams = {\n $name: Category.name,\n $created: Category.created,\n $modified: Category.modified,\n $todo: Category.todo\n };\n return this.common.run(sqlRequest, sqlParams);\n }", "async function getCategory(catId) {\n let response = await axios.get(`${BASE_API_URL}category?id=${catId}`);\n let cat = response.data;\n let allClues = cat.clues;\n let randomClues = _.sampleSize(allClues, NUM_CLUES_PER_CAT);\n let clues = randomClues.map(c => ({\n question: c.question,\n answer: c.answer,\n showing: null,\n }));\n return { title: cat.title, clues };\n}", "function setRecipeCategory(recipeId, categoryId) {\n return trx\n .insert({\n categorisable_id: recipeId,\n categorisable_type: 'recipes',\n category_id: categoryId\n })\n .into('categorisables')\n .then(() => categoryId);\n }", "function GetCategory(categoryId) {\n const [category, setCategory] = useState('');\n const url = \"/api/categories/\"+categoryId;\n useEffect(() => {\n const requestCategory = async () => {\n const response = await fetch(url);\n const { data } = await response.json();\n const att = await data.attributes;\n const cat = await att.category;\n setCategory(cat);\n };\n requestCategory();\n }, []);\n\n return category;\n}", "updateCategory(state, data) {\n const ind = findIndex(state.categories, (r) => {\n return r.id === data.id\n })\n\n const category = state.categories[ind]\n\n for (const prop in data) {\n category[prop] = data[prop]\n }\n }", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "function createCat(catName) {\n var catIndex = names.indexOf(catName);\n var newCat = new Cat(catName, images[catIndex]);\n cats.push(newCat);\n}", "function GetCategoryByName(name) {\n return $resource(_URLS.BASE_API + 'get_category_by_name/' + name + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "function Category() {\n}", "function editTodoCategory(category, id){\n\tvar count = readCount();\n\tvar listArr = readTodosArray();\n\tvar listLength = listArr.length;\n\n\tfor(index = 0; index < listLength; index++){\n\t\tif(listArr[index][ID] == id){\n\t\t\tlistArr[index][CATEGORY] = category;\n\t\t\twriteTodosArray(count, listArr);\n\t\t\treturn 0;\n\t\t}\n\t}\n\t\n\treturn -1;\n}", "function ProductCategory(categoryId,categoryName,categoryOptions){\r\n\t\tthis.categoryId = categoryId;\r\n\t\tthis.categoryName=categoryName;\r\n\t\tthis.categoryOptions=categoryOptions;\r\n\t}", "function findCatById (id) {\r\n return catArray.find(c => c.id == id);\r\n }", "function UpdateCategoryToDB(catId, catName){\n\tdb.transaction(function(tx) {\n\t\tdoQuery(tx, 'UPDATE Category SET CategoryName =\"'+ catName +'\" WHERE CategoryId=' + catId +';',[],querySuccessUpdate); \n\t});\n\treturn false;\n}", "setData(category, body){\n (body.name) ? category.name = body.name : null;\n (body.desc) ? category.desc = body.desc : null;\n (body.max) ? category.max = body.max : null;\n return category\n }", "function addProductCategory(){\r\n\t var categoryId = 0;\r\n\t var categoryName,categoryOptions ;\r\n\r\n\t productCategoriesArray.push(new ProductCategory(categoryId,categoryName,categoryOptions));\r\n iterateProductCategoriesArray();\r\n }", "function Category(category_data) {\r\n $.extend(this, category_data);\r\n }", "function getCategory(categoryId) {\n\t\t\treturn getCategories().then(function(result) {\n\t\t\t\treturn CatalogCache.getCategoryById(categoryId);\n\n\t\t\t});\n\n\n\t\t}", "validateCategory(_name) {\n\t\t/* Format the string */\n\t\tconst name = _name.toLowerCase();\n\n\t\t/* If the name is unique */\n\t\tvar unique = true;\n\t\tfor (var [categoryID, category] of Object.entries(this.storage.state.categories)) {\n\t\t\tif (category.name == name) {\n\t\t\t\tunique = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (unique) {\n\t\t\t/* Unique name */\n\t\t\tconst parameters = this.storage.emptyCategory;\n\t\t\tparameters.name = name;\n\t\t\tthis.storage.addCategory(parameters);\n\t\t} else {\n\t\t\t/* Existing name */\n\t\t\tconsole.log('\"' + name + '\" already exist');\n\t\t}\n\t}", "function whatCategory(num, cat) {\n for(var i = 0; i < cat.categories.length; i++) {\n if(cat.categories[i].id === num) {\n return cat.categories[i].name\n }\n }\n}", "static applyCategoryInfoToInstance(category, categoryInfo) {\n category.id = categoryInfo.id;\n category.title = categoryInfo.title;\n category.photoCount = categoryInfo.photo_count;\n category.selfLink = categoryInfo.links.self;\n category.photosLink = categoryInfo.links.photos;\n }", "get category() {\n\t\treturn this.__category;\n\t}", "constructor(id, name, category, dateCreated, description) {\n this.id = id;\n this.name = name;\n this.category = category;\n this.dateCreated = dateCreated;\n this.description = description;\n }", "function Cat( cat_name ) {\n var name = cat_name;\n this.getName = function() {\n return name;\n };\n }", "function insertCategory(category){\n var newId=getMaxId(_categoryProducts)+1;\n var newcategory = {\n id:newId,\n category:category,\n products:[]\n }\n _categoryProducts.push(newcategory); \n return newId;\n}", "static loadById(apiClient, id) {\n return __awaiter(this, void 0, _promise2.default, function* () {\n const response = yield apiClient.sendRequest('/categories/' + id),\n category = new Category(apiClient);\n Category.applyCategoryInfoToInstance(category, response);\n return category;\n });\n }", "function createIngredJS(id,name,category){\n var obj = new Object();\n obj.id = id;\n obj.name = name;\n obj.category = category;\n return obj;\n }", "function addCategory(category) {\n// var db = ScriptDb.getMyDb(); \n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n \n if (category == null) {\n return 0; \n }\n \n // if (db.query({type: \"list#categories\"}).getSize() == 0) {\n \n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n var id = db.save({type: \"categories\", list: [category]}).getId(); \n PropertiesService.getScriptProperties().setProperty(\"categories\", id);\n return 1;\n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n for (var i = 0 ; i<categories.list.length ; i++) {\n if (categories.list[i] == category) {\n return 0;\n }\n }\n categories.list.push(category);\n categories.list = categories.list.sort();\n db.save(categories);\n return 1;\n}", "async getCatToSub(_, { categoryId }) {\n try {\n const subcategories = await Subcategory.find({ category: categoryId });\n return subcategories;\n } catch (error) {\n throw new Error(error);\n }\n }", "function getProductCategoryData(catId){\n var productCategoryData = $http.post($global.API_URL + 'api/catalog/category/getData/', {\n data: catId\n }, {\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded' //Fix for Symfony\n }\n });\n\n return productCategoryData;\n }", "static getOneCategory (id) {\n return new Promise(async (resolve, reject) => {\n try {\n let res = await axios.get(`${urlC}/${id}`)\n let data = res.data\n resolve(data)\n } catch (error) {\n reject(error)\n }\n })\n }", "function addCategory() {\n\tif ( $('#catName').val()==='') {\n\t\treturn;\n\t}\n\n\tvar pnode = $('#tree1').tree('getSelectedNode');\n\tvar parentName;\n\tvar catid;\n\tvar rootid = \"00000000-0000-0000-0000-000000000000\"\n\t\t\n\t/* Assigning parent based on selected node, if any, otherwise parent is root*/\n\tif (pnode == false)\t{\n\t\tparentName=rootid;\n\t} else\t{\n\t\tparentName=pnode['id'];\n\t}\n\t\n\t\n /*Tree node description*/\t\n\tvar newNode= {\n\t\t\t\tname:$('#catName').val(),\n\t\t\t\tparentid:parentName //$('#tree1').tree('getNodeByName',$('#catName').val()).parent,\t\n\t}\n\t\t\n\t/*sending node data to server*/\n\t$.ajax({\n\t\turl : openke.global.Common.getRestURLPrefix()+\"/concepts/category\",\n\t\ttype : \"POST\",\n\t\tcontentType: \"application/json; charset=utf-8\",\n\t\tdata : JSON.stringify(newNode),\n\t\tdataType : \"JSON\",\n\t\tsuccess: function(data) {\n\t\t\t\t// get the UID from the result\n\t\t\t\n\t\t\t\tnewNode.id = data.concept.id;\n\t\t\t\t\n\t\t\t\t// Add node in UI(Front End)\n\t\t\t\t$('#tree1').tree( 'appendNode', newNode, pnode );\n\t\t\t\t$('#catName').val(''); //Reset text\n\t\t\t},\n\t\terror: function (jqXHR, textStatus, errorThrown) {\n\t\t\t// TODO\n\t\t}\n\t\n\t});\n}", "async adjustCatalog(categoryId) {\n if (categoryId === 0) return;\n const children = await this.children({ categoryId });\n await this.ctx.model.category.update({\n id: categoryId,\n catalog: children.length === 0 ? 0 : 1,\n });\n }", "updateCategory(id) {\n this.setState({\n category_id: id\n });\n }", "getCategory(_parameters) {\n\t\treturn new Category(_parameters);\n\t}", "function update(CatParam){\n var deferred = Q.defer();\n \n var id= CatParam._id;\n var category = CatParam.category;\n\n var set = {\t\n \t\t\tcategory: category,\n };\n\n db.categoryNRf.update(\n {_id: mongo.helper.toObjectID(CatParam._id)},\n {$set: set},\n function(err){\n \tif(err) deferred.reject(err);\n \t\n \tdeferred.resolve();\n });\n return deferred.promise;\n}", "function getCategory(categoryId, cb){\n\tconsole.log('getCategory()');\n\tdb.connect(function(conn){\n\t\tconn.query('select * from categories where id = $1', [categoryId], function(err, result){\n\t\t\tif (err) throw err;\n\t\t\tcb(result.rows);\n\t\t})\n\t});\n}", "function AddCategory(id, name) {\n $(\"#parentcategoryhidden\").val(id);\n $(\"#ParentCategoryNameForm\").html(name);\n}", "getcategory(state){\n return state.category\n }", "async adjustCatalog(categoryId) {\n if (categoryId === 0) return;\n const children = await this.children({ categoryId });\n await this.modelCategory.update({\n id: categoryId,\n categoryCatalog: children.length === 0 ? 0 : 1,\n });\n }", "function renameTreeCategory(categoryId, identifier)\n\t{\n\t\tvar elements = getElementsById(categoryId);\n\t\tfor (var j=0; j<elements.length; j++)\n\t\t{\n\t\t\telements[j].children(1).firstChild.nodeValue = identifier;\n\t\t}\n\t}", "async getOneCategory(req, res){\n try {\n res.status(200).json(await Category.findById(req.params.id));\n } catch (error) {\n res.status(400).json(error);\n }\n }", "function UpdateCategory(id, name) {\n $(\"#nameupdatedcategory\").val(name);\n $(\"#CategoryNameForUpdate\").html(name);\n $(\"#updatedidhidden\").val(id);\n $(\"#removedidhidden\").val(id);\n}", "function getNameByCatID(which) {\n\n for (var c = 0; c < activityCats.length; c++) {\n if (activityCats[c].CategoryID == which) {\n return activityCats[c].CategoryName;\n }\n }\n\n}", "function editNameAndConfirmCategory(categoryId,oldCategoryName){\r\n\t\r\n\t\tvar categoryName = $(categoryNameInput+categoryId).val();\r\n\t if(categoryName.split(\" \").join(\"\") != \"\"){\r\n\t\r\n\t if($.trim(categoryName.toLowerCase()) != $.trim(oldCategoryName.toLowerCase())){\r\n\t \r\n\t \t var productCategory = productCategoriesArray[categoryId];\r\n\t \t productCategory.categoryId = 0;\r\n\r\n\t \t if(productCategory.categoryOptions != undefined){\r\n\t \t\t $.each(productCategory.categoryOptions,function(idx,productOption){\r\n\t \t\t\t productOption.optionId = 0;\r\n\t \t\t });\r\n\t \t }\r\n\t \t \r\n\t \t productCategory.categoryName = categoryName;\r\n\t \t\r\n\t $.getJSON(\"renameCategoryNameInSession.htm\", {oldName:oldCategoryName,productCategory:JSON.stringify(productCategory)});\r\n\t \r\n\t \r\n\t //After the rename this category is treated as a whole new entity.\r\n\t \r\n\t }\r\n\t }\r\n\t iterateProductCategoriesArray();\r\n\t}", "async addCategory(name) {\n const res = await fetch(`/categories`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify({ name }),\n });\n if (res.ok) return;\n else throw new Error(\"Something went wrong\");\n }", "function Category({ categories }) {\n const { name, _id } = categories;\n\n return (\n <div className=\"col-lg-6 col-sm-12 category\" key={_id}>\n <img\n src={require(`../../assets/${name}category.jpg`)}\n alt={name}\n className=\"category-box\"\n />\n <div className=\"category-text\">\n <Link to={`/category/${_id}`}>\n <button className=\"btn btn-lg btn-outline-dark categorybtn\">{name}</button>\n </Link>\n </div>\n </div>\n );\n}", "function updateCategory(name, id) {\n let altToken = \"\";\n getToken();\n altToken = localStorage.getItem('token');\n return fetch('/api/book-category/update', {\n method: \"POST\",\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': 'Bearer ' + altToken\n },\n withCredentials: true,\n credentials: 'include',\n body: JSON.stringify({ name: name, id: id })\n }).then(function (response) {\n response.json().then(function (json) {\n if (json.success == true) {\n window.location = '/admin/book-category/index';\n } else {\n alert(json.message.name[0]);\n }\n });\n }).catch(function (r) {\n return reject(r)\n });\n}", "function getCategoryID(category) {\n if (category) {\n const element = view.categories.find(cur => cur.name === category);\n return element.id;\n } else {\n return '';\n }\n }", "function saveCategory(categoryObj) {\n return API.save(\"category\", categoryObj);\n }", "function addCategory(category) {\n return db(\"categories\")\n .insert(category, \"id\")\n .then(ids => {\n return db(\"categories\")\n .where({ id: ids[0] })\n .first();\n });\n}", "function Updatecategory(id) {\n const access = sessionStorage.getItem('access');\n console.log(\"id value\", id);\n const Id = id;\n const payload = {\n 'name': DataForUpdate.name,\n }\n const requestOptions = {\n method: 'PUT',\n headers: {\n 'Content-Type': 'application/json',\n Authorization: 'Bearer' + ' ' + access,\n },\n body: JSON.stringify(payload)\n }\n console.log(requestOptions);\n fetch(\"http://api.chicking-malappuram.in/api/category/\" + Id + '/', requestOptions)\n .then(response => response.json())\n .then(result => {\n console.log(result)\n alert(\"Updated successfully\");\n setDataForUpdate(\n {\n id: '',\n name: '',\n }\n );\n ToggleForUpdate();\n fetchData();\n })\n }", "function changeCategory(){\n\tcurObjName = $('#category').val();\n\t$('#curobj').val(curObjName);\t\t\n}", "putCategories(IdCat, CatName){\n console.log(IdCat);\n console.log(CatName);\n let ret = {};\n // Open a database connection\n sqlite3.connect('./db/SWOdb.db', (err) => {\n if (err) {\n return console.error(err.message);\n }\n console.log('[categories.putCategories] Connected to the SQlite file database.');\n });\n \n let sql = \"UPDATE Categories SET CatName = '\" + CatName + \"' WHERE IdCat = '\" + IdCat + \"';\";\n ret = sqlite3.run(sql);\n\n sqlite3.close();\n return ret;\n }", "async get() {\n const category = await CategoryModel.findById(this.id);\n if (category) {\n return category;\n } else {\n const err = createError(404, {\n status: \"error\",\n message: \"Not found\",\n });\n throw err;\n }\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 createCategory(logger, line) {\n logger.debug('category=' + line);\n\n var MINIMUM_FIELDS_LENGTH = 3;\n var arr = line.split('^');\n if (arr.length !== MINIMUM_FIELDS_LENGTH) {\n throw new Error('The RPC returned data but the category was missing elements: ' + line);\n }\n\n var category = {\n ien: arr[1],\n categoryName: arr[2]\n };\n\n logger.debug({category: category});\n return category;\n}", "static convertToBMICategoryObject(obj) {\n return new BMICategory(obj[\"minRange\"], obj[\"maxRange\"], obj[\"category\"], obj[\"healthRisk\"]);\n }", "function identifyCategory(e) {\n // declare variables\n let chosenRadius = '0';\n let chosenCategory = '0';\n // simple conditional to match the DOM element to the api ID\n if (e.id == 'jsCatTrending') {\n // chosenRadius = '6000';\n extractNeededData(trending.response.venues);\n\n } else if (e.id == 'jsCatParks') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d163941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n\n } else if (e.id == 'jsCatBeaches') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d1e2941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n\n } else if (e.id == 'jsCatLookouts') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d165941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n }\n else if (e.id == 'jsCatTrending') {\n extractNeededData(trending.response.venues);\n }\n}", "getCategoriesByGroupId(id){\n return http.get(`/categories/${id}`)\n \n }", "function addCategory(category) {\n categories[category] = []\n originals[category] = []\n}", "function changeCategory(id) {\n let radio = document.getElementsByClassName(id);\n let newCategory = null;\n for (let i = 0; i < radio.length; i++){\n if (radio[i].checked === true) {\n newCategory = radio[i].value;\n break;\n }\n }\n submitCategory(id, newCategory);\n}", "function getProductCategory(productCategoryId,listProductCategories)\n{\n\tvar oProductCategory=null;\n\tfor(var i=0;i<listProductCategories.length;i++)\n\t{\n\t\tif (listProductCategories[i].id==productCategoryId)\n\t\t{\n\t\t\toProductCategory=listProductCategories[i];\n\t\t\tbreak\n\t\t}\n\t}\n\treturn oProductCategory;\n}", "deleteCategory(state, id) {\n const ind = findIndex(state.categories, (r) => {\n return r.id === id\n })\n\n state.categories.splice(ind, 1)\n }", "function addCategory() {\n ajaxCall('action=add-category&new_category=' + categoryName.value.trim(),\n function(response) {\n categoryCloseButton.click();\n console.log(response);\n var data = JSON.parse(response);\n console.log(data);\n var cat = data.category;\n var index = data.index;\n insertCategoryInSidebar(cat, index);\n insertCategoryInMenuList(cat, index);\n insertCategoryInSelect(cat, index);\n window.location.hash = '#category-' + cat;\n });\n }", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function setCategory(cat) {\n\tcategory = cat;\n\tdisplayPic(1);\n}", "function getpodCategory () {\n var newpodCategoryId = parseInt(document.getElementById(\"listcategory\").value);\n var newpodCategoryName = document.getElementById(\"newsubcategory\").value;\n var x = new Object();\n\n x.id = Math.floor(Math.random() * (1000000 - 2000 + 1)) + 2000;;\n x.name = newpodCategoryName;\n\n for (j=0; j<articleCategory.length; j++) {\n if (articleCategory[j].id==newpodCategoryId) {\n articleCategory[j].podCategory.push(x)\n }\n }\n console.log(articleCategory);\n\n document.getElementById('cat').options.length = 0;\n for (j=0; j<articleCategory.length; j++) {\n for (var k=0; k<articleCategory[j].podCategory.length; k++) {\n var el = document.createElement('option');\n el.textContent = articleCategory[j].name + \" \" + articleCategory[j].podCategory[k].name;\n el.value = articleCategory[j].podCategory[k].id;\n cat.appendChild(el);\n }\n }\n}" ]
[ "0.7133862", "0.7028709", "0.6821646", "0.68209726", "0.6767014", "0.66952807", "0.66586894", "0.6623354", "0.662332", "0.6611755", "0.65931004", "0.6570522", "0.6565288", "0.6561871", "0.65399015", "0.63914365", "0.6352031", "0.63439333", "0.62868655", "0.62743294", "0.6249756", "0.62411463", "0.62196964", "0.6210667", "0.6183973", "0.6152735", "0.61416954", "0.6116864", "0.61147565", "0.6109174", "0.60892594", "0.60566014", "0.60542566", "0.60476047", "0.5989151", "0.59685165", "0.59685165", "0.59685165", "0.59685165", "0.5966082", "0.5948565", "0.5947826", "0.5946844", "0.59366125", "0.59309196", "0.59285986", "0.5908535", "0.5905319", "0.5903904", "0.58984303", "0.5897648", "0.58908015", "0.5885739", "0.5837959", "0.5834034", "0.58256173", "0.58185196", "0.5813947", "0.57895064", "0.57887673", "0.5785766", "0.5780719", "0.57735664", "0.5772254", "0.57572913", "0.5755559", "0.57263124", "0.5725881", "0.5717279", "0.57119304", "0.56892616", "0.56819516", "0.56800914", "0.56754375", "0.5669596", "0.5649805", "0.5638416", "0.56340784", "0.5627774", "0.5623994", "0.56206506", "0.56004614", "0.5586663", "0.558397", "0.55795157", "0.55773026", "0.55617654", "0.5555033", "0.5546371", "0.55344576", "0.5522317", "0.5519107", "0.55144686", "0.5510428", "0.5501172", "0.5499539", "0.54982156", "0.54981494", "0.5491402", "0.5488946" ]
0.68961877
2
Init, called from gamepage.html
function init() { //simplest: //console.log('oh hai'+"*D4EL means different for each level"); //show some stuff //$(DOC.$term).text("YEAGAD").show(); //$(DOC.$term).text("YEAGAD").show(); //store DOC cats in array // DOC.cats = [DOC.leftCategory, DOC.rightCategory]; //set up category objects from data-given categories makeCategories(DATA.cats); //check if categories are ok //debugger; //set up card objects from data-given cards makeCards(DATA.cards); //show instructions showInstructions(); //set first currentcard //GAME.CURRENTCARD = GAME.cards[GAME.cardIndex]; //make list of items (terms) on right side makeList(); //first turn //newTurn(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function initPage() {\n renderLevelsButtons();\n initGame();\n}", "function initLoad()\n{\n console.log('page load');\n myGame.buildBoard();\n myGame.nextMove();\n myGame.reset();\n}", "function init()\r\n{\r\n\tconsole.log('init');\r\n\tinitView(); \t\r\n OSnext(); \r\n \t \t\t\r\n// \tdeleteGame();\r\n// \tloadGame();\r\n// \t\r\n// \tif (game==null) {\r\n// \t\tstartNewGame();\r\n// \t} else {\r\n// \t UI_clear(); \r\n// \t UI_closeOverlay(); \r\n// \t UI_hideActions();\r\n// \t \tUI_hideCard();\r\n// \t UI_updateFront('Sinai');\r\n// \t UI_updateFront('Mesopotamia');\r\n// \t UI_updateFront('Caucasus');\r\n// \t UI_updateFront('Arab');\r\n// \t UI_updateFront('Gallipoli');\r\n// \t UI_updateFront('Salonika');\r\n// \t UI_updateNarrows();\r\n// \t UI_updateCounters();\t\t\t\r\n// \t\tconsole.log('loaded previous game');\r\n// \t}\r\n\t\t \r\n}", "function initPage()\n\t{\n\t\tinitGlobalVars();\n\t\tinitDOM();\n\t\tinitEvents();\n\t}", "function init() {\n const newCardList = createNewDeck();\n insertNewDeck(newCardList);\n initScorePanel();\n // Show game and hide result page\n document.querySelector('header').classList.remove(\"hide\");\n document.querySelector('.score-panel').classList.remove(\"hide\");\n document.querySelector('.deck').classList.remove(\"hide\");\n document.querySelector('.result').classList.add(\"hide\");\n}", "function initPage() {\n\tresize();\n\tstage = new Kinetic.Stage({\n\t\theight: boardSize,\n\t\twidth: boardSize,\n\t\tcontainer: 'game'\n\t});\n\twindow.location.href = '#game';\n\t\n\tbgTileLayer = new Kinetic.Layer();\n\tpieceLayer = new Kinetic.Layer();\n\tfgTileLayer = new Kinetic.Layer();\n\t\n\tstage.add(bgTileLayer);\n\tstage.add(pieceLayer);\n\tstage.add(fgTileLayer);\n\t\n\tloader();\n\t\n\tconnect('localhost', '8080');\n\t\n\ttotalTimer = new Timer('#totalTimer');\n\twhiteTimer = new Timer('#whiteTimer');\n\tblackTimer = new Timer('#blackTimer');\n\t\n\ttotalTimer.draw();\n\twhiteTimer.draw();\n\tblackTimer.draw();\n}", "function initializeWebpage() {\r\n drawGridLines();\r\n drawGridLines();\r\n initArray();\r\n populateGameGrid(gameGrid);\r\n // Add any necessary functionality you need for the Reach portion below here\r\n }", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "init() {\n\n this.assignPlayer();\n gameView.init(this);\n gameView.hide();\n scoreBoardView.init(this);\n registerView.init(this);\n this.registerSW();\n }", "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function initMain(){\n\tbuildGameButton();\n\tbuildGameStyle();\n\tbuildScoreboard();\n\t\n\tgoPage('main');\n\tloadXML('questions.xml');\n}", "function init() {\n let query1 = URL_POKE + \"?pokedex=all\";\n fetch(query1)\n .then(checkStatus)\n .then((resp) => resp.text())\n .then(makeSprites)\n .catch(console.error);\n id(\"start-btn\").addEventListener(\"click\", startGame);\n id(\"flee-btn\").addEventListener(\"click\", resultMove);\n id(\"endgame\").addEventListener(\"click\", goBack);\n }", "function init() {\n cookies = new Cookies();\n ui = new UI();\n game = new Game();\n}", "initGame() {\n\n\t\t// Empty the container\n\t\t// TODO: Try a reset to default instead of a rerender\n\t\tthis._$container.innerHTML= '';\n\n\t\t// Set matched cards to 0\n\t\tthis._matchedCards= 0;\n\t\t\n\t\t// Set initial score\n\t\tthis._setScore(0);\n\n\t\t// Start score deduction timer\n\t\tthis._startScoreLoop();\n\n\n\t\t// Generate the grid and render elements\n\t\tthis._generateGrid(this.rows, this.cols);\n\t\tthis._randomizeList(this._grid);\n\t\tthis._$container.appendChild(this._renderGrid());\n\n\t\t// Scale the grid\n\t\tthis._resizeHandler();\n\t}", "function init() {\n // THIS IS THE CODE THAT WILL BE EXECUTED ONCE THE WEBPAGE LOADS\n }", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function init() {\r\n var levelData = document.querySelector('input[name=\"level\"]:checked')\r\n gLevel.size = levelData.getAttribute('data-inside');\r\n gLevel.mines = levelData.getAttribute('data-mines');\r\n gLevel.lives = levelData.getAttribute('data-lives');\r\n var elHints = document.querySelector('.hints')\r\n elHints.innerText = 'hints: ' + HINT.repeat(3)\r\n var elButton = document.querySelector('.start-button')\r\n elButton.innerText = NORMAL\r\n document.querySelector('.timer').innerHTML = 'Time: 00:00:000'\r\n gBoard = createBoard()\r\n clearInterval(gTimerInterval);\r\n gGame = { isOn: false, shownCount: 0, markedCount: 0, isFirstClick: true, isHintOn: false }\r\n renderBoard()\r\n renderLives()\r\n}", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function init() {\n\t// Load the video data and populate the array of all video IDs\n\t$.getJSON('vids.json', function(data) {\n\t\tfor (var i=0;i<data.vids.length;i++) {\n\t\t\tif(i%2==0) {\n\t\t\t\tvid_array[(i/2)+1] = data.vids[i];\n\t\t\t}\n\t\t}\n\t\tswitchToVideo(vid_array.length-1);\n\t\tswitchToPage(1);\n\t\tchangeNowPlaying(vid_array.length-1);\n\t\tpopulatePages();\n\t\t$('#page-1').addClass('current-page');\n\t\t$('#scriptless').remove();\t\t\n\t}); \n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function gameInit() {\r\n // disable menu when right click with the mouse.\r\n dissRightClickMenu();\r\n resetValues();\r\n // switch emoji face to normal.\r\n switchEmoji();\r\n gBoard = createBoard(gLevel.SIZE);\r\n renderBoard(gBoard);\r\n}", "function initGame (){\n\n resetData();\n \n //Update content\n\n \n //Pick a new country and display info\n pickCountry();\n getcountryText();\n UpdateContent();\n\n //hide background image\n\n dispGame.classList.add(\"gameStarted\");\n dispGame.style.display = \"block\";\n dispGame.style.visibility = \"visible\";\n \n //hide start button\n startGame.style.display = \"none\";\n\n //Set isGameOver to false\n isgameOver = false;\n\n}", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "function init() {\n if ($('.scheduled-page').length > 0) {\n setPageUrl();\n bindEvents();\n renderSwitcher();\n renderActions();\n switchPage(scheduled.currentView);\n }\n }", "function initializePage() {\r\n createCanvas();\r\n resetArray();\r\n setUpControls();\r\n drawCurrentState();\r\n addBox();\r\n // timer = setInterval(updateBox, 200);\r\n }", "function initializePage() {\n //Event Listeners\n handleQuizStart();\n handleAnswerSubmitted();\n handleNextQuestion();\n handleRestartQuiz();\n\n //Render Function\n render(); \n}", "function init() {\r\n\t/* Globals initialisation */\r\n\tset_globals();\r\n\t\r\n\t/* Retrieving top scores from database */\r\n\tretrieves_top_scores();\r\n\t\r\n\t/* Loading musics */\r\n\tload_musics()\r\n\t\r\n\t/* Drawing menu */\r\n\tdraw_menu_background();\r\n\t\r\n\t/* Images loading */\r\n\tset_images();\r\n\t\r\n\t/* A boom is heard when the mainSquare dies */\r\n\tset_boom_sound();\r\n\t\r\n\t/* Buttons creation */\r\n\tset_buttons();\r\n}", "function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}", "constructor(gamePage, winningPlayer=null){\n super();\n this.gamePage = gamePage;\n this.winningPlayer = winningPlayer;\n this.addEvents({\n 'click .rematch-btn' : 'rematch',\n 'click .new-game-btn' : 'newGame',\n 'click .hide-window-btn' : 'hideWindow'\n });\n FixEverything.navbar.render();\n }", "function init() {\n stage = new createjs.Stage(document.getElementById(\"gameCanvas\"));\n game = new createjs.Container();\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n // When game begins, current state will be opening menu (MENU_STATE)\n //scoreboard = new objects.scoreBoard(stage, game);\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "init(game) {\n\n }", "function init() {\n reset();\n menu = new GameMenu();\n /* Initialize the level */\n initLevel();\n\n lastTime = Date.now();\n main();\n }", "function init() {\n\n // setup canvas\n canvas = document.getElementById(canvas_id);\n context = canvas.getContext('2d');\n\n // render user controls\n if (controlsRendered === false) {\n self.renderControls();\n controlsRendered = true;\n }\n\n // add page controls\n window.addEventListener('keydown', self.navigation, false);\n window.addEventListener('hashchange', checkHash, false);\n }", "function init() {\n cashElements();\n attachEvents();\n render();\n }", "init() {\r\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\r\n //console.log(result);\r\n\r\n this.assignPlayer();\r\n gameView.init();\r\n }", "init() {\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\n //console.log(result);\n\n this.assignPlayer();\n gameView.init(this);\n registerView.init(this);\n }", "function init() {\n initializeVariables();\n initializeHtmlElements();\n}", "constructor() {\n\n this.render();\n this.playerName = \"\";\n //this.playerCode = 0;\n this.renderStartPageButtons = true;\n this.amountOfPlayers = 2;\n }", "init() {\n\t\tthis.mousePos = {x: 0, y: 0};\n\t\tthis.gameWidth = Math.max(screen.width, window.innerWidth);\n\t\tthis.gameHeight = Math.max(screen.height, window.innerHeight);\n\t\tthis.skier.init();\n\t\tthis.yeti.init();\n\t\tthis.lift.init();\n\t\tthis.slalom.init();\n\t\tthis.isPaused = false;\n\t\tthis.yDist = 0;\n\t\tthis.timestampFire = this.util.timestamp();\n\t\tthis.skierTrail = [];\n\t\tthis.currentTreeFireImg = this.tree_bare_fire1;\n\t\tthis.stylePointsToAwardOnLanding = 0;\n\t\tthis.style = 0;\n\t\tsocket.emit('new_point', 0);\n\t\tthis.logo = { x: -50, y: -40 };\n\t\tthis.gameInfoBtn.title = 'Pause';\n\t}", "function init() {\n emptyAbilities();\n renderHeroButtons();\n handleClick();\n }", "function init() {\n intro.style.display = \"grid\";\n winner.style.display = \"none\";\n newGame.style.display = \"none\";\n heading.style.display = \"none\";\n cards.style.display = \"none\";\n}", "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function init() {\n lastTime = Date.now();\n doc.getElementById('game-start').onclick = function() {\n main();\n setTimer(90, game);\n\n doc.getElementById('score').innerHTML = 'Score: ' + game.score;\n doc.getElementById('life').innerHTML = 'Life: ' + game.life;\n doc.getElementById('timer').style.display = 'inline-block';\n doc.getElementById('life').style.display = 'inline-block';\n doc.getElementById('score').style.display = 'inline-block';\n doc.getElementById('try-again').style.display = 'inline-block';\n doc.getElementById('game-play').style.display = 'inline-block';\n\n var gameRules = doc.getElementById('game-rules');\n gameRules.parentNode.removeChild(gameRules);\n var gameStart = doc.getElementById('game-start');\n gameStart.parentNode.removeChild(gameStart);\n var gameTitle = doc.getElementById('game-title');\n gameTitle.parentNode.removeChild(gameTitle);\n };\n }", "function initializePage() {\n\t$('.project a').click(addProjectDetails);\n\n\t$('#colorBtn').click(randomizeColors);\n\n\t$('.spotify .handle').hover(function() {\n\t\tshowSpotify($(this).parent());\n\t});\n}", "function initGame() {\n gBoard = buildBoard(gLevel);\n renderBoard();\n}", "function init() {\n /*Add click event to refresh / restart button*/\n document.querySelector('.restart').addEventListener(\"click\", function(event) {\n refreshGame();\n });\n createDeck();\n }", "function initializePage() {\n // Initialize variables that correspond to\n // DOM objects in the user interface plus\n // $window.\n initializeVariables();\n\n // Check errorMessage\n if (errorMessage.length > 0) {\n Print.print(errorMessage);\n Print.print(instructions);\n return;\n }\n\n // Provide the link behavior for the arrows.\n $backArrow.click(backSlide);\n $nextArrow.click(nextSlide);\n\n // Initialize the slide dropdown menu\n initializeSlideDropdown();\n\n // Provide the behavior for the slide dropdown menu\n slideDropdown.onchange = slideDropdownBehavior;\n \n // Do the initial sizing of the story frame.\n resizeStoryFrame();\n\n // Show the total number of slides\n $slideTotal.text(\"\" + storyLength);\n\n // Initialize by showing slide 0 or show the slide\n // corresponding to the query parameter start=N.\n //\n // Keep in mind that user indexing starts at 1 so\n // we need to adjust here by subtracting 1.\n\n var start = 0;\n\n if (QueryParams.Params[\"start\"]) {\n start = parseInt(QueryParams.Params[\"start\"]);\n\n if (isNaN(start))\n start = 0;\n else\n start--;\n }\n\n showSlide(start);\n\n // Set up auto resize on the story frame.\n window.onresize = resizeStoryFrame;\n}", "function init() {\n // quadTree = new QuadTree();\n showCanvas();\n debug.init();\n keyboard.init();\n menuWindow.init();\n // fillboxes(100);\n Game.init();\n}", "function initializePage() {\n getMoveCount();\n cards.forEach(function(card) {\n card.classList.remove(\"open\", \"show\", \"match\");\n });\n shuffleCards();\n startTimer();\n setStars(3);\n}", "function init() {\n\tdocument.getElementById(\"play\").blur();\n\t//call function inside the object to start the game\n\tmyGame.start();\n}", "function init(){\n renderScores();\n setBoard();\n createCheckers();\n message.innerHTML = `Player 1! It's your turn!`\n playerTurn = redCheckers.player;\n}", "function initGame() {\r\n console.log(\"Init Game\");\r\n version.innerText = application.version;\r\n grid.innerHTML = TemplateForGrid();\r\n miniSquaresInit();\r\n gameOverDiv.style.display = \"none\";\r\n scoreInit();\r\n gameTimer.stop();\r\n currentPosition = 4;\r\n currentRotation = 0;\r\n random = Math.floor(Math.random() * theTetrominoes.length);\r\n nextRandom = Math.floor(Math.random() * theTetrominoes.length);\r\n current = theTetrominoes[random][currentRotation];\r\n nextRotatedCurrent = theTetrominoes[random][nextRotation];\r\n startBtn.innerHTML = \"▶ START\";\r\n deactivateGameButtons();\r\n rewardPicDivSetHeight(0);\r\n rewardPicDivSetBackground();\r\n rewardCheckBox.checked = checkRewardExtra();\r\n weird.checked = checkWeirdMode();\r\n}", "function setupGame() { console.log(\"in setupGame\");\n\n\t//console.log(\"here setupGame\");\n\n\t$(\"#startPage\").show();\n\t$(\"#content\").hide();\n\t$(\"#questionPage\").hide();\n\t$(\"#answerPage\").hide();\n\t$(\"#scorePage\").hide();\n\n}", "function init() {\n\n browserManager = new BrowserManager();\n screenshotsAndroid = new ScreenshotsAndroid();\n magazine = new Magazine();\n workFlowManager = new WorkFlowManager();\n buttonsManager = new ButtonsManager();\n fieldsEdit = new FieldsEdit();\n tableEdit = new TableEdit();\n workFlowEdit = new WorkFlowEdit();\n\n //View Manager\n viewManager = new ViewManager();\n\n // table\n tileManager.drawTable();\n\n // ScreenshotsAndroid\n screenshotsAndroid.init();\n\n // BrowserManager\n browserManager.init();\n\n var dimensions = tileManager.dimensions;\n\n // groups icons\n headers = new Headers(dimensions.columnWidth, dimensions.superLayerMaxHeight, dimensions.groupsQtty,\n dimensions.layersQtty, dimensions.superLayerPosition);\n\n // uncomment for testing\n //create_stats();\n\n $('#backButton').click(function() {\n\n if(viewManager.views[window.actualView])\n viewManager.views[window.actualView].backButton();\n\n });\n\n $('#container').click(onClick);\n\n //Disabled Menu\n //initMenu();\n\n setTimeout(function() { initPage(); }, 500);\n\n setTimeout(function (){\n guide.active = true;\n if(actualView === 'home'){\n guide.showHelp();\n }\n }, 15000);\n\n /*setTimeout(function() {\n var loader = new Loader();\n loader.findThemAll();\n }, 2000);*/\n\n //TWEEN.removeAll();\n}", "function init() {\n\t\tclearBoard();\n\t\tprintBoard(board);\n\t\ttopPlayerText.innerHTML = `- ${game.currentPlayer.name}'s turn -`;\n\t\tgame.currentPlayer = game.playerOne;\n\t\tgame.squaresRemaining = 9;\n\t\tgame.winner = false;\n\t\tclickSquares();\n\t}", "function init () {\n win.SiteCanvas = PageInterface;\n on(win, 'message', onMessage);\n\n on(win, 'load', FrameInterface.calculateViewportDimensions);\n on(win, 'resize', FrameInterface.calculateViewportDimensions);\n }", "onInit() {\n this.score = this.timeLimit;\n this.quizOver = false;\n this.introView.render();\n this.introView.attachEventHandlers();\n }", "function setupPage(){\n Card.create();\n Menu.render();\n}", "function initPage() {\n\n initHeader();\n\n initForm();\n\n initDatalist();\n}", "function initGame() //function that calls the functions and variables that need to be loaded when the page opens\n{\n\tgenerateCardNumbers(); //calls the generateCardNumbers function\n}", "function initialiseGame() {\n enableAnswerBtns();\n hideGameSummaryModal();\n showGameIntroModal();\n selectedStories = [];\n score = 0;\n round = 1;\n resetGameStats();\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n //set the current game staate to MENU_STATE\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function initGameHooks() {\n gameScoreField.value = gameScore;\n gameRankField.value = gameRank;\n rotateLetters(outerLetterButtons);\n changeBtnLtr(document.querySelector('.centerLetter'), centerLetter);\n displayAnswerList(answerList);\n // The main game header uses the player name entered at the start\n // of the game. It uses \"DEBUG MODE\" instead of a date if the\n // game was started in debug mode.\n let header1 = `${playerName[0].toUpperCase()}${playerName.slice(1)}'s ${\n document.getElementById('gameHeader').innerText\n }`;\n let header2 = `${debugMode ? 'DEBUG MODE' : `${gameWeekday}, ${gameDate}`}`;\n document.getElementById('gameHeader').innerText = header1;\n document.getElementById('gameDateHdr').innerText = header2;\n gameStartModal.style.visibility = 'hidden';\n}", "function init() {\n lobby.init();\n game.init();\n}", "function initialise() {\n mainMenu();\n\n initialisePage();\n}", "init() { \n this.ecs.set(this, \"Game\", \"game\", \"scene\")\n }", "function init() {\n setCircleVisibility(false);\n isPlayingGame = false;\n id(\"start-button\").addEventListener(\"click\", () => {\n isPlayingGame = !isPlayingGame;\n if (isPlayingGame) {\n startGame();\n } else {\n endGame();\n }\n });\n id(\"game-frame\").style.borderWidth = FRAME_BORDER_PIXELS + \"px\";\n }", "function init()\n {\n // Get all necessary HTML elements\n for (var elementID in my.html) {\n my.html[elementID] = document.getElementById(elementID)\n }\n\n // Get user settings\n resetSettings()\n loadSettings()\n\n // Initialize the user interface\n showPracticePanelWrapper()\n updateUnitFromURL()\n hideGuide()\n\n // Event handlers\n window.onhashchange = processURLChange\n my.html.input.onkeyup = updatePracticePane\n guideLink.onclick = toggleGuide\n }", "function init()\n{\n\t// get a reference to the game canvas\n\tgame = document.getElementById(\"gameCanvas\");\n\t\n\t// load and build the spritesheet\n\tbuildSpriteSheet();\n}", "function init (){\n\t\ttimer = 30;\n\t\t//activates game area for user click. \n\t\t$(\"#area\").on(\"click\", userPlay);\n\t\t//starts Timer countdown. \n\t\tcountdown = setInterval(updateTimer, 1000);\n\t\tflashDogs();\n\t\t$('#scoreKeeper').html(score);\t\n\t}", "function init() {\n // get a referene to the target <canvas> element.\n if (!(canvas = document.getElementById(\"game-canvas\"))) {\n throw Error(\"Unable to find the required canvas element.\");\n }\n\n // resize the canvas based on the available browser available draw size.\n // this ensures that a full screen window can contain the whole game view.\n canvas.height = (window.screen.availHeight - 100);\n canvas.width = (canvas.height * 0.8);\n\n // get a reference to the 2D drawing context.\n if (!(ctx = canvas.getContext(\"2d\"))) {\n throw Error(\"Unable to get 2D draw context from the canvas.\");\n }\n\n // specify global draw definitions.\n ctx.fillStyle = \"white\";\n ctx.textAlign = \"center\";\n\n // set the welcome scene as the initial scene.\n setScene(welcomeScene);\n }", "function init() {\n\n\n\n\t}", "function init() {\n\tif (logFull) console.log(\"%s(%j)\", arguments.callee.name, Array.prototype.slice.call(arguments).sort());\n\tcanvas = document.getElementById(\"game-canvas\");\n\tctx = canvas.getContext(\"2d\");\n\n\tdocument.body.style.backgroundColor = BACKGROUND_COLOR;\n\n\thandleResize();\n}", "function Init() {\n \n playGame = false;\n\n statusTab.hide();\n board.hide();\n gameEnd.hide();\n \n startButton.click(function(event) {\n event.preventDefault();\n StartPlaying();\n });\n\n resetButton.click(function(event) {\n event.preventDefault();\n RestartGame();\n });\n}", "function init() {\n gameData = {\n emeraldValue: gemValue(1, 12),\n jewelValue: gemValue(1, 12),\n rubyValue: gemValue(1, 12),\n topazValue: gemValue(1, 12),\n randomTarget: targetScore(19, 120),\n scoreCounter: null,\n }\n targetScore();\n displayAll();\n }", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function init(){\n console.debug('Document Load and Ready');\n console.trace('init');\n initGallery();\n \n pintarLista( );\n pintarNoticias();\n limpiarSelectores();\n resetBotones();\n \n}", "function initGame() {\n first_item_timestamp = Math.round((new Date().getTime()) / 100) / 10;\n initializeSetsOfChoices();\n adjustSlider(set[round][stage][1], set[round][stage][2], set[round][stage][3], set[round][stage][4], set[round][stage][5], set[round][stage][6]);\n\n // we store some data\n itemLowvalYou[stage] = set[round][stage][1];\n itemHighvalYou[stage] = set[round][stage][2];\n itemDescYou[stage] = set[round][stage][3];\n itemLowvalOther[stage] = set[round][stage][4];\n itemHighvalOther[stage] = set[round][stage][5];\n itemDescOther[stage] = set[round][stage][6];\n itemID[stage] = set[round][stage][7];\n\n initSlider();\n if (storeSearchPath == 1) {\n trackTicks();\n }\n gameMsg = '';\n dispGame();\n }", "function _init() {\r\n // set page <title>\r\n Metadata.set(home.title);\r\n\r\n // activate controller\r\n _activate();\r\n }", "function init() {\r\n\taddListeners();\r\n\t// Polite loading\r\n\tif (Enabler.isPageLoaded()) {\r\n\t\tshow();\r\n\t}\r\n\telse {\r\n\t\tEnabler.addEventListener(studio.events.StudioEvent.PAGE_LOADED, show);\r\n\t\t//Enabler.addEventListener(studio.events.StudioEvent.VISIBLE, show);\r\n\t}\r\n}", "function init(){\n \n load_seasons();\n load_char();\n \n}", "function init() {\n pageID = 1;\n page01 = document.getElementById(\"page01\");\n page02 = document.getElementById(\"page02\");\n page03 = document.getElementById(\"page03\");\n pageTracker();\n}", "function load_create_game_page() {\n page = 'create_game';\n load_page();\n}", "function initialiseGame()\n{\n\tclear();\n\tmainText.draw();\n\tscoreText.draw();\n\t\n\tstartButtonDraw();\n\tdifficultyButtonDraw();\n}", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function onPageInit(e){\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t}", "function windowOnLoad() {\n\n setupCodeMirrorBox()\n registerEventHandlers()\n setupTutorial()\n\n setSpeed(INIT_PLAY_SPEED)\n\n var campaign = PUZZLE_CAMPAIGN\n var state = PUZZLE_CAMPAIGN_STATE\n\n showOrHideLevelMenu(state) \n\n loadLevel(campaign, state)\n restartSimulation()\n\n}", "initiate() {\n this.#buildStartGameButton();\n this.#buildhowToPlayButton();\n this.#buildAboutButton();\n this.#startHeaderAnimation();\n }", "function init() {\n\t\tscore = 0;\n\t\tdirection = \"right\";\n\t\tsnake_array = [];\n\t\tcreate_snake();\n\t\tmake_food();\n\t\tactiveKeyboard();\n\t\t$(\"#message\").css(\"display\",\"none\");\n\t\tgame_loop = setInterval(paint,100);\n\t}", "function init () {\r\n initAllVars();\r\n gameLoop();\r\n}", "init() {\n\t\tif (this.isStart) {\n\t\t\tthis.world = new World(this.ctx);\n\t\t\tthis.world.init();\n\n\t\t\tthis.ctx.drawImage(flappyBird, 69, 100, FLAPPY_BIRD_WIDTH, FLAPPY_BIRD_HEIGHT);\n\t\t\tthis.ctx.drawImage(birdNormal, 120, 145, BIRD_WIDTH, BIRD_HEIGHT);\n\t\t\tthis.ctx.drawImage(getReady, 72, 220, GET_READY_WIDTH, GET_READY_HEIGHT);\n\t\t\tthis.ctx.drawImage(tap, 72, 300, TAP_WIDTH, TAP_HEIGHT);\n\n\t\t\tthis.ctx.font = '500 30px Noto Sans JP';\n\t\t\tthis.ctx.fillStyle = 'white';\n\t\t\tthis.ctx.fillText('Click To Start', 60, 450);\n\n\t\t\tthis.getHighScore();\n\t\t\tthis.drawScore();\n\n\t\t\tthis.container.addEventListener('click', this.playGame);\n\t\t}\n\t}", "function init() {\n\theader.innerHTML = gui_setRandomTitle();\n\tdungeon.level = 0;\n\tp = new Player(15, 5, 5)\n\n\tsave = new savegame();\n\tsave.addObj(p);\n\tsave.addObj(dungeon);\n\tsave.parseData();\n\tif(save.isDataAvailable()) {\n\t\tvar onYesButton = function () { save.load(); p.enterNewDungeon(); }\n\t\tvar onNoButton = function () { p.enterNewDungeon(); }\n\t\tvar onImportButton = function () {\n\t\t\tvar onLoadButton = function(savestring) { save.loadString(savestring); p.enterNewDungeon(); }\n\t\t\tgui_requestLoadGameInput(onLoadButton);\n\t\t}\n\t\tgui_requestLoadGame(save, onYesButton, onNoButton, onImportButton);\n\t} else {\n\t\tvar onLoadButton = function(savestring) { save.loadString(savestring); p.enterNewDungeon(); }\n\t\tgui_requestLoadGameInput(onLoadButton);\n\t}\n}", "function init() {\n if (game.init())\n game.start();\n}", "init() {\n super.init();\n this.html = require('./sim-html.js');\n\n this.engine.world.gravity.y = 0; // Disable universial downward gravity\n this.scene.load(this.stage, Matter.World, this.engine); // Load the current scene (Add all objects)\n Matter.World.add(this.engine.world, []); // Init the current world\n\n // Start the scene\n Matter.Engine.run(this.engine);\n\n // Add all the planets\n for (let planet of this.planets) {\n planet.addToStage(PIXI, this.stage);\n }\n }", "function init() {\n \"use strict\";\n \n resizeCanvas();\n \n background = new CreateBackground();\n Player = new CreatePlayer();\n \n if (window.innerHeight <= 768) {\n background.setup(resources.get(imgFileBackground_small));\n } else {\n background.setup(resources.get(imgFileBackground));\n }\n\n gameArray.splice(0,gameArray.length);\n \n // HTML Components\n htmlBody.addEventListener('keydown', function() {\n uniKeyCode(event);\n });\n \n btnNewGame.addEventListener('click', function() {\n setGameControls(btnNewGame, 'new');\n }); \n \n btnPauseResume.addEventListener('click', function() {\n setGameControls(btnPauseResume, 'pauseResume');\n }); \n \n btnEndGame.addEventListener('click', function() {\n setGameControls(btnEndGame, 'askEnd');\n }); \n \n btnOptions.addEventListener('click', function() {\n setGameControls(btnOptions, 'options');\n });\n \n btnJournal.addEventListener('click', function() {\n setGameControls(btnJournal, 'journal');\n }); \n \n btnAbout.addEventListener('click', function() {\n setGameControls(btnAbout, 'about');\n });\n \n window.addEventListener('resize', resizeCanvas);\n \n setGameControls(btnNewGame, \"init\");\n \n }", "function initializePage() {\n handleGlobalEvent();\n handleSideBar();\n handleMessageBar();\n handleCollapsibleController();\n handleResetButton();\n handleDisabledSubmit();\n handleAjaxError();\n handleAjaxSetup();\n }", "function init() {\r\n BEST_SCORE = 0;\r\n load();\r\n GameMenu.updateHighScore(BEST_SCORE);\r\n }", "Init()\n {\n this.my_state_machine = new StateMachine();\n this.overlay_manager_inst = new OverlayManager();\n this.level_viewer = null;\n this.information_log = document.getElementById(\"informationLog\");\n this.level_object_manager = new LevelObjectManager();\n this.level_complete = document.getElementById(\"complete\");\n this.stats_manager = new StatManager();\n this.AI_bridge = new AIBridge();\n this.memento = new Memento();\n this.toolbar_manager = new ToolbarManager();\n }", "function init()\n{\n //initalize the application\n meDominance='';\n reset();\n //setFrameUrl('header','header.htm');\n //setFrameUrl('left','selectdomleft.htm');\n //setFrameUrl('right','selectdomright.htm');\n\n blnInitCalled=true;\n}", "function onPageInit(e){\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t}" ]
[ "0.82908905", "0.80855167", "0.751233", "0.7502015", "0.7414541", "0.73173475", "0.7294887", "0.72913325", "0.7287606", "0.7226449", "0.7215182", "0.7199746", "0.71942455", "0.71606374", "0.7135241", "0.712718", "0.71227485", "0.7108507", "0.70857525", "0.70821816", "0.70746434", "0.70713854", "0.7066709", "0.70652026", "0.70549935", "0.70525366", "0.701311", "0.701134", "0.6976898", "0.69691366", "0.69660586", "0.6965866", "0.6961396", "0.69613713", "0.6957641", "0.69440424", "0.694213", "0.693228", "0.6927476", "0.69227237", "0.6916811", "0.6903908", "0.69014776", "0.6883831", "0.68730325", "0.6871444", "0.6868907", "0.6864535", "0.6863402", "0.6861574", "0.68591243", "0.68495476", "0.6846383", "0.6844569", "0.6830531", "0.68246907", "0.68161803", "0.68135285", "0.6813511", "0.6808752", "0.6808592", "0.67967844", "0.67877734", "0.6787306", "0.67813927", "0.67768544", "0.67707956", "0.6769927", "0.6763933", "0.67624795", "0.67613727", "0.67456543", "0.6739724", "0.673433", "0.67303157", "0.67234313", "0.6720564", "0.6720193", "0.6708122", "0.6707375", "0.6702551", "0.67011493", "0.66941136", "0.6693448", "0.66906565", "0.66829413", "0.6678888", "0.66732526", "0.66721755", "0.6670406", "0.6667848", "0.6661379", "0.6659586", "0.66537005", "0.66510236", "0.66466045", "0.664527", "0.66387445", "0.66313213", "0.66280764", "0.6627587" ]
0.0
-1
GAME.CURRENTCARD = GAME.cards[GAME.cardIndex] newTurn(); Hardcoding instruction cards and pushing them to instructions queue
function makeInstructions() { //Instructions var iCard = new instructionCard("Play with arrow keys.", "Click right arrow ▶ to continue", '◀ Choose other set', 'Continue ▶', function() { window.location.href = 'file:///Users/katkat/Desktop/wordblox/intro.html'; }, function() { GAME.cardIndex = 1; showNextInstruction() }); instructions.push(iCard); // //Show answers var iCard2 = new instructionCard("Want to see answers?", "Choose ◀ yes or no ▶", '◀ Yes', 'No ▶', hi, hi2); instructions.push(iCard2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextTurn(){\n\tchangeDiscard();\n\tplayerTurnIs();\n}", "startTurn() {\n this.pendingChip = new Chip({ player: this.currentPlayer });\n if (this.currentPlayer.getNextMove) {\n this.currentPlayer.getNextMove({ game: this }).then((nextMove) => {\n this.emit('async-player:get-next-move', {\n player: this.currentPlayer,\n nextMove\n });\n });\n }\n }", "gainCard(card) {\n this.cards.push(card);\n this.out = false;\n if (this.numCards < 2) {\n ++this.numCards;\n }\n }", "drawCard() {\n let card = this.hand.shift()\n this.currentCards.push( card )\n }", "function nextCard () {\n if (events.currentcard === (conversationcards.length-1)) {\n return\n } else {\n events.currentcard++\n conversationcards[events.currentcard].setCard()\n }\n}", "function newGame(cards) {\n rearrangeCards();\n moves = 0;\n movesCounter.textContent = moves;\n matchedCards = [];\n matchedCardNum = 0;\n openCardsList = [];\n document.querySelector('.one').innerHTML = '<i class=\"fa fa-star\"></i>';\n document.querySelector('.two').innerHTML = '<i class=\"fa fa-star\"></i>';\n document.querySelector('.three').innerHTML = '<i class=\"fa fa-star\"></i>';\n if (watch.isOn) {\n watch.stop();\n }\n watch.reset();\n}", "function setActive(card){\n\tif(playerDeck.length < 35 || enemyDeck.length < 35){\n\t\talert(\"A deck count error occurred. Restarting game.\");\n\t\tlocation.reload();\n\t}\n\t$('.handButton').trigger('click');\n\tcard = card;\n\tif (card.Stage == \"basic\" || card == Clefairy_Doll){\n\t\t\t$('#player .active').append('<img src=\"Cards/Base_Set/' + card.Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t// Remove the card from the hand\n\t\t\tindex = playerInHand.indexOf(card);\n\t\t\tinPlay7 = {Card: playerInHand[index].Card, Stage: playerInHand[index].Stage, Type: playerInHand[index].Type, HP: playerInHand[index].HP, PokePower: playerInHand[index].PokePower, Attack1: playerInHand[index].Attack1, Attack2: playerInHand[index].Attack2, Weak: playerInHand[index].Weak, Resist: playerInHand[index].Resist, Retreat: playerInHand[index].Retreat};\n\t\t\tplayerInHand.splice(index, 1);\n\t\t\t// Automatically exit hand\n\t\t\t$('#exit').trigger('click');\n\t\t\t$('.inPlayerHand').empty();\n\t\t\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"That is not a Basic Pokemon. Choose another card.\");\n\t\t}\n\t\talert(\"Choose any basic Pokemon you want on the bench.\");\n\t\t$('#coinFlip').css('display', 'block');\n\t\tsetBench();\n}", "function newCard() {\n//draw a new card by pushing a card into the deck\n//then add this card into the sum\nif( isAlive === true && hasBlackJack === false) {\n let newPlCardDrawn = getPlayerRandomCard()\n let newDlCardDrawn = getDealerRandomCard()\n plcardSum += newPlCardDrawn\n dealercardSum += newDlCardDrawn\n plcards.push(newPlCardDrawn)\n dlcards.push(newDlCardDrawn)\n \n renderGame()\n}\n}", "function setNewCards() {\n\tcardList = shuffle(cardList);\n\tfor (let i = 0; i < cardList.length; i++) {\n\t\tcardList[i].classList.remove('match', 'open', 'show');\n\t\tcardList[i].addEventListener('click', turnCard);\n\t\tmyDeck.appendChild(cardList[i]);\n\t}\n}", "function newTurn() {\n\t\n\t// check if we have had a winner already\n\tif (current_team == NONE) return;\n\t\n\tvar bma_string = \"\";\n\t\n\t// work out our new game board state\n\tif (current_team == YELLOW) {\n\t\tcurrent_team = RED;\n\t\tbma_string = \"place_red\";\n\t} else {\n\t\tcurrent_team = YELLOW;\n\t\tbma_string = \"place_yellow\";\n\t}\n\t\n\t// set the placement images at the top of the board\n\tfor (var col = 0; col < max_col; col++) {\n\t\tvar bma = map[col][1];\n\t\tbma.gotoAndPlay(bma_string);\n\t}\n}", "function turnCardUp(numCard) {\n\n // let imgCard = newGame.imgCardID + numCard;\n let imgCard = 'back' + numCard.dataset.card;\n document.getElementById(imgCard).src = newGame.deckArray[numCard.dataset.card - 1];\n flipSound.play();\n numCard.parentNode.parentNode.classList.add('is-flipped');\n\n newGame.checkCards.push(numCard.dataset.card);\n if (newGame.firstCard) {\n newGame.firstCard = false;\n }\n else {\n newGame.board.classList.add('no-click');\n newGame.firstCard = true;\n displayMoves();\n compareCards();\n displayFoundPairs();\n }\n}", "function Card1click(){\n console.log(\"card 1 clickt\");\n if(currentplayer)\n setcardstate(0, 0, 1);\n else\n setcardstate(0, 0, 2);\n}", "function turnCard(){\n\tif (this.classList.contains('open')) { //to avoid double click on the opened card...\n\t\n\t} else {\n\t\tif (animationFinished == false) { //to avoid to click on the third card before finishing matchCheck...\n\t\t} else {\n\t\t\tthis.classList.add('open', 'show');\n\t\t\tclickedCount ++;\n\t\t\tmoves.textContent = clickedCount;\n\t\t\topenedCard.push(this);\n\t\t\tif (openedCard.length === 2) {\n\t\t\t\tanimationFinished = false; \n\t\t\t\tmatchCheck(); \n\t\t\t} //once the second card was turned, call matchCheck...\n\t\t};\n\t};\n}", "function passCards()\n {\n DOM.cardsContainer.classList.remove(CSS.hidden);\n DOM.container.classList.remove(CSS.container.pause);\n DOM.container.classList.add(CSS.container.game);\n state.screen = \"GAME\";\n\n if (state.newGame)\n {\n useMemorisingTimeId = cards[0].addEventListener(\"move\", useMemorisingTime);\n }\n else\n {\n state.cardsTurnable = true;\n }\n\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(\n DOM.game.field.rows[cards[counter].dataset.position.row].cells[cards[counter].dataset.position.col],\n {height: sizes.card.height + \"PX\", width: sizes.card.width + \"PX\"},\n true\n );\n }\n\n toggleHideElements([DOM.game.score, DOM.game.pauseButton], animation.duration.hide, false);\n desk.removeEventListener(\"closeFan\", passCardsId);\n }", "function reactToNewAICards () {\n /* update behaviour */\n players[currentTurn].hand.determine();\n if (players[currentTurn].hand.strength == HIGH_CARD) {\n players[currentTurn].updateBehaviour([BAD_HAND, ANY_HAND]);\n } else if (players[currentTurn].hand.strength == PAIR) {\n players[currentTurn].updateBehaviour([OKAY_HAND, ANY_HAND]);\n } else {\n players[currentTurn].updateBehaviour([GOOD_HAND, ANY_HAND]);\n }\n \n players[currentTurn].commitBehaviourUpdate();\n \n players[currentTurn].swapping = false;\n \n saveSingleTranscriptEntry(currentTurn);\n\n /* wait and then advance the turn */\n timeoutID = window.setTimeout(advanceTurn, GAME_DELAY / 2);\n}", "function startGame() {\n generateCards();\n addStars();\n $('#moves').html('0');\n $('.card').click(cardToggle);\n}", "function startF() {\n playerHand.push(getCard());\n playerHand.push(getCard());\n playerScore = getPlayerScore();\n updatePage();\n}", "draw(){\n\t\tvar communityNewHand = this.state.communityCards;\n\t\tif (communityNewHand[0] === 'deck2'){\n\t\t\t// start over and push 3 cards off the top of the deck onto the array\n\t\t\tcommunityNewHand = [cards.deck.shift(),cards.deck.shift(),cards.deck.shift()]\t\t\n\t\t}else{\n\t\t\t// push\n\t\t\tcommunityNewHand.push(cards.deck.shift());\n\t\t}\n\t\tthis.setState({\n\t\t\tcommunityCards: communityNewHand\n\t\t})\n\t}", "processCard() {\n const card = this.currentCard.getCard();\n const cardClass = card.class;\n const rank = card.rank;\n // correct and incorrect card animations\n if (this.correctness && cardClass === 'Attack') {\n this.gamingScene.playAttack();\n this.action(cardClass, rank);\n } else if (this.correctness && cardClass === 'Defence') {\n this.gamingScene.playDefence();\n this.action(cardClass, rank);\n } else if (this.correctness && cardClass === 'Magic') {\n // replace this with magic\n this.gamingScene.playMagic();\n this.action(cardClass, rank);\n } else {\n this.gamingScene.playSelfDamage();\n this.player1.dealDamage(1);\n }\n }", "function stepCardUp() {\n switchCard(activeCard + 1);\n}", "function newGame() {\n cardFlipped = null;\n matching = false;\n moves = 0;\n firstMove = true;\n if (typeof runningTimer != 'undefined') {\n clearInterval(runningTimer);\n }\n seconds = 0;\n timer.html('00:00');\n stars.html('<li><i class=\"fa fa-star\"></i></li>'.repeat(3));\n deck.html('');\n movesDisplayer.html(moves);\n let cardModel = $('<li class=\"card\"><i class=\"fa\"></i></li>');\n let shuffledCards = shuffle(cards);\n // This will loop through the already shuffled cards and place them on the deck\n for (let cardClass of shuffledCards) {\n let card = cardModel.clone();\n card.children('i').addClass(cardClass);\n deck.append(card);\n }\n $('li.card').click(selectCard);\n}", "function addCard(newState, action){\r\n\r\n switch (action.pile) { //depending on the suited destination, we perform different moves\r\n case 'leftPostPile':\r\n newState.playerData[`player${action.player}Data`].leftPostPile.unshift(action.card);\r\n break;\r\n case 'middlePostPile':\r\n newState.playerData[`player${action.player}Data`].middlePostPile.unshift(action.card);\r\n break;\r\n case 'rightPostPile':\r\n newState.playerData[`player${action.player}Data`].rightPostPile.unshift(action.card);\r\n break;\r\n default:\r\n }\r\n return newState;\r\n}", "playCard(cardIndex, player) {\n if (player === true) {\n this.playerMana = this.playerMana - this.playerhand[cardIndex].cost;\n this.playerboard.push(this.playerhand[cardIndex]);\n this.playerhand.splice(cardIndex, 1)\n } else {\n this.aiMana = this.aiMana - this.aihand[cardIndex].cost;\n this.aiboard.push(this.aihand[cardIndex]);\n this.aihand.splice(cardIndex, 1)\n }\n\n }", "function performAction(data, turn, card, hero){\n var object = turn ? my : opponent;\n var figureOutMine = turn? !data.mine : data.mine;\n var updateScore = turn? opponent : my;\n\n //attack the card if the clicked card is not mine, have selected Card on my turn and selected card is not turnover card.\n if(figureOutMine && object.selectedCard && !object.selectedCard.classList.contains('card-turnover')){\n data.hp = data.hp - object.selectedCardData.att;\n if(data.hp <= 0){\n if(hero){//if hero's card hp is less than or equal to 0 then game end\n turn ? alert('You win!'): alert('You lose..');\n reset(true);\n reset(false);\n initialSetting();\n }else{//if soldier's card hp is less than or equal to 0 then remove from fieldData.\n var index = updateScore.FieldData.indexOf(data);\n updateScore.FieldData.splice(index, 1);\n }\n }\n\n turn ? updateDom(false) : updateDom(true); //update screen\n object.selectedCard.classList.remove('card-selected');\n object.selectedCard.classList.add('card-turnover');\n object.selectedCard = null;\n object.selectedCardData = null;\n return;\n }else if(figureOutMine){// return if click other side try to attack or select cards when its not their turn.\n return;\n }\n if(data.field){\n card.parentNode.querySelectorAll('.card').forEach(function(e){\n e.classList.remove('card-selected');\n });\n card.classList.add('card-selected');\n object.selectedCard = card;\n object.selectedCardData = data;\n }else{\n if(deckToField(data,turn) !== 'end'){//refill a card to deck once one card selected and moved to field.\n turn ? createMyDeck(1): createOpponentDeck(1);\n }\n }\n}", "dealIntoNewStack()\n {\n this._abStack.push([-1, this.nCards - 1]);\n this._abComposed = undefined;\n }", "function newGame() {\r\n resetGame();\r\n for (var i = 0; i < 2; i++) {\r\n playerCards();\r\n }\r\n dealerCards();\r\n dealerarea.appendChild(backCard());\r\n checkBlackJack();\r\n }", "function cycleTurn() {\n console.log('cycleTurn invoked');\n\n if (turnOf === players.length - 1) {\n\n turnOf = 0;\n\n } else {\n\n turnOf++;\n }\n\n alreadyTakenTurn = false;\n isDeckDisabled = false;\n discardPile.push(...board);\n board.length = 0;\n cycleActingPlayer();\n checkGameOver();\n oneCardDrawn = false;\n getDiscardCount.innerHTML = discardPile.length;\n showModal('new turn');\n\n}", "exchangeGainCard(card) {\n this.cards.push(card);\n ++this.numCards;\n }", "function playercardturn(player){\n //show cards\n //ask to select cards to play\n //push them into action slot\n }", "function hitMe(turn) {\n // console.log(`${turn.name} hits!`);\n let $newCard = ($('<div>', {'class': 'card removed'}));\n let newCard = deck.shift();\n\n $newCard.css('background-image', `url('${newCard.img}')`);\n\n turn.hand.push(newCard);\n $newCard.attr('id', `${turn.name}-card-${turn.hand.length}`);\n turn.$hand.append($newCard);\n\n turn.total = calculateHand(turn);\n\n $(`#${turn.name}-total p`).text(turn.total);\n\n checkForAce(turn);\n\n}", "function turnCards()\n {\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].turn(true);\n }\n }", "function startGame() {\n buildQuestionCard()\n}", "acceptCard(aCard, aGame) {\n\n let tempNewPoints;\n\n //Validate still playing, throw exception if not\n this.validateStillPlaying();\n\n //Deal with new card\n tempNewPoints = aGame.assignPointsFor(aCard, this);\n this.addPlayedCard(new PlayedCard(aCard, tempNewPoints));\n\n //Evaluate my next gameState given aCard\n this.determineNextState();\n\n }", "newTurn() {\n \n }", "function get_card(newCard){\n if(dbg){\n\t\tdebug(\"Get card\");\n\t}\n\tcard4 = newCard;\n\tupdate_hand();\n\tenable_discard();\n}", "function startNewGame() {\n if(cardIndex == 52) {\n shuffleDeck();\n }\n while (playerHand.firstChild) {\n playerHand.removeChild(playerHand.firstChild);\n }\n while (houseHand.firstChild) {\n houseHand.removeChild(houseHand.firstChild);\n }\n playerBoardCount.classList.remove('bust');\n playerBoardCount.classList.remove('black-jack');\n houseBoardCount.classList.remove('bust');\n houseBoardCount.classList.remove('black-jack');\n playerBoardCount.textContent = '';\n houseBoardCount.textContent = '';\n playerCount = 0;\n playerCards = [];\n houseCount = 0;\n houseCards = [];\n setTimeout(function(){ drawPlayerCard(); }, 500);\n setTimeout(function(){ drawHouseCard(); }, 1500);\n setTimeout(function(){ drawPlayerCard(); }, 2500);\n setTimeout(function(){ drawHouseCard(true); }, 3500);\n setTimeout(function(){\n hitBtn.disabled = false;\n standBtn.disabled = false;\n }, 3500);\n}", "function StartPlaying(){\n \n gameStart.hide();\n gameEnd.hide(); \n \n moves.show();\n statusTab.show();\n board.show();\n \n numberOfMoves = 0;\n cardsmatched = 0;\n \n movesMade.html(numberOfMoves);\n \n if (playGame == false) {\n \n playGame = true;\n images.array.sort(Shuffle);\n \n for(var i = 0; i < images.array.length - 1; i++){\n $(\".card:first-child\").clone().appendTo(\"#board\");\n }\n\n board.children().each(function(index) {\n $(this).css({\"left\" : ($(this).width() + 20) * (index % 6),\n \"top\" : ($(this).height() + 20) * Math.floor(index / 6)});\n \n faceValue = images.array.pop();\n $(this).find(\".back\").addClass(faceValue);\n $(this).attr(\"data-pattern\",faceValue);\n $(this).click(SelectCard);\n });\t\t\t\t\t\t\t\t\t\t\t \n }\t\t\t \n }", "switchTurn(x,y,lx,ly){\n console.log(\"switching current turn\")\n game.isXTurn = !game.isXTurn\n game.turns++\n game.boardTurns[x][y] = game.boardTurns[x][y] + 1 // Now the turns for each mini board are updated\n console.log(\"Board turns:\", game.boardTurns[x][y])\n console.log(\"turn count: \" + game.turns)\n\n // Set Logic for piece placement next time around (needs alpha changes)\n for (var i = 0; i < 3; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n for (var k = 0; k < 3; k++)\n {\n for (var l = 0; l < 3; l++)\n {\n if(i == x && j == y && k == lx && l == ly)\n game.redSquares[i][j][k][l].alpha = .7\n else\n game.redSquares[i][j][k][l].alpha = 0\n }\n }\n }\n }\n\n var connectedSquare = false\n\n for (var i = 0; i < 3; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n //Normal functionality, just assign one open spot\n if(i == lx && j == ly && game.magicBoardLogic[i][j] != \"magic\")\n {\n console.log(\"i: \", i)\n console.log(\"j: \", j)\n console.log(\"lx: \", lx)\n console.log(\"ly: \", ly)\n game.bigBoardLogic[i][j] = \"open\"\n\n game.cursorSquares[i][j].alpha = .7\n\n }\n // If the click on a open spot sends you to magic board\n else if (i == lx && j == ly && game.magicBoardLogic[i][j] === \"magic\")\n {\n for (var i = 0; i < 3; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n // Set all squares to closed\n game.bigBoardLogic[i][j] = \"closed\"\n game.cursorSquares[i][j].alpha = 0\n }\n }\n\n if (lx+1 < 3) {\n game.bigBoardLogic[lx+1][ly] = \"open\" // Right\n game.cursorSquares[lx+1][ly].alpha = .7\n if (lx+1 == x && ly == y)\n connectedSquare = true\n }\n\n if (lx-1 > -1) {\n game.bigBoardLogic[lx-1][ly] = \"open\" // Left\n game.cursorSquares[lx-1][ly].alpha = .7\n if (lx-1 == x && ly == y)\n connectedSquare = true\n }\n\n if (ly+1 < 3) {\n game.bigBoardLogic[lx][ly+1] = \"open\" // Bottom\n game.cursorSquares[lx][ly+1].alpha = .7\n if (lx == x && ly+1 == y)\n connectedSquare = true\n }\n\n if (ly-1 > -1) {\n game.bigBoardLogic[lx][ly-1] = \"open\" // Top\n game.cursorSquares[lx][ly-1].alpha = .7\n if (lx == x && ly-1 == y)\n connectedSquare = true\n }\n\n if (lx+1 < 3 && ly-1 > -1) {\n game.bigBoardLogic[lx+1][ly-1] = \"open\" // Top right\n game.cursorSquares[lx+1][ly-1].alpha = .7\n if (lx+1 == x && ly-1 == y)\n connectedSquare = true\n }\n\n if (lx-1 > -1 && ly-1 > -1) {\n game.bigBoardLogic[lx-1][ly-1] = \"open\" // Top left\n game.cursorSquares[lx-1][ly-1].alpha = .7\n if (lx-1 == x && ly-1 == y)\n connectedSquare = true\n }\n\n if (lx+1 < 3 && ly+1 < 3) {\n game.bigBoardLogic[lx+1][ly+1] = \"open\" // Bottom right\n game.cursorSquares[lx+1][ly+1].alpha = .7\n if (lx+1 == x && ly+1 == y)\n connectedSquare = true\n }\n\n if (lx-1 > -1 && ly+1 < 3) {\n game.bigBoardLogic[lx-1][ly+1] = \"open\" // Bottom left\n game.cursorSquares[lx-1][ly+1].alpha = .7\n if (lx-1 == x && ly+1 == y)\n connectedSquare = true\n }\n\n for (var i = 0; i < 3; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n\n if (game.magicBoardLogic[i][j] === \"magic\")\n game.cursorSquares[i][j].alpha = 0\n }\n }\n\n // If you get stuck, open up outer layer\n var stuck = true\n for (var i = 0; i < 3; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n if (game.bigBoardLogic[i][j] === \"open\" && game.magicBoardLogic[i][j] != \"magic\")\n stuck = false\n }\n }\n\n if (stuck == true) {\n console.log(\"STUCK\");\n if (lx+2 < 3) {\n console.log(\"A\");\n game.bigBoardLogic[lx+2][ly] = \"open\" // Right\n game.cursorSquares[lx+2][ly].alpha = .7\n if (lx+2 == x && ly == y)\n connectedSquare = true\n }\n\n if (lx+2 < 3 && ly-1 > -1) {\n console.log(\"A1\");\n game.bigBoardLogic[lx+2][ly-1] = \"open\" // Right 2 up 1\n game.cursorSquares[lx+2][ly-1].alpha = .7\n if (lx+2 == x && ly-1 == y)\n connectedSquare = true\n }\n\n if (lx+1 < 3 && ly-2 > -1) {\n console.log(\"A2\");\n game.bigBoardLogic[lx+1][ly-2] = \"open\" // Right 1 up 2\n game.cursorSquares[lx+1][ly-2].alpha = .7\n if (lx+1 == x && ly-2 == y)\n connectedSquare = true\n }\n\n if (lx+1 < 3 && ly+2 < 3) {\n console.log(\"A3\");\n game.bigBoardLogic[lx+1][ly+2] = \"open\" // Right 1 down 2\n game.cursorSquares[lx+1][ly+2].alpha = .7\n if (lx+1 == x && ly+2 == y)\n connectedSquare = true\n }\n\n if (lx+2 < 3 && ly+1 < 3) {\n console.log(\"A4\");\n game.bigBoardLogic[lx+2][ly+1] = \"open\" // Right 2 down 1\n game.cursorSquares[lx+2][ly+1].alpha = .7\n if (lx+2 == x && ly+1 == y)\n connectedSquare = true\n }\n\n if (lx-2 > -1) {\n console.log(\"B\");\n game.bigBoardLogic[lx-2][ly] = \"open\" // Left\n game.cursorSquares[lx-2][ly].alpha = .7\n if (lx-2 == x && ly == y)\n connectedSquare = true\n }\n\n if (lx-2 > -1 && ly-1 > -1) {\n console.log(\"B1\");\n game.bigBoardLogic[lx-2][ly-1] = \"open\" // Left 2 up 1\n game.cursorSquares[lx-2][ly-1].alpha = .7\n if (lx-2 == x && ly-1 == y)\n connectedSquare = true\n }\n\n if (lx-1 > -1 && ly-2 > -1) {\n console.log(\"B2\");\n game.bigBoardLogic[lx-1][ly-2] = \"open\" // Left 1 up 2\n game.cursorSquares[lx-1][ly-2].alpha = .7\n if (lx-1 == x && ly-2 == y)\n connectedSquare = true\n }\n\n if (lx-1 > -1 && ly+2 < 3) {\n console.log(\"B3\");\n game.bigBoardLogic[lx-1][ly+2] = \"open\" // Left 1 down 2\n game.cursorSquares[lx-1][ly+2].alpha = .7\n if (lx-1 == x && ly+2 == y)\n connectedSquare = true\n }\n\n if (lx-2 > -1 && ly+1 < 3) {\n console.log(\"B4\");\n game.bigBoardLogic[lx-2][ly+1] = \"open\" // Left 2 down 1\n game.cursorSquares[lx-2][ly+1].alpha = .7\n if (lx-2 == x && ly+1 == y)\n connectedSquare = true\n }\n\n if (ly+2 < 3) {\n console.log(\"C\");\n game.bigBoardLogic[lx][ly+2] = \"open\" // Bottom\n game.cursorSquares[lx][ly+2].alpha = .7\n if (lx == x && ly+2 == y)\n connectedSquare = true\n }\n\n if (ly-2 > -1) {\n console.log(\"D\");\n game.bigBoardLogic[lx][ly-2] = \"open\" // Top\n game.cursorSquares[lx][ly-2].alpha = .7\n if (lx == x && ly-2 == y)\n connectedSquare = true\n }\n\n if (lx+2 < 3 && ly-2 > -1) {\n console.log(\"E\");\n game.bigBoardLogic[lx+2][ly-2] = \"open\" // Top right\n game.cursorSquares[lx+2][ly-2].alpha = .7\n if (lx+2 == x && ly-2 == y)\n connectedSquare = true\n }\n\n if (lx-2 > -1 && ly-2 > -1) {\n console.log(\"F\");\n game.bigBoardLogic[lx-2][ly-2] = \"open\" // Top left\n game.cursorSquares[lx-2][ly-2].alpha = .7\n if (lx-2 == x && ly-2 == y)\n connectedSquare = true\n }\n\n if (lx+2 < 3 && ly+2 < 3) {\n console.log(\"g\");\n game.bigBoardLogic[lx+2][ly+2] = \"open\" // Bottom right\n game.cursorSquares[lx+2][ly+2].alpha = .7\n if (lx+2 == x && ly+2 == y)\n connectedSquare = true\n }\n\n if (lx-2 > -1 && ly+2 < 3) {\n console.log(\"H\");\n game.bigBoardLogic[lx-2][ly+2] = \"open\" // Bottom left\n game.cursorSquares[lx-2][ly+2].alpha = .7\n if (lx-2 == x && ly+2 == y)\n connectedSquare = true\n }\n }\n\n for (var i = 0; i < 3; i++)\n {\n for (var j = 0; j < 3; j++)\n {\n\n if (game.magicBoardLogic[i][j] === \"magic\")\n game.cursorSquares[i][j].alpha = 0\n }\n }\n\n }\n else\n {\n game.bigBoardLogic[i][j] = \"closed\"\n game.cursorSquares[i][j].alpha = 0\n }\n }\n }\n\n game.printBoardLogic() //this is printing weird but logic is fine\n\n var turn = game.isXTurn ? \"x\" : \"o\"\n if(game.singleplayer || game.vsAi)\n game.turnStatusText.setText(\"Current Turn: \" + turn.toUpperCase())\n // Below is for multiplayer\n else if(game.player === turn)\n game.turnStatusText.setText(\"Your Turn\")\n else\n game.turnStatusText.setText(game.opponent + \"'s turn\")\n }", "function addToOtherPhases(computerStack, computerDivId) {\n\n var array_phase_stacks = [phase1Stack, phase2Stack, c1phase1Stack, c1phase2Stack, c2phase1Stack,\n c2phase2Stack,c3phase1Stack, c3phase2Stack];\n\n var current_array_stack;\n var current_phase;\n var current_div;\n var new_cards = new Array();\n \n\n for (var j=0; j<computerStack.cardCount();j++) {\n var card_used = \"False\";\n var cur_card = computerStack.cards[j];\n for (var i=0; i<array_phase_stacks.length; i++) {\n current_array_stack = array_phase_stacks[i]; //the current stack we're evaluating against to place a \n switch (current_array_stack) {\n case phase1Stack: \n current_phase = phase1Stack.phase;\n current_div = '#phaseField1'; \n break; \n case phase2Stack:\n current_phase = phase2Stack.phase;\n current_div = '#phaseField2';\n break;\n case c1phase1Stack:\n current_phase = c1phase1Stack.phase;\n current_div = '#c1p1field';\n break;\n case c1phase2Stack:\n current_phase = c1phase2Stack.phase; \n current_div = '#c1p2field';\n break;\n case c2phase1Stack:\n current_phase = c2phase1Stack.phase;\n current_div = '#c2p1field';\n break;\n case c2phase2Stack:\n current_phase = c2phase2Stack.phase;\n current_div = '#c2p2field';\n break;\n case c3phase1Stack:\n current_phase = c3phase1Stack.phase;\n current_div = '#c3p1field';\n break;\n case c3phase2Stack:\n current_phase = c3phase2Stack.phase;\n current_div = '#c3p2field';\n break;\n }\n \n if (current_array_stack.phase == \"SET\") {\n //console.log(\"ITS A SET\");\n //console.log(\"cur card rank:\", cur_card.rank);\n //console.log(\"phase match num is\", current_array_stack.matchingNumber());\n if (cur_card.rank == current_array_stack.matchingNumber()) {\n var card_used = \"True\";\n console.log(\"MATCH: Rank is\", cur_card.rank);\n console.log(\"MATCH: Matching number is\", current_array_stack.matchingNumber());\n current_array_stack.addCard(cur_card);\n var node = cur_card.createNode(); \n $(computerDivId).append(node);\n id = $(node).data('id'); \n moveAnimate(id, current_div, computerDivId);\n console.log(\"Moving\", id, \"from\", computerDivId, \"to\", current_div);\n $(current_div).append($(node));\n node.firstChild.style.visibility = \"\";\n $(node).css('display', 'block');\n var last = computerDivId + ' div:last(1)';\n $(last).remove();\n }\n }\n else if (current_array_stack.phase == \"RUN\") {\n if (cur_card.rank == parseInt(current_array_stack.lastCard) + 1) {\n console.log(\"Rank is\", cur_card.rank);\n console.log(\"Matching color is\", cur_card.colors);\n current_array_stack.addCard(cur_card);\n var node = cur_card.createNode();\n //$(computerDivId).append(node);\n //node.firstChild.style.visibility = \"\";\n id = $(node).data('id');\n //moveAnimate(id, computerDivId, current_div);\n }\n else if (cur_card.rank == parseInt(current_array_stack.firstcard) - 1) {\n var card_used = \"True\";\n // check back later\n current_array_stack.addCard(cur_card);\n var node = cur_card.createNode();\n //$(computerDivId).append(node);\n //node.firstChild.style.visibility = \"\";\n id = $(node).data('id');\n //moveAnimate(id, computerDivId, current_div);\n }\n }\n else if (current_array_stack.phase == \"COLORS\") {\n if (cur_card.rank == current_array_stack.matchingColor) {\n var card_used = \"True\";\n current_array_stack.addCard(cur_card);\n var node = cur_card.createNode();\n //$(computerDivId).append(node);\n //node.firstChild.style.visibility = \"\";\n id = $(node).data('id');\n //moveAnimate(id, computerDivId, current_div);\n }\n }\n }\n\n if (card_used == \"False\") {\n new_cards.push(cur_card);\n }\n\n }\n computerStack.clearCards();\n computerStack.addCards(new_cards);\n\n\n\n\n}", "dealCards (state) {\n for (var i = 0; i < 7; i++) {\n state.game.deck[i * 4].location = LOCATION.PLAYER1\n state.game.deck[i * 4 + 1].location = LOCATION.PLAYER2\n state.game.deck[i * 4 + 2].location = LOCATION.PLAYER3\n state.game.deck[i * 4 + 3].location = LOCATION.PLAYER4\n }\n }", "function updateCards(index) {\n let card = cards[index]\n let cardsArr = [...cards]\n\n // If card is already flipped, or has been \"removed\" don't do anything\n if (!card.view || card.view === card.front) {\n return\n }\n\n if (turn <= 1) {\n card.view = card.front // Flip the card\n cardsArr[index] = card // Overwrite the old card state in the cards array\n\n let matchArr = checkMatch(cardsArr) // Get matching cards\n\n if (matchArr) {\n setTurn(0) // If match is found, reset turn to 0, because\n cardsArr = handleMatch(matchArr, cardsArr) //\n } else {\n setTurn((prev) => prev + 1)\n }\n setCards(cardsArr)\n } else {\n props.setCurrPlayer((props.currPlayer === \"player1\" ? \"player2\" : \"player1\"))\n setTurn(1)\n cardsArr = resetCards(cardsArr)\n card.view = card.front\n cardsArr[index] = card\n setCards(cardsArr)\n }\n return\n }", "function startNewGame() {\n arrayPlayCardTravaux = arrayCardTravaux.slice();\n melangeArray(arrayPlayCardTravaux);\n \n arrayPlayCardPlan1 = arrayCardPlan1.slice();\n melangeArray(arrayPlayCardPlan1);\n \n arrayPlayCardPlan2 = arrayCardPlan2.slice();\n melangeArray(arrayPlayCardPlan2);\n \n arrayPlayCardPlan3 = arrayCardPlan3.slice();\n melangeArray(arrayPlayCardPlan3);\n\n startBtnElt.style.display = 'none';\n soloBtnElt.style.display = 'block';\n \n affichageCardsTravaux();\n affichageCardsPlan();\n affichageNumberCard();\n setInterval(chronoRunVar, 1000);\n}", "function newMove() {\n game.currentGame.push(game.possibilities[Math.floor(Math.random()*4)]);\n showMoves();\n }", "function open_turn() {\r\n // remove 1 card\r\n triumphSet.pop();\r\n \r\n turn = triumphSet.pop();\r\n \r\n turn_src.nodeValue = convert(turn);\r\n}", "newTurn () {\n let player\n\n if (!this.turn) {\n // Decide first turn\n player = this.players[0]\n } else {\n const current = this.players.indexOf(this.turn.player)\n player = current >= 0 && current < this.players.length - 1 ? this.players[current + 1] : this.players[0]\n }\n\n this.turns.push(new Turn(this, player))\n }", "function nextAssistState () {\n\tswitch (assistInfo.state) {\n\t\tcase 'intro':\n\t\t\tassistInfo.curGame = curGame; //temporary\n\t\t\tloadAssistState('chooseOrder');\n\t\t\tbreak;\n\t\tcase 'chooseOrder':\n\t\t\tassistInfo.board = getValue('assistStageSelect'); //todo: should probably also be moved\n\t\t\tloadAssistState('turn');\n\t\t\tbreak;\n\t\tcase 'turn':\n\t\t\t//loadAssistState('minigame');\n\t\t\tbreak;\n\t}\n}", "function addCard(card, person) {\n // Add the card to the person's play area if this fuction is being called in hitMe \n if (person.cards > 1) {\n $('#' + person.name).find('.card' + (person.cards)).after(\"<div class='extraCard card\" + (person.cards + 1) + \"'>X</div>\");\n $('#' + person.name).find('.card' + (person.cards +1)).html(deck[index].slice(1)).addClass(\"suit\" + (deck[index])[0]);\n }\n\n \n // Parse the card and assign to to sum or aces\n function parseCard(slicedCard) {\n\n if (slicedCard === \"A\") {\n person.aces++;\n } else if (slicedCard === \"J\" || slicedCard === \"Q\" || slicedCard === \"K\") {\n person.sum += 10;\n } else { person.sum += parseInt((slicedCard), 10); }\n }\n\n // Parse the value of the card to a number or an Ace.\n parseCard(card.slice(1));\n\n // Increase the card count of that person\n person.cards++;\n\n // Once the card has been added, the index is increased\n index++;\n}", "function distributeNewCards()\n {\n if (Game.lastTimedEvent === 0)\n {\n Game.lastTimedEvent = Game.frameCounter;\n }\n\n if (Game.frameCounter === Game.lastTimedEvent + 60)\n {\n for (let i = 0; i < Game.userHand.cards.length; i++)\n {\n Game.userHand.cards[i].selected = false;\n }\n\n drawNormalHand();\n Game.counter++;\n }\n }", "function playCard(){\n\tcardPlayed = playerArr[turn].playerHand.splice($(this).index(), 1);\n\tcheckCard();\n}", "function startRound() {\n printGameScreen();\n printPlayer(activePlayer)\n rl.question(\"Command: \", function(answer) {\n\n //draw phase\n //play hand phase\n //buy components\n //play action\n\n //if final person has reached then do the cycle update round\n\n //check to see if anyone has reached the winning amount\n\n\n //need to cycle between players\n\n if (/^[d]/.test(answer)) {\n console.log('someone pressed the d')\n players[activePlayer].drawCard(deck);\n playerActionCount++;\n }\n\n if (/^[x]/.test(answer)) {\n console.log('someone pressed x')\n let pred = answer.split(' ');\n let temp = pred[1];\n let cardsList = temp.split(\",\");\n var result = cardsList.map(function (x) {\n return parseInt(x, 10);\n });\n //need to draw that many cards for this player\n //error handling make sure not allowed take more than allowed\n\n players[activePlayer].board.exchangeForComponent(result);\n playerActionCount++;\n }\n\n if (/^[t]/.test(answer)) {\n let pred = answer.split(' ');\n let cardNum = pred[1];\n players[activePlayer].board.addNewTask(cardNum);\n playerActionCount++\n }\n\n if (answer == \"help\" || answer == \"h\") {\n console.log('>d //to draw a card');\n console.log('>x 1,2,3 //to exchange cards for components, the number in csv will be the number of the card in your hand');\n console.log('>t n // to add a card from your hand to the tasks');\n }\n\n if (answer == \"exit\"){\n rl.close();\n } else {\n if(playerActionCount == maxActionPerTurn) {\n activePlayer = nextPlayer(activePlayer);\n playerActionCount = 0;\n }\n\n\n\n startRound();\n }\n });\n}", "answeredQuestionIncorrectly() {\n //move the card to the end of the queue\n let failedCard = this.shift('now');\n failedCard.currentStack = 'now';\n this.fetchEnd('now').child = failedCard;\n }", "function useCard(player, card, x, y)\n{\n\tconsole.log(\"activating card effect on card \"+card.name + \" \" + player.cardsInHand.indexOf(card));\n\t\n\tfor(var i = 0;i<player.cardsInHand.length;i++)\n\t{\n\t\tif(player.cardsInHand[i].name == card.name)\n\t\t{\n\t\t\tboards[player.socket.room][x][y] = card;\n\t\t\tplayer.field.push({x: x, y: y});\n\t\t\tplayer.cardsInHand.splice(i, 1);\n\t\t\t\n\t\t\tupdatePlayer(player);\n\t\t\tconsole.dir(player.cardsInHand);\n\t\t\t\n\t\t\tvar opp = findOpponent(player, player.socket);\n\t\t\tplayer.socket.emit(\"updateCards\", \n\t\t\t{\n\t\t\t\tplayer: player.cardsInHand,\n\t\t\t\topp: Object.keys(opp.cardsInHand).length,\n\t\t\t\tdeck: getNumCardsInDeck(player.deck),\n\t\t\t\toppDeck: getNumCardsInDeck(opp.deck)\n\t\t\t});\n\t\t\t\n\t\t\tplayer.socket.emit(\"updateBoard\",\n\t\t\t{\n\t\t\t\tboard: boards[player.socket.room],\n\t\t\t\tfield: player.field,\n\t\t\t\toppField: opp.field\n\t\t\t});\n\t\t\t\n\t\t\topp.socket.emit(\"updateCards\", \n\t\t\t{\n\t\t\t\tplayer: opp.cardsInHand,\n\t\t\t\topp: Object.keys(player.cardsInHand).length,\n\t\t\t\tdeck: getNumCardsInDeck(opp.deck),\n\t\t\t\toppDeck: getNumCardsInDeck(player.deck)\n\t\t\t});\n\t\t\t\n\t\t\topp.socket.emit(\"updateBoard\",\n\t\t\t{\n\t\t\t\tboard: boards[player.socket.room],\n\t\t\t\tfield: opp.field,\n\t\t\t\toppField: player.field\n\t\t\t});\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t\n}", "function computerPlayPhase(array_of_nums, wilds) {\n\n var new_cards = new Array();\n var cards_removed = 0;\n var num_wilds = 0;\n var num_wilds_needed1 = 0;\n var num_wilds_needed2 = 0;\n phase1Stack.phase = \"SET\";\n phase2Stack.phase = \"SET\";\n\n if (wilds == \"False\") {\n var first_num = array_of_nums[1];\n var second_num = array_of_nums[2];\n } else if (wilds == \"True\") {\n var first_num = array_of_nums[2];\n var second_num = array_of_nums[3];\n }\n\n for (var i = 0; i < computerStack.cardCount(); i++) {\n var new_card = new Card(computerStack.cards[i].rank, computerStack.cards[i].colors);\n if (new_card.rank == first_num) {\n phase1Stack.addCard(new_card);\n cardNode = new_card.createNode();\n cardNode.firstChild.style.visibility=\"\";\n $(phaseField1).append(cardNode);\n cards_removed += 1;\n }\n else if (new_card.rank == second_num) {\n phase2Stack.addCard(new_card);\n cardNode = new_card.createNode();\n cardNode.firstChild.style.visibility=\"\";\n $(phaseField2).append(cardNode);\n cards_removed +=1;\n }\n else if (new_card.rank == \"W\") {\n num_wilds += 1;\n } \n else {\n new_cards.push(new_card); // create a new list of all the non matching cards\n }\n }\n\n if (wilds == \"True\") {\n console.log(\"Wilds is true.\");\n if (phase1Stack.cardCount() < 3) {\n num_wilds_needed1 = 3 - phase1Stack.cardCount();\n for (var i = 0; i < num_wilds_needed1; i++) {\n wildcard = new Card(\"W\", \"X\");\n cardNode = wildcard.createNode();\n cardNode.firstChild.style.visibility = \"\";\n $(phaseField1).append(cardNode);\n phase1Stack.addCard(wildcard);\n }\n }\n if (phase2Stack.cardCount() < 3) {\n num_wilds_needed2 = 3 - phase2Stack.cardCount();\n for (var i = 0; i < num_wilds_needed2; i++) {\n wildcard = new Card(\"W\", \"X\");\n cardNode = wildcard.createNode();\n cardNode.firstChild.style.visibility = \"\";\n $(phaseField2).append(cardNode);\n phase2Stack.addCard(wildcard);\n }\n }\n var wilds_left = num_wilds - num_wilds_needed1 - num_wilds_needed2;\n for (var i = 0; i<wilds_left; i++) {\n new_cards.push(new Card(\"W\",\"X\"));\n }\n }\n\n cards_removed = cards_removed + num_wilds_needed2 + num_wilds_needed1;\n for (var i = 1; i < cards_removed+1; i++) {\n var last = '#computer' + computer_num + 'DivId div:last(' + i + ')';\n $(last).remove();\n }\n\n console.log(\"New cards are\", new_cards);\n console.log(\"Before being cleared\", computerStack);\n console.log(\"the cards are\", computerStack.cards)\n computerStack.clearCards();\n console.log(\"Computer stack cleared is\", computerStack);\n computerStack.addCards(new_cards); // new hand without the played phase cards\n console.log(\"Computer stack with added cards is\", computerStack);\n }", "flipCard (card)\r\n {\r\n /*\r\n console.log (card != this.cardToCheck);\r\n console.log (!this.matchedCards.includes(card));\r\n console.log (\"start: \" + this.busy);\r\n */\r\n if (!this.busy && card != this.cardToCheck && !this.matchedCards.includes(card))\r\n {\r\n this.count++;\r\n //console.log (\"num: \" + this.count);\r\n this.score.innerHTML = this.count;\r\n /*\r\n * Adding visible to the card's class so it flips to the other side\r\n */\r\n card.classList.add(\"visible\");\r\n\r\n if (this.cardToCheck != null)\r\n {\r\n this.checkMatch (card);\r\n //console.log (\"a: \" + this.getCardType (this.cardToCheck));\r\n this.cardToCheck = null;\r\n }\r\n else\r\n {\r\n this.cardToCheck = card;\r\n //console.log(\"f: \" + this.getCardType (this.cardToCheck));\r\n }\r\n }\r\n //console.log (\"flipped\");\r\n }", "_getPlayerCards(){\n let newCard = _deck.draw()\n _playersHand.push(newCard)\n return _playersHand\n }", "function player2Initial() {\n deck2.id = \"cardsrightnew\";\n\n //sets the cards in the players hand\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n gameData.player2Cards.push(`images/${gameData.playerCards[randPlay]}`);\n\n //if card is selected by user, replace the card with a new one and move to next player\n twoCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n twoCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[0]}'s turn`;\n\n setPlayerCard();\n twoCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck1.id = \"cardsleftnew\";\n deck2.style.display = \"none\";\n deck2.id = \"cardsright\";\n setTimeout(function(){player1Turn2();}, 2000);\n });\n}", "Hit() {\n //Get the player's next card\n this.pHand.cards.push(this.deck.NewCard(GetRandomCardNumber()));\n\n //Update the hand's total.\n this.pHand.CalculateTotal();\n\n //Evaluate the totals.\n this.Evaluate(false);\n }", "function nextCard()\r\n\t\t{\r\n\t\t\tvar length = questions.length;\r\n\r\n\t\t\tif(questionNumber<length-1)\r\n\t\t\t\tquestionNumber++;\r\n\t\t\telse\r\n\t\t\t\tquestionNumber=0;\r\n\t\t\t\r\n\t\t\tif(cardState==0){\r\n\t\t\t\tcurrentText = questions[questionNumber];\r\n\t\t\t\tupdateFront();\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tflipCard();\r\n\t\t\t\tflashcard.classList.toggle('flipped');\r\n\t\t\t\tupdateText();\r\n\t\t\t}\r\n\r\n\t\t}", "function setBench(card){\n\t$('.handButton').trigger('click');\n\tcard = card;\n\t\tif (card.Stage == \"basic\" || card == Clefairy_Doll){\n\t\tif ($('#player .benchPoke:first img').length == 0){\n\t\t\t$('#player .benchPoke:first').append('<img src=\"Cards/Base_Set/' + card.Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t// Remove the card from the hand\n\t\t\tindex = playerInHand.indexOf(card);\n\t\t\tinPlay8 = {Card: playerInHand[index].Card, Stage: playerInHand[index].Stage, Type: playerInHand[index].Type, HP: playerInHand[index].HP, PokePower: playerInHand[index].PokePower, Attack1: playerInHand[index].Attack1, Attack2: playerInHand[index].Attack2, Weak: playerInHand[index].Weak, Resist: playerInHand[index].Resist, Retreat: playerInHand[index].Retreat};\n\t\t\tplayerInHand.splice(index, 1);\n\t\t\t$('.inPlayerHand').empty();\n\t\t\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n\t\t} else if ($('#player .benchPoke:nth-child(2) img').length == 0){\n\t\t$('#player .benchPoke:nth-child(2)').append('<img src=\"Cards/Base_Set/' + card.Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t// Remove the card from the hand\n\t\t\tindex = playerInHand.indexOf(card);\n\t\t\tinPlay9 = {Card: playerInHand[index].Card, Stage: playerInHand[index].Stage, Type: playerInHand[index].Type, HP: playerInHand[index].HP, PokePower: playerInHand[index].PokePower, Attack1: playerInHand[index].Attack1, Attack2: playerInHand[index].Attack2, Weak: playerInHand[index].Weak, Resist: playerInHand[index].Resist, Retreat: playerInHand[index].Retreat};\n\t\t\tplayerInHand.splice(index, 1);\n\t\t\t$('.inPlayerHand').empty();\n\t\t\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n\t\t} else if ($('#player .benchPoke:nth-child(3) img').length == 0){\n\t\t$('#player .benchPoke:nth-child(3)').append('<img src=\"Cards/Base_Set/' + card.Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t// Remove the card from the hand\n\t\t\tindex = playerInHand.indexOf(card);\n\t\t\tinPlay10 = {Card: playerInHand[index].Card, Stage: playerInHand[index].Stage, Type: playerInHand[index].Type, HP: playerInHand[index].HP, PokePower: playerInHand[index].PokePower, Attack1: playerInHand[index].Attack1, Attack2: playerInHand[index].Attack2, Weak: playerInHand[index].Weak, Resist: playerInHand[index].Resist, Retreat: playerInHand[index].Retreat};\n\t\t\tplayerInHand.splice(index, 1);\n\t\t\t$('.inPlayerHand').empty();\n\t\t\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n\t\t} else if ($('#player .benchPoke:nth-child(4) img').length == 0){\n\t\t$('#player .benchPoke:nth-child(4)').append('<img src=\"Cards/Base_Set/' + card.Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t// Remove the card from the hand\n\t\t\tindex = playerInHand.indexOf(card);\n\t\t\tinPlay11 = {Card: playerInHand[index].Card, Stage: playerInHand[index].Stage, Type: playerInHand[index].Type, HP: playerInHand[index].HP, PokePower: playerInHand[index].PokePower, Attack1: playerInHand[index].Attack1, Attack2: playerInHand[index].Attack2, Weak: playerInHand[index].Weak, Resist: playerInHand[index].Resist, Retreat: playerInHand[index].Retreat};\n\t\t\tplayerInHand.splice(index, 1);\n\t\t\t$('.inPlayerHand').empty();\n\t\t\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n\t\t} else if ($('#player .benchPoke:last img').length == 0){\n\t\t$('#player .benchPoke:last').append('<img src=\"Cards/Base_Set/' + card.Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t// Remove the card from the hand\n\t\t\tindex = playerInHand.indexOf(card);\n\t\t\tinPlay12 = {Card: playerInHand[index].Card, Stage: playerInHand[index].Stage, Type: playerInHand[index].Type, HP: playerInHand[index].HP, PokePower: playerInHand[index].PokePower, Attack1: playerInHand[index].Attack1, Attack2: playerInHand[index].Attack2, Weak: playerInHand[index].Weak, Resist: playerInHand[index].Resist, Retreat: playerInHand[index].Retreat};\n\t\t\tplayerInHand.splice(index, 1);\n\t\t\t$('.inPlayerHand').empty();\n\t\t\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n\t\t}\n\t} else {\n\t\talert(\"Only basic Pokemon can go on the bench. Pick another card.\");\n\t}\n\tif (enemyInHand[0].Stage == \"basic\"){\n\t\t$('#enemy .benchPoke:first').append('<img src=\"Cards/Base_Set/' + enemyInHand[0].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[0].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[0];\n\t\t\tenemyInPlay8 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(0, 1);\n\t} else if (enemyInHand[1].Stage == \"basic\"){\n\t\tif ($('#enemy .benchPoke:first img').length > 0) {\n\t\t\t$('#enemy .benchPoke:nth-child(2)').append('<img src=\"Cards/Base_Set/' + enemyInHand[1].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[1].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[1];\n\t\t\tenemyInPlay9 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(1, 1);\n\t\t} else {\n\t\t\t$('#enemy .benchPoke:first img').append('<img src=\"Cards/Base_Set/' + enemyInHand[1].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[1].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[1];\n\t\t\tenemyInPlay8 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(1, 1);\n\t\t}\n\t} else if (enemyInHand[2].Stage == \"basic\"){\n\t\tif ($('#enemy .benchPoke:first img').length > 0 || $('#enemy .benchPoke:nth-child(2) img').length > 0) {\n\t\t\t$('#enemy .benchPoke:nth-child(3)').append('<img src=\"Cards/Base_Set/' + enemyInHand[2].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[2].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[2];\n\t\t\tenemyInPlay10 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(2, 1);\n\t\t} else {\n\t\t\t$('#enemy .benchPoke:first').append('<img src=\"Cards/Base_Set/' + enemyInHand[2].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[2].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[2];\n\t\t\tenemyInPlay8 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(2, 1);\n\t\t}\n\t} else if (enemyInHand[3].Stage == \"basic\"){\n\t\tif ($('#enemy .benchPoke:first img').length > 0 || $('#enemy .benchPoke:nth-child(2) img').length > 0 || $('#enemy .benchPoke:nth-child(3) img').length > 0) {\n\t\t\t$('#enemy .benchPoke:nth-child(4)').append('<img src=\"Cards/Base_Set/' + enemyInHand[3].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[3].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[3];\n\t\t\tenemyInPlay11 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(3, 1);\n\t\t} else {\n\t\t\t$('#enemy .benchPoke:first').append('<img src=\"Cards/Base_Set/' + enemyInHand[3].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[3].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[3];\n\t\t\tenemyInPlay8 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(3, 1);\n\t\t}\n\t} else if (enemyInHand[4].Stage == \"basic\"){\n\t\tif ($('#enemy .benchPoke:first img').length > 0 || $('#enemy .benchPoke:nth-child(2) img').length > 0 || $('#enemy .benchPoke:nth-child(3) img').length > 0 || $('#enemy .benchPoke:nth-child(4) img').length > 0) {\n\t\t\t$('#enemy .benchPoke:nth-child(5)').append('<img src=\"Cards/Base_Set/' + enemyInHand[4].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[4].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[4];\n\t\t\tenemyInPlay12 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(4, 1);\n\t\t} else {\n\t\t\t$('#enemy .benchPoke:first').append('<img src=\"Cards/Base_Set/' + enemyInHand[4].Card + '\" class=\"card\" onClick=\"largeCard(this)\" />');\n\t\t\t$('.inEnemyHand img[src=\"Cards/Base_Set/' + enemyInHand[4].Card + '\"]').remove();\n\t\t\tindex = enemyInHand[4];\n\t\t\tenemyInPlay8 = {Card: index.Card, Stage: index.Stage, Type: index.Type, HP: index.HP, PokePower: index.PokePower, Attack1: index.Attack1, Attack2: index.Attack2, Weak: index.Weak, Resist: index.Resist, Retreat: index.Retreat};\n\t\t\tenemyInHand.splice(4, 1);\n\t\t}\n\t}\n\t\n\t// Array of all player's in play cards\n\tplayerInPlay = new Array(inPlay1, inPlay2, inPlay3, inPlay4, inPlay5, inPlay6, inPlay7, inPlay8, inPlay9, inPlay10, inPlay11, inPlay12);\n\t$('.inPlayerHand').empty();\n\tfor (i=0; i < playerInHand.length; i++){\n\t\t\t\t$('.inPlayerHand').append('<img src=\"Cards/Base_Set/' + playerInHand[i].Card + '\" class=\"card\" onClick=\"setBench(playerInHand[' + i + '])\" />');\n\t\t\t}\n}", "function makeMove(){\n\t$(\".card\").click(function(e){\n\t\tshowCardSymbol($(e.target));\n\t\taddToCardCheck($(e.target));\n\t\tif (cardCheck.length === 2) {\n\t\t\tcheckMatches();\n\t\t}\n\t\tcongratsMessage();\n\t});\n}", "function newGame() {\n\tconst randomCards = shuffle(cardDeck);\n\tfor(randomCard of randomCards){\n\t\tgameBoard.appendChild(randomCard);\n\t\trandomCard.classList.remove('open','show','match');\n\t\trandomCard.addEventListener('click', cardClick);\n\t}\n\tmoves = 0;\n\tmatches = 0;\n\tseconds = 0;\n\tminutes = 0;\n}", "function getNewCard() {\r\n // Set index of next card from deck\r\n let nextCardIndex = shuffledDeck[shuffledDeckIndex];\r\n\r\n // Get next card number and suit from deck\r\n const nextCardNumber = deck[nextCardIndex].cardNumber;\r\n const nextCardSuit = deck[nextCardIndex].cardSuit;\r\n\r\n // Create new card object with next card number and suit\r\n const nextCard = new Card(nextCardNumber, nextCardSuit);\r\n\r\n // Render next card on the 'front' of the next card\r\n nextCard.render();\r\n\r\n shuffledDeckIndex++;\r\n\r\n // Re-shuffle cards when all cards from deck have been used\r\n if (shuffledDeckIndex > 51) {\r\n shuffledDeckIndex = 0;\r\n shuffledDeck = shuffle(numbersToShuffle);\r\n\r\n // Remove all played cards from Played Cards area\r\n while (playedCardArea.lastElementChild) {\r\n playedCardArea.removeChild(playedCardArea.lastElementChild);\r\n }\r\n console.log(shuffledDeck);\r\n }\r\n showLastPlayed();\r\n}", "function startGame() {\n playerOneCards = [];\n playerTwoCards = [];\n assignCards();\n updateCurrentCards();\n if(gamesPlayed === 0){\n gamesPlayed++;\n let i = 0;\n card1Back.classList.add('hiddenLeft'); \n displayCard(i); \n }\n else {\n gamesPlayed++;\n let i = 0; \n displayCard(i);\n startButton.innerText = 'START';\n card1Back.classList.add('hiddenLeft');\n card1.classList.remove('hiddenLeft');\n card2.classList.remove('hiddenRight');\n }\n\n\n}", "startTurn () { this.resetResources (); this._startTurn (); }", "function PlayerTurn() {\n var canPlay = false; document.getElementById(\"layer\").open = true;\n\n if (plus2counter !== 0 && plus4counter === 0) {\n for (x = 0; x < 20; x++) {\n let card = document.getElementById(\"player\" + player + \"-slot\" + x);\n if (IsPlus2(card) || IsPlus4(card)) { canPlay = true; counter = 1; break; }\n }\n }\n else if (plus4counter !== 0) {\n for (x = 0; x < 20; x++) {\n let card = document.getElementById(\"player\" + player + \"-slot\" + x);\n if (IsPlus4(card)) { canPlay = true; counter = 1; break; }\n }\n }\n else { canPlay = true; }\n\n if (canPlay) { if (player === 1) { HighlightPlayableCards(); } else { setTimeout(CPUPlay, 1100) } }\n else {\n setTimeout(function () {\n let numberOfCards = (plus2counter * 2) + (plus4counter * 4);\n DrawCard(numberOfCards); plus4counter = 0; plus2counter = 0; soundDraw.play();\n PlayerAction(player, \"+\" + numberOfCards); CallNextPlayer();\n }, 400)\n }\n }", "function Board() {\r\n //slots will either be null or contain a card\r\n this.slots = [];\r\n\r\n //called by this player\r\n this.PlaceCard = function (slotIndex, card) {\r\n this.slots[slotIndex] = card;\r\n this.UpdateBoard(card); \r\n mainState.toggleTurn(false);\r\n\r\n //websocket, send info to other player\r\n websocket.send(JSON.stringify({\r\n action: 'go',\r\n card: { slotIndex: slotIndex, cardType: { sprite: card.cardType.sprite, values: card.values }, owner: card.owner }\r\n }));\r\n\r\n }\r\n\r\n this.CreateCard = function (slotIndex, cardType, owner) {\r\n //get the point coords\r\n var point = { x: mainState.emptyfadeGridHexes.getAt(slotIndex).x, y: mainState.emptyfadeGridHexes.getAt(slotIndex).y };\r\n\r\n var card = new Card(point, cardType, 4, 3, globalScale);\r\n card.SetOwner(owner);\r\n card.cardImg.inputEnabled = false;\r\n this.slots[slotIndex] = card;\r\n this.UpdateBoard(card); \r\n }\r\n\r\n //check neighboring cards, and see if they should be flipped\r\n this.UpdateBoard = function (card) {\r\n //if a card were to exist, it should be close to this phantomCard's position \r\n var phantomPoint;\r\n var cardAtPoint;\r\n var initialPoint = { x: card.position.x, y: card.position.y };\r\n\r\n //must check the 6 potential cards around the just placed card\r\n phantomPoint = CalculatePoint(initialPoint, card.cardImg.width, 0);\r\n cardAtPoint = this.GetCardFromFuzzyHexGrid(phantomPoint);\r\n if (cardAtPoint && card.values[2] > cardAtPoint.values[0] && cardAtPoint.owner != card.owner) {\r\n cardAtPoint.SetOwner(card.owner);\r\n \r\n }\r\n\r\n phantomPoint = CalculatePoint(initialPoint, card.cardImg.width, 60);\r\n cardAtPoint = this.GetCardFromFuzzyHexGrid(phantomPoint);\r\n if (cardAtPoint && card.values[2] > cardAtPoint.values[1] && cardAtPoint.owner != card.owner) {\r\n cardAtPoint.SetOwner(card.owner);\r\n \r\n }\r\n\r\n phantomPoint = CalculatePoint(initialPoint, card.cardImg.width, 120);\r\n cardAtPoint = this.GetCardFromFuzzyHexGrid(phantomPoint);\r\n if (cardAtPoint && card.values[0] > cardAtPoint.values[1] && cardAtPoint.owner != card.owner) {\r\n cardAtPoint.SetOwner(card.owner);\r\n \r\n }\r\n\r\n phantomPoint = CalculatePoint(initialPoint, card.cardImg.width, 180);\r\n cardAtPoint = this.GetCardFromFuzzyHexGrid(phantomPoint);\r\n if (cardAtPoint && card.values[0] > cardAtPoint.values[2] && cardAtPoint.owner != card.owner) {\r\n cardAtPoint.SetOwner(card.owner);\r\n \r\n }\r\n\r\n phantomPoint = CalculatePoint(initialPoint, card.cardImg.width, 240);\r\n cardAtPoint = this.GetCardFromFuzzyHexGrid(phantomPoint);\r\n if (cardAtPoint && card.values[1] > cardAtPoint.values[2] && cardAtPoint.owner != card.owner) {\r\n cardAtPoint.SetOwner(card.owner);\r\n \r\n }\r\n\r\n phantomPoint = CalculatePoint(initialPoint, card.cardImg.width, 300);\r\n cardAtPoint = this.GetCardFromFuzzyHexGrid(phantomPoint);\r\n if (cardAtPoint && card.values[1] > cardAtPoint.values[0] && cardAtPoint.owner != card.owner) {\r\n cardAtPoint.SetOwner(card.owner);\r\n \r\n }\r\n\r\n //update score\r\n mainState.score = [0, 0];\r\n var gameOver = true;\r\n for (var i = 0; i < mainState.board.slots.length; i++) {\r\n var card = mainState.board.slots[i];\r\n if (card != null) {\r\n mainState.score[card.owner-1] += 1;\r\n }\r\n else {\r\n //if the whole board isn't full then the game isn't over\r\n gameOver = false;\r\n }\r\n }\r\n mainState.playerOneScore.setText(mainState.score[0]);\r\n mainState.playerTwoScore.setText(mainState.score[1]);\r\n\r\n //gameover\r\n if (gameOver) {\r\n mainState.gameOver = true;\r\n if (mainState.score[0] > mainState.score[1] && mainState.player == 1) {\r\n mainState.turnText.setText(\"You Win!\");\r\n }\r\n else if (mainState.score[0] < mainState.score[1] && mainState.player == 2) {\r\n mainState.turnText.setText(\"You Win!\");\r\n }\r\n else if (mainState.score[0] == mainState.score[1]) {\r\n mainState.turnText.setText(\"Tie\");\r\n }\r\n else {\r\n mainState.turnText.setText(\"You Lose\");\r\n }\r\n }\r\n }\r\n\r\n //retrieves the card near a point otherwise returns null\r\n this.GetCardFromFuzzyHexGrid = function (point) {\r\n\r\n for (var i = 0; i < this.slots.length; i++) {\r\n if (this.slots[i] != null) {\r\n var halfWidth = this.slots[i].cardImg.width / 4;\r\n if (Math.abs(this.slots[i].position.x - point.x) < halfWidth && Math.abs(this.slots[i].position.y - point.y) < halfWidth) {\r\n return this.slots[i];\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n }\r\n}", "function UpdateOptionCardInfo(){ //Send info of the options of Event card to Option Card Controller\r\n \r\n if (Important.ImmidiateDrawCardNumber != 0){ //To Override the queue and immidiately draw certain cards (eg. Desolation)\r\n Scripts.OptionClickControlScript.UpdateCards(\r\n AllEventCardsInGame[0].Miscellaneous[Important.ImmidiateDrawCardNumber-1].CardIdentifier[0],\r\n AllEventCardsInGame[0].Miscellaneous[Important.ImmidiateDrawCardNumber-1].CardIdentifier[1]);\r\n\r\n return;\r\n }\r\n\r\n Scripts.OptionClickControlScript.UpdateCards(\r\n Important.CardToUse[EventCardPlayed-1].CardIdentifier[0],\r\n Important.CardToUse[EventCardPlayed-1].CardIdentifier[1]);\r\n}", "function getNextCard(){ //shifts to next in array\n return deck.shift();\n}", "function toggleCard() {\n\n if (game_started === false) {\n game_started = true;\n timer.start();\n }\n\n if (openCards.length === 0) {\n $(this).toggleClass(\"show open\");\n openCards.push($(this));\n disableCLick();\n }\n else if (openCards.length === 1) {\n updateMoves();\n $(this).toggleClass(\"show open\");\n openCards.push($(this));\n setTimeout(matchOpenCards, 1100);\n }\n}", "function takeAHardMove(turn) {\n var available = game.currentState.emptyCells();\n\n //enumerate and calculate the score for each avaialable actions to the ai player\n var availableActions = available.map(function(pos) {\n var action = new AIAction(pos); //create the action object\n var next = action.applyTo(game.currentState); //get next state by applying the action\n\n action.minimaxVal = minimaxValue(next); //calculate and set the action's minmax value\n\n return action;\n });\n\n //sort the enumerated actions list by score\n if(turn === \"X\")\n //X maximizes --> sort the actions in a descending manner to have the action with maximum minimax at first\n availableActions.sort(AIAction.DESCENDING);\n else\n //O minimizes --> sort the actions in an ascending manner to have the action with minimum minimax at first\n availableActions.sort(AIAction.ASCENDING);\n\n\n //take the first action as it's the optimal\n var chosenAction = availableActions[0];\n var next = chosenAction.applyTo(game.currentState);\n\n ui.insertAt(chosenAction.movePosition, turn);\n\n game.advanceTo(next);\n }", "function player1Initial() {\n deck1.id = \"cardsleftnew\";\n\n //sets the cards in the players hand\n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n \n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n \n //if card is selected by user, replace the card with a new one and move to next player\n oneCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n oneCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n turn.innerHTML = `${gameData.players[1]}'s turn`;\n\n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n deck2.id = \"cardsrightnew\";\n deck1.style.display = \"none\";\n deck1.id = \"cardsleft\";\n setTimeout(function(){player2Turn2();}, 2000);\n });\n}", "function SetUpNextCard() {\n screen.getElementsByTagName('div')[0].setAttribute('id', 'panel-curr');\n\n currCard = document.getElementById('panel-curr');\n currCard.setAttribute('class', 'panel');\n currCard.style.transition = 'all 0.3s ease-in-out';\n currCardPos = {};\n\n heart = currCard.getElementsByTagName('span')[0];\n heart.setAttribute('id', 'heart');\n\n mc = new Hammer.Manager(currCard);\n mc.add(new Hammer.Pan());\n mc.add(new Hammer.Press());\n\n CreateEvents();\n\n var url = currCard.getElementsByTagName('img')[0].getAttribute('src');\n cardShadow.style.backgroundImage = 'url(../'+url+')';\n\n setTimeout(function() {\n ShadowOpacity(maxOpacity, 0.3);\n }, 300);\n}", "function turnCard(item){\n\tif (!is_blocked){\n\titem.src = memoryCards[item.id].src;\n\tmemoryCards[item.id].turned = true;\n\t/** Verify if its a pair click; if isnt a pair click, may be two same cards turned */\n\tif (count % 2 !== 0){\n\t\tis_blocked = true;\n\t\tvar check = hasAnotherCardWithSameIdTurned(item);\n\t\tif (!check){\n\t\t\tsleep(2000).then(function(){\n\t\t\t\tunturnAllCardsTurned(item);\n\t\t\t\tis_blocked = false;\n\t\t\t})\n\t\t}\n\t} else {\n\t\tidOfHtmlCards.push(item.id);\n\t\tis_blocked = false;\n\n\t}\n\tcount++;\n\t}\n}", "function newBoard(level) {\n if (level == 'easy') {\n memory_cards = memory_cards_easy;\n } else if (level == 'medium') {\n memory_cards = memory_cards_medium;\n } else if (level == 'hard') {\n memory_cards = memory_cards_hard;\n }\n cards_flipped = 0;\n var cards ='' ;\n memory_cards.memory_card_shuffle();\n for (var i = 0; i < memory_cards.length; i++) {\n cards += '<div id=\"card_'+ i +'\" onclick=\"memoryFlipCard(this,\\''+memory_cards[i]+'\\')\"></div>';\n }\n document.getElementById('active_board').innerHTML = cards;\n}", "start() {\n this.deck.shuffle();\n this.draw();\n this.matched = [];\n this.clicked = [];\n this.updateTurns(true);\n }", "function hit() {\n let newCard = round.cards[Math.round(Math.random() * round.cards.length)];\n round.playerCards.push(newCard);\n display.innerHTML += ` ${newCard}`;\n round.checkResult(false, true);\n console.log(round.playerCards);\n }", "function takeCards()\n {\n if (state.turnedCard)\n {\n state.turnedCard.turn(true);\n }\n\n showMenuId = cards[0].addEventListener(\"move\", showMenu);\n\n for (var counter = 0; counter < cards.length; counter++)\n {\n cards[counter].move(DOM.cardsContainer, {width: sizes.desk.width + \"PX\", height: sizes.desk.height + \"PX\"}, true);\n }\n }", "function opened(card) {\n if (activeCards.length > 0) {\n movesHandler();\n displayer(card);\n activeCards.push(card);\n if (isMatch(activeCards)) {\n matched(activeCards);\n activeCards = [];\n } else {\n notMatched(activeCards);\n activeCards = [];\n }\n } else {\n activeCards.push(card);\n movesHandler();\n }\n allMatched();\n}", "function evalCards() {\n\n}", "function player1TurnNext(){\n deck2.style.display = \"none\";\n deck1.style.display = \"inline-flex\";\n deck1.id = \"cardsleftnew\";\n\n oneCard1.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard1.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n oneCard2.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard2.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n oneCard3.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard3.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n oneCard4.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard4.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinner();\n });\n oneCard5.addEventListener(\"click\", function(e){\n e.preventDefault(); \n setPlayerCard();\n oneCard5.src = `images/${gameData.playerCards[randPlay]}`;\n\n selWinnerFin();\n });\n}", "drawNewCard() {\n return this.#deck.drawCard();\n }", "function addChosenCard(card){\n\t\tchosenCards.push(card);\n\t\tif (chosenCards.length === 2) {\n\t\t\t\tcheckMatch();\n\t\t\t\tmoveCount();\n\t\t}\n}", "function setUpTurn(){\n setMainCard();\n turn.style.display = \"block\";\n if (gameData.index == 0) {\n turn.innerHTML = `${gameData.players[0]}'s turn`;\n setTimeout(function(){player1Initial();}, 2000);\n deck2.style.display = \"none\";\n }\n else {\n deck2.style.float = \"left\";\n turn.innerHTML = `${gameData.players[1]}'s turn`;\n setTimeout(function(){player2Initial();}, 2000);\n deck1.style.display = \"none\";\n }\n}", "function draw(newState, action){\r\n const element=action.player;\r\n console.log(newState);\r\n console.log(action.player);\r\n let board=newState.playerData[`player${element}Data`];\r\n //\r\n if(!board.hand || !board.hand[0]){ //if there is no remaining card in the and pile\r\n board.hand = board.woodPile.reverse(); //flip it\r\n board.woodPile=[]\r\n }\r\n let i=0;\r\n while(board && board.hand[0] && i<3){ //while there is still a card in the hand pile\r\n let a= board.hand.shift();\r\n board.woodPile.unshift(a);\r\n i++\r\n }\r\n newState.playerData[`player${element}Data`]=board;\r\n return newState;\r\n}", "function game (){\n $( \".card\" ).on( \"click\", function() {\n $( this ).addClass(\"open\");\n openCards.push( $( this ));\n puntua();\n allAction();\n complete();\n });\n}", "function newAdvBoard(){\n\t//tiles flipped set to 0 each time a new board is generated\n\tadv_tiles_flipped = 0;\n\tvar adv_output = '';\n\t//runs the shuffle method on the memory array\n\tadv_memory_array.adv_memory_tile_shuffle();\n\t//loops over all the cards and adds all the divs to the output variable. Each div receives an id of dynamic tile number\n\tfor(var i = 0; i < adv_memory_array.length; i++){\n\t\tadv_output += '<div id = \"adv_tile_ ' + i + '\" onclick = \"advMemoryFlipTile(this,\\'' + adv_memory_array[i] + '\\')\"></div>';\n\t}\n\tdocument.getElementById('adv_memory_board').innerHTML = adv_output;\n}", "function newGame() { \n cardArray.sort(() => 0.5 - Math.random());\n movesDisplay.textContent = 0;\n cardsChosen = [];\n cardsChosenId = [];\n cardsWon = [];\n var cards = document.querySelectorAll(\"img\");\n //set all of our cards to blank to begin\n for (let i = 0; i < cards.length; i++) {\n cards[i].setAttribute(\"src\", \"images/blank.png\");\n cards[i].addEventListener(\"click\", flipCard);\n }\n resultDisplay.textContent = 0;\n }", "function handleCardClick(event) {\n event.preventDefault();\n\n if (!timerInterval) {\n startTimer();\n }\n\n // Check if card has been matched previously\n if (this.classList.contains('.matched') || chosen.length === 2) {\n return;\n }\n // If the card has not already been selected...\n if (!chosen.includes(this)) {\n chosen.push(this);\n // Flip the Card\n this.classList.replace('hidden', 'open');\n }\n \n // Check if 2 cards are flipped\n if (chosen.length === 2) {\n // Record the move\n movesCount();\n // Check to see if the 2 flipped cards match\n if (chosen[0].dataset.icon === chosen[1].dataset.icon) {\n // Add matched class to both cards if they do match\n chosen[0].classList.add('matched');\n chosen[1].classList.add('matched');\n // add the card to the matched array\n matched.push(this);\n // Reset the chosen array\n chosen = []\n } else {\n // return cards to normal state after a short delay\n setTimeout(function () {\n chosen[0].classList.replace('open', 'hidden');\n chosen[1].classList.replace('open', 'hidden');\n // Reset the chosen array\n chosen = []\n }, 1000);\n }\n // Call to check if number of moves affect the accomplishment meter\n levelCounter();\n // Regenerate the levelDisplay based on No. of moves\n generateLevelDisplay();\n winGame();\n }\n}", "nextCardinDeck(){\n const mainDeck = Store.getMainDeck(),\n discardDeck = Store.getDiscardDeck(),\n currentCard = mainDeck.cards[ui.findDisplayedCard(mainDeck)];\n if (mainDeck.cards.length > 1){ \n mainDeck.cards.splice(ui.findDisplayedCard(mainDeck), 1);\n discardDeck.cards.unshift(currentCard);\n Store.addDeckToStorage('mainDeck', mainDeck);\n Store.addDeckToStorage('discardDeck', discardDeck);\n ui.dealCard();\n } else {\n ui.UIMessages('No More Cards...', 'red','.message');\n }\n}", "startHand(player) {\n // deal two cards to player\n let nextCard = blackjack.nextCard();\n player.hand.push(nextCard);\n this.displayPlayerCard(nextCard);\n nextCard = blackjack.nextCard();\n player.hand.push(nextCard);\n this.displayPlayerCard(nextCard);\n document.getElementById(\"score\").innerText = player.calculateHand();\n console.log(\"Player hand: \", player.hand);\n\n // deal two cards to dealer revealing on the second\n this.hand.push(blackjack.nextCard());\n nextCard = blackjack.nextCard();\n this.hand.push(nextCard);\n this.displayDealerCard(nextCard);\n console.log(\"Dealer hand: \", this.hand);\n }", "function addToggleCard(clickedCard) {\n flipCards.push(clickedCard);\n}", "nextPlayer(){\r\n if (this.turn === 3){\r\n this.turn = 0;\r\n }\r\n else {\r\n this.turn += 1;\r\n }\r\n\r\n if(this.initialPlacementPhase === true){\r\n this.initialPlacementOverCheck();\r\n }\r\n\r\n this.currentPlayer = this.players.array[this.turn];\r\n this.renderPlayerImg();\r\n this.updateTurnOrder();\r\n\r\n if (this.territorySelectedInstance){\r\n this.territorySelectedInstance.tileElement.classList.remove(\"selected\");\r\n this.territorySelectedInstance = null;\r\n this.territorySelected = false;\r\n }\r\n if (this.initialPlacementPhase === false && this.claimTerritoryPhase === false && !this.button){\r\n this.addEndTurnButton();\r\n this.button.innerHTML = \"Place Units\";\r\n }\r\n if (this.placementPhase === true){\r\n this.turnPlaceable = this.currentPlayer.bonusUnits();\r\n this.turnPlaceableEvaluated = true;\r\n }\r\n\r\n this.updateInfoDisplay();\r\n }", "function nextMove() {\n if (endGame(currentState) == false) {\n markBoard(currentState);\n currentState.whichPlayerPlayed = userWinValue;\n var num = computerMakingMove(currentState);\n document.getElementById(num).innerText = computer;\n markBoard(currentState);\n currentState.whichPlayerPlayed = compWinValue;\n }\n endGame(currentState);\n}", "function selectNextCard() {\n\tcurrentCard = cardList[1];\n\tdisplayCard(eleId, currentCard);\n}", "function nextTurn() {\n\t// Put moves in the move queue.\n\twhile (replay.moves.length > currentMoveIndex && replay.moves[currentMoveIndex].turn <= game.turn) {\n\t\tvar move = replay.moves[currentMoveIndex++];\n\t\tgame.handleAttack(move.index, move.start, move.end, move.is50);\n\t}\n\n\t// Check for AFKs.\n\twhile (replay.afks.length > currentAFKIndex && replay.afks[currentAFKIndex].turn <= game.turn) {\n\t\tvar afk = replay.afks[currentAFKIndex++];\n\t\tvar index = afk.index;\n\n\t\t// If already dead, mark as dead general and neutralize if needed.\n\t\tif (game.deaths.indexOf(game.sockets[index]) >= 0) {\n\t\t\tgame.tryNeutralizePlayer(index);\n\t\t}\n\t\t// Mark as AFK if not already dead.\n\t\telse {\n\t\t\tgame.deaths.push(game.sockets[index]);\n\t\t\tgame.alivePlayers--;\n\t\t}\n\t}\n\n\tgame.update();\n}", "function initGame() {\n startTimer();\n $(\".card\").on(\"click\", function (evt){\n /** asks if there is already one upturned card\n * display the card's symbol\n * (put this functionality in another function that you call from this one) */\n const hasClassShow = ($(listOfCards).hasClass(\"show\"));\n const hasTwoCardsOrMore = (listOfCards.length >= 2);\n const stopTurn = console.log('cards stop turning on click');\n hasClassShow ? (hasTwoCardsOrMore ? stopTurn : (showCard(this), cardMatch(listOfCards))): showCard(this);\n });\n}", "function gameRestart() {\n clickedCards = [];\n matchedCards = 0;\n $('.card').removeClass('open show match');\n $('.stars > li:first-child > i').removeClass('fa-star-o').addClass('fa-star');\n $('.stars > li:nth-child(2) > i').removeClass('fa-star-o').addClass('fa-star');\n setBoard();\n Clock.reset();\n $('.moves').text('0');\n $('.deck').one(\"click\", function () {\n Clock.start();\n });\n $('#finishedMoves').empty();\n $('#finishedTime').empty();\n $('#finishedRating').empty();\n}", "function cardUp() {\n openList.push($(this).children('i').attr('class'));\n counter++;\n $('.moves').html(Math.floor(counter / 2));\n startTimer();\n //once two cards are choosen\n if (openList.length === 2) {\n stars();\n modalStars();\n //if matched\n if (openList[0] === openList[1]) {\n matched();\n matchCount++;\n matchingCards.push(matchCount);\n if (matchingCards.length == 8) {\n winner();\n }\n //no match\n } else {\n unMatched();\n }\n }\n }", "addFlop(card1, card2, card3) {\n this.hand.push(card1);\n this.hand.push(card2);\n this.hand.push(card3);\n }", "function showCard(card, indexOfCurrentCard) {\n\n // reveal the individual card\n card.classList.add('show', 'open');\n // target icon element\n let icon = card.querySelector('i');\n\n // store current card info into object and then push to openCard array\n let currentCard = {\n className: icon.className,\n index: indexOfCurrentCard\n };\n openCard.push(currentCard);\n\n // call timerDisplay on when the first card is fliped\n if (openCard.length == 1 && movesCount == 0 && document.querySelector('#timer span').innerText =='00:00:00') {\n timerDisplay();\n } else if (openCard.length == 2) {\n if ((openCard[0].index != openCard[1].index)) {\n matchCheck(openCard);\n openCard = [];\n } else {\n notMatched();\n openCard = [];\n }\n }\n}" ]
[ "0.6758173", "0.6682267", "0.65662813", "0.6477723", "0.6466616", "0.6450955", "0.6428587", "0.63845813", "0.6378942", "0.6366129", "0.6360752", "0.6340222", "0.63327026", "0.6312915", "0.6308446", "0.62915593", "0.62736756", "0.62729466", "0.6263955", "0.62605745", "0.62547", "0.62530714", "0.6244448", "0.622931", "0.62214315", "0.62096745", "0.6208026", "0.6207291", "0.6198272", "0.6183191", "0.61533296", "0.6152074", "0.61469376", "0.6134506", "0.6129501", "0.6119015", "0.61171746", "0.6112843", "0.6109735", "0.610768", "0.60892963", "0.6081254", "0.6080496", "0.60802925", "0.60693574", "0.6066889", "0.6065372", "0.6061217", "0.6060674", "0.6059716", "0.6048224", "0.6044483", "0.6011803", "0.60049444", "0.600277", "0.5987801", "0.59825754", "0.59797335", "0.59631777", "0.59630084", "0.59622985", "0.595986", "0.5958249", "0.5939025", "0.59368265", "0.59362286", "0.59361166", "0.59311926", "0.5911416", "0.59025806", "0.5895606", "0.58918756", "0.58898747", "0.5885281", "0.5882113", "0.5881939", "0.58789533", "0.5877518", "0.58681166", "0.58611304", "0.58597875", "0.5858788", "0.58587646", "0.58578867", "0.58570474", "0.58436406", "0.583389", "0.5832035", "0.582941", "0.58177114", "0.58151954", "0.58126026", "0.581254", "0.5810738", "0.5807688", "0.58043", "0.58023876", "0.5802105", "0.57983327", "0.57896596" ]
0.61643153
30
Currently unused For testing
function setOC(num) { if (num == null) { console.warn("num is undef"); debugger; } GAME.CURRENTCARD.opposingCategory = GAME.categories[parseInt(num)]; if (GAME.CURRENTCARD.opposingCategory == null) { console.warn("OC is undef"); debugger; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "transient private protected internal function m182() {}", "protected internal function m252() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static transient final private internal function m43() {}", "static final private internal function m106() {}", "static private internal function m121() {}", "static transient final protected internal function m47() {}", "static transient final protected public internal function m46() {}", "static private protected internal function m118() {}", "transient private protected public internal function m181() {}", "transient final private protected internal function m167() {}", "static transient final private protected internal function m40() {}", "static transient private protected internal function m55() {}", "transient final private internal function m170() {}", "function _____SHARED_functions_____(){}", "static transient private protected public internal function m54() {}", "obtain(){}", "transient private public function m183() {}", "static transient private public function m56() {}", "static protected internal function m125() {}", "static private protected public internal function m117() {}", "static transient private internal function m58() {}", "transient final private protected public internal function m166() {}", "static transient final protected function m44() {}", "static final private protected internal function m103() {}", "function DWRUtil() { }", "static final private protected public internal function m102() {}", "static final protected internal function m110() {}", "static ready() { }", "static transient final private public function m41() {}", "__previnit(){}", "function Utils() {}", "function Utils() {}", "static transient final private protected public internal function m39() {}", "static transient final private protected public function m38() {}", "function AeUtil() {}", "static final private public function m104() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "transient final private public function m168() {}", "function StupidBug() {}", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "compilable(_locator) {\n throw new Error('Method not implemented.');\n }", "constructor() {\n\n\t}", "static first(context) {\n throw new Error(\"TODO: Method not implemented\");\n }", "function Utils(){}", "constructor() {\n\t}", "constructor() {\n\t}", "function kp() {\n $log.debug(\"TODO\");\n }", "constructor () { super() }", "function dummy(){}", "function dummy(){}", "function dummy(){}", "static private public function m119() {}", "constructor () {\r\n\t\t\r\n\t}", "constructor (){}", "function fm(){}", "constructor() {\n\t\t// ...\n\t}", "function Util() {}", "function TMP() {\n return;\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "_get () {\n throw new Error('_get not implemented')\n }", "prepare() {}", "method() {\n throw new Error('Not implemented');\n }", "init () {\n\t\treturn null;\n\t}", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "function __func(){}", "function __it() {}", "initialize()\n {\n }", "static notImplemented_() {\n throw new Error('Not implemented');\n }", "constructor() {\n throw new Error('Not implemented');\n }", "static transient final private public internal function m42() {}" ]
[ "0.7565139", "0.73252213", "0.7004986", "0.6909444", "0.6869249", "0.68572855", "0.66727984", "0.6605374", "0.6559156", "0.65579224", "0.65304786", "0.6465962", "0.6424722", "0.63877916", "0.6340827", "0.63363713", "0.63183725", "0.6266548", "0.62280357", "0.6132488", "0.61313367", "0.60987896", "0.60886794", "0.6087944", "0.60114944", "0.5996837", "0.5960747", "0.5931878", "0.5879032", "0.58776575", "0.58752686", "0.57947123", "0.57883185", "0.57832336", "0.57579184", "0.5748745", "0.5748745", "0.57355964", "0.5732193", "0.57307744", "0.57219595", "0.57218546", "0.57218546", "0.57218546", "0.57218546", "0.57218546", "0.57218546", "0.5702907", "0.5675502", "0.5626035", "0.5626035", "0.5626035", "0.5623019", "0.5600931", "0.55846184", "0.55798876", "0.55798876", "0.55703336", "0.5561935", "0.5546747", "0.5546747", "0.5546747", "0.5546572", "0.55271053", "0.55247283", "0.550869", "0.5501959", "0.54922414", "0.5488985", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5481767", "0.5472374", "0.5469271", "0.54638934", "0.5450006", "0.5443648", "0.5443648", "0.54417306", "0.5436413", "0.5436111", "0.54234177", "0.54204893", "0.54204816" ]
0.0
-1
docCat is the doc object category chosen otherDocCat is the doc object category not chosen chosenCat is the category object chosen, corresponds with docCat
function checkCategory(docCat, otherDocCat, chosenCat) { //can add as parameter: "notChosenCat" console.log("in checkCategory"); //debugger; if (chosenCat && GAME.CURRENTCARD.category.name == chosenCat.name) { //header feedback //$("#feedback").text("☺ Correct!").show(); //show final term (i.e. "el margen" for Spanish) $($term).text(GAME.CURRENTCARD.finalTerm).show(); //show feedback otherDocCat.style.opacity = "0.5"; //card jumbotron changes color to category DOC.jumbotron.style.background = chosenCat.color; //font changes to white DOC.jumbotron.style.color = "White"; //hide text shadow DOC.jumbotron.style.textShadow = "none"; //change item[cardIndex] color on right list var tmpdiv = document.getElementById("item" + GAME.cardIndex.toString()); tmpdiv.style.background = GAME.CURRENTCARD.category.color; //sets opacity on next term, increments cardIndex setTimeout(addList, 900); //clean up shownCats GAME.currentCategories = []; //should be moved to newCategories??? setTimeout(newTurn, 1000); docCat.children[0].innerText = "✓"; } //if wrong category chosen else { //show feedback //header feedback // $("#feedback").text("☹ Wrong!").show(); // var txt = $(DOC.definition).text(); // $(DOC.definition).text("Correct answer: "+txt).show(); //incorrectly chosen cat lowers opacity docCat.style.opacity = "0.5"; //incorrectly chosen cat shown as x docCat.children[0].innerText = "✘"; console.log("wah, should have chosen " + GAME.CURRENTCARD.category.name); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDocCategories() {\n if (utils.isEmptyObj(masterData.getMasterData())) {\n var request = masterData.fetchMasterData();\n $q.all([request]).then(function (values) {\n self.documentCategories = values[0].documents_cat;\n self.docModel.category = values[0].documents_cat[0];\n })\n } else {\n self.documentCategories = masterData.getMasterData().documents_cat;\n self.docModel.category = masterData.getMasterData().documents_cat[0];\n }\n }", "static async transferAllDocumentInNewCategory (current, newCategoryId) {\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n\n // Find Current Category in database.\n const currentDocumentCategory = await serviceUtils.isExist(ObjectId(current), collections.DOCUMENTCATEGORY_COLL);\n\n if (currentDocumentCategory.isDefault) {\n return new Error('Could not update or delete a default category');\n }\n\n // Find new Category in database.\n const newDocumentCategory = await serviceUtils.isExist(ObjectId(newCategoryId), collections.DOCUMENTCATEGORY_COLL);\n\n if (!newDocumentCategory) {\n return new Error('Could not find the new category');\n }\n\n newDocumentCategory._id = ObjectId(newDocumentCategory._id);\n\n // Find Documents in database.\n let documents = await db.collection(Document.COLLECTION).find({\n 'documentCategory._id': ObjectId(currentDocumentCategory._id)\n })\n .toArray();\n\n documents = documents.map((d) => ObjectId(d._id));\n\n // If no documents found.\n if (!documents || !documents.length) {\n log.debug('Does not have documents to update');\n }\n\n const results = await db.collection(Document.COLLECTION).update(\n {\n _id: { $in: documents }\n },\n {\n $set: {\n documentCategory: newDocumentCategory,\n updatedAt: moment().toDate()\n }\n },\n { multi: true }\n );\n\n return results;\n }", "function select() {\n\t\tif (chosenCategory === randomWord[0]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation One\";\n\t\t} else if (chosenCategory === randomWord[1]) {\n\t\t\tcategoryName.innerHTML = \"Category: Generation Two\";\n\t\t}\n\t}", "function cat_chosen(obj,re_order) // when a user selects a category to post in this is called\n{\n\t\t//document.getElementById(\"test_results\").innerHTML += set_string+\":cat_chosen<br />\";\n\nif(top_bar_browse) { window.location = R5_link_url+\"category/\"+obj.getAttribute(\"data-ltext\").replace(/[ ]/g,\"-\");return;}; // if the browse window is open via the \"Browse\" link on the top bar\n\nif(parent_prefix == \"\")\n {\n\tif(x_changed == true)\n\t {\n\t\tset_string = \"\";\n\t\tdocument.getElementById(\"b_selected0\").style.display = \"none\";\n\t\tdocument.getElementById(\"b_selected1\").style.display = \"none\";\n\t\tdocument.getElementById(\"b_selected2\").style.display = \"none\";\n\n\t\tdocument.getElementById(\"cat_selected0\").style.display = \"none\";\n\t\tdocument.getElementById(\"cat_selected1\").style.display = \"none\";\n\t\tdocument.getElementById(\"cat_selected2\").style.display = \"none\";\n\t\tx_changed = false;\n\t }\n\tfor(var s=0;s<3;s++)\n\t {\n\t\tif(s == 0 && (set_category[0][0] == true || re_order == false))\n\t\t {\n\t\t\tdocument.getElementById(\"cat_placeholder\").innerHTML = \"Secondary category <span style='font-size:10px;'>(Up to 3 Total)</span>\";\n\t\t } else\n\t\tif(s == 0 && set_category[0][0] != true)\n\t\t {\n\t\t\tdocument.getElementById(\"cat_placeholder\").innerHTML = \"Primary category <span style='font-size:10px;'>(Up to 3 Total)</span>\";\n\t\t }\n\n\t\thold_ltext = (re_order == false)?obj.getAttribute(\"data-ltext\"):\"\";\n\t\tif(set_category[s][0] == false && re_order == false && set_string.indexOf(\";\"+hold_ltext+\";\") == -1)\n\t\t {\n\t\t\tset_category[s][0] = true;\n\t\t\tset_category[s][1] = hold_ltext;\n\t\t\tdocument.getElementById(\"cat_sel_hold\"+s).innerHTML = hold_ltext;\n\t\t\tdocument.getElementById(\"cat_selected\"+s).style.display = \"block\";\n\t\t\tdocument.getElementById(\"cat_selected\"+s).title = hold_ltext;\n\n\t\t\tset_string += \";\"+hold_ltext+\";\";\n\t\t\tdocument.getElementById(\"b_sel_hold\"+s).innerHTML = hold_ltext;\n\t\t\tdocument.getElementById(\"b_selected\"+s).style.display = \"block\";\n\n\t\t\tdocument.getElementById(\"cat_selected\"+s).style.fontSize = \"12px\";\n\t\t\toffset_cat = document.getElementById(\"cat_selected\"+s).offsetWidth;\n\t\t\tif(offset_cat >= 177) // width of text is >= max size so make font smaller\n\t\t\t {\n\t\t\t\tdocument.getElementById(\"cat_selected\"+s).style.fontSize = \"11px\";\n\t\t\t\toffset_cat = document.getElementById(\"cat_selected\"+s).offsetWidth;\n\t\t\t }\n\t\t\tif(offset_cat >= 177) // width of text is still >= max size so make font smaller again\n\t\t\t {\n\t\t\t\tdocument.getElementById(\"cat_selected\"+s).style.fontSize = \"10px\";\n\t\t\t\toffset_cat = document.getElementById(\"cat_selected\"+s).offsetWidth;\n\t\t\t }\n\t\t\tnew_post_textp += offset_cat+5; // 5 px to account for margin\n\t\t\tnew_post_textw -= offset_cat+5;\n\t\t\tnew_post_placel += offset_cat+5;\n\t\t\tset_category[s][2] = offset_cat;\n\n\t\t\tdocument.getElementById(\"new_post_category\").value = \"\";\n\t\t\tdocument.getElementById(\"cat_placeholder\").className = \"placeholder no_user_select\";\n\t\t\tdocument.getElementById(\"new_post_category\").style.width = new_post_textw+\"px\";\n\t\t\tdocument.getElementById(\"new_post_category\").style.paddingLeft = new_post_textp+\"px\";\n\t\t\tdocument.getElementById(\"category_select\").style.left = (new_post_textp+2)+\"px\";\n\t\t\tdocument.getElementById(\"cat_placeholder\").style.left = new_post_placel+\"px\";\n\n\t\t\tif(b_is_shown == false)\n\t\t\t {\n\t\t\t\tdocument.getElementById(\"new_post_category\").focus();\n\t\t\t }\n\n\t\t\tif(s == 2) // all 3 are now used\n\t\t\t {\n\t\t\t\tdocument.getElementById(\"cat_placeholder\").style.display = \"none\";\n\t\t\t\tdocument.getElementById(\"new_post_category\").style.backgroundColor = \"#f7f7f7\";\n\t\t\t\tdocument.getElementById(\"new_post_category\").disabled = \"true\";\nclear_labels2();\n\t\t\t\tdocument.getElementById(\"new_post_category\").blur();\n\t\t\t\tis_disabled = true;\n\t\t\t }\n\t\t\tbreak;\n\t\t } else\n\t\tif(set_category[s][0] == true)\n\t\t {\n\t\t\thold_ltext = set_category[s][1];\n\t\t\tset_string += \";\"+hold_ltext+\";\";\n\t\t\tdocument.getElementById(\"b_sel_hold\"+s).innerHTML = hold_ltext;\n\t\t\tdocument.getElementById(\"b_selected\"+s).style.display = \"block\";\n\n\t\t\tdocument.getElementById(\"cat_sel_hold\"+s).innerHTML = hold_ltext;\n\t\t\tdocument.getElementById(\"cat_selected\"+s).style.display = \"block\";\n\t\t\tdocument.getElementById(\"cat_selected\"+s).title = hold_ltext;\n\n\t\t\tif(re_order == true){change_place_pos(s);}\n\t\t } else\n\t\tif(!set_category[s][0] && re_order)\n\t\t {\n\t\t\tdocument.getElementById(\"b_sel_hold\"+s).innerHTML = \"\";\n\t\t }\n\t }\n } else {\n\tparent_cat_chosen(obj);\n\tclose_category_browse();\n }\n}", "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "function chooseCategory(input) {\n\t var category = data[input];\n\t return category;\n\t }", "function tech() { categoryChoice = TECHNOLOGY;\n getNews()\n}", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "function printCategory(cat){\n var i;\n //check that |cat| is not null\n if(areReqdArgsNull(cat)){\n\treturn;\n }\n document.write(\"Category: name = \" + cat.name + \"; Options: [\" +cat.options[0]);\n for(i=1; i<cat.options.length; i++){\n\tdocument.write(\", \" + cat.options[i]);\n }\n\n document.write(\"]; Type: \" + cat.type + \"</br>\");\n}", "function catSelector(event) {\n // find object of selected cat and set it as active cat\n activeCat = cats.find(function (x) {\n return x.name === event.target.textContent;\n });\n // clear container of previous cat\n clearHtml();\n // add selected cat to html\n renderCat();\n}", "function renderCats() {\n let tempCats = []\n // 1. Iterar sobre o array categorias\n for (var i = 0; i < categorias.length; i++) {\n if (tempCats.indexOf(categorias[i]._id) == -1) {\n // 2. Guardar todos os CatsId não duplicados\n tempCats.push(categorias[i]._id)\n console.log(tempCats)\n }\n }\n console.log(tempCats)\n // 3. Criar o HTML (option) para todos as categorias encontradas\n let strHtml = \"<option value=''>Lista de categorias</option>\"\n for (let i = 0; i < tempCats.length; i++) {\n // Obter o nome da categoria no array users\n console.log(tempCats[i])\n for (let j = 0; j < categorias.length; j++) {\n if (categorias[j]._id == tempCats[i]) {\n strHtml += `<option value='${tempCats[i]}'>${categorias[j]._nome}</option>`\n console.log(categorias[j]._nome)\n }\n }\n }\n\n let selCategorias = document.getElementById(\"selCategorias\")\n selCategorias.innerHTML = strHtml\n}", "function determineCategory(data) {\n if(category.value === 'astronaut') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addAstronautToDOM(data);\n } else showNoResults();\n } else if(category.value === 'launch') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addLaunchToDOM(data);\n } else showNoResults();\n } else if(category.value === 'expedition') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addExpeditionToDOM(data);\n } else showNoResults();\n } else if(category.value === 'spacecraft') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addSpacecraftToDOM(data);\n } else showNoResults();\n }\n}", "function randomCategory() {\n const keys = Object.keys(originals)\n return keys[Math.floor(Math.random() * keys.length)]\n}", "function whatCategory(num, cat) {\n for(var i = 0; i < cat.categories.length; i++) {\n if(cat.categories[i].id === num) {\n return cat.categories[i].name\n }\n }\n}", "function changeCat() {\r\n\ttrace(\"changeCat()\");\r\n\r\n\tvar cat=document.getElementById(\"cat\"); \r\n\r\n\tfor (var i=0; i<emuleCat.length; i++) {\r\n\t\tif(emuleCat[i].value==cat.value) {\r\n\t\t\temuleCat[i].select=1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\temuleCat[i].select=0;\r\n\t\t}\r\n\t}\r\n\t//GM_config.set(\"emuleCat\", catToStr(emuleCat));\r\n\tupdatePopup();\r\n\r\n}", "function get_cat(e){\"forum\"==e||\"fjb\"==e?($(\".select-category\").addClass(\"show\"),$.ajax({url:\"/misc/get_categories_search/\"+e,success:function(e){var t=location.href.match(/forumchoice(\\[\\])*=([^&]+)/),s=\"\";t&&(s=t[2]);var a=\"\";for(var o in e)s==e[o].forum_id?(a=\"selected\",$(\"#search_category\").parent().find(\".customSelectInner\").text(e[o].name)):a=\"\",$(\"#search_category\").append('<option data-child-list=\"'+e[o].child_list+'\" value=\"'+e[o].forum_id+'\" '+a+\">\"+e[o].name+\"</option>\")}})):$(\".select-category\").removeClass(\"show\")}", "function changeCat() {\r\n cat = this;\r\n\r\n if (cat === list[0]) {\r\n currentCat(cats[0]);\r\n }\r\n\r\n if (cat === list[1]) {\r\n currentCat(cats[1]);\r\n }\r\n\r\n if (cat === list[2]) {\r\n currentCat(cats[2]);\r\n }\r\n\r\n if (cat === list[3]) {\r\n currentCat(cats[3]);\r\n }\r\n\r\n if (cat === list[4]) {\r\n currentCat(cats[4]);\r\n }\r\n}", "function groupDocs (docs, groups) {\n return docs .reduce((acc, doc) => {\n (acc[doc.category] = acc[doc.category] || []).push(doc)\n return acc\n }, buildGroupsTemplate(groups))\n}", "function findCategory(category) {\n return originals[category]\n}", "function note_category(a) {\n var category = a.meta[\"coco:category\"] || 'other';\n if (a.getAnnotationType().title == 'Quiz') {\n category = \"quiz\";\n };\n return capitalize(category);\n }", "function renChkCat(xmlRenDoc) {\n\tvar renChkContent = '';\n\tvar oldCatName = '';\n\t\n\tvar renIndex = document.getElementById('checkItems').selectedIndex;\n\tvar renXml = xmlRenDoc.getElementsByTagName('label');\n\tvar renLen = renXml.length;\n\n\tif (renIndex >= 0) {\n\t\toldCatName = getText(renXml[renIndex]);\n\t} else {\n\t\tdisplayMessage('Select an Item in the Category you wish to rename');\n\t\treturn;\n\t}\t\t\n\t\t\n\tif (document.getElementById('checkLabel').value != '') {\n\t\t// Check that new Category Name is Unique.\n\t\tfor (var a=0;a<renLen;a++) {\n\t\t\tif (getText(renXml[a]) == document.getElementById('checkLabel').value) {\n\t\t\t\tdocument.getElementById('checkLabel').focus();\n\t\t\t\tdocument.getElementById('checkLabel').select();\n\t\t\t\tdisplayMessage('Checklist Category name must be unique');\n\t\t\t\treturn;\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\tif (oldCatName != '') {\n\t\t\tfor (var b=0;b<renLen;b++) {\n\t\t\t\tif (getText(renXml[b]) == oldCatName) {\n\t\t\t\t\txmlRenDoc.getElementsByTagName('label')[b].firstChild.nodeValue = document.getElementById('checkLabel').value;\n\t\t\t\t}\t\t\n\t\t\t}\n\t\t}\n\t\t\n \t\trenChkContent = buildChkXmlFile(xmlRenDoc, 0);\n \t\tsaveChkXmlFile(renChkContent);\n \t\treloadChkDisplay();\n \t} else {\n\t\tdisplayMessage('Category name cannot be null');\n\t\tdocument.getElementById('checkLabel').focus();\n \t}\t\n}", "function filterByCat( categ ){\n filteredBooks = [];\n for (let i = 0; i < allBooks.length; i++) {\n if (allBooks[i].categories == categ ) {\n filteredBooks.push(allBooks[i]);\n }\n }\n}", "static async deleteDocumentsFromCategory (documentCategoryId) {\n // Retrieve instance of Mongo\n const db = await Mongo.instance().getDb();\n\n // Find Documents in database.\n const currentDocumentCategory = await db.collection(DocumentCategory.COLLECTION).findOne({\n _id: ObjectId(documentCategoryId)\n });\n\n if (currentDocumentCategory.isDefault) {\n log.debug('Could not update or delete a default category');\n return null;\n }\n\n const results = await db.collection(Document.COLLECTION).remove(\n {\n 'documentCategory._id': ObjectId(currentDocumentCategory._id)\n }\n );\n\n if (!results) {\n return null;\n }\n\n return results;\n }", "function changeCategory(){\n\tcurObjName = $('#category').val();\n\t$('#curobj').val(curObjName);\t\t\n}", "function getpodCategory () {\n var newpodCategoryId = parseInt(document.getElementById(\"listcategory\").value);\n var newpodCategoryName = document.getElementById(\"newsubcategory\").value;\n var x = new Object();\n\n x.id = Math.floor(Math.random() * (1000000 - 2000 + 1)) + 2000;;\n x.name = newpodCategoryName;\n\n for (j=0; j<articleCategory.length; j++) {\n if (articleCategory[j].id==newpodCategoryId) {\n articleCategory[j].podCategory.push(x)\n }\n }\n console.log(articleCategory);\n\n document.getElementById('cat').options.length = 0;\n for (j=0; j<articleCategory.length; j++) {\n for (var k=0; k<articleCategory[j].podCategory.length; k++) {\n var el = document.createElement('option');\n el.textContent = articleCategory[j].name + \" \" + articleCategory[j].podCategory[k].name;\n el.value = articleCategory[j].podCategory[k].id;\n cat.appendChild(el);\n }\n }\n}", "categ(state,data)\n {\n return state.category=data\n }", "async function assignCategories(ngramData) {\n let dataTypes = await wordpos.getPOS(ngramData);\n let filteredData = sortTypes(dataTypes);\n let nounResults = [];\n let verbResults = [];\n let adverbResults = [];\n let adjectiveResults = [];\n let restResults = filteredData.rest;\n\n\n // create ngram objects with all information (definitions, synonyms...etc) for nouns\n for (let ngram of filteredData.nouns) {\n let ngramInfo = await wordpos.lookupNoun(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n nounResults.push(info);\n }\n // create ngram objects with all information (definitions, synonyms...etc) for verbs\n for (let ngram of filteredData.verbs) {\n let ngramInfo = await wordpos.lookupVerb(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n verbResults.push(info);\n }\n // create ngram objects with all information (definitions, synonyms...etc) for adverbs\n for (let ngram of filteredData.adverbs) {\n let ngramInfo = await wordpos.lookupAdverb(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n adverbResults.push(info);\n }\n // create ngram objects with all information (definitions, synonyms...etc) for adjectives\n for (let ngram of filteredData.adjectives) {\n let ngramInfo = await wordpos.lookupAdjective(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n adjectiveResults.push(info);\n }\n\n let allResults = nounResults.concat(verbResults, adjectiveResults, adverbResults);\n let animals = finder(allResults, \"animal\");\n let attributes = finder(allResults, \"attribute\");\n let shapes = finder(allResults, \"shape\");\n let food = finder(allResults, \"food\");\n let places = finder(allResults, \"location\");\n let person = finder(allResults, \"person\");\n let possessions = finder(allResults, \"possession\");\n let communication = finder(allResults, \"communication\");\n let motions = finder(allResults, \"motion\");\n let substances = finder(allResults, \"substance\");\n let cognition = finder(allResults, \"cognition\");\n let contentActions = finder(allResults, \"contact\");\n let actions = finder(allResults, \"act\");\n let descriptors = finder(allResults, \"adj.all\");\n let plants = finder(allResults, \"plant\");\n let time = finder(allResults, \"time\");\n let creationActions = finder(allResults, \"creation\");\n let artifacts = finder(allResults, \"artifact\");\n let objects = finder(allResults, \"object\");\n\n // ngrams related to animals\n let finalAnimals = sortRest(restResults, animals);\n // ngrams that give attributes to other words\n let finalAttributes = sortRest(restResults, attributes);\n // ngrams that are related to shapes\n let finalShapes = sortRest(restResults, shapes);\n // ngrams that are related to food\n let finalFood = sortRest(restResults, food);\n // ngrams that are related to locations\n let finalPlaces = sortRest(restResults, places);\n // ngrams that are related to people\n let finalPerson = sortRest(restResults, person);\n // ngrams that are related to possessions\n let finalPossessions = sortRest(restResults, possessions);\n // ngrams that are related to communication\n let finalCommunication = sortRest(restResults, communication);\n // ngrams that are related to motion\n let finalMotions = sortRest(restResults, motions);\n // ngrams that are related to substances\n let finalSubstances = sortRest(restResults, substances);\n // ngrams that are related to cognition\n let finalCognition = sortRest(restResults, cognition);\n // ngrams that are contact actions\n let finalContentActions = sortRest(restResults, contentActions);\n // ngrams that are miscellanious actions\n let finalMiscActions = sortRest(restResults, actions);\n // ngrams that are descriptors for other words\n let finalDescriptors = sortRest(restResults, descriptors);\n // ngrams that are related to related to plants\n let finalPlants = sortRest(restResults, plants);\n // ngrams that are related to related to time\n let finalTime = sortRest(restResults, time);\n // ngrams that are creation actions\n let finalCreationActions = sortRest(restResults, creationActions);\n // ngrams that are man made objects\n let finalArtifacts = sortRest(restResults, artifacts);\n // ngrams that are objects\n let finalObjects = sortRest(restResults, objects);\n\n let allSortedNgrams = finalAnimals.concat(\n finalAttributes,\n finalShapes,\n finalFood,\n finalPlaces,\n finalPerson,\n finalPossessions,\n finalCommunication,\n finalMotions,\n finalSubstances,\n finalCognition,\n finalContentActions,\n finalMiscActions,\n finalDescriptors,\n finalPlants,\n finalTime,\n finalCreationActions,\n finalArtifacts,\n finalObjects\n );\n\n let sortedData = data.sort((a, b) => a.length - b.length);\n let sortedDataLowered = lower(sortedData);\n\n // ngrams that are not included in any category\n let leftovers = [];\n\n sortedDataLowered.forEach((ngram) => {\n if (\n !allSortedNgrams.includes(ngram) &&\n !leftovers.includes(ngram)\n ) {\n leftovers.push(ngram);\n }\n });\n\n // final data object containing all ngrams sorted into pertinent categories\n let categorizedNgrams = {\n categories: {\n finalAnimals: finalAnimals,\n finalAttributes: finalAttributes,\n finalShapes: finalShapes,\n finalFood: finalFood,\n finalPlaces: finalPlaces,\n finalPerson: finalPerson,\n finalPossessions: finalPossessions,\n finalCommunication: finalCommunication,\n finalMotions: finalMotions,\n finalSubstances: finalSubstances,\n finalCognition: finalCognition,\n finalContentActions: finalContentActions,\n finalDescriptors: finalDescriptors,\n finalPlants: finalPlants,\n finalTime: finalTime,\n finalCreationActions: finalCreationActions,\n finalArtifacts: finalArtifacts,\n finalMiscActions: finalMiscActions,\n finalObjects: finalObjects,\n leftovers: leftovers\n }\n };\n\n return categorizedNgrams;\n}", "function checkCatSeleted() {\n var allcatSelected = true;\n angular.forEach(self.multiFilesdata, function (datavalue, datakey) {\n if (datavalue.doc_category_id == '' || datavalue.error != '') {\n allcatSelected = false;\n }\n });\n\n if (allcatSelected == true) {\n toggleButtons(true);\n\n } else {\n toggleButtons(false);\n toggleButtons(true, 'Cancel');\n }\n }", "function getCategory(obj) {\n var id = obj.id;\n for (i in cats) {\n for (j = 0; j < cats[i].length; j++) {\n if (id == cats[i][j]) {\n return i;\n }\n }\n }\n}", "function addToCateg () {\n\n\t\tfor(var i=0;i<whichCateg;i++){\n\t\t\tif(cathegory == Object.getOwnPropertyNames(categ.categName)[i])\n\t\t\t\t{console.log(\"this is working BUT\");\n\t\t\t\t\tconsole.log(\"cathegory \" + cathegory);\n\t\t\t\t\t// BUT CANT AUTOMATED////////\n\t\t\t\t\tObject.keys(categ.categName[cathegory].push(Name));\t\n\t\t\t\t}\n\t\t}\n\t}", "filterBooks(category) {\n this.currentCategory = category;\n if (this.currentCategory == \"Todos\") {\n this.currentBooks = this.books;\n } else {\n this.currentBooks = this.books.filter(this.applyFilter);\n }\n }", "function setCategory(cat) {\n\tcategory = cat;\n\tdisplayPic(1);\n}", "searchDoc(ch){\n switch (ch) {\n case 1:\n var j=1, key =-1, flag = false ;\n var dname = readline.question('Enter Doctor full name : ');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (this.dfile.Doctors[i].DoctorName == dname) {\n key = i;\n flag = true;\n }\n }\n if (flag) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[key].DoctorName+'\\t\\t|'+this.dfile.Doctors[key].Specialization+'\\t\\t|'+this.dfile.Doctors[key].Availability+'\\t\\t\\t|'+this.dfile.Doctors[key].DocID); \n \n }\n else{\n console.log('Doctor not found or please check input again.........');\n \n }\n break;\n \n case 2:\n var j=1;\n var speciality = readline.question('Enter Specialization : \\n');\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (speciality == this.dfile.Doctors[i].Specialization) {\n \n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n case 3:\n var j=1;\n var id = readline.question('Enter Doctor ID : \\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (id == this.dfile.Doctors[i].DocID) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n case 4:\n var j=1;\n var avail = readline.question('Enter Availablity Type \"AM, PM, or Both\" : \\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (avail == this.dfile.Doctors[i].Availability) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n }\n\n }", "function getSubcategoryDocumnetExaplined_(docId, obj, fromSearch){\r\n\r\n\tdocument.getElementById(\"faq_explain_\").innerHTML = '<img class=\"loaderimg\" src=\"images/firstchoice/loading-3-anim-transparent.gif\" />';\r\n var docid = \"doc_\"+docId;\r\n\ttabsSelection(\"documentsListing_\", \"documents-selected\", docid, \"LI\");\r\n\r\n\tvar results = '';\r\n var cookieName = \"faq_document_\"+docId;\r\n\tvar cookievalue = faqGetCookie(cookieName);\r\n\r\n\tvar targetURL = \"contentForDocument?documentID=\"+docId;\r\n\r\n\tvar xmlhttp;\r\n\tif (window.XMLHttpRequest) {// code for IE7+, Firefox,\r\n\t// Chrome, Opera, Safari\r\n\t\txmlhttp = new XMLHttpRequest();\r\n\t}\r\n\telse {// code for IE6, IE5\r\n\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n\txmlhttp.onreadystatechange = function() {\r\n\t\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n\t\t\t\tresults = xmlhttp.responseText;\r\n\t\t\t\tvar subString1=results.split('test1');\r\n\r\n\t\t\t\tvar subresult = subString1[1];\r\n\r\n\t\t\t\tvar subString=subresult.split('test2');\r\n\r\n\t\t\t\tvar ObjStr = subString[0];\r\n\t\t\t\tvar divId = \"faq_explain_\";\r\n\t\t\t\tif(ObjStr != '[]' || ObjStr != ''){\r\n\t\t\t\t\tdocument.getElementById(divId).innerHTML = '<div id=\"documentID\" style=\"display:none;\">'+docId+'</div>'+ObjStr;\r\n\t if(fromSearch){\r\n\t \t//sleep(2000);\r\n\t }\r\n\r\n\t\t\t \tvar dd = \"anchordoc_\"+docId;\r\n\t\t\t \tif(document.getElementById(dd) != undefined){\r\n\t\t\t \tvar objContent = document.getElementById(dd).innerHTML;\r\n\r\n\t\t \t\t \tdocument.getElementById(\"docHeading_\").innerHTML = \"<h2>\"+objContent+\"</h2>\";\r\n\t\t\t \t}\r\n\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tdocument.getElementById(divId).innerHTML = \"No documents available\";\r\n\t\t\t\t}\r\n\r\n\r\n\t\t\t}\r\n\t }\r\n var url = targetURL;\r\n xmlhttp.open(\"GET\",url,true);\r\n xmlhttp.send();\r\n if(ObjStr != '[]' || ObjStr != ''){\r\n\t return true;\r\n }\r\n return false;\r\n}", "function catAndMouse(mouse, cat1, cat2) {\n let distanceCat1 = Math.abs(cat1 - mouse);\n let distanceCat2 = Math.abs(cat2 - mouse);\n switch (true) {\n case (distanceCat1 > distanceCat2):\n return 'cat2';\n case (distanceCat2 > distanceCat1):\n return 'cat1';\n default:\n return 'os gatos trombam e o rato foge';\n }\n}", "function populatePreferentialCategory() {\n $('#preferentialCategory-label, #preferentialCategory-element').show();\n // junto las categorias\n var categories = [];\n $('#category').children().each(function() {\n if ($(this).attr('selected') === 'selected') {\n categories.push({value: $(this).attr('value'), text: $(this).text()});\n }\n });\n // me fijo que categoria esta seleccionada en este momento\n var previousElements = [];\n var previousSelectedElement = null;\n $('#preferentialCategory').children().each(function() {\n if ($(this).attr('selected') === 'selected') {\n previousSelectedElement = $(this).attr('value');\n }\n });\n var categoryExists = false;\n // si el elemento previamente seleccionado no esta en las categorias actuales, marcamos el primero\n for (var i in categories) {\n if (categories[i].value == previousSelectedElement) {\n categoryExists = true;\n }\n }\n // agrego las categorias\n $('#preferentialCategory').empty();\n for (var i = 0, count = categories.length; i < count; i++) {\n var selected = '';\n if (categories[i].value == previousSelectedElement) {\n selected = ' selected=\"selected\"';\n }\n $('#preferentialCategory').append('<option value=\"' + categories[i].value + '\"' + selected + '>' + categories[i].text + '</option>');\n }\n if ($('#preferentialCategory').children().length === 1 || !categoryExists) {\n $($('#preferentialCategory option')[0]).attr('selected', 'selected');\n }\n }", "choosenCat (category) {\n\t\tthis.setState({\n\t\t\tisFiltering: true,\n\t\t});\n\t\tif ( this.state.isLocationBased ){\n\t\t\tthis.filterOnCat(this.props.data.allRestaurantses, category).then((resturants) => {\n\t\t\t\tthis.filterOnLocation(resturants).then((resturants) => {\n\t\t\t\t\tthis.setState({\n\t\t\t\t\t\tstep: 2,\n\t\t\t\t\t\tselectedCategory: category,\n\t\t\t\t\t\trestaurantsList: resturants,\n\t\t\t\t\t\tisFiltering: false,\n\t\t\t\t\t\tisLoading: true\n\t\t\t\t\t});\n\t\t\t\t\tthis.shouldPosBeUpdated();\n\t\t\t\t})\n\t\t\t})\n\t\t\t\n\t\t} else {\n\t\t\tthis.filterOnCat(this.props.data.allRestaurantses, category).then((resturants) => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tstep: 2,\n\t\t\t\t\tselectedCategory: category,\n\t\t\t\t\trestaurantsList: resturants,\n\t\t\t\t\tisFiltering: false,\n\t\t\t\t})\n\t\t\t})\n\t\t}\n\t}", "function categorify(cat) {\n var ret;\n if(typeof cat == \"string\")\n ret = cat\n ;\n else ret = d3.entries(cat) // Overview pseudo-phase\n .filter(function(e) { return e.value === \"Yes\"; })\n .map(function(k) { return k.key.trim(); })\n [0]\n ;\n return ret || \"Not Applicable\";\n } // categorify()", "function addCatToListN(id, kitten){\n\t\t\t//if(address == config.sale_contract_address){\n\t\t\tkitten.id = id;\n\t\t\tkitten.chanceOfTrait = {};\n\n\t\t\tallFilteredCatsC.push(kitten);\n\t\t\t//}\n\n\t\t}", "function lastNews() { categoryChoice = NOCHOICE;\n getNews()\n}", "function identifyCategory(e) {\n // declare variables\n let chosenRadius = '0';\n let chosenCategory = '0';\n // simple conditional to match the DOM element to the api ID\n if (e.id == 'jsCatTrending') {\n // chosenRadius = '6000';\n extractNeededData(trending.response.venues);\n\n } else if (e.id == 'jsCatParks') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d163941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n\n } else if (e.id == 'jsCatBeaches') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d1e2941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n\n } else if (e.id == 'jsCatLookouts') {\n chosenRadius = '2000';\n chosenCategory = '4bf58dd8d48988d165941735';\n createSearchRequestURI(chosenRadius, chosenCategory);\n }\n else if (e.id == 'jsCatTrending') {\n extractNeededData(trending.response.venues);\n }\n}", "function parseMolecularCategories(categories, other_value){\n for(let category in categories){\n if(categories[category]){\n document.getElementById(category).classList.add(\"chosen_molecular_category\");\n document.getElementById(category).childNodes[0].checked = true;\n if(category == \"other\"){\n document.getElementById(category).childNodes[1].nodeValue = \" \" + other_value;\n }\n }\n }\n }", "function delChkCat(xmlDelDoc) {\n\tvar catName = '';\n\tvar delContent = '';\n\t\n\tvar delIndex = document.getElementById('checkItems').selectedIndex;\n\tvar dXml = xmlDelDoc.getElementsByTagName('item');\n\tvar dXmlLen = dXml.length;\n\n\tif (delIndex >= 0) {\n\t\tvar catName = getText(xmlDelDoc.getElementsByTagName('label')[delIndex]);\n\t} else {\n\t\tdisplayMessage('Select an Item in the Category you wish to delete');\n\t\treturn;\n\t}\t\t\n\n\tif (catName != '') {\n\t\tvar delXml = xmlDelDoc.getElementsByTagName('label');\n\t\tfor (var d=0;d < dXmlLen;d++) {\n\t\t\tif (getText(delXml[d]) == catName) {\n\t\t\t\txmlDelDoc.getElementsByTagName('checklist')[0].removeChild(dXml[d]);\n \t\t\t\td -= 1;\n \t\t\t\tdXmlLen -= 1;\n\t\t\t} \n\t\t}\n\t\tdelContent = buildChkXmlFile(xmlDelDoc);\n\t\tsaveChkXmlFile(delContent);\n\t\treloadChkDisplay();\n\t}\t\n}", "function _predictCategory(description, shop) {\r\n let key = null;\r\n\r\n if (shop) { // the most of known shops have 1 category of goods\r\n key = _findInList(SCROOGE.CATEGORY_BY_SHOP, shop);\r\n }\r\n\r\n if (!key) { // if that didn't help, try to analyse purchase description\r\n // get separate words from description (that are usually things purchased)\r\n const keywordMatch = description.match(/([a-zа-я\\-]+)/gi);\r\n\r\n // and use them as keywords to search for the categories they belong to\r\n if (keywordMatch) {\r\n for (let i = 0; i < keywordMatch.length; i++) {\r\n key = key || _findInList(SCROOGE.CATEGORY_BY_KEYWORD, keywordMatch[i]);\r\n }\r\n }\r\n }\r\n\r\n return key ? SCROOGE.CATEGORY[key] : '';\r\n }", "function addCategory(element){\n\t\t// get the option selected by client\n\t\tvar option_value = element.value;\n\t\t//check whether option is other\n\t\tif(option_value == \"other\" )\n\t\t{\t\n\t\t//prompt to get user response\n\t\tvar category = prompt(\"Please enter the category\");\n\t\tif (category != null) \n\t\t{\t\n\t\t\tvar cat = document.getElementById(\"category\");\n\t\t\t//add new option tag\n\t\t\tvar option = document.createElement(\"option\");\n\t\t\toption.text = category;\n\t\t\t//add new category\n\t\t\tcat.add(option,cat[0]);\n\t\t\tdocument.getElementById(\"category\").value = category;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdocument.getElementById(\"listingMsg\").innerHTML = \"Category not added\";\n\t\t}\n\t\t}\n}", "function Main(curDoc, sel, amountofselectedobjects, clipobject){\n if (amountofselectedobjects){\n if(curDoc.activeLayer.locked || !curDoc.activeLayer.visible){\n alert(\"Please select objects on an unlocked and visible layer,\\nthen run this script again.\");\n }else{\n\n //IF Compound object, alter appearance SOURCE\n //if (clipobject.typename === \"CompoundPathItem\") {\n // clipobject = sel[amountofselectedobjects -1].pathItems[0];\n //}\n //app.executeMenuCommand('deselectall');\n //clipobject = sel[0].pathItems[0];\n //clipobject.selected = true;\n app.executeMenuCommand('ungroup');\n app.executeMenuCommand('copy');\n app.executeMenuCommand('Live Pathfinder Crop');\n app.executeMenuCommand('expandStyle');\n app.executeMenuCommand('ungroup');\n app.executeMenuCommand('pasteBack');\n app.executeMenuCommand('releaseMask');\n sel = curDoc.selection;\n amountofselectedobjects = sel.length;\n app.executeMenuCommand('deselectall');\n for (i = 1; i < amountofselectedobjects ; i++) {\n killobject = sel[i];\n killobject.remove();\n }\n }\n }\n}", "function whatIsTheCatAndTypeId(category, type) {\n if(category === type) {\n console.log(type)\n\n // print products which have type id === type\n }\n}", "function getCategory(catName, searchTerm, searchExclude) {\n\tfunction getCategoryNode(name, subcategories, parent) {\n\t\tif (selectedCategory = categories[0][name]) {\n\t\t\treturn topCategory = homeCategory = selectedCategory;\n\t\t}\n\t\ttopCategory = undefined;\n\n\t\tstack.push(parent);\n\t\tvar category,\n\t\t\tl = subcategories.length;\n\t\twhile (l--) {\n\t\t\tcategory = subcategories[l];\n\t\t\tif (category.name === name || category.categories && (category = getCategoryNode(name, category.categories, category))) {\n\t\t\t\twhile (parent = stack.pop()) {\n\t\t\t\t\ttopCategory = parent;\n\t\t\t\t\tif (!parent.expanded) {\n\t\t\t\t\t\t$.observable(parent).setProperty(\"expanded\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn category;\n\t\t\t}\n\t\t}\n\t\tstack.pop();\n\t}\n\tvar topCat, // specific to this getScript call\n\t\tstack = [],\n\t\tcategories = content.categories,\n\t\toldTopCategory = topCategoryName,\n\t\tloadedPromise = $.Deferred();\n\n\tselectedCategory = catName && getCategoryNode(catName, categories) || categories[0].jsrender;\n\ttopCategory = topCategory || selectedCategory;\n\tif (searchTerm && !catName) {\n\t\ttopCategory = searchCategory;\n\t\tif (page) {\n\t\t\tpage.category = undefined;\n\t\t}\n\t}\n\n\ttopCategoryName = topCategory.name;\n\n\tif (topCategoryName !== oldTopCategory) {\n\t\tif (oldTopCategory) {\n\t\t\t$(\"#id-\" + oldTopCategory)\n\t\t\t\t.removeClass(\"selected\")\n\t\t\t\t.addClass(\"unselected\");\n\t\t}\n\t\t$(\"#id-\" + topCategoryName)\n\t\t\t.removeClass(\"unselected\")\n\t\t\t.addClass(\"selected\");\n\t}\n\n\tif (content.topCategory !== topCategory) {\n\t\tcontent.catName = catName; // Don't change this observably, to avoid triggering an additional UI update before topCategory has been set.\n\t\t$.observable(content).setProperty(\"topCategory\", topCategory);\n\t}\n\n\tif (searchTerm) {\n\t\tif (content.searched !== searchTerm || content.searchExclude !== searchExclude) {\n\t\t\tloadAllContent()\n\t\t\t\t.then(function() {\n\t\t\t\t\tloadAllContent(\"find\")\n\t\t\t\t\t\t.then(function() {\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tsearchContent(searchTerm);\n\t\t\t\t\t\t\t\t$.observable(content).setProperty(\"searched\", searchTerm);\n\t\t\t\t\t\t\t\tcontent.searchExclude = searchExclude;\n\t\t\t\t\t\t\t\tloadedPromise.resolve();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t} else {\n\t\t\tloadedPromise.resolve();\n\t\t}\n\t} else {\n\t\tif (!topCategory.loaded && !topCategory.loading) {\n\t\t\ttopCategory.loading = \" \"; // true, but render blank until after timeout\n\t\t\ttopCat = topCategory; // Specific to this getCategory() call. (Global topCategory var may change before then() returns)\n\n\t\t\t$.getScript(\"documentation/contents-\" + topCategory.name + \".js\")\n\t\t\t\t.then(function() {\n\t\t\t\t\t$.observable(topCat).setProperty(\"loaded\", true);\n\t\t\t\t\tloadedPromise.resolve();\n\t\t\t\t});\n\t\t} else if (topCategory.loaded) {\n\t\t\tif (content.searched) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tclearSearch(); // lazy clear search annotations from content\n\t\t\t\t\t$.observable(content).setProperty({\n\t\t\t\t\t\tsearch: undefined,\n\t\t\t\t\t\tfilterlen: 0\n\t\t\t\t\t});\n\t\t\t\t\tcontent.searched = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\tloadedPromise.resolve();\n\t\t}\n\t}\n\treturn loadedPromise.promise();\n}", "function findCury(){\n let curyBooks = []\n\n for(let category of booksByCategory){\n for(let books of category.books){\n if(books.author === \"Augusto Cury\"){\n curyBooks.push(books.title)\n }\n }\n }\n\n console.log(curyBooks)\n}", "function addCategory(e) {\n if (e.value === 'entree') {\n createCategorySection('Entrees', 'entree', 'Add Entree')\n } else if (e.value === 'appetizer') {\n createCategorySection('Appetizers', 'appetizer', 'Add Appetizer')\n } else if (e.value === 'dessert') {\n createCategorySection('Desserts', 'dessert', 'Add Dessert')\n } else if (e.value === 'sides') {\n createCategorySection('Sides', 'sides', 'Add Side')\n } else if (e.value === 'addOn') {\n createCategorySection('Add-On', 'addOn', 'Add Add-On')\n } else if (e.value === 'soupOrSalad') {\n createCategorySection('Soups & Salads', 'soupOrSalad', 'Add Soup or Salad')\n } else if (e.value === 'kidsMenu') {\n createCategorySection('Kids Menu Item', 'kidsMenuItem', 'Add Kids Item')\n } else if (e.value === 'otherFood') {\n createCategorySection('Other Food', 'otherFood', 'Add Other Food')\n } else if (e.value === 'wine') {\n createCategorySection('Wine', 'wine', 'Add Wine')\n } else if (e.value === 'beer') {\n createCategorySection('Beer', 'beer', 'Add Beer')\n } else if (e.value === 'cocktails') {\n createCategorySection('Cocktails', 'cocktail', 'Add Cocktail')\n } else if (e.value === 'nonAlcoholic') {\n createCategorySection('Non-Alcoholic', 'nonAlcoholic', 'Add Non-Alcoholic')\n } else if (e.value === 'afterDinnerDrink') {\n createCategorySection('After Dinner Drinks', 'afterDinnerDrink', 'Add After Dinner Drink')\n } else if (e.value === 'otherDrink') {\n createCategorySection('Other Drinks', 'otherDrink', 'Add Other Drink')\n }\n $(\".categorySelector option[value='\" + e.value + \"']\").remove();\n $('select').material_select();\n //Found this line from stackoverflow and it fixed the \"need to click dropdown twice\" bug so I'm gonna keep it\n document.querySelectorAll('.select-wrapper').forEach(t => t.addEventListener('click', e=>e.stopPropagation()))\n}", "componentWillReceiveProps(nextProps){\n const {posts, postsByCat, globalSettings} = nextProps;\n let selectedCategory = globalSettings.selectedCat;//this.determineTrueSelectedCategory();//globalSettings.selectedCat;\n if(postsByCat.hasOwnProperty(selectedCategory)){ //if category exists\n this.filterPostsBySelectedCategory(posts,postsByCat, selectedCategory);\n }\n }", "function demoTemplateDocument(parent) {\n var template_document = common_data['template_document'];\n parent.find('.image_document').addClass('hide');\n parent.find('.sub_title_document').addClass('hide');\n if (parent.find('.document_type').val() == template_document[type_image_document]) {\n //image, title & subtitle\n parent.find('.image_document').removeClass('hide');\n parent.find('.sub_title_document').removeClass('hide');\n }else if (parent.find('.document_type').val() == template_document[type_title_document]) {\n //title only\n parent.find('.image_document').addClass('hide');\n parent.find('.sub_title_document').addClass('hide');\n }else {\n //title & subtitle\n parent.find('.sub_title_document').removeClass('hide');\n }\n}", "function onCategoryChosen(event) {\n let category = event.target.innerHTML;\n //Prevents choosing all faculties at once on moving a pressed mouse over list elements and chosing the same faculty again\n if (category !== this.buttons.categoryButton.innerHTML && event.target !==\n this.dropDowns.categoryDropDown) {\n this.buttons.resetCategoryFilterButton.classList.remove(\"hidden\");\n this.buttons.categoryButton.innerHTML = category;\n this.notifyAll(new Event(Config.FILTER_VIEW.EVENT.CATEGORY_CHOSEN,\n category));\n }\n}", "_isFocoCategory(option_name){\n\t\tvar obj = this.objects_hash['foco'];\n\t\tif(obj.clicked_button.dataset['option_name'] == option_name){\n\t\t\treturn true;\n\t\t}\n\t}", "_hideCategories(button){\n\t\tif(this._isFocoCategory('Solo_Montura') || this._isFocoCategory('Neutra')){\n\t\t\treturn;\n\t\t}\n\t\tvar button_category = button.dataset['category'];\n\t\tif(button.className == 'button-blue' && (button_category != 'graduacion1' || (button_category == 'graduacion1' && this._isFillInPrescription(button)))){\n\t\t\t\tvar cat_position = this.t_categories.indexOf(button_category);\n\t\t\t\tvar\tobject = this.objects_hash\n\t\t\t\tvar cat_to_hide = this.t_categories[cat_position]\n\t\t\t\tvar object = this.objects_hash[cat_to_hide];\n\t\t\t\tobject.hideCategory();\n\t\t}\n\t\t\n\t}", "displayCategories(){\n const categoriesList = cocktail.getCategories()\n .then(categories => {\n const catList = categories.categories.drinks;\n \n // append the first option without value\n const firstOption = document.createElement('option');\n firstOption.textContent = '-- Select --';\n firstOption.value = '';\n document.querySelector('#search').appendChild(firstOption);\n\n // append the other options\n catList.forEach(category => {\n const option = document.createElement('option');\n option.textContent = category.strCategory;\n option.value = category.strCategory.split(' ').join('_');\n document.querySelector('#search').appendChild(option);\n \n });\n\n })\n }", "function DocCard(props) {\n const classes = useStyles();\n\n\n let language = \"\";\n props.targetDoc[\"languages\"].forEach((lang) => {\n language = language + \", \" + lang;\n });\n language = language.substring(1);\n\n\n\n const clickDoctorCard = () => {\n let newestTargetDoc = props.targetDoc;\n newestTargetDoc[\"Address\"] = newestTargetDoc.address;\n newestTargetDoc[\"Language\"] = newestTargetDoc.languages;\n newestTargetDoc['Phone'] = newestTargetDoc.phone;\n newestTargetDoc['Hospital'] = newestTargetDoc.hospital;\n newestTargetDoc['Conditions'] = newestTargetDoc.conditions;\n newestTargetDoc['DocName'] = newestTargetDoc.name;\n newestTargetDoc['Specialty'] = newestTargetDoc.specialty;\n newestTargetDoc['YearsofPractice'] = newestTargetDoc.yearsOfPractice;\n newestTargetDoc['Procedures'] = newestTargetDoc.procedures;\n newestTargetDoc['NumberOfLikes'] = newestTargetDoc.likes;\n newestTargetDoc['Qualifications'] = newestTargetDoc.qualifications;\n newestTargetDoc['Type'] = newestTargetDoc.type;\n newestTargetDoc['userName'] = props.targetDocUserName;\n props.updateTargetDoc(newestTargetDoc);\n props.setProfileBackToDestination(props.displayType);\n if (props.history != null) {\n props.history.push(\"/docprofile\");\n }\n }\n\n\n\n return (\n <Card style={{ cursor: \"pointer\" }} className={classes.root} onClick={clickDoctorCard}>\n <Grid container spacing={0}>\n <Grid item xs={12} sm={3} className={classes.imageGrid}>\n {/* doctor image */}\n <CardMedia\n component=\"img\"\n className={classes.img}\n // image={docImg}\n src={props.targetDoc.imgSrc}\n ></CardMedia>\n </Grid>\n <Grid item xs={12} sm={7}>\n <CardContent>\n {/* doctor details */}\n <Typography variant=\"h6\" color=\"primary\">\n {\"Dr. \" + props.targetDoc.name}\n </Typography>\n <br></br>\n <Typography variant=\"subtitle1\" color=\"textSecondary\">\n <strong>Specialty: </strong>{\" \"}\n <span>{props.targetDoc.specialty}</span>\n </Typography>\n <Typography variant=\"subtitle1\" color=\"textSecondary\">\n <strong>Hospital: </strong>\n <span>{props.targetDoc[\"hospital\"]}</span>\n </Typography>\n <Typography variant=\"subtitle1\" color=\"textSecondary\">\n <strong>Languages: </strong>\n <span>{language}</span>\n </Typography>\n <br></br>\n {/* private tag */}\n <Chip color=\"secondary\" size=\"small\" label={props.targetDoc.type}></Chip>\n </CardContent>\n </Grid>\n <Grid item xs={12} sm={2}>\n {/* Like icon + number of likes */}\n <Box className={classes.likeBox}>\n <FavoriteIcon style={{ color: \"red\" }} />\n <Typography variant=\"body2\" color=\"primary\">\n {props.targetDoc[\"likes\"].toLocaleString(navigator.language, { minimumFractionDigits: 0 })}\n </Typography>\n </Box>\n </Grid>\n </Grid>\n </Card>\n );\n\n}", "static getInstanceFromDoc(doc) {\n return {\n id: doc.id,\n name: doc.data().name,\n description: doc.data().description,\n channels: doc.data().channels,\n categories: doc.data().categories,\n logo: doc.data().logo,\n rank: doc.data().rank,\n schedules: doc.data().schedules,\n year: doc.data().year\n }\n }", "category () {\n if (this.categoryId) {\n return BacklogItemCategories.findOne(this.categoryId)\n }\n }", "function categoryCheck (word) {\n switch (word) {\n case \"anniversary\":\n return \"anniversary\"\n break;\n case \"birthday\":\n return \"birthday\"\n break; \n case \"congratulations\":\n return \"congratulations\"\n break; \n case \"well\":\n return \"getWell\"\n break;\n case \"getwell\":\n return \"getWell\"\n break;\n case \"housewarming\":\n return \"housewarming\"\n break; \n case \"warming\":\n return \"housewarming\"\n break; \n case \"sorry\":\n return \"sorry\"\n break; \n case \"patrick\":\n return \"stPatricksDay\"\n break; \n case \"patrick\\'s\":\n return \"stPatricksDay\"\n break; \n case \"because\":\n return \"justBecause\"\n break;\n case \"just\":\n return \"justBecause\"\n break;\n case \"justBecause\":\n return \"justBecause\"\n break;\n case \"baby\":\n return \"newBaby\"\n break;\n case \"newBaby\":\n return \"newBaby\"\n break;\n case \"newborn\":\n return \"newBaby\"\n break; \n case \"romance\":\n return \"loveRomance\"\n break;\n case \"retirement\":\n return \"retirement\"\n break; \n case \"retire\":\n return \"retirement\"\n break; \n case \"funeral\":\n return \"sympathy\"\n break; \n case \"sympathy\":\n return \"sympathy\"\n break; \n case \"thank\":\n return \"thankYou\"\n break; \n case \"thankYou\":\n return \"thankYou\"\n break; \n case \"year\":\n return \"newYear\"\n break;\n case \"valentine\":\n return \"valentinesDay\"\n break;\n case \"valentine\\'s\":\n return \"valentinesDay\"\n break;\n case \"valentines\":\n return \"valentinesDay\"\n break;\n case \"easter\":\n return \"easter\"\n break; \n case \"mother\\'s\":\n return \"mothersDay\"\n break;\n case \"mothers\":\n return \"mothersDay\"\n break;\n case \"mother\":\n return \"mothersDay\"\n break;\n case \"memorial\":\n return \"memorialDay\"\n break; \n case \"fathers\":\n return \"fathersDay\"\n break;\n case \"father\\'s\":\n return \"fathersDay\"\n break;\n case \"father\":\n return \"fathersDay\"\n break; \n case \"july\":\n return \"july4th\"\n break; \n case \"4th\":\n return \"july4th\"\n break; \n case \"fourth\":\n return \"july4th\"\n break; \n case \"labor\":\n return \"laborDay\"\n break;\n case \"laborDay\":\n return \"laborDay\"\n break;\n case \"halloween\":\n return \"halloween\"\n break; \n case \"veteran\":\n return \"veteransDay\"\n break;\n case \"veterans\":\n return \"veteransDay\"\n break;\n case \"veteransDay\":\n return \"veteransDay\"\n break;\n case \"veteran\\'s\":\n return \"veteransDay\"\n break;\n case \"thanksgiving\":\n return \"thanksgiving\"\n break; \n case \"hanukkah\":\n return \"hanukkah\"\n break; \n case \"christmas\":\n return \"christmas\"\n break;\n }\n}", "function getCategories(word){\n\twhile(word.length > 0){\n\t\tif (RID[word]){\n\t\t\treturn RID[word];\n\t\t}\n\t\tif (RID[word+\"%\"]){\n\t\t\treturn RID[word+\"%\"];\n\t\t}\n\t\tword = word.substr(0,word.length-1);\n\t}\n\treturn null;\n}", "function handleCategoryChange() {\n var newResponseCategory = $(this).val();\n getResponses(newResponseCategory);\n }", "function addThis(name, cat, subcat) {\n\t//console.log(name + ' : ' + cat + ' : ' + subcat);\n\tvar id = (subcat != 0 && subcat != 'undefined') ? subcat : cat;\n\t\n\tif (id && id != '' && id!='undefined') {\n\t\t//assign name and cat id in hidden fields\n\t\t$('#hiddenCatField').val(id);\n\t\t$('#hiddenCatName').val(name);\n\n\t\t//ajac call to fetch custom fields\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: UrlFetchCustomFields,\n\t\t\tdataType: 'json',\n\t\t\tdata: {category: id,},\n\t\t\tsuccess: function(data) {\n\t\t\t\t//console.log(data);\n\t\t\t\t//alert(data);\n\t\t\t\tif (data.status == 'success') {\n\t\t\t\t\t$('#customFields').html(data.html);\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#customFields\").html('');\n\t\t\t\t}\n\t\t\t\t$('#chooseCategory').html(name);\n\t\t\t},\n\t\t\terror: function(XMLHttpRequest, textStatus, errorThrown) {\n\t\t\t\t//$('#waiting').hide(500);\n\t\t\t\t//$('#message').removeClass().addClass('error').text('There was an error.').show(500);\n\t\t\t\t//$('#demoForm').show(500); \n\t\t\t\talert('error');\n\t\t\t}\n\t\t});\n\t}\n\treturn false;\n}", "function showCritCatList() {\n // reSets all Markers, removes all Popups and renders criteria list\n updateCategoryList(crtCritIndex);\n }", "function createCatCities(newCatIndex){\n //Done with all new Categories\n if(newCatIndex>=data.NewCategories.length){\n console.log(\"---------\"+data.Manufacturer+\"-----DONE with all new categories\");\n callback();\n return;\n }\n executeView(\"SELECT RAW records from records where docType=$1 and Manufacturer=$2 and ProductCategory=$3\",[\"MfrProCat\",data.Manufacturer,data.NewCategories[newCatIndex]],function(mfrProCatSearchRes){\n if(mfrProCatSearchRes.error || mfrProCatSearchRes.length == 0){\n if(mfrProCatSearchRes.error){\n console.log(mfrProCatSearchRes);\n }else{\n console.log(data.Manufacturer+\" ****NOT RELATED**** \"+data.NewCategories[newCatIndex]);\n };\n //if Not processing next record\n createCatCities(newCatIndex+1);\n return;\n }\n mfrCatRecord=mfrProCatSearchRes[0];\n //Getting the new category record\n executeView(\"SELECT RAW records from records use keys $1\",[data.NewCategories[newCatIndex]],function(catRecord){\n if (catRecord.error) {\n console.log(catRecord.error);\n createCatCities(newCatIndex+1);\n return;\n }\n catRecord = catRecord[0];\n //Creating MfrProCatCity\n var mfrProCatCityRecord = {\n \"$status\": \"published\",\n \"@identifier\": \"mfrprocatcity\",\n \"@uniqueUserName\": mfrRecord.name.trim().replace(/\\W+/g, \"-\").toLowerCase() + \"-\" + catRecord.categoryName.trim().replace(/\\W+/g, \"-\").toLowerCase() + \"-\" + cityRecord.cityName.trim().replace(/\\W+/g, \"-\").toLowerCase(),\n \"City\": data.City,\n \"Manufacturer\": data.Manufacturer,\n \"ProductCategory\": data.NewCategories[newCatIndex],\n \"author\": \"administrator\",\n \"cityName\": cityRecord.cityName,\n \"cloudPointHostId\": \"cloudseed\",\n \"dateCreated\": global.getDate(),\n \"dateModified\": global.getDate(),\n \"docType\": \"MfrProCatCity\",\n \"editor\": \"administrator\",\n \"flag\": \"created with script\",\n \"manufacturerName\": mfrRecord.name,\n \"metaDescription\": \"Find all \" + catRecord.categoryName + \" manufactured by \" + mfrRecord.name + \"in\" + cityRecord.cityName +\". Also locate and chat with stores and dealers near you.\",\n \"metaTitle\": mfrRecord.name + \" \" + catRecord.categoryName + \"in\" + cityRecord.cityName +\" | cloudseed.com\",\n \"mfrProCat\": mfrCatRecord.recordId,\n \"mfrprocatcity\": mfrRecord.name + \" \" + catRecord.categoryName + \" \" + cityRecord.cityName,\n \"org\": \"public\",\n \"productCategoryName\": catRecord.categoryName,\n \"recordId\": \"MfrProCatCity\" + global.guid(),\n \"relationDesc\": [\n \"mfrProCat-availableIn-City\",\n \"City-hasMfrProCat-mfrProCat\"\n ],\n \"revision\": 1\n }\n\n createRecordInDataBase(mfrProCatCityRecord,function(crr){\n mfrProCatCityRecord=crr;\n console.log(\"mfrProCatCityRecord----\",mfrProCatCityRecord.recordId);\n createCatCitySupplier(0);\n });\n function createCatCitySupplier(supplierIndex){\n if(supplierIndex>=data.Suppliers.length){\n //createCatCitySupplier();\n createCatCities(newCatIndex+1);\n return;\n }\n\n executeView(\"SELECT RAW records from records use keys $1\",[data.Suppliers[supplierIndex]],function(supRecordRes){\n if (supRecordRes.error) {\n console.log(supRecordRes.error);\n createCatCitySupplier(supplierIndex+1);\n return;\n }\n supRecord = supRecordRes[0];\n var mfrProCatCitySupRecord = {\n \"$status\": \"published\",\n \"@identifier\": \"recordId\",\n \"City\": data.City,\n \"Manufacturer\": data.Manufacturer,\n \"ProductCategory\": data.NewCategories[newCatIndex],\n \"MfrProCatCity\": mfrProCatCityRecord.recordId,\n \"Supplier\": data.Suppliers[supplierIndex],\n \"author\": \"administrator\",\n \"cloudPointHostId\": \"cloudseed\",\n \"dateCreated\": global.getDate(),\n \"dateModified\": global.getDate(),\n \"docType\": \"MfrProCatCitySupplier\",\n \"editor\": \"administrator\",\n \"flag\": \"created with script\",\n \"org\": \"public\",\n \"recordId\": \"MfrProCatCitySupplier\"+ global.guid(),\n \"relationDesc\": [\n \"MfrProCatCity-hasSupplier-Supplier\",\n \"Supplier-hasMfrProCatCity-MfrProCatCity\"\n ],\n \"revision\": 1\n }\n\n createRecordInDataBase(mfrProCatCitySupRecord,function(crr2){\n mfrProCatCitySupRecord=crr2;\n console.log(\"mfrProCatCitySupRecord----\",mfrProCatCitySupRecord.recordId);\n createCatCitySupplier(supplierIndex+1);\n });\n })\n\n }\n\n })\n });\n }", "function setCategoryRights(){\n var catRights = allEnabled();\n //set the Admin rights\n setRight(catRights,'Admin','New Meeting',false);\n setRight(catRights,'Admin','Hide',false);\n //set the viewer rights\n setFalse(catRights[1]); //all viewer rights false\n setRight(catRights,'Viewer','Hide',true);\n return catRights;\n }", "function nCategory(t){this.category=new category(t),this.built=!1,this.build=null}", "function findCategory(){\n return _.find(categories, function(c){\n return c.name == categoryName;\n });\n }", "function generateContent(_data) {\n console.log(\"category\");\n for (let category in _data) {\n console.log(\"category\");\n let items = _data[category];\n createOption(items);\n }\n }", "function imprimirCategory(arrObjetos){\n \n var option = document.createElement(\"option\"); //creacion elemento option\n option.setAttribute(\"value\", \"Selecciona categoria\") //el valor que va a ser \"seleccionar categoria\"\n option.setAttribute(\"selected\",true); //salga seleccionado por defecto\n option.setAttribute(\"disabled\",true); //desabilitado para que no lo puedan marcar\n var nodoOption=document.createTextNode(\"Selecciona categoria\"); //el texto de la opcion\n option.appendChild(nodoOption); \n document.getElementById(\"categ\").appendChild(option); \n \n for(var i=0; i<arrObjetos.length; i++){\n option = document.createElement(\"option\"); //creacion elemento option\n option.setAttribute(\"value\", arrObjetos[i].nombre) //el valor sea el nombre de la categoria\n nodoOption = document.createTextNode(arrObjetos[i].nombre); //muestro el nombre\n option.appendChild(nodoOption); \n document.getElementById(\"categ\").appendChild(option); //aparezca dentro del select\n \n }\n}", "function genreAndNeighborhood(obj) {\n if (obj.dominant_discipline === document.getElementById('exampleFormControlSelect1').value && obj.neighborhood === document.getElementById('exampleFormControlSelect2').value) {\n return obj;\n }\n }", "function catOnlySearchQuery(val) {\n var peopleOps = \"human+resources+OR+hr+OR+people+OR+operations+OR+employee+OR+partner+OR+development+OR+relations+OR+talent+OR+management+OR+ops+OR+ organization+OR+organizational\";\n var peopleAnalytics = \"people+OR+analytics+OR+talent+OR+human+OR+insights+OR+organization+OR+organizational\";\n var divInclu = \"diversity inclusion organization organizational\";\n var talent = \"talent sourcer+OR+recruiter\";\n var hrExec = \"talent+OR+operations+OR+CPO+OR+human+OR+resources+OR+HR+OR+CHRO+OR+culture+OR+D&I+OR+diversity+OR+inclusion+OR+head+OR+Chief+OR+director+OR+VP+OR+officer\";\n var allCat = \"diversity+OR+inclusion+OR+head+OR+talent+OR+people+OR+operations+OR+chief+OR+cpo+OR+human+OR+resources+OR+director+OR+acquisition+OR+hr+OR+vp+OR+chro+OR+officer+OR+culture+OR+d&i+OR+diversity+OR+inclusion+OR+employee+OR+partner+OR+development+OR+relations+OR+talent+OR+management+OR+hr+OR+ops+OR+analytics+OR+recruiting+OR+insights+OR+talent+OR+acquisition+OR+sourcer+OR+recruiter+OR+recruiting\";\n switch (val) {\n case \"10\":\n return peopleAnalytics;\n break;\n case \"11\":\n return peopleOps;\n break;\n case \"12\":\n return divInclu;\n break;\n case \"13\":\n return talent;\n break;\n case \"14\":\n return hrExec;\n break;\n case \"15\":\n return allCat;\n break;\n }\n}", "renderCatButtons(data, filteredCategory)\n {\n if(filteredCategory === undefined)\n return null;\n \n if(data.category === filteredCategory[0].category)\n {\n return(\n\n <div id=\"open-note\" key={\"render\" + data.noteId}>\n <p className=\"menu-p\">{data.title}</p>\n <span className=\"note-time\">Last edited:&nbsp;</span><Moment className=\"note-time\" format=\"DD MMM YYYY, HH:mm:ss\">{data.timestamp}</Moment>\n <br/>\n <CatBtn className=\"edit-btn btn\" id=\"catBtn\" label=\"E\" key={\"btn\" + data.noteId} onClick={() => { this.props.handleSingleNote(data.noteId, \"edit\"); this.props.setOpen(false); }}>\n\n {data.body}\n </CatBtn>&nbsp;&nbsp;&nbsp;\n <CatBtn className=\"delete-btn btn\" label=\"E\" key={\"delBtn\" + data.noteId} id={\"delBtn\" + data.noteId} onClick={() => { this.props.handleSingleNote(data.noteId, \"delete\") }}>\n Delete\n </CatBtn>\n </div>\n )\n }\n }", "function deleteCategory(catOut) {\n// var db = ScriptDb.getMyDb();\n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n\n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n return; \n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n // Logger.log(categories);\n // if there are no more books in catOut, delete it from list.\n // Logger.log(getBooksInCategory(catOut));\n if (getBooksInCategory(catOut).length == 0) {\n // Logger.log(categories);\n for (var i = 0; i < categories.list.length ; i++) {\n if (categories.list[i] == catOut) {\n var tmp = categories.list[0];\n categories.list[0] = categories.list[i];\n categories.list[i] = tmp;\n categories.list.shift();\n categories.list = categories.list.sort();\n db.save(categories);\n break;\n }\n }\n }\n}", "function prepareCategories() {\n var categories = {},\n page,\n pagesData;\n\n // iterator to build categories\n for (page in pages) {\n pagesData = pages[page].data;\n\n if (pages.hasOwnProperty(page) && pagesData.title !== undefined) {\n // check if already defined with category or not\n if(categories[pagesData.category] === undefined){\n categories[pagesData.category] = { list: [] };\n }\n\n // build pages list for each category\n listItemsforCategory(categories[pagesData.category], pagesData);\n }\n }\n\n // return the categories\n return categories;\n }", "function setCategoryColors(category) {\n var color;\n switch (category) {\n case 'football':\n case 'nfl':\n case 'ncaaf':\n case 'nflncaaf':\n category = 'football';\n break;\n case 'basketball':\n case 'nba':\n case 'ncaam':\n case 'college_basketball':\n category = 'basketball';\n break;\n case 'baseball':\n case 'mlb':\n category = 'baseball';\n break;\n case \"realestate\":\n case \"disaster\":\n case \"demographics\":\n case \"crime\":\n case \"weather\":\n case \"politics\":\n category = 'realestate';\n break;\n case \"finance\":\n case \"money\":\n category = 'finance';\n break;\n case \"entertainment\":\n case \"celebrities\":\n case \"actor\":\n case \"musician\":\n case \"music\":\n case \"director\":\n category = 'entertainment';\n break;\n default:\n category = 'default';\n break;\n }\n var atomicClass = friendlyIframeWindow.document.getElementsByClassName(\"widget_ad\")[0];\n atomicClass.id = wideWidget ? category + '-wide' : category;\n\n }", "function renderReviewDonboscoMuseum(doc){\n let li = document.createElement('li');\n let DonboscoMuseum = document.createElement('h6');\n let name = document.createElement('h6');\n let headingDonboscoMuseum = document.createElement('b');\n let contentDonboscoMuseum = document.createElement('p');\n\n li.setAttribute('data-id',doc.id);\n DonboscoMuseum.textContent = \"Donbosco Museum: \";\n name.textContent = \"Author Name: \"+ doc.data().name;\n headingDonboscoMuseum.textContent =\"Title: \"+ doc.data().heading;\n contentDonboscoMuseum.textContent = doc.data().content;\n\n li.appendChild(DonboscoMuseum);\n li.appendChild(name);\n li.appendChild(headingDonboscoMuseum);\n li.appendChild(contentDonboscoMuseum);\n\n DonboscoMuseumPostList.appendChild(li);\n}", "function getCat(){\n var cat = {\n\tname: nameList[getRandomInt(0,nameList.length-1)],\n\tage: getRandomInt(0,100),\n\tcolor: getColor()\n };\n return cat;\n}", "function populateSecCategory(priElemId, secElemId) {\r\n\r\n\tvar index = document.getElementById(priElemId).selectedIndex;\r\n\tvar stateElement = document.getElementById(secElemId);\r\n\r\n\tstateElement.length = 0;\r\n\tstateElement.options[0] = new Option('Select Category', '');\r\n\r\n\tvar state_arr = secArray[index].split(\"|\");\r\n\r\n\tfor (var i = 0; i < state_arr.length; i++) {\r\n\t\tstateElement.options[stateElement.length] = new Option(state_arr[i],\r\n\t\t\t\tstate_arr[i]);\r\n\t}\r\n\tstateElement.selectedIndex = 0;\r\n}", "function addCorrectClass(myDoc) {\n const docs = [...document.getElementsByClassName('doc')];\n const hasGroup =\n myDoc.getAttribute('docGroupId') &&\n docs.some((doc) => {\n return (\n doc !== myDoc &&\n doc.getAttribute('docGroupId') === myDoc.getAttribute('docGroupId')\n );\n });\n\n myDoc.classList.remove(\n 'top-of-group',\n 'middle-of-group',\n 'bottom-of-group',\n 'group-item'\n );\n\n if (hasGroup) {\n myDoc.classList.add('group-item');\n const group = docs.filter((doc) => {\n return (\n doc.getAttribute('docGroupId') === myDoc.getAttribute('docGroupId')\n );\n });\n const index = group.indexOf(myDoc);\n if (index === 0) {\n myDoc.classList.add('top-of-group');\n } else if (index === group.length - 1) {\n myDoc.classList.add('bottom-of-group');\n } else {\n myDoc.classList.add('middle-of-group');\n }\n }\n}", "function confirmCategory(categoryId){\r\n\t \r\n\t var categoryName = $(categoryNameInput+categoryId).val();\r\n\t\t\r\n\t if(categoryName.split(\" \").join(\"\") != \"\"){\r\n\t\t\t \r\n\t\tvar categoryAtLocation = duplicateProductCategory(categoryName);\r\n\t\t\r\n\t\tif(categoryAtLocation == -1){\r\n\t productCategoriesArray[categoryId].categoryName = categoryName;\r\n\t iterateProductCategoriesArray();\r\n\t addOption(categoryId);\r\n\t\t}else{\r\n\t\t\t$(categoryNameInput + categoryId).val('');\r\n\t\t\talert(\"Category Already Exists !\");\r\n\t\t}\r\n\t }else{\r\n\t\t alert(\"Category Name cannot be empty !\");\r\n }\r\n \r\n }", "setData(category, body){\n (body.name) ? category.name = body.name : null;\n (body.desc) ? category.desc = body.desc : null;\n (body.max) ? category.max = body.max : null;\n return category\n }", "function compMemberCats(member1, member2) {\nif (member1[\"category2\"] == member2[\"category2\"]) {\nreturn true;\n}\nreturn false;\n}", "function getSubcategories_(subCatId, fromSearch){\r\n\tvar results = '';\r\n\r\n\r\n\t//if from search , request comes\r\n\r\n\tvar query = window.location.search.substring(1);\r\n\tif(query && fromSearch){\r\n\t var vars = query.split('&');\r\n\t var vars1 = vars[0];\r\n\t var vars2 = vars[1];\r\n\t var vars3 = vars[2];\r\n\r\n\t var inputsCat = vars1.split('=');\r\n\t var catId = inputsCat[1];\r\n\r\n\t var inputsSubCat = vars2.split('=');\r\n\t var subCatId = inputsSubCat[1];\r\n\r\n\t var inputsDocId = vars3.split('=');\r\n\r\n\t var docId = inputsDocId[1];\r\n\t var targetURL = \"faqsForSubCategory?subCategoryID=\"+subCatId+\"&catId=\"+catId+\"&subcatId=\"+subCatId+\"&docId=\"+docId;\r\n\t}\r\n\telse{\r\n\t\tvar targetURL = \"faqsForSubCategory?subCategoryID=\"+subCatId;\r\n\t}\r\n\tvar targetURL = \"faqsForSubCategory?subCategoryID=\"+subCatId+\"&docId=\"+docId;\r\n\tdocument.getElementById(\"top_faqs_div_\").innerHTML = '<img class=\"loaderimg\" src=\"images/firstchoice/loading-3-anim-transparent.gif\" />';\r\n\r\n\tdocument.getElementById(\"faq_explain_\").innerHTML = \"<div id='docHeading'></div>\";\r\n\tvar subcat= \"subcat_\"+subCatId;\r\n\r\n\r\n\ttabsSelection(\"sub_before_you_go_\", \"subcat-tab-selected\", subcat, \"DIV\");\r\n//\r\n\tvar xmlhttp;\r\n\tif (window.XMLHttpRequest) {// code for IE7+, Firefox,\r\n\t// Chrome, Opera, Safari\r\n\t\txmlhttp = new XMLHttpRequest();\r\n\t}\r\n\telse {// code for IE6, IE5\r\n\txmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\r\n\t}\r\n\txmlhttp.onreadystatechange = function() {\r\n\t\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\r\n\t\t\t\tresults = xmlhttp.responseText;\r\n\t\t\t\tvar subString1=results.split('test1');\r\n\r\n\t\t\t\tvar subresult = subString1[1];\r\n\r\n\t\t\t\tvar subString=subresult.split('test2');\r\n\r\n\t\t\t\tvar ObjStr = subString[0];\r\n\t\t\t\tvar divId = \"top_faqs_div_\";\r\n\t\t\t\tif(ObjStr != '[]' || ObjStr != ''){\r\n\r\n\t\t\t\tdocument.getElementById(divId).innerHTML = ObjStr;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tdocument.getElementById(divId).innerHTML = \"No documents available\";\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t }\r\n var url = targetURL;\r\n xmlhttp.open(\"GET\",url,true);\r\n xmlhttp.send();\r\n if(ObjStr != '[]' || ObjStr != ''){\r\n\t return true;\r\n }\r\n return false;\r\n}", "function loadBasedOnCategory(value) {\r\n\t$('#disease,#toxin').val('').trigger(\"chosen:updated\");\r\n\t$.getJSON('http://pollutantapi-aaroncheng.rhcloud.com/category/getDiseases/' + value,function(data) {\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tvar api_data = [],\r\n\t\t\t\tcount\t=\t1;\r\n\t\t\tif( data.hasOwnProperty('diseases') )\r\n\t\t\t\tfor(var i in data.diseases) {\r\n\t\t\t\t\tapi_data.push( { type:'disease', name:data.diseases[i]['name'], id:count++, color:'#1f77b4' } );\r\n\t\t\t}\r\n\t\t\t$(\".current-status\").html('<i>Diseases linked to '+value+' </i>');\r\n\t\t\tupdateCanvas(api_data);\r\n\t\t\t\r\n\t\t} catch(e) {\r\n\t\t\tconsole.log(e.message);\r\n\t\t}\r\n\t});\r\n}", "[consts.VIS_EDIT_CATEGORY](state, obj) {\n state.visEditCategory = obj.vis;\n }", "function getInputCategories(idx) {\r\n\tvar result = $(inputmetadata[idx]).find(\"categories>data\");\r\n\tif (result == null || result.text()==null) {return \"none\"}\r\n\telse return result.split(extract(result.text()));\r\n}", "function hotcat_find_category (wikitext, category)\n{\n var cat_name = category.replace(/([\\\\\\^\\$\\.\\?\\*\\+\\(\\)])/g, \"\\\\$1\");\n var initial = cat_name.substr (0, 1);\n var cat_regex = new RegExp (\"\\\\[\\\\[\\\\s*[Kk]ategoria\\\\s*:\\\\s*\"\n + (initial == \"\\\\\"\n ? initial\n : \"[\" + initial.toUpperCase() + initial.toLowerCase() + \"]\")\n + cat_name.substring (1).replace (/[ _]/g, \"[ _]\")\n + \"\\\\s*(\\\\|.*?)?\\\\]\\\\]\", \"g\"\n );\n var result = new Array ();\n var curr_match = null;\n while ((curr_match = cat_regex.exec (wikitext)) != null) {\n result [result.length] = {match : curr_match};\n }\n return result; // An array containing all matches, with positions, in result[i].match\n}", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "function addCategoryBooks(category, index){\n createCategory(category)\n fetch(`https://www.googleapis.com/books/v1/volumes?q=subject:${category}`)\n .then(response => {return response.json()})\n .then(data => {\n data.items.forEach(element => { \n if (element.volumeInfo.hasOwnProperty('imageLinks') \n && element.volumeInfo.hasOwnProperty('authors')\n && element.volumeInfo.hasOwnProperty('description')){\n let cover = element.volumeInfo.imageLinks.thumbnail\n let name = element.volumeInfo.title\n let author = element.volumeInfo.authors[0]\n let bookId = element.id\n if(name.length > 35){\n name = name.slice(0, 35) + \"...\" \n }\n if(author.length > 25){\n author = author.slice(0, 25) + \"...\"\n }\n createBookContainer1(cover,name,author,index,bookId)\n } \n })\n })\n}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "get category () {\n\t\treturn this._category;\n\t}", "function buildCategories() {\n const selectCategories = {};\n\n for (let i = 0; i < skills.length; i++) {\n const category = skills[i].category;\n // Make array for each category\n if (!selectCategories[category]) {\n selectCategories[category] = [];\n }\n\n let skill = skills[i];\n if (skill.comp === 1) {\n selectCategories[category].push({\n 'value': i,\n 'label': skill.name,\n // Custom attrs on Select Options\n 'tariff': skill.tariff.toFixed(1),\n 'startPosition': skill.startPosition,\n 'endPosition': skill.endPosition,\n 'makeDim': false\n });\n }\n }\n return selectCategories;\n}", "findCategoryBySubcategoryId(id, cb) {\n this\n .findOne({subcategories: id})\n .select('title url')\n .exec(cb);\n }", "function GetCategoryOrSubCategoryOnId(OpertionFlag, id) {\n if (OpertionFlag) {\n var list = $filter('filter')($scope.CategoryList, { categoryId: id });\n return list[0].categoryName;\n }\n else {\n var list = $filter('filter')($scope.SubCategory, { id: id });\n return list[0].name;\n }\n }", "function setCategory(category) {\r\n\t\t\tvar textElem = $('<span>' + category + '</span>');\r\n\t\t\t$(textElem).appendTo(self.bbgCss.jq.category);\r\n\t\t}", "change(docId, doc) {\n const cleanedDoc = this._getCleanedObject(doc);\n let storedDoc = this.store[docId];\n deepExtend(storedDoc, cleanedDoc);\n\n let changedData = {};\n _.each(cleanedDoc, (value, key) => {\n changedData[key] = storedDoc[key];\n });\n\n this.send('changed', docId, changedData);\n }", "function getDocs(categoryIndex) {\n let docsList = []\n ToC[categoryIndex].docs.map((d,i) => {\n docsList.push(Doc(state, ToC, categoryIndex, i))\n })\n return `\n<div id=\"docs\">\n ${docsList.join('')}\n</div>\n`\n }" ]
[ "0.62367296", "0.5558625", "0.55453634", "0.5480499", "0.54052097", "0.5352896", "0.53428745", "0.5273854", "0.52588946", "0.52482474", "0.5226446", "0.5161925", "0.51475996", "0.51373917", "0.5136128", "0.51303643", "0.51238", "0.51128054", "0.5107202", "0.510177", "0.50170887", "0.50083905", "0.49977466", "0.49885082", "0.4981651", "0.49680528", "0.4964058", "0.4946002", "0.49390224", "0.49199203", "0.49162388", "0.4911775", "0.4911212", "0.49059233", "0.48839304", "0.48723137", "0.48716894", "0.48648018", "0.48564354", "0.48540932", "0.48510408", "0.4847066", "0.48410812", "0.48357403", "0.48240423", "0.4814752", "0.48081356", "0.48081025", "0.48063198", "0.4798894", "0.47976762", "0.479615", "0.4788419", "0.47718418", "0.47708058", "0.47606096", "0.47603515", "0.475355", "0.47515103", "0.47480857", "0.4740835", "0.4740052", "0.47345003", "0.4732227", "0.473096", "0.47309014", "0.47304755", "0.47298974", "0.47285917", "0.472823", "0.47279397", "0.47245303", "0.4721425", "0.47190765", "0.47138008", "0.47136983", "0.47063118", "0.4704873", "0.46995744", "0.46988153", "0.46940202", "0.46905607", "0.46892896", "0.46863705", "0.46813214", "0.46778366", "0.46750087", "0.46750054", "0.4666489", "0.4662136", "0.46618503", "0.46618503", "0.46618503", "0.46618503", "0.4660402", "0.46573794", "0.464647", "0.46458897", "0.46457303", "0.4645187" ]
0.6275349
0
if arrow key pressed
function checkKey(e) { if (GAME.mode == "instructions") { e = e || window.event; // left arrow if (e.keyCode == '37') { //left category function; instructions[GAME.cardIndex].leftFunc(); } //right arrow else if (e.keyCode == '39') { //right category function instructions[GAME.cardIndex].rightFunc(); } } if (GAME.mode == "play") { e = e || window.event; // left arrow if (e.keyCode == '37') { checkCategory(DOC.leftCategory, DOC.rightCategory, GAME.currentCategories[0]); } //right arrow else if (e.keyCode == '39') { checkCategory(DOC.rightCategory, DOC.leftCategory, GAME.currentCategories[1]); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function keyDownhandler(event) {\n if ( event.keyCode == 39 ) {\n //NOTE keyCode MUST!!! have Capitcal C in key C ode\n //keycode 39 = right arrow button\n rightPressed = true;\n } else if ( event.keyCode == 37 ){\n //keycode 37 = left arrow button\n leftPressed = true;\n }\n}", "function keyDownHandler(e) {\r\n if(e.keyCode == 39) { // 39 defines as right arrow\r\n rightArrowPressed = true;\r\n }\r\n else if(e.keyCode == 37) { //37 defines as left arrow\r\n leftArrowPressed = true;\r\n }\r\n }", "function keyDown(e) {\n if (e.keyCode == 39) {\n rightPressed = true;\n } else if (e.keyCode == 37) {\n leftPressed = true;\n //arrow up\n } else if (e.keyCode == 38) {\n upPressed = true;\n } else if (e.keyCode == 40) {\n downPressed = true;\n }\n}", "function onKeyDown(evt) {\r\n switch (evt.keyCode) {\r\n case 39: KEY_ARROW_RIGHT = true; break;\r\n case 37: KEY_ARROW_LEFT = true; break;\r\n case 38: KEY_ARROW_UP = true; break;\r\n case 40: KEY_ARROW_DOWN = true; break;\r\n case 16: KEY_SHIFT = true; break;\r\n }\r\n}", "function keyPressed()\n{\n if(keyCode == RIGHT_ARROW && which_point < 3) {which_point ++;}\n else if (keyCode == LEFT_ARROW && which_point > 0) {which_point --;}\n return false;\n}", "function onKeyDown(evt) {\n if (evt.keyCode == 81) Up1Pressed = true; //q\n else if (evt.keyCode == 65) Down1Pressed = true; //a\n // else if (evt.keyCode == 80) Up2Pressed = true; //p\n // else if (evt.keyCode == 76) Down2Pressed = true; //l\n}", "function KeyPressed(e) {\n if(e.keyCode == 39) {\n Right = true; //if the right arrow is pressed, sets it true\n }//if\n else if(e.keyCode == 37) {\n Left = true;\n }//else if\n\n}//Pressed", "function keyReleased()\n{\n if (keyCode === LEFT_ARROW || keyCode === RIGHT_ARROW || keyCode === DOWN_ARROW) \n {\n b1 = true;\n }\n}", "function keyDownHandler(e) {\n if (e.key == 'Right' || e.key == 'ArrowRight') {\n rightPressed = true;\n } else if (e.key == 'Left' || e.key == 'ArrowLeft') {\n leftPressed = true;\n }\n}", "function keyPressed() {\n if (keyCode === UP_ARROW) {\n upPressed = true;\n } else if (keyCode === DOWN_ARROW) {\n downPressed = true;\n } else if (keyCode === LEFT_ARROW) {\n leftPressed = true;\n } else if (keyCode === RIGHT_ARROW) {\n rightPressed = true;\n } else if (keyCode === 32){\n spacePressed = true;\n fired = true\n }\n}", "function keyDownHandler(event) {\r\n // get the keyCode\r\n switch (event.keyCode) {\r\n // \"up arrow\" key\r\n case 38:\r\n // set upArrowPressed = true\r\n upArrowPressed = true;\r\n break;\r\n // \"down arrow\" key\r\n case 40:\r\n downArrowPressed = true;\r\n break;\r\n }\r\n}", "function keyDown (event) {\r\n // console.log(event.keyCode);\r\n if (event.keyCode == 65) {\r\n rightPressed = true;\r\n } else if (event.keyCode == 68) {\r\n leftPressed = true;\r\n } else if (event.keyCode == 87) {\r\n upPressed = true;\r\n } else if (event.keyCode == 83) {\r\n downPressed = true;\r\n }\r\n}", "function onKeyDown(evt) {\n if (evt.keyCode == 39) rightDown = true;\n else if (evt.keyCode == 37) leftDown = true;\n }", "checkKey(e) {\n if (e.keyCode == '87') { //up\n console.log(\"UP key pressed.\")\n this.moveFrog(0, -10);\n }\n else if (e.keyCode == '83') { //down\n console.log(\"DOWN key pressed.\")\n this.moveFrog(0, 10);\n }\n else if (e.keyCode == '65') { //left\n console.log(\"LEFT key pressed.\")\n this.moveFrog(-10, 0)\n }\n else if (e.keyCode == '68') { //right\n console.log(\"RIGHT key pressed.\")\n this.moveFrog(10, 0);\n }\n }", "function onKeyDown(evt) {\n if (evt.keyCode == 39) rightDown = true;\n else if (evt.keyCode == 37) leftDown = true;\n }", "function checkArrowKeysPressed(event, component) {\n event = event || window.event;\n \n if (event.keyCode == '38') {\n // up arrow\n component.val(parseInt(component.val()) + 1)\n }\n else if (event.keyCode == '40') {\n // down arrow\n component.val(parseInt(component.val()) - 1)\n }\n}", "function isPressed(keyCode) {\n\t if (typeof(keyCode)=='string') {\n\t keyCode = code(keyCode);\n\t }\n\t return index(_downKeys, keyCode) != -1;\n\t }", "function isPressed(keyCode) {\n\t if (typeof(keyCode)=='string') {\n\t keyCode = code(keyCode);\n\t }\n\t return index(_downKeys, keyCode) != -1;\n\t }", "function onKeyUp(event) {\n\n switch (event.key) {\n\n case \"ArrowLeft\":\n moveLeft = false;\n break;\n case \"ArrowRight\":\n moveRight = false;\n break;\n \n default:\n break;\n\n } \n\n}", "function onKeyDown(event) {\n\n // console.log(event);\n\n switch (event.key) {\n\n case \"ArrowLeft\":\n moveLeft = true;\n break;\n case \"ArrowRight\":\n moveRight = true;\n break;\n \n default:\n break;\n\n }\n\n}", "function whichKey(e) {\n\t \te.preventDefault();\n\t var code = (e.keyCode ? e.keyCode : e.which);\n\t switch (code){\n\t case 40:\n\t mooveDown();\n\t break;\n\t case 38:\n\t \tmooveUp();\n\t break;\n\t case 37:\n\t alert(\"left\");\n\t break;\n\t case 39:\n\t mooveRight();\n\t break;\n\t }\n\t \n\t }", "function keyDownHandler(e)\n{\n\tif (e.keyCode == 39)\n\t{\n\t\trightPressed = true;\n\t}\n\telse if (e.keyCode == 37)\n\t{\n\t\tleftPressed = true;\n\t}\n}", "function keyDownHandler(event) {\n if (event.keyCode == 39 || event.keyCode == 68) {\n rightPressed = true;\n }\n else if (event.keyCode == 37 || event.keyCode == 65) {\n leftPressed = true;\n }\n if (event.keyCode == 40 || event.keyCode == 83) {\n downPressed = true;\n }\n else if (event.keyCode == 32) {\n upPressed = true;\n }\n}", "function handlerKeyDown(e){\n if(e.keyCode === 37){\n leftPressed = true;\n }else if(e.keyCode === 39){\n rightPressed = true;\n }\n }", "function isPressed(keyCode) {\r\n if (typeof(keyCode)=='string') {\r\n keyCode = code(keyCode);\r\n }\r\n return index(_downKeys, keyCode) != -1;\r\n }", "function keyDownHandler(e){\r\n if(e.keyCode == 39){\r\n rightPressed = true;\r\n }\r\n else if(e.keyCode == 37){\r\n leftPressed = true;\r\n }\r\n }", "function keyDownHandler(e) {\n if(e.keyCode == 39) { \n rightPressed = true\n }\n else if(e.keyCode == 37) { \n leftPressed = true;\n }\n}", "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "static getKeyPressed(_keyCode) {\n return this.keyPressed[_keyCode] == true;\n }", "function keyDownHandler(event){\n event.preventDefault(); //prevents from default event handler from executing (prevents scrolling)\n if(event.key == \"ArrowLeft\"){\n isPressed.left = true;\n }\n else if(event.key == \"ArrowUp\"){\n isPressed.up = true;\n }\n else if(event.key == \"ArrowRight\"){\n isPressed.right = true;\n }\n else if(event.key == \"ArrowDown\"){\n isPressed.down = true;\n }\n\n}", "function keyUpHandler(e) {\n console.log(e.key);\n if (e.key == 'Right' || e.key == 'ArrowRight') {\n rightPressed = false;\n } else if (e.key == 'Left' || e.key == 'ArrowLeft') {\n leftPressed = false;\n }\n}", "function onKeyDown(evt) {\n if (evt.keyCode == 39) rightDown = true;\n else if (evt.keyCode == 37) leftDown = true;\n}", "function checkKey(e) {\n\n e = e || window.event;\n\n if (e.keyCode == '38') {\n\tdirection = 1;\n\tmove();\n }\n else if (e.keyCode == '40') {\n\tdirection = 2;\n\tmove();\n }\n else if (e.keyCode == '37') {\n\tdirection = 3;\n\tmove();\n }\n else if (e.keyCode == '39') {\n\tdirection = 4\n\tmove();\n }\n\n}", "function control(e) {\n if(e.keyCode === 37) {\n keyLeft()\n } else if (e.keyCode === 38) {\n keyUp()\n } else if (e.keyCode === 39) {\n keyRight()\n } else if (e.keyCode === 40) {\n keyDown()\n }\n }", "function keyIsDown(event) {\n keyPressed[event.keyCode] = true;\n}", "function keyPressed(){\n if(keyCode === RIGHT_ARROW){ //Checking for is the 'RIGHT_ARROW' key is being pressed down.\n cleanUp = true;\n }\n return false; //Used to stop default behaviour \n}", "switch(key) {\n case \"ArrowRight\": moveCaret(caret+1, shiftKey); break;\n case \"ArrowLeft\": moveCaret(caret-1, shiftKey); break;\n case \"ArrowUp\": break;\n case \"ArrowDown\": break;\n case \"C\": break;//TODO : copy\n case \"V\": break;//TODO : paste\n case \"X\": break;//TODO : cut\n default: break;\n }", "function keyDownHandler(e) {\n if(e.keyCode == 39) {\n rightPressed = true;\n }\n else if(e.keyCode == 37) {\n leftPressed = true;\n }\n}", "function keyDownHandler(e) {\n if(e.keyCode == 39) {\n rightPressed = true;\n }\n else if(e.keyCode == 37) {\n leftPressed = true;\n }\n}", "function keyPressed() {\r\n\t//if the right arrow is pressed, Mario will move to the right\r\n\tif (keyCode == RIGHT_ARROW) {\r\n\t\tposX += 25;\r\n\t}\r\n\t//if the left arrow is pressed, Mario will move to the left\r\n\telse if (keyCode == LEFT_ARROW) {\r\n\t\tposX -= 25;\r\n\t}\r\n\t//if the up arrow is pressed, Mario will move up \r\n\telse if (keyCode == UP_ARROW) {\r\n\t\t//when the up button is pressed he will jump\r\n\t\tposY -= 75;\r\n\t}\r\n\t//if the down arrow is pressed, Mario will move down\r\n\telse if (keyCode == DOWN_ARROW) {\r\n\t\tposY += 25;\r\n\t}\r\n}", "function keyDownHandler(e){\n if(e.keyCode == 39){\n rightPressed = true;\n }\n else if (e.keyCode == 37){\n leftPressed = true;\n }\n}", "function keyDownHandler(e) {\n if(e.keyCode == 39) {\n rightPressed = true;\n } else if(e.keyCode == 37) {\n leftPressed = true;\n }\n}", "function estado1(){\r\n\r\n \r\n\tif(keyCode === RIGHT_ARROW){\r\n\t\t\t\t uno.control(0);\r\n\t }else if(keyCode === LEFT_ARROW){\r\n\t\t\t uno.control(1); \r\n\t\t }\r\n\r\n}", "function arrows(x){\n if(x.keyCode === 39){ \n arrowRight()\n } else if(x.keyCode == 37){\n arrowLeft()\n } else if(x.keyCode == 38){\n arrowUp()\n } else if(x.keyCode == 40){\n arrowDown()\n }\n}", "function keyDownHandler(e) {\r\n if(e.keyCode == 37) {\r\n leftPressed = true;\r\n }\r\n else if(e.keyCode == 38) {\r\n upPressed = true;\r\n }\r\n else if(e.keyCode == 39) {\r\n rightPressed = true;\r\n }\r\n else if(e.keyCode == 40) {\r\n downPressed = true;\r\n }\r\n}", "function isPressed(keyCode) {\n if (typeof(keyCode)=='string') {\n keyCode = code(keyCode);\n }\n return index(_downKeys, keyCode) != -1;\n }", "function keydown(e) {\n if(e.which == _forwardKey) _forwardDown = true;\n if(e.which == _rightKey) _rightDown = true;\n if(e.which == _leftKey) _leftDown = true;\n }", "function checkKeyDown(e){\r\n\te.view.event.preventDefault();\r\n\tswitch(e.keyCode) {\r\n\t\tcase 37:\r\n\t\t\tleft_flag = true;\r\n\t\t\tbreak;\r\n\t\t//up key pressed 38\r\n\t\tcase 38:\r\n\t\t\tup_flag = true;\r\n\t\t\tbreak;\r\n\t\tcase 39:\r\n\t\t\tright_flag = true;\r\n\t\t\tbreak;\r\n\t\t//down key pressed 40\r\n\t\tcase 40:\r\n\t\t\tdown_flag = true;\r\n\t\t\tbreak;\r\n\t\tcase 13:\r\n\t\t\tstartGame();\r\n\t\t\tbreak;\t\t\r\n\t}\r\n}", "function keyDownFunction(e) {\n if (e.keyCode == 39) {\n keyPressRight = true;\n } else if (e.keyCode == 37) {\n keyPressLeft = true;\n }\n }", "function arrowPress(i) {\n\t\n\t\n\t\n\t\n}", "function keystroke(event) \n{\n 'use strict';\n\n // Left arrow?\n if (event.which == 37) {\n pfView.moveLeft();\n }\n\n // Right arrow?\n else if (event.which == 39) {\n pfView.moveRight();\n }\n}", "function control (e){\r\n if(e.keyCode ===37){\r\n moveLeft()\r\n \r\n }else if (e.keyCode === 38){\r\n rotate()\r\n }else if(e.keyCode=== 39){\r\n moveRight()\r\n }else if(e.keyCode===40){\r\n moveDown()\r\n }\r\n}", "function keyDownHandler(e) {\n if (e.key == 'd') {\n rightPressed = true\n } else if (e.key == 'a') {\n leftPressed = true\n }\n}", "function onKeyDown(evt) {\r\n\tif (evt.keyCode == 32) spacebarDown = true;\t\r\n\t\r\n\tif (evt.keyCode == 39) rightDown = true;\r\n\telse if (evt.keyCode == 37) leftDown = true;\r\n}", "function keyDownHandler(e) {\n\tif(e.keyCode == 39) {\n\t\trightPressed = true;\n\t}\n\telse if(e.keyCode == 37) {\n\t\tleftPressed = true;\n\t} else if(e.keyCode === 0 || e.keyCode == 32) {\n\t\tspacePressed = true;\n\t}\n}", "function keydown(event){switch(event.keyCode){case $mdConstant.KEY_CODE.LEFT_ARROW:event.preventDefault();incrementIndex(-1,true);break;case $mdConstant.KEY_CODE.RIGHT_ARROW:event.preventDefault();incrementIndex(1,true);break;case $mdConstant.KEY_CODE.SPACE:case $mdConstant.KEY_CODE.ENTER:event.preventDefault();if(!locked)select(ctrl.focusIndex);break;}ctrl.lastClick=false;}", "onDownKey() {\n this.onArrowKey('down');\n }", "onDownKey() {\n this.onArrowKey('down');\n }", "function keyDownHandler(e)\n{\n if(e.keyCode === 39) {rightPressed = true;}\n if(e.keyCode === 37) {leftPressed = true;}\n if(e.keyCode === 38) {upPressed = true;}\n if(e.keyCode === 40) {downPressed = true;}\n}", "function pressArrowKeys (event) {\n // console.log(event.keyCode);\n if (!gameStarted || changingTurn) { \n return; \n }\n\n let isFightMode = canFight(currentPlayer, otherPlayer);\n console.log(\"isFightMode: \" + isFightMode);\n if (isFightMode) {\n fightMode(event.keyCode)\n }else{\n boardMode(event.keyCode)\n }\n\n drawGame();\n}", "function keyDownHandler(e){\n\tif(e.keyCode == 39){\n\t\tconsole.log(\"Left\");\n\t\trightPressed = true;\n\t}\n\telse if(e.keyCode == 37){\n\t\tconsole.log(\"Right\");\n\t\tleftPressed = true;\n\t}\n}", "keyPressed() {\n if (this.started){\n\n switch (event.key) {\n case \"ArrowDown\":\n this.mainLoop(); //Call mainloop because funtion is the same\n break;\n case \"ArrowUp\":\n this.rotate('rotateright');\n break;\n case \"ArrowLeft\":\n this.arrowKeys(-1);\n break;\n case \"ArrowRight\":\n this.arrowKeys(1);\n break;\n case \" \": //space\n this.hardLock();\n break;\n case \"Escape\":\n // this.pauze();\n break;\n case \"z\":\n this.rotate('rotateleft');\n break;\n case \"c\":\n // this.hold();\n break;\n case \"r\":\n // this.gameover();\n // this.start();\n break;\n default:\n return; // Quit when this doesn't handle the key event.\n }\n\n }\n\n }", "keyDown(_keycode) {}", "function handleKey(e){\n if(e.key.includes('Arrow')){\n e.preventDefault();\n console.log(e.key);\n draw({key: e.key});\n console.log('HANDLING KEY');\n }\n}", "function Keydown(evt) {\n switch (evt.keyCode) { // keyCode source: http://www.asquare.net/javascript/tests/KeyCode.html\n case 38: // Up\n console.log('Up');\n break;\n case 37: // Left\n slider.PrevSlide();\n break;\n case 39: // Right\n slider.NextSlide();\n break;\n case 40: // Down\n console.log('Down');\n break;\n }\n }", "onDownArrowKeypress() {\n var e;\n this.activeTabId && ((e = document.getElementById(this.activeTabId)) == null || e.focus());\n }", "function keyboardNav(event) {\r\n // handling Internet Explorer stupidity with window.event\r\n const keycode = (event.which) ? event.which : event.keyCode;\r\n const LEFT = 37;\r\n const RIGHT = 39;\r\n if (event.altKey) {\r\n return true;\r\n }\r\n if (keycode === LEFT) {\r\n previousButtonPressed();\r\n return false;\r\n } else if (keycode === RIGHT) {\r\n nextButtonPressed();\r\n return false;\r\n }\r\n return true;\r\n }", "checkArrows(){\n\t\tif (keyIsDown(UP_ARROW)){\n\t\t\tthis.increaseAngle(0.1);\n\t\t}\n\t\tif (keyIsDown(DOWN_ARROW)){\n\t\t\tthis.decreaseAngle(0.1);\n\t\t}\n\t}", "key(e) {\n if(e.keyCode == 39) {this.next();}\n else if(e.keyCode == 37) {this.prev();}\n }", "function mb_checkKey(e) {\n\t\t e = e || window.event;\n\t\t\t// console.log(e.keyCode);\t\t// remember to put focus on window not on console.\n\n\t\t if (e.keyCode == '39') {\n\t\t $('.multipost_nav_forward').click();\n\t\t }\n\t\t else if (e.keyCode == '37') {\n\t\t $('.multipost_nav_back').click();\n\t\t }\n\t\t}", "function KeyDownFunc(e) {\r\n if (e.keyCode == 39) {\r\n right_pressed = true;\r\n } else if (e.keyCode == 37) {\r\n left_pressed = true;\r\n } else if (e.keyCode == 38) {\r\n up_pressed = true;\r\n } else if (e.keyCode == 40) {\r\n down_pressed = true;\r\n } else if (e.keyCode == 32) {\r\n space_pressed = true;\r\n }\r\n}", "function control (e) {\n if (e.keyCode === 37 || e.keyCode === 65) moveLeft()\n if (e.keyCode === 39 || e.keyCode === 68) moveRight()\n if (e. keyCode === 38 || e.keyCode === 87) rotate()\n if (e.keyCode === 40 || e.keyCode == 83) moveDown()\n }", "function eatKey(keyCode) {\n\t var isDown = g_keys[keyCode];\n\t g_keys[keyCode] = false;\n\t return isDown;\n}", "function control(e){\n if(e.keyCode === 37)\n {\n moveLeft();\n }\n\n else if(e.keyCode === 39)\n {\n moveRight();\n }\n else if(e.keyCode === 38)\n {\n rotate();\n }\n else if(e.keyCode === 40)\n {\n moveDown();\n }\n }", "function control(e){\n if(e.keyCode === 37){\n moveLeft();\n }else if(e.keyCode ===38){\n rotate();\n }else if(e.keyCode === 39){\n moveRight();\n }else if(e.keyCode === 40){\n moveDown();\n }\n }", "function onKeyDown(event){\n \n //keyboard events\n switch(event.keyCode){\n case 48:\n case 96:\n lookUp = true;\n break;\n case 38: //up\n case 87: //w\n console.log('w');\n moveForward = true;\n break;\n case 37: //left\n case 65: //a\n moveLeft = true;\n break;\n case 40: //down \n case 83: //s\n moveBackward = true;\n break;\n case 39: //right\n case 68: //d\n moveRight = true;\n break;\n }//end switch\n}", "function keyDown(evt) {\n var c = (evt.keyCode) ? evt.keyCode : evt.charCode;\n switch(c) {\n case 37: // left\n case 63234:\n dx = 1; break;\n case 39: // right\n case 63235:\n dx = -1; break;\n case 40: // down\n case 63233:\n dy = -1; break;\n case 38: // up\n case 63232:\n dy = 1; break;\n case 32: // fire\n if (Torpedo.x) {\n playSound('notAvail');\n message('Not loaded new torpedo yet!');\n mainPanel(\"#779\");\n } else Torpedo.fire();\n break;\n case 16: // shift\n withShift = 1; break;\n case 27: // esc\n gameRunning = score = 0;\n IntroOutro.endAnimDest(0 , 1, 1);\n }\n}", "function keyDownHandler(e) {\n // If right arrow key is pressed\n if (e.keyCode === 39) {\n gameClass.rightPressed = true;\n // If left arrow key is pressed\n } else if (e.keyCode === 37) {\n gameClass.leftPressed = true;\n }\n}", "function control(e) {\r\n if (e.keyCode === 37) {\r\n moveLeft();\r\n } else if (e.keyCode === 38) {\r\n rotate();\r\n } else if (e.keyCode === 39) {\r\n moveRight();\r\n } else if (e.keyCode === 40) {\r\n moveDown();\r\n }\r\n }", "function handleKeyDown(evt) {\r\n if (evt.keyCode == KEYCODE_UP) {\r\n pressing.up = true;\r\n }\r\n else if (evt.keyCode == KEYCODE_DOWN) {\r\n pressing.down = true;\r\n }\r\n else if (evt.keyCode == KEYCODE_LEFT) {\r\n pressing.left = true;\r\n }\r\n else if (evt.keyCode == KEYCODE_RIGHT) {\r\n pressing.right = true;\r\n }\r\n}", "function keyPressed(){\n\tif(keyCode === UP_ARROW){\n\t\ts.dir(0, -1);\n\t}else if(keyCode === DOWN_ARROW){\n\t\ts.dir(0, 1);\n\t}else if(keyCode === RIGHT_ARROW){\n\t\ts.dir(1, 0);\n\t}else if(keyCode === LEFT_ARROW){\n\t\ts.dir(-1, 0);\n\t}\n}", "function keydown(e) {\r\n if (e.keyCode == \"38\") {\r\n // called the function according to the requirement\r\n moveup();\r\n } else if (e.keyCode == \"40\") {\r\n movedown();\r\n } else if (e.keyCode == \"37\") {\r\n moveleft();\r\n } else if (e.keyCode == \"39\") {\r\n moveright();\r\n }\r\n}", "function isPressed(keyCode) {\n if (typeof keyCode === 'string') {\n keyCode = code(keyCode); // Convert to key code\n }\n return _downKeys.indexOf(keyCode) !== -1;\n }", "function keyPressed() {\n\n // LEFT_ARROW, makes gameChar turn left\n if ( keyCode == 37 ) {\n isLeft = true;\n \n // RIGHT_ARROW, makes gameChar turn right\n } else if ( keyCode == 39 ) {\n isRight = true;\n \n // BACKSPACE, makes a new game start when gameChar is dead or level is complete\n } else if ( keyCode == 32 && ( isGameOver || isLevelComplete ) ) {\n isNewGame = true;\n loop();\n \n // BACKSPACE, makes gameChar jump when gameChar is on the floor and flagpole hasn't been reached\n } else if ( keyCode == 32 && !isFalling && !isLevelComplete ) {\n hasJumped = true;\n }\n \n // Logs values to the console if `DEBUG` and `DEBUG_KEY_PRESSES` are set to `true`\n debug_KeyPresses();\n}", "function keyPressed() {\n\tswitch (keyCode){\n\t\tcase LEFT_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\t\n\t\t\tsnake.setDir(-1, 0);\n\t\t\tbreak;\n\t\t\t\n\n\t\tcase RIGHT_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\t\n\t\t\tsnake.setDir(1, 0);\n\t\t\tbreak;\n\t\t\t\n\n\t\tcase DOWN_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\n\t\t\t\n\t\t\tsnake.setDir(0, 1)\n\t\t\tbreak;\n\t\t\t\n\t\tcase UP_ARROW:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\t\n\t\t\tsnake.setDir(0, -1)\n\t\t\tbreak;\n\t\t\t\n\t\tdefault:\n\t\t\tconsole.log('pressed', keyCode)\n\t\t\tbreak;\n\t}\n}", "isLeftPressed() {\n return this.currentKeys.get(LEFT);\n }", "function doKeyDown(evt) {\n var keyCode = evt.keyCode; // code for the key that was pressed\n \n if (keyCode >=34 && keyCode <= 40) {\n evt.preventDefault(); // Stop page from scrolling for arrow keys, home, end, pageup, pagedown.\n }\n if (evt.shiftKey) \n shiftBeingHeld = true;\n \n switch( keyCode ) {\n case 37: eyeX -= 10; break; // left arrow\n case 38: eyeY += 10;\n break; // up arrow\n case 39: eyeX += 10; break; // right arrow\n case 40: eyeY -= 10; break; // down arrow\n case 36: atX = origAtX;\n atY = origAtY;\n atZ = origAtZ;\n eyeX = origEyeX;\n eyeY = origEyeY;\n eyeZ = origEyeZ; break; // home\n case 82:\n case 114: rotationTurnedOn = !rotationTurnedOn; // the letter R\n }\n \n display(); \n}", "function onKeyUp(evt) {\n if (evt.keyCode == 39) rightDown = false;\n else if (evt.keyCode == 37) leftDown = false;\n }", "function keyNav(e) {\n // why === doesn't work? because if the user input is a HTML input text field, it might interpret a number as a string. \"37\" === 37 false.\n if (e.keyCode == '37') {\n goBack(); \n } else if (e.keyCode == '39') {\n goForward();\n }\n}", "function upArrow(event){\n if(event.key == \"w\" || event.key == \"W\"){\n console.log(\"up key pressed\");\n DunWithYou.goNorth();\n }\n}", "function keyPressed(e){\n\t\tif(e.key==\"ArrowRight\"){\n\t\t\tsnake.direction=\"right\";\n\t\t}\n\t\telse if(e.key==\"ArrowLeft\"){\n\t\t\tsnake.direction=\"left\";\n\t\t}\n\t\telse if(e.key==\"ArrowDown\"){\n\t\t\tsnake.direction=\"down\";\n\t\t}\n\t\telse if(e.key==\"ArrowUp\"){\n\t\t\tsnake.direction=\"up\" ;\n\t\t}\n\t\tconsole.log(snake.direction);\n\t}", "onKeyPressed(keyCode, event) {\n switch (keyCode) {\n case cc.KEY.a:\n case cc.KEY.left:\n self.accLeft = true;\n self.accRight = false;\n break;\n case cc.KEY.d:\n case cc.KEY.right:\n self.accLeft = false;\n self.accRight = true;\n break;\n }\n }", "function handlerKeyUp(e){\n if(e.keyCode === 37){\n leftPressed = false;\n }else if(e.keyCode === 39){\n rightPressed = false;\n }\n }", "function keyPressed() {\n if(keyCode === UP_ARROW) {\n \tsnake.direction(0,-1);\n }\n if(keyCode === DOWN_ARROW) {\n \tsnake.direction(0,1);\n }\n if(keyCode === LEFT_ARROW) {\n \tsnake.direction(-1,0);\n }\n if(keyCode === RIGHT_ARROW) {\n \tsnake.direction(1,0);\n }\n \n}", "function keyDown(e) {\n //explains what happens if keybinds are pressed down upon\n if(e.key == \"Right\" || e.key == \"ArrowRight\") {\n keydownpaddle = true;\n }\n //left side\n else if(e.key == \"Left\" || e.key == \"ArrowLeft\") {\n keydownpaddle2 = true;\n }\n}", "function keyPressed() {\n}", "_isDown(keyCode) {\n return this._registered(keyCode) && this.keyAssignment[keyCode][2] ? true : false;\n }", "keyDown(event) {\n var keyCode = event.which || event.keyCode;\n this.activeCommands[keyCode] = true;\n }" ]
[ "0.7627929", "0.7613116", "0.75792825", "0.7455572", "0.7442013", "0.74310863", "0.73398274", "0.73385423", "0.7260651", "0.725683", "0.7211316", "0.7207666", "0.7206557", "0.7205824", "0.717909", "0.7159126", "0.71503764", "0.71503764", "0.71432734", "0.7136447", "0.7114272", "0.7103561", "0.7097678", "0.70963705", "0.7089733", "0.7085845", "0.7078869", "0.7077231", "0.7077231", "0.7077231", "0.7077231", "0.70768356", "0.7071261", "0.7065172", "0.7060593", "0.7048074", "0.7029991", "0.7029032", "0.7025065", "0.7020081", "0.70009583", "0.70009583", "0.6998273", "0.6994502", "0.6993821", "0.6992186", "0.69898665", "0.6982666", "0.6980267", "0.6979562", "0.69717747", "0.69510496", "0.6946465", "0.6938639", "0.69334036", "0.6931785", "0.6931544", "0.69265944", "0.692375", "0.6919855", "0.6919855", "0.6919062", "0.6917061", "0.6913392", "0.6908617", "0.6907617", "0.68984985", "0.68902564", "0.6890095", "0.6884858", "0.6882216", "0.68817806", "0.6879142", "0.68743384", "0.68699086", "0.6856655", "0.68538034", "0.6847853", "0.6847206", "0.68443453", "0.6837807", "0.6834721", "0.6831871", "0.6831005", "0.68309945", "0.6823083", "0.6822023", "0.68202937", "0.6818941", "0.6813118", "0.6807061", "0.6799062", "0.6795892", "0.6793781", "0.67893773", "0.67876625", "0.6784653", "0.67806214", "0.6777802", "0.6767778", "0.67661077" ]
0.0
-1
! Get all playlist
async function playlistIndex(req, res, next) { try { const playlist = await Playlist.find().populate('users').populate('user') res.status(200).json(playlist) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "all(){\n const playlists = this.repository.load();\n return playlists.map(playlist => new Playlist(playlist.name, playlist.songs));\n }", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getAllTracks() {\n // TODO: Return array of objects.\n return tdInstance.playlist();\n }", "function getPlaylistItems(data){\n\tgetPlaylistTracks(getTrackIDs, data.playlists.items[playlistLoop].id);\n}", "function requestPlaylist() {\n var request = gapi.client.youtube.playlists.list({\n channelId : channelId,\n part: 'contentDetails',\n maxResults: 50\n });\n request.execute(function(response) {\n console.log(response);\n var playlistArr = response.result.items;\n for(var i = 0 ; i < playlistArr.length ; i++){\n var item = playlistArr[i];\n var playlistId = item.id;\n requestVideoPlaylist(playlistId);\n }\n \n });\n}", "function getPlaylist() {\r\n return new Promise(function(resolve, reject) {\r\n var xhttp = new XMLHttpRequest();\r\n\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let playlist = JSON.parse(this.response);\r\n songs = [];\r\n\r\n for (var i = 0; i < playlist.length; i++) {\r\n playlistAdd(playlist[i]);\r\n songs.push(playlist[i]);\r\n \r\n }\r\n \r\n resolve(\"Got the playlist. Check song array.\");\r\n }\r\n };\r\n\r\n xhttp.onerror = function() {\r\n reject({\r\n status: this.status,\r\n statusText: this.statusText\r\n });\r\n };\r\n\r\n xhttp.open(\"GET\", \"playlist\", true);\r\n xhttp.send();\r\n });\r\n }", "async getPlaylists() {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n const userID = await this.getUserID();\n //GET method\n try {\n const response = await fetch(\n 'https://api.spotify.com/v1/me/playlists?limit=50',\n { headers: headers }\n );\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items\n .filter(playlist => playlist.owner.id === userID)\n .map(playlist => {\n return {\n id: playlist.id,\n name: playlist.name,\n tracksURL: playlist.tracks.href,\n image: playlist.images[1],\n uri: playlist.uri,\n };\n });\n }\n } else {\n throw new Error('Request to GET Playlists Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "function getPlaylist() {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/me/playlists';\n xhr.open(\"GET\", url);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }", "static getPlaylistAll (req, res) {\n\n Playlist.find().then(playLists => {\n\n const arrayToSend = []\n\n playLists.forEach(playList => { playList.users.forEach(u => { if (u.id === req.params.userId && playList.type === 'private') { arrayToSend.push(playList) } }) })\n playLists.forEach(playList => { if (playList.type === 'public') { arrayToSend.push(playList) } })\n playLists.forEach(p => {\n p.songs = _.sortBy(p.songs, ['grade'])\n\n })\n return res.json({ message: 'Your playLists', playLists: arrayToSend }) /* istanbul ignore next */\n }).catch(() => { return res.status(500).send({ message: 'Internal serveur error' }) })\n }", "function getSongList(){\n\t\t\tSongSheetAPI.index(\n\t\t\t\tfunction success(data){\n\t\t\t\t\tconsole.log('success', data);\n\t\t\t\t\t$scope.songSheets = data;\n\t\t\t\t},\n\t\t\t\tfunction error(data){\n\t\t\t\t\tconsole.log('error', data);\n\t\t\t\t}\n\t\t\t);\n\t\t}", "async fetch() {\n return await this.client.playlists.get(this.id, true);\n }", "function getPlaylists(){\n\n rp(requestPlaylists)\n .then(function(body) {\n var difference = diff(playlistsArray, body); // Compare old with new data\n if (difference) {\n io.emit('playlists', {\n playlists: body,\n userID: req.session.playlistOwner\n });\n }\n playlistsArray = body;\n })\n .catch(function(err) {\n console.log('error when loading playlists', err);\n socket.emit('offline' , err );\n // res.redirect('/');\n });\n }", "allPlaylistsList(){\n return this.state.playlists.map(current => {\n return (<Playlist playlist={current} key={current._id}/>)\n })\n }", "async function getPlaylists() {\n const result = await $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization': 'Bearer ' + access_token\n },\n error: function () {\n console.log(\"error fetching playlists!\");\n return;\n }\n });\n\n return result.items;\n}", "function getPlaylists(access_token, allCallSongs) {\n $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization':'Bearer ' + access_token\n },\n success: function(response) {\n $(\".recommendations\").show();\n generatePlaylistDropdown(response.items, allCallSongs);\n }\n });\n}", "function getPlaylistTracks(playlistId, options, getAll, callback) {\r\n let url = 'https://api.spotify.com/v1/playlists/' + playlistId + '/tracks';\r\n if (getAll) {\r\n delete options.offset;\r\n delete options.limit;\r\n var tracks = [];\r\n function recurse(res) {\r\n tracks = tracks.concat(res.items);\r\n if(res.next && tracks.length > 0) {\r\n callSpotify(res.next, {}, recurse);\r\n } else {\r\n res.items = tracks;\r\n callback(res);\r\n }\r\n }\r\n return callSpotify(url, options, recurse);\r\n }\r\n return callSpotify(url, options, callback);\r\n}", "getPlaylists(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylists()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.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}", "viewFriendsSongsInPlaylist(playlist_id){\n this.getPlaylist(playlist_id)\n }", "async function getPlaylistItems(listId) {\n\t// See https://developers.google.com/youtube/v3/docs/playlistitems/list\n\tvar res = await youtube.playlistItems.list({\n\t\tplaylistId: listId,\n\t\tpart: 'snippet',\n\t})\n\n\tconst videoIds = res.data.items.map(\n\t\t({ snippet }) => snippet.resourceId.videoId\n\t)\n\n\t// Now that we know the IDs of all the videos in the uploads list,\n\t// we can retrieve information about each video.\n\treturn await getVideosMetadata(videoIds)\n}", "function loadPlaylist() {\n myPlayer.catalog.getPlaylist('4450721964001', function(error, playlist) {\n myPlayer.catalog.load(playlist);\n playlistLength = myPlayer.playlist().length;\n });\n }", "function getPlaylist() {\n\t\treturn pls.id;\n\t}", "async getPlaylists() {\n try {\n let playlists = await spotifyWebApi.getUserPlaylists();\n this.setState({\n playlists: playlists,\n loading: false,\n selectedPlaylist: {\n id: playlists.items[0].id, \n }\n });\n } catch (error) {\n console.error('Get User Playlists error: ', error);\n }\n }", "function gotAllSongs(err) {\n console.log(\"gotAllSongs()\");\n\n // report an error, you'd want to do something better than this in production\n if (err) {\n console.log(\"error loading songs\");\n console.error(err);\n return;\n }\n\n // call functions to log and show the songs\n consoleLogSongs();\n showSongs();\n}", "function createPlaylist() {\n\tvar html = '<li data-i=\"all\">All</li>';\n\t$.each(playlistsData, function(k, v){\n\t\thtml += '<li data-i=\"'+ k +'\">'+ v.title +'</li>';\n\t});\n\t$playlist.html(html);\n}", "function getSongs(callback) {\n\n}", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "async function fetchPlaylists() {\n const libPath = await window.api.invoke('store-get', 'library')\n if (libPath === undefined) {\n empty(playlistsElement)\n error.show('You must select an iTunes library. This can be done in the application settings.')\n return\n }\n\n try {\n await library.open(libPath)\n } catch(err) {\n error.show('Failed to open iTunes library')\n }\n\n try {\n const playlists = await library.getPlaylists()\n await empty(playlistsElement)\n\n Object.entries(playlists).forEach(([key, value]) => {\n const shouldExclude = excludes.some(item => value[item])\n const excludeDownloaded = value.name === 'Downloaded' && value.distinguished_kind !== 65\n if (!shouldExclude && !excludeDownloaded) {\n const playlist = document.createElement('a')\n const span = document.createElement('span')\n playlist.setAttribute('href', '#')\n playlist.setAttribute('data-playlist-id', value.playlist_id)\n playlist.classList.add('playlist-item')\n playlist.innerHTML = `${icons.playlist}`\n span.innerText = `${value.name}`\n playlist.append(span)\n\n playlist.addEventListener('click', async({ currentTarget }) => {\n window.api.send('store-set', 'last-playlist', currentTarget.getAttribute('data-playlist-id'))\n\n // Remove current 'active' class\n const active = document.querySelector('.active')\n if (active !== null) {\n active.classList.remove('active')\n }\n\n // Add 'active' class to clicked item\n currentTarget.classList.add('active')\n\n // Empty current playlist tracks\n await empty(list)\n\n // Get the playlist tracks\n const playlistItems = await library.getPlaylistItems(value)\n\n // Append each playlist track to the table\n Object.entries(playlistItems).forEach(async([key, value]) => {\n const track = await library.getTrackById(value.track_id)\n await list.append(table.buildRow(track))\n\n const trackName = document.getElementById('track-name')\n if (trackName.getAttribute('data-track-id') !== undefined) {\n const trackId = document.querySelector(`[data-id=\"${trackName.getAttribute('data-track-id')}\"]`)\n if (trackId) {\n trackId.classList.add('is-playing')\n trackId.querySelector('.play-button').innerHTML = icons.pause\n }\n }\n })\n })\n\n playlistsElement.append(playlist)\n }\n })\n\n // Get a list of all tracks for the search\n tracks = await library.getTracks()\n\n // Click on the last playlist that was viewed\n const lastPlaylist = await window.api.invoke('store-get', 'last-playlist')\n if (lastPlaylist !== undefined) {\n document.querySelector(`[data-playlist-id=\"${lastPlaylist}\"]`).click()\n }\n\n table.sort()\n } catch(err) {\n empty(playlistsElement)\n error.show('There was an error parsing the iTunes library')\n }\n}", "getPlaylist() {\n return this.playlist;\n }", "function requestPlaylists(accessToken) {\n const options = {\n method: 'GET',\n url:\n 'https://www.googleapis.com/youtube/v3/playlists?part=snippet&mine=true',\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n json: true,\n }\n return request(options)\n}", "function getPlaylistSongs(value) {\n var songs = [];\n var index = 0;\n for (i = 1; i < user_playlists.length; i++) {\n if (value == user_playlists[i].name) {\n songs = user_playlists[i].songs;\n index = i;\n };\n };\n printFavoritesPlaylists(songs, 1, index);\n}", "function getPlaylist(id, params) {\n return playlist.get(id, params).then(function(message) {\n message.results = _.shuffle(message.results);\n console.log(message);\n return message;\n }).catch(function(err) {\n console.error(err);\n throw err;\n });\n}", "function showUserPlaylists() {\n getUserPlaylists().then(text => {\n var playlists = JSON.parse(text);\n for (var playlist in playlists) {\n console.log(playlist);\n if (playlist != 'favourites') {\n createAsidePlaylist(playlists[playlist]);\n }\n };\n });\n}", "function getAllPlaylists(options, userID) { \n var playlistsPromise = get(options);\n playlistsPromise.then(function (result) {\n var playlists = result.items;\n for (index in playlists) {\n var playlist = playlists[index];\n allTracksList[userID].push(playlist.tracks);\n }\n trackscount = 0\n for (index in allTracksList[userID]) {\n for (j in allTracksList[userID][index]) {\n trackscount += 1\n }\n }\n //paging\n if (result.next && allTracksList[userID].length < 75) {\n options['url'] = result.next;\n return getAllPlaylists(options, userID);\n } else {\n //Don't want to get rate-limited\n setTimeout(getAllTracks(userID), 5000);\n }\n });\n\n return playlistsPromise;\n }", "function requestPlaylist(channelId, pageToken) {\n //$('#video-container').html('');\n var requestOptions = {\n channelId: channelId,\n part: 'snippet',\n maxResults: 50\n };\n if (pageToken) {\n requestOptions.pageToken = pageToken;\n }\n var request = gapi.client.youtube.playlists.list(requestOptions);\n request.execute(function(response) {\n // Only show pagination buttons if there is a pagination token for the\n // next or previous page of results.\n nextPageToken = response.result.nextPageToken;\n\n if (nextPageToken) {\n requestPlaylist(channelId, nextPageToken);\n }\n\n var playlists = response.result.items;\n if (playlists) {\n $.each(playlists, function(index, item) {\n displayResult(item);\n });\n } else {\n $('#list-container').html('Sorry you have no playlists');\n }\n });\n}", "playlist() {\n return Playlists.findOne(playlistId);\n }", "async getPlaylistWithTracks(id) {\n const _this = this;\n const playlist = (await _this.props.spotifyAPI.getPlaylist(id)).body\n \n // if there is more tracks than the limit (100 by default)\n if (playlist.tracks.total > playlist.tracks.limit) {\n\n // Divide the total number of track by the limit to get the number of API calls\n for (let i = 1; i < Math.ceil(playlist.tracks.total / playlist.tracks.limit); i++) {\n\n const trackToAdd = (await _this.props.spotifyAPI.getPlaylistTracks(id, {\n offset: playlist.tracks.limit * i // Offset each call by the limit * the call's index\n })).body;\n\n // Push the retreived tracks into the array\n trackToAdd.items.forEach((item) => playlist.tracks.items.push(item));\n }\n }\n return playlist;\n }", "function get_playlists(APIKey , channelid , maxResults , callBackFunction ) {\n $.getJSON( \"https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelId=\" + channelid + \"&maxResults=\" + maxResults + \"&fields=etag%2Citems%2Ckind%2CnextPageToken%2CpageInfo&key=\" + APIKey ,\n //callback\n function(data) {\n var playlistContainer = [];\n data.items.forEach( function (element){\n playlistContainer.push(new PlayListObj(element.id , element.snippet.title, element.snippet.description , element.snippet.publishedAt , element.snippet.thumbnails.default.url));\n }, this);\n\n callBackFunction(playlistContainer);\n });\n}", "function getPlaylists(req, res) {\n\tconst playlists = {\n\t\t\"Wake Up Gently\": \"https://i.scdn.co/image/ab67706f0000000286de24710c7230fcb6e08c13\",\n\t\tRise: \"https://i.scdn.co/image/ab67706f000000022db541a3493ce312d4abc9dd\",\n\t\t\"#ThrowbackThursday\": \"https://i.scdn.co/image/ab67706f0000000297caa0117cf5c17830e83354\",\n\t\t\"Mellow Morning\": \"https://i.scdn.co/image/ab67706f0000000294d851cc78e04406e373f156\",\n\t\t\"Country Rock Classics\": \"https://i.scdn.co/image/ab67706f0000000246edbf0e750d9bab7073d801\",\n\t\t\"Peace Of Mind\": \"https://i.scdn.co/image/ab67706f00000002dc724966dfa4ccf0863fb04a\",\n\t};\n\tres.send(playlists);\n}", "function getAllPlaylists(options, userID) { \n //get a user's public playlists \n var playlistsPromise = get(options);\n playlistsPromise.then(function (result) {\n var playlists = result.items;\n //iterate through all playlists\n for (index in playlists) {\n var playlist = playlists[index];\n allTracksList[userID].push(playlist.tracks);\n }\n trackscount = 0\n //count number of playlists\n for (index in allTracksList[userID]) {\n for (j in allTracksList[userID][index]) {\n trackscount += 1\n }\n }\n //paging\n if (result.next && allTracksList[userID].length < 75) {\n options['url'] = result.next;\n return getAllPlaylists(options, userID);\n } else {\n //Don't want to get rate-limited\n setTimeout(getAllTracks(userID), 5000);\n }\n });\n\n return playlistsPromise;\n }", "async getPlaylistTracks(trackURL) {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n // GET method\n try {\n const response = await fetch(trackURL, { headers: headers });\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items.map(track => {\n return {\n id: track.track.id,\n name: track.track.name,\n artist: track.track.artists[0].name,\n album: track.track.album.name,\n uri: track.track.uri,\n preview: track.track.preview_url,\n };\n });\n }\n } else {\n throw new Error('Request to GET Top Tracks Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "async function getPlaylistInfo() {\n var playlistInfo = await queryDbOnce('/Playlists/' + vue.playlist);\n var info = playlistInfo.val();\n vue.currentSongId = info.Current;\n vue.allowExplicit = info.Settings['Allow Explicit Songs'];\n vue.allowSpotify = info.Settings.Spotify;\n vue.allowYoutube = info.Settings.Youtube;\n}", "function getPlaylistTracks(callback, playlistID){\n\tsettings = {\n\t\turl: `https://api.spotify.com/v1/users/Spotify/playlists/${playlistID}/tracks`,\n\t\theaders: {'Authorization': \"Bearer \"+ AUTHORIZATION_CODE},\n\t\tsuccess: callback,\n\t};\n\t$.ajax(settings);\n}", "async function getVideos(playlistId) {\r\n const videos = [];\r\n try {\r\n let pageToken = \"\";\r\n while (true) {\r\n const { data } = await service.playlistItems.list({\r\n part: [\"snippet\"],\r\n playlistId,\r\n maxResults: 5,\r\n pageToken,\r\n });\r\n videos.push(...data.items);\r\n\r\n if (!data.nextPageToken) break;\r\n pageToken = data.nextPageToken;\r\n }\r\n } catch (err) {\r\n console.error(`Failed to get videos. ${err.message}`);\r\n }\r\n\r\n return videos;\r\n}", "function getUserPlaylistSongs(currentPlaylist){\n // Empty out the object (if called another time)\n currentPlaylistSongObjects = [];\n // AJAX Call to get Selected Playlist's Songs and other info\n $.ajax({\n url: \"https://api.spotify.com/v1/users/\" + currentPlaylist.ownerID + \"/playlists/\" + currentPlaylist.playlistID + \"/tracks\",\n async : false,\n headers: {\n 'Authorization': 'Bearer ' + spotifyAccessToken\n }\n }).done(function(currentPlaylistResponse){\n\n // Loop Through the Playlists and get the IDs\n for(var i = 0; i < currentPlaylistResponse.items.length; i++){\n\n var newSongObject = {\n songName: currentPlaylistResponse.items[i].track.name,\n songID: currentPlaylistResponse.items[i].track.id,\n artistName: currentPlaylistResponse.items[i].track.artists[0].name,\n //albumCoverLink: currentPlaylistResponse.items[i].track.album.images[0].url\n };\n\n // Add Song Attributes Object to the PLay Array\n currentPlaylistSongObjects.push(newSongObject);\n }\n //console.log(currentPlaylistSongObjects)\n });\n }", "async playAll ({ state, dispatch }) {\n const plays = Object.keys(state.tracks)\n .map(track => dispatch('playTrack', track))\n\n const ids = await Promise.all(plays)\n return ids.flat()\n }", "function getPlaylistTracks(access_token, allCallSongs, request_url, playListTracks){\n var url = request_url || 'https://api.spotify.com/v1/playlists/' + $('select option:selected').val() + '/tracks'\n var playListTracks = (playListTracks || []);\n $.ajax({\n url: url,\n headers: {\n 'Authorization':'Bearer ' + access_token\n },\n success: function(response) {\n var tracks = generateTrackList(response.items, allCallSongs);\n console.log(tracks);\n tracks.map(function(track){\n playListTracks.push(track);\n })\n console.log(playListTracks);\n if(response.next) {\n getPlaylistTracks(access_token, allCallSongs, response.next, playListTracks);\n } else {\n console.log('done making spotify api requests for this playlist');\n $(\"#sortPane\").show();\n $(\"#controlPanel\").show();\n $('#playlistSwitcher').show();\n initNativePlays(playListTracks);\n writePlayListToPanel(playListTracks);\n initializePlayListControl(playListTracks);\n\n }\n }\n });\n}", "getPlaylist(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\t\tconst playlistId = args.playlistId;\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylist()');\n\t\t}\n\n\t\tif (!_.isString(playlistId)) {\n\t\t\tthrow new Error('A playlistId string is required for getPlaylist()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists/${playlistId}`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.access_token),\n\t\t\t\tquery: {}\n\t\t\t});\n\n\t\t\treturn this.makeRequest(args);\n\t\t});\n\t}", "function loadPlaylist(){\n let playlistID = this.dataset.id; // this.dataset is an object containing all attributes with \"data-\" before\n spotupdtr.getMissingTracks(playlistID); // Fetching the missing tracks of the playlist\n}", "getAllSongs() {\n Utils.get('/allSongs')\n .then((response) => {\n return response.json();\n })\n .then((json) => {\n Dispatcher.dispatch({\n type: ActionType.RECEIVE_ALL_SONGS,\n songs: json\n })\n })\n .catch((err) => {\n console.error('failed: ', err)\n })\n }", "async function getAllUserPlaylistTracks (uid, pid) {\n try {\n const spotify = createSpotify()\n let tracks = []\n // Batch size.\n const limit = 100\n // Track index.\n let offset = 0\n // Empty tracks guard variable.\n let empty = false\n while (!empty) {\n let options = { limit, offset }\n // Get tracks from playlist.\n const results = await spotify.getPlaylistTracks(uid, pid, options)\n .then(response => response.body.items )\n .catch(e => console.log(e) )\n // Add playlist tracks to tracks.\n if (results && results.length) {\n tracks = tracks.concat(results)\n // Offset track index for next batch.\n offset += 100\n } else {\n empty = true\n }\n }\n return tracks\n } catch (e) {\n throw e\n }\n}", "function getPlaylists() {\n\n\n \n var queryUrl = \"https://api.spotify.com/v1/me/playlists\"\n\n $.ajax({\n url: queryUrl,\n type: \"GET\",\n beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + _token); },\n success: function (response) {\n $(\"ul\").text(response.items[0].name)\n $(\"ul\").attr(\"value\", response.items[0].id)\n $(\"ul\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[0].images[0].url)\n $(\".album-page-name\").text(response.items[0].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(2)\").text(response.items[1].name)\n $(\"ul:nth-child(2)\").attr(\"value\", response.items[1].id)\n $(\"ul:nth-child(2)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[1].images[0].url)\n $(\".album-page-name\").text(response.items[1].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n\n $(\"ul:nth-child(3)\").text(response.items[2].name)\n $(\"ul:nth-child(3)\").attr(\"value\", response.items[2].id)\n $(\"ul:nth-child(3)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[2].images[0].url)\n $(\".album-page-name\").text(response.items[2].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(4)\").text(response.items[3].name)\n $(\"ul:nth-child(4)\").attr(\"value\", response.items[3].id)\n $(\"ul:nth-child(4)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[3].images[0].url)\n $(\".album-page-name\").text(response.items[3].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(5)\").text(response.items[4].name)\n $(\"ul:nth-child(5)\").attr(\"value\", response.items[4].id)\n $(\"ul:nth-child(5)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[4].images[0].url)\n $(\".album-page-name\").text(response.items[4].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(6)\").text(response.items[5].name)\n $(\"ul:nth-child(6)\").attr(\"value\", response.items[5].id)\n $(\"ul:nth-child(6)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[5].images[0].url)\n $(\".album-page-name\").text(response.items[5].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(7)\").text(response.items[6].name)\n $(\"ul:nth-child(7)\").attr(\"value\", response.items[6].id)\n $(\"ul:nth-child(7)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[6].images[0].url)\n $(\".album-page-name\").text(response.items[6].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(8)\").text(response.items[7].name)\n $(\"ul:nth-child(8)\").attr(\"value\", response.items[7].id)\n $(\"ul:nth-child(8)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[7].images[0].url)\n $(\".album-page-name\").text(response.items[7].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(9)\").text(response.items[8].name)\n $(\"ul:nth-child(9)\").attr(\"value\", response.items[8].id)\n $(\"ul:nth-child(9)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[8].images[0].url)\n $(\".album-page-name\").text(response.items[8].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(10)\").text(response.items[9].name)\n $(\"ul:nth-child(10)\").attr(\"value\", response.items[9].id)\n $(\"ul:nth-child(10)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[9].images[0].url)\n $(\".album-page-name\").text(response.items[9].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(11)\").text(response.items[10].name)\n $(\"ul:nth-child(11)\").attr(\"value\", response.items[10].id)\n $(\"ul:nth-child(11)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[10].images[0].url)\n $(\".album-page-name\").text(response.items[10].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(12)\").text(response.items[11].name)\n $(\"ul:nth-child(12)\").attr(\"value\", response.items[11].id)\n $(\"ul:nth-child(12)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[11].images[0].url)\n $(\".album-page-name\").text(response.items[11].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(13)\").text(response.items[12].name)\n $(\"ul:nth-child(13)\").attr(\"value\", response.items[12].id)\n $(\"ul:nth-child(13)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[12].images[0].url)\n $(\".album-page-name\").text(response.items[12].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(14)\").text(response.items[13].name)\n $(\"ul:nth-child(14)\").attr(\"value\", response.items[13].id)\n $(\"ul:nth-child(14)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[13].images[0].url)\n $(\".album-page-name\").text(response.items[13].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(15)\").text(response.items[14].name)\n $(\"ul:nth-child(15)\").attr(\"value\", response.items[14].id)\n $(\"ul:nth-child(15)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[14].images[0].url)\n $(\".album-page-name\").text(response.items[14].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(16)\").text(response.items[15].name)\n $(\"ul:nth-child(16)\").attr(\"value\", response.items[15].id)\n $(\"ul:nth-child(16)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[15].images[0].url)\n $(\".album-page-name\").text(response.items[15].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(17)\").text(response.items[16].name)\n $(\"ul:nth-child(17)\").attr(\"value\", response.items[16].id)\n $(\"ul:nth-child(17)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[16].images[0].url)\n $(\".album-page-name\").text(response.items[16].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(18)\").text(response.items[17].name)\n $(\"ul:nth-child(18)\").attr(\"value\", response.items[17].id)\n $(\"ul:nth-child(18)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[17].images[0].url)\n $(\".album-page-name\").text(response.items[17].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(19)\").text(response.items[18].name)\n $(\"ul:nth-child(19)\").attr(\"value\", response.items[18].id)\n $(\"ul:nth-child(19)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[18].images[0].url)\n $(\".album-page-name\").text(response.items[18].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n\n }\n})\n}", "allTracks(){\n return this.collecTracks(this.collectAlbums());\n }", "function requestPlaylist(playlistId) {\n const maxResults = 20;\n const playlistURL = `https://www.googleapis.com/youtube/v3/playlistItems?key=${apiKey}&playlistId=${playlistId}&part=snippet&maxResults=${maxResults}`;\n\n fetch(playlistURL)\n .then(res => res.json())\n .then(data => loadVideo(data));\n}", "async function getAllUserPlaylists (uid) {\n try {\n const spotify = createSpotify()\n let playlists = []\n const limit = 50\n // Playlist index.\n let offset = 0\n // Empty playlist guard variable.\n let empty = false\n while (!empty) {\n let options = { limit, offset }\n // Get user playlists.\n const results = await spotify.getUserPlaylists(uid, options)\n .then(response => response.body.items )\n // Add playlists to results.\n if (results && results.length) {\n playlists = playlists.concat(results)\n // Offset playlist index for next batch.\n offset += 50\n } else {\n empty = true\n }\n }\n return playlists\n } catch (e) {\n throw e\n }\n}", "function getSongPlaylist() {\n axios.get(contextPath + \"/read\")\n .then(res => {\n table.innerHTML = \"\";\n\n const SongPlaylists = res.data;\n console.log(SongPlaylists);\n\n SongPlaylists.forEach(SongPlaylist => {\n const newSongPlaylist = renderSongPlaylist(SongPlaylist);\n console.log(\"New SongPlaylist: \", newSongPlaylist);\n table.appendChild(newSongPlaylist);\n });\n }).catch(err => console.error(err))\n}", "function fetchPlaylists(){\n $('#playlists').empty();\n /* listing the playlists */\n $.get(SERVER_ADDRESS+'/playlist',function(data){\n data = String(data);\n var playlists = data.split(\",\");\n if (playlists[0] != ''){\n for (var i=0; i<playlists.length; i++){\n $('#playlists').append(\"<div class='playlist_wrap'><div class='playlist_div'><div class='delete_pl'><button class='pl_delete_button ui-btn-icon-notext ui-btn ui-icon-delete ui-btn-icon-left ui-btn-b'></button></div><h3>\"+ playlists[i] + \"</h3></div></div>\");\n }\n }\n });\n}", "function getChannelPlaylists(channel, pageToken, resultArr) {\n\n youtube.playlists.list({\n part: 'snippet',\n key: key,\n channelId: channel,\n maxResults: 50,\n pageToken: pageToken\n }).then((res) => putPlaylistsInArray(channel, res, resultArr))\n .catch((err) => {\n console.log('getChannelPlaylists ' + err);\n crawlChannels(++crawlIter);\n }\n );\n\n}", "function _readPlaylist () {\n\n\t\tthis.albums = (typeof this.settings.playlist.albums != 'undefined') ? this.settings.playlist.albums : [];\n\t\tthis.tracks = (typeof this.settings.playlist.tracks != 'undefined') ? this.settings.playlist.tracks : [];\n\n\t\t_sortTracks.apply(this);\n\n\t\tthis.currentSoundtrack = this.tracks[0].id;\n\n\t\tthis.debug('Playlist: '+ this.albums.length +' albums, '+ this.tracks.length +' soundtracks');\n\n\t}", "function getSongs() {\n\n var spotify = new Spotify(keys.spotify);\n\n var songName = process.argv[3];\n\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(data.tracks.items[0].artists[0].name);\n console.log(data.tracks.items[0].album.name);\n console.log(data.tracks.items[0].name);\n console.log(data.tracks.items[0].external_urls.spotify);\n });\n\n\n}", "function gotAllSongs(err) {\r\n console.log(\"gotAllSongs()\");\r\n\r\n // report an error, you'd want to do something better than this in production\r\n if (err) {\r\n console.log(\"error loading songs\");\r\n console.error(err);\r\n return;\r\n }\r\n\r\n // call functions to log and show the books\r\n consoleLogSongs();\r\n showSongs();\r\n}", "function getPlaylist(info) {\n $http.get(\"/playlist/\" + $rootScope.userLog).then(function (response) {\n if (response.status == 200) {\n $scope.playlist = response.data.playlist;\n username.innerHTML = response.data.username;\n }\n });\n }", "function handleAPILoaded() {\n requestPlaylist();\n}", "function listSongs () {\n $.getJSON(\"/songs\", function(songs){\n $.each(songs, function(index, song) {\n var the_song = new Song(song)\n $(\"#song_list\").append(the_song.formatSong())\n })\n })\n}", "async function songs(req, res, next) {\n try {\n const { playlistId } = req.params\n const playlist = await Playlist.findById(playlistId).populate('songs')\n if (!playlist) {\n throw new NotFound(`Playlist with id: ${playlistId} does not exist.`)\n }\n res.status(200).json(playlist.songs)\n } catch (err) {\n next(err)\n }\n}", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "async function refreshPlaylistUrls(playlist) {\n var command = '/song/url?id='\n for(var i=0;i<playlist.length;i++) {\n command += playlist[i].id + ','\n }\n command = command.substr(0, command.length-1)\n url = host + command\n\n const res = await req('GET', url, '')\n let data = processHotSongs(res.body)\n addPlaylist(data.data)\n\n return data.data\n\n}", "function getVids(playlist){\n //get videos from selected playlist\n $.get(\n \"https://www.googleapis.com/youtube/v3/playlistItems\", {\n part:'snippet',\n maxResults: 5,\n playlistId: playlist,\n key: apiKey\n },\n function(data){\n //parse data from api\n var output;\n $.each(data.items, function(i, item){\n console.log(item);\n var vidTitle = item.snippet.title;\n var videoId = item.snippet.resourceId.videoId;\n var videoDate = item.snippet.publishedAt;\n var prettyVideoDate = new Date(videoDate).toDateString();\n var videoDesc = item.snippet.description;\n //collect result\n output = '<p><h1>'+vidTitle+'</h1><p>'+videoDesc+'</p><p>'+prettyVideoDate+'</p><iframe height=\"'+vidHeight+'\" width=\"'+vidWidth+'\"src=\\\"//www.youtube.com/embed/'+videoId+'\\\"></iframe></p><hr>';\n\n //append result to content div \n $('#content').append(output);\n\n });// end .each\n }\n );//end get\n }", "function playAplaylist(data, playCurrent = false) {\n\n let arr = []\n let songs = []\n console.log(data)\n if (data.length > 0) {\n data.map((song) => {\n console.log(song)\n arr.push(song.Content.videoId)\n songs.push(song.Content)\n })\n\n updatePlayerState({\n isPlaying: true,\n playlist: songs,\n songPlaying: songs[0],\n playedSongIndex: 0,\n playlistVideoIds: arr\n })\n }\n }", "function getTracks() {\n vm.loader.start();\n MainService.getTracks()\n .then(function (response) {\n vm.trackList = response.data.tracks.track;\n })\n .finally(function() {\n vm.loader.complete();\n });\n }", "getSongs() {\n\t\treturn this.songs;\n\t}", "async function getData(userID) {\n console.log(\"Getting list of all playlists...\");\n\n const data = {};\n\n // get the first 50 playlists (if the user has that many)\n let playlistRequest = await spotifyApi.getUserPlaylists(userID, {\n limit: 50\n });\n\n // create an array with all the playlists\n // filter out spotify stuff because they could get mad that we're scraping their playlists (see: SongShift)\n data.playlists = playlistRequest.body.items.filter(x => x.owner.display_name != \"Spotify\");\n\n // while the user still has more playlists to go, get those too\n let i = 1;\n while (playlistRequest.body.next)\n {\n // get the next 50 playlists from the user (if they have that many)\n playlistRequest = await spotifyApi.getUserPlaylists(userID, {\n limit: 50,\n offset: 50 * i\n });\n\n // add the playlists to the array\n data.playlists.push(...playlistRequest.body.items);\n \n // increment counter for the offset\n i++;\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n console.log(\"Got list of all playlists!\");\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 4000));\n\n // for each playlist, get the tracks\n const artistIDs = [];\n for (const playlist of data.playlists)\n {\n console.log(`Downloading tracks information for ${playlist.name}...`);\n\n // get the list of tracks for the playlist\n let tracksRequest = await spotifyApi.getPlaylistTracks(playlist.id, {\n limit: 50\n });\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n\n // get audio features for tracks\n let trackIDs = tracksRequest.body.items.map(x => x.track.id);\n let audioFeaturesRequest = await spotifyApi.getAudioFeaturesForTracks(trackIDs);\n let features = audioFeaturesRequest.body.audio_features;\n tracksRequest.body.items.forEach((x, i) => x.track.audio_features = features[i]);\n\n // add the tracks to the tracks array\n playlist.tracks.list = tracksRequest.body.items;\n\n // if the playlist has more than 50 tracks, get those too\n let i = 1;\n while (tracksRequest.body.next)\n {\n // get the next 50 songs from the playlist\n tracksRequest = await spotifyApi.getPlaylistTracks(playlist.id, {\n limit: 50,\n offset: 50 * i\n });\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n\n // get audio features for tracks\n trackIDs = tracksRequest.body.items.map(x => x.track.id);\n audioFeaturesRequest = await spotifyApi.getAudioFeaturesForTracks(trackIDs);\n features = audioFeaturesRequest.body.audio_features;\n tracksRequest.body.items.forEach((x, i) => x.track.audio_features = features[i]);\n\n // add the tracks to the tracks array\n playlist.tracks.list.push(...tracksRequest.body.items);\n\n i++;\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n // get all unique artists from playlist\n playlist.tracks.list.forEach(obj => {\n obj.track.artists.forEach(x => {\n if (!artistIDs.includes(x.id))\n {\n artistIDs.push(x.id);\n }\n });\n });\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 2000));\n }\n\n console.log(\"Getting artists information...\");\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 4000));\n\n // download artist information\n data.artists = [];\n for (let i = 0; i < artistIDs.length; i += 50)\n {\n const artistsRequest = await spotifyApi.getArtists(artistIDs.slice(i, i + 50));\n data.artists.push(...artistsRequest.body.artists);\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n console.log(\"Playlist data download complete!\");\n\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n}", "function loadPlaylistData(player, result) {\n player_playlist[player].remove();\n\n var playlistItems = [];\n for (var i = 0; i < result.length; i++) {\n playlistItems.push({\n title: (result[i].name.length > 50 ? (result[i].name.substring(0, 50) + \"...\") : result[i].name),\n name: result[i].name,\n mp3: result[i].path,\n id: result[i].id\n });\n }\n player_playlist[player].setPlaylist(playlistItems);\n}", "getPlaylist(playlistResolvable) {\n return __awaiter(this, void 0, void 0, function* () {\n const id = yield this.getId(playlistResolvable, 'playlist');\n return this.getItemById(entities_1.Playlist, id);\n });\n }", "function getUserPlaylistIDs(){\n // Empty out the array (if previously called set)\n userPlaylistObjects = [];\n\n // AJAX Call to get the User's Playlists (using the Access Token)\n $.ajax({\n url: \"https://api.spotify.com/v1/users/\" + userSpotifyId + \"/playlists\",\n headers: {\n 'Authorization': 'Bearer ' + spotifyAccessToken\n }\n }).done(function(userPlaylistResponse){\n // Loop Through the Playlists and get the IDs\n for(var i = 0; i < userPlaylistResponse.items.length; i++){\n\n var newPlaylistObject = {\n name: userPlaylistResponse.items[i].name,\n playlistID: userPlaylistResponse.items[i].id,\n ownerID: userPlaylistResponse.items[i].owner.id,\n plalyistChildren: []\n };\n\n // Add Playlist IDs to array\n userPlaylistObjects.push(newPlaylistObject);\n }\n });\n }", "async function loadSongs() {\n for await (const song of dbmanager.getAllSongs()) {\n win.webContents.send(\"add-song-to-list\", song);\n }\n}", "function loadPlaylist() {\n \n \n var embargo_str = (options.has_embargo) ? \" displaydatetime:[* TO NOW]\" : \"\";\n \n //LOAD THE JSON FOR THE PLAYLIST VIA SITE SEARCH\n var dataURL = 'https://www.washingtonpost.com/apps/national/proxy/methode/sitesearch/' + \n \t'?q=tag:\"' + options.video_tag + \n \t'\"&fq=contenttype:\"Video\"' + \n \t embargo_str + //if embargoed, add tonow\n \t'&start=0&' + \n \t'rows='+ options.max_videos +\n \t'&fl=embedcode,headline,subheadline,credit,blurb,imageurl,displaydatetime,pubdatetime,contentbinaryurl,smallthumburl,systemid&' + \n \t'wt=json&' +\n \t'omitHeader=true&' + \n \t'tracking=video-series-player-' + options.video_tag + \n \t'&json.wrf=jQuery.playlistLoaded';\n \t \t\n $.ajax({\n url: dataURL,\n dataType: 'jsonp',\n jsonpCallback: 'jQuery.playlistLoaded',\n context: document.body,\n cache: true\n })\n }", "getAllTracks()\n {\n let res = [];\n \n for (let i=0; i<this.albums.length;i++){\n res = res.concat(this.albums[i].getTracks())\n }\n return res;\n\n }", "function getVideosInPlaylist(name) {\r\n\tvar data = {};\r\n\tdata[\"playlistName\"] = name;\r\n\tvar js = JSON.stringify(data);\r\n\t\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.open(\"POST\", getVideosInPlaylistURL, true);\r\n\txhr.send(js);\r\n\t\r\n\txhr.onloadend = function () {\r\n\t\tif (xhr.readyState == XMLHttpRequest.DONE) {\r\n\t\t\tconsole.log (\"XHR:\" + xhr.responseText);\r\n\t\t\tclearPlaylistVideos();\r\n\t\t\tprocessPlaylistVideos(xhr.responseText);\r\n\t\t} else {\r\n\t\t}\r\n\t};\r\n}", "getList(){\n var html = \"\"\n playList.forEach(song => {\n const id = song.id\n const extraClass = id === selectedVideo ? \"selected\" : \"\"\n html += `<div class=\"playlist-song ${extraClass}\">\n <div id=\"${id}\">${song.title}</div>\n <div id=\"delete${id}\" class=\"playlist-song-delete\"> x </div>\n </div>` \n })\n return html\n }", "async getSongsFromPlaylist(request, h) {\n try {\n const { playlistId } = request.params;\n console.log(playlistId);\n const { id: credentialId } = request.auth.credentials;\n await this._playlistsService.verifyPlaylistAccess(\n playlistId,\n credentialId\n );\n const data = await this._playlistssongService.getSongsFromPlaylist(\n playlistId\n );\n const response = h.response({\n status: 'success',\n data: {\n songs: data,\n },\n });\n response.code(200);\n return response;\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n console.log(error);\n return response;\n }\n\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami',\n });\n response.code(500);\n console.log(error);\n return response;\n }\n }", "function getProviderPlaylists() {\n let playlistsRequest = new Request(`http://${PROXY_SERVER}/playlists/`);\n let headers = playlistsRequest.headers;\n headers.append('X-Audiowings-DeviceId', MAC_ADDRESS);\n return fetch(playlistsRequest)\n .then(status)\n .then(response => response.json())\n .catch(error => console.log(':( Request failed', error));\n}", "function showAll() {\n searchForSongs();\n displayAudioBookInformation();\n }", "function processGetPlaylists(resultArr) {\n if ((!resultArr) || (resultArr == '')) {\n $('#playlistslist').empty();\n return;\n }\n var tmp = '', favourites = '', starred = '';\n\n for (var i = 0; i < resultArr.length; i++) {\n var li_html = '<li><a href=\"#\" onclick=\"return showTracklist(this.id);\" id=\"' + resultArr[i].uri + '\">';\n if(isSpotifyStarredPlaylist(resultArr[i])) {\n starred = li_html + '&#9733; Spotify Starred Tracks</a></li>' + tmp;\n } else if (isFavouritesPlaylist(resultArr[i])) {\n favourites = li_html + '&hearts; Musicbox Favourites</a></li>';\n } else {\n tmp = tmp + li_html + '<i class=\"' + getMediaClass(resultArr[i].uri) + '\"></i> ' + resultArr[i].name + '</a></li>';\n }\n };\n // Prepend the user's Spotify \"Starred\" playlist and favourites to the results. (like Spotify official client).\n tmp = favourites + starred + tmp;\n $('#playlistslist').html(tmp);\n scrollToTracklist();\n showLoading(false);\n}", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "function getRandomPlaylist() {\n\t var randomPlaylist = [];\n var randoNum = Math.floor(Math.random() * playlistIds.length);\n return playlistIds[randoNum];\n }", "async getAllMusicPlaylistHandler(request, h) {\n try {\n const { playlistId } = request.params;\n const { id: credentialId } = request.auth.credentials;\n\n // await this._service.verifyPlaylistsOwner(playlistId, credentialId);\n await this._service.verifyPlaylistAccess(playlistId, credentialId);\n\n const songs = await this._service.getAllMusicPlaylist(playlistId);\n\n return {\n status: 'success',\n data: {\n songs,\n },\n };\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n return response;\n }\n\n // Server ERROR!\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami.',\n\n });\n response.code(500);\n console.error(error);\n return response;\n }\n }", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "getPlaylistItems(playlistResolvable, maxResults = -1) {\n return __awaiter(this, void 0, void 0, function* () {\n const playlistId = yield this.getId(playlistResolvable, 'playlist');\n return this.getPaginatedItems('playlistItems', playlistId, maxResults);\n });\n }", "function getSpotifyPlaylist(callback, category){\n\tconst settings = {\n\t\theaders: {'Authorization': \"Bearer \"+ AUTHORIZATION_CODE},\n\t\turl: `https://api.spotify.com/v1/browse/categories/${category}/playlists`,\n\t\tsuccess: callback,\n\t\terror: \"Error getting playlist\"\n\t};\n\t$.ajax(settings)\n}", "searchPlaylists(searchTerm, maxResults = 10) {\n return this.search([entities_1.Playlist], searchTerm, maxResults);\n }", "function loadPlaylistData() {\n\t\t// clear any old info\n\t\t$(\"#playlist\")\n\t\t\t.empty()\n .append(\"<option value='select'>(Select playlist)</option>\")\n .val(\"select\");\n\t\n\t\t// populate playlist dropdown\n\t\tvar userLib = Library.forCurrentUser();\n\t\tuserLib.playlists.snapshot().done(function (snapshot) {\n\t\t\tvar l = snapshot.length;\n\t\t\tfor (var i = 0; i < l; i++) {\n\t\t\t\tvar playlist = snapshot.get(i);\n\t\t\t\t$(\"#playlist\").append($(\"<option />\").val(i).text(playlist.name));\n\t\t\t}\n\t\t});\n\t}", "getPlaying() {\n return apiClient.get(\n '/movie/now_playing?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3&language=en-US&page=1'\n )\n }", "function playListAction(res){\n\n\tclient.playlist.listAction(function(data){\n\t\tcallbackResult(res,data);\n\t});\n\n}", "function getAll(){\n\tvar pictures = document.getElementById(\"picture\");\n\taudio.src = SingleList[i].audio;\n\tpictures.src = SingleList[i].picture;\n\t$('#nowplay').html(SingleList[i].artistSong());\n\t\n\taudio.play();\n\n}", "function requestUserUploadsPlaylistId() {\n var request = gapi.client.youtube.videos.list({\n part: 'snippet',\n chart: 'mostPopular',\n // myRating: 'like',\n maxResults: 20,\n });\n request.execute(function(response) {\n var foo = response.items;\n for(var i=0; i<foo.length; i++) {\n var str = response.items[i].id;\n $('#video-container').append(\"<iframe width='640' height='320' src='https://www.youtube.com/embed/\"+str+\"'>\");\n }\n })\n}", "static getPlaylistDataById(playlistId) {\n return fetch(`http://localhost:8888/getplaylistdata/${playlistId}`, {\n }).then(response => {\n return response.json().then(data => {\n return data\n })\n })\n }", "function getMp3 ()\n{\n var url = controller_url + \"?action=lib_display\";\n\n // get mp3 file list in json\n $.getJSON(url, function (mp3)\n {\n // log('result :', mp3);\n\n if (mp3)\n {\n $.each(mp3, function(i, val){\n var pos = val.file.lastIndexOf(\"/\");\n\n path = val.file.substr(0, pos);\n file = val.file.substr(pos+1);\n\n $('#filelist').append(\"<li><span class='add_song' s_id='\" + val.s_id['$id'] + \"' path='\" + path + \"' title='click to add to playlist'>\" + file + \"</span><img s_id='\" + val.s_id['$id'] + \"' class='float_right_button tag' alt='[Tag]' title='show/edit tags' /></li>\");\n });\n\n // default initial action:\n // - add first song to playlist\n $('#filelist .add_song:first').trigger( \"click\" );\n // - load first song\n $('.play_song:first()').trigger('click');\n }\n });\n\n return;\n}", "function processGetPlaylists(playlists){\n if ((!playlists) || (playlists == '')) {return;}\n for (var i = 0; i < playlists.length; i++) {\n\n var playlist = playlists[i];\n var duration = 0;\n\n for(var j = 0; j<playlist.tracks.length; j++){\n duration += playlist.tracks[j].length;\n }\n\n playlist.duration = msToTime(duration); //utils.js\n addPlaylist(playlists[i]); //playlists.js\n };\n}", "getAll() {\n return this.tvShows;\n }" ]
[ "0.81852", "0.7510527", "0.7510527", "0.7462374", "0.7383023", "0.7202821", "0.7182557", "0.7167615", "0.7121504", "0.7111514", "0.7035671", "0.701547", "0.6936919", "0.6874141", "0.686161", "0.6809825", "0.67979085", "0.67469066", "0.67429394", "0.67006695", "0.6695995", "0.6679696", "0.6673166", "0.66679025", "0.66489375", "0.66314924", "0.6627596", "0.6625333", "0.66083467", "0.65780646", "0.6572653", "0.6567629", "0.65666693", "0.65487576", "0.65396416", "0.65363765", "0.652577", "0.65149176", "0.649937", "0.64742875", "0.64620554", "0.64590544", "0.6440052", "0.64008886", "0.63885736", "0.6386622", "0.6368849", "0.63559365", "0.63464093", "0.6318006", "0.63170564", "0.63112783", "0.6297998", "0.62784207", "0.62680036", "0.6267054", "0.6252837", "0.6250072", "0.624945", "0.62486786", "0.62443036", "0.6241193", "0.62265587", "0.62263846", "0.62211245", "0.61972636", "0.6194051", "0.6188165", "0.61838216", "0.617897", "0.6176995", "0.6171689", "0.616768", "0.6164166", "0.6156193", "0.61557233", "0.6154152", "0.61508864", "0.6146956", "0.61468023", "0.6139267", "0.6129556", "0.6128234", "0.61067474", "0.61016005", "0.6094738", "0.6094606", "0.6080303", "0.60781336", "0.60712826", "0.6069564", "0.60660964", "0.60650456", "0.6063244", "0.6061652", "0.60286623", "0.60065734", "0.6005781", "0.6001232", "0.5999139" ]
0.63256234
49
! Get a Users Playlists
async function getUsersPlaylist(req, res, next) { try { req.body.user = req.currentUser const userplaylist = await Playlist.find({ user: req.body.user._id, }).populate('songs') return res.status(200).send(userplaylist) } catch (e) { next(e) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async getPlaylists() {\n try {\n let playlists = await spotifyWebApi.getUserPlaylists();\n this.setState({\n playlists: playlists,\n loading: false,\n selectedPlaylist: {\n id: playlists.items[0].id, \n }\n });\n } catch (error) {\n console.error('Get User Playlists error: ', error);\n }\n }", "async getPlaylists() {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n const userID = await this.getUserID();\n //GET method\n try {\n const response = await fetch(\n 'https://api.spotify.com/v1/me/playlists?limit=50',\n { headers: headers }\n );\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items\n .filter(playlist => playlist.owner.id === userID)\n .map(playlist => {\n return {\n id: playlist.id,\n name: playlist.name,\n tracksURL: playlist.tracks.href,\n image: playlist.images[1],\n uri: playlist.uri,\n };\n });\n }\n } else {\n throw new Error('Request to GET Playlists Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "getPlaylists(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylists()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.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}", "async fetch() {\n return await this.client.playlists.get(this.id, true);\n }", "async function getAllUserPlaylists (uid) {\n try {\n const spotify = createSpotify()\n let playlists = []\n const limit = 50\n // Playlist index.\n let offset = 0\n // Empty playlist guard variable.\n let empty = false\n while (!empty) {\n let options = { limit, offset }\n // Get user playlists.\n const results = await spotify.getUserPlaylists(uid, options)\n .then(response => response.body.items )\n // Add playlists to results.\n if (results && results.length) {\n playlists = playlists.concat(results)\n // Offset playlist index for next batch.\n offset += 50\n } else {\n empty = true\n }\n }\n return playlists\n } catch (e) {\n throw e\n }\n}", "function requestPlaylists(accessToken) {\n const options = {\n method: 'GET',\n url:\n 'https://www.googleapis.com/youtube/v3/playlists?part=snippet&mine=true',\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n json: true,\n }\n return request(options)\n}", "function getPlaylists(){\n\n rp(requestPlaylists)\n .then(function(body) {\n var difference = diff(playlistsArray, body); // Compare old with new data\n if (difference) {\n io.emit('playlists', {\n playlists: body,\n userID: req.session.playlistOwner\n });\n }\n playlistsArray = body;\n })\n .catch(function(err) {\n console.log('error when loading playlists', err);\n socket.emit('offline' , err );\n // res.redirect('/');\n });\n }", "function getUserPlaylists(userId) {\n return new Promise(function (fulfill, reject) {\n \n // Ensure connection exists\n if (!pool) return reject(\"Not connected to DB.\");\n\n // Execute the query and transition promise state\n pool.query('SELECT `id`, `uri` FROM `playlist` WHERE `userId` = ?', \n [userId], function(error, results, fields) {\n\n if (results === undefined || results.length == 0) {\n return reject(error ? error : \n \"No results found for user \" + userId);\n }\n\n // Purify the playlists object\n playlists = results.map(function(item) {\n return {'id': item['id'], 'uri': item['uri']};\n });\n\n return fulfill(playlists);\n });\n });\n}", "function showUserPlaylists() {\n getUserPlaylists().then(text => {\n var playlists = JSON.parse(text);\n for (var playlist in playlists) {\n console.log(playlist);\n if (playlist != 'favourites') {\n createAsidePlaylist(playlists[playlist]);\n }\n };\n });\n}", "function listOfUsers() {\n request.get('https://slack.com/api/users.list?token='+\n process.env.Apptoken+'&pretty=1',function (err,requ,response)\n {\n var data= JSON.parse(response);\n usersLists=data.members;\n });//end of get users.list function\n}", "async function getPlaylists() {\n const result = await $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization': 'Bearer ' + access_token\n },\n error: function () {\n console.log(\"error fetching playlists!\");\n return;\n }\n });\n\n return result.items;\n}", "function getPlaylists(access_token, allCallSongs) {\n $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization':'Bearer ' + access_token\n },\n success: function(response) {\n $(\".recommendations\").show();\n generatePlaylistDropdown(response.items, allCallSongs);\n }\n });\n}", "function getAllPlaylists(options, userID) { \n //get a user's public playlists \n var playlistsPromise = get(options);\n playlistsPromise.then(function (result) {\n var playlists = result.items;\n //iterate through all playlists\n for (index in playlists) {\n var playlist = playlists[index];\n allTracksList[userID].push(playlist.tracks);\n }\n trackscount = 0\n //count number of playlists\n for (index in allTracksList[userID]) {\n for (j in allTracksList[userID][index]) {\n trackscount += 1\n }\n }\n //paging\n if (result.next && allTracksList[userID].length < 75) {\n options['url'] = result.next;\n return getAllPlaylists(options, userID);\n } else {\n //Don't want to get rate-limited\n setTimeout(getAllTracks(userID), 5000);\n }\n });\n\n return playlistsPromise;\n }", "async getPlaylists(users) {\n const query = {\n text: `SELECT playlists.id, playlists.name, users.username FROM playlists \n LEFT JOIN users ON users.id = playlists.owner\n LEFT JOIN collaborations ON playlists.id = collaborations.playlist_id\n WHERE playlists.owner = $1 OR collaborations.user_id = $1;`,\n values: [users],\n }\n \n const result = await this._pool.query(query)\n return result.rows\n }", "function getPlaylists(req, res) {\n\tconst playlists = {\n\t\t\"Wake Up Gently\": \"https://i.scdn.co/image/ab67706f0000000286de24710c7230fcb6e08c13\",\n\t\tRise: \"https://i.scdn.co/image/ab67706f000000022db541a3493ce312d4abc9dd\",\n\t\t\"#ThrowbackThursday\": \"https://i.scdn.co/image/ab67706f0000000297caa0117cf5c17830e83354\",\n\t\t\"Mellow Morning\": \"https://i.scdn.co/image/ab67706f0000000294d851cc78e04406e373f156\",\n\t\t\"Country Rock Classics\": \"https://i.scdn.co/image/ab67706f0000000246edbf0e750d9bab7073d801\",\n\t\t\"Peace Of Mind\": \"https://i.scdn.co/image/ab67706f00000002dc724966dfa4ccf0863fb04a\",\n\t};\n\tres.send(playlists);\n}", "function getPlaylistSongs(value) {\n var songs = [];\n var index = 0;\n for (i = 1; i < user_playlists.length; i++) {\n if (value == user_playlists[i].name) {\n songs = user_playlists[i].songs;\n index = i;\n };\n };\n printFavoritesPlaylists(songs, 1, index);\n}", "function requestPlaylist() {\n var request = gapi.client.youtube.playlists.list({\n channelId : channelId,\n part: 'contentDetails',\n maxResults: 50\n });\n request.execute(function(response) {\n console.log(response);\n var playlistArr = response.result.items;\n for(var i = 0 ; i < playlistArr.length ; i++){\n var item = playlistArr[i];\n var playlistId = item.id;\n requestVideoPlaylist(playlistId);\n }\n \n });\n}", "function getAllPlaylists(options, userID) { \n var playlistsPromise = get(options);\n playlistsPromise.then(function (result) {\n var playlists = result.items;\n for (index in playlists) {\n var playlist = playlists[index];\n allTracksList[userID].push(playlist.tracks);\n }\n trackscount = 0\n for (index in allTracksList[userID]) {\n for (j in allTracksList[userID][index]) {\n trackscount += 1\n }\n }\n //paging\n if (result.next && allTracksList[userID].length < 75) {\n options['url'] = result.next;\n return getAllPlaylists(options, userID);\n } else {\n //Don't want to get rate-limited\n setTimeout(getAllTracks(userID), 5000);\n }\n });\n\n return playlistsPromise;\n }", "static getPlaylistAll (req, res) {\n\n Playlist.find().then(playLists => {\n\n const arrayToSend = []\n\n playLists.forEach(playList => { playList.users.forEach(u => { if (u.id === req.params.userId && playList.type === 'private') { arrayToSend.push(playList) } }) })\n playLists.forEach(playList => { if (playList.type === 'public') { arrayToSend.push(playList) } })\n playLists.forEach(p => {\n p.songs = _.sortBy(p.songs, ['grade'])\n\n })\n return res.json({ message: 'Your playLists', playLists: arrayToSend }) /* istanbul ignore next */\n }).catch(() => { return res.status(500).send({ message: 'Internal serveur error' }) })\n }", "async function searchUserPlaylists (uid, name) {\n try {\n // Search for playlists.\n return await getAllUserPlaylists(uid)\n .then(response => response.filter(playlist =>\n // Convert to lower case for flexible matching.\n name.toLowerCase() === playlist.name.toLowerCase()))\n .catch(e => console.log(e))\n } catch (e) {\n throw e\n }\n}", "function getProviderPlaylists() {\n let playlistsRequest = new Request(`http://${PROXY_SERVER}/playlists/`);\n let headers = playlistsRequest.headers;\n headers.append('X-Audiowings-DeviceId', MAC_ADDRESS);\n return fetch(playlistsRequest)\n .then(status)\n .then(response => response.json())\n .catch(error => console.log(':( Request failed', error));\n}", "function getUserList(tok) {\n\treturn new Promise(function(resolve, reject) {\n\t\trequest.get('https://slack.com/api/users.list?token='+tok,\n\t\t\tfunction (error, response, body) {\n\t\t\t\tif (error) {\n\t\t\t\t\treject(error);\n\t\t\t\t} else {\n //console.log(body);\n resolve(JSON.parse(body));\n }\n });\n\t});\n}", "function getUserList() {\n \n return userList;\n }", "function getChannelPlaylists(channel, pageToken, resultArr) {\n\n youtube.playlists.list({\n part: 'snippet',\n key: key,\n channelId: channel,\n maxResults: 50,\n pageToken: pageToken\n }).then((res) => putPlaylistsInArray(channel, res, resultArr))\n .catch((err) => {\n console.log('getChannelPlaylists ' + err);\n crawlChannels(++crawlIter);\n }\n );\n\n}", "queryLists() {\n fetch(\"https://deco3801-oblong.uqcloud.net/wanderlist/get_bucketlist_belonging_to_user/\" + this.state.userData.id)\n .then(response => response.json())\n .then(obj => this.loadLists(obj));\n }", "function get_playlists(APIKey , channelid , maxResults , callBackFunction ) {\n $.getJSON( \"https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelId=\" + channelid + \"&maxResults=\" + maxResults + \"&fields=etag%2Citems%2Ckind%2CnextPageToken%2CpageInfo&key=\" + APIKey ,\n //callback\n function(data) {\n var playlistContainer = [];\n data.items.forEach( function (element){\n playlistContainer.push(new PlayListObj(element.id , element.snippet.title, element.snippet.description , element.snippet.publishedAt , element.snippet.thumbnails.default.url));\n }, this);\n\n callBackFunction(playlistContainer);\n });\n}", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`listUsers:${util.inspect(res.body)}`);\r\n return res.body\r\n}", "function sendMyPlaylists() {\n var playlists = [];\n $(\"#playlists\").children(\"a\").each(function() {\n playlists.push({title: $.trim($(this).find(\".tooltip\").text()), titleLink: getLink($(this))});\n });\n post(\"player-navigationList\", {type: \"playlistsList\", link: \"myPlaylists\", list: playlists, empty: playlists.length === 0});\n }", "function requestUserPlaylistId() {\n // See https://developers.google.com/youtube/v3/docs/channels/list\n var request = gapi.client.youtube.channels.list({\n mine: true,\n part: 'contentDetails'\n });\n request.execute(function(response) {\n\n channelId = response.result.items[0].id;\n requestPlaylist(channelId);\n });\n}", "function getUserList(){\r\n var userListforGet = [];\r\n for(var i=0;i<chatAppUsers.length;i++){\r\n userListforGet.push(chatAppUsers[i].currentUser);\r\n }\r\n return userListforGet;\r\n}", "function getPlaylistItems(data){\n\tgetPlaylistTracks(getTrackIDs, data.playlists.items[playlistLoop].id);\n}", "function getFeaturedPlaylists(options, callback) {\r\n let url = 'https://api.spotify.com/v1/browse/featured-playlists';\r\n return callSpotify(url, options, callback);\r\n}", "function requestUserUploadsPlaylistId() {\r\n \"use strict\";\r\n // See https://developers.google.com/youtube/v3/docs/channels/list\r\n var request = gapi.client.youtube.channels.list({\r\n mine: true,\r\n part: 'contentDetails'\r\n });\r\n}", "function getPlaylist() {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/me/playlists';\n xhr.open(\"GET\", url);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }", "function getPlaylists() {\n\n\n \n var queryUrl = \"https://api.spotify.com/v1/me/playlists\"\n\n $.ajax({\n url: queryUrl,\n type: \"GET\",\n beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + _token); },\n success: function (response) {\n $(\"ul\").text(response.items[0].name)\n $(\"ul\").attr(\"value\", response.items[0].id)\n $(\"ul\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[0].images[0].url)\n $(\".album-page-name\").text(response.items[0].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(2)\").text(response.items[1].name)\n $(\"ul:nth-child(2)\").attr(\"value\", response.items[1].id)\n $(\"ul:nth-child(2)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[1].images[0].url)\n $(\".album-page-name\").text(response.items[1].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n\n $(\"ul:nth-child(3)\").text(response.items[2].name)\n $(\"ul:nth-child(3)\").attr(\"value\", response.items[2].id)\n $(\"ul:nth-child(3)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[2].images[0].url)\n $(\".album-page-name\").text(response.items[2].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(4)\").text(response.items[3].name)\n $(\"ul:nth-child(4)\").attr(\"value\", response.items[3].id)\n $(\"ul:nth-child(4)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[3].images[0].url)\n $(\".album-page-name\").text(response.items[3].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(5)\").text(response.items[4].name)\n $(\"ul:nth-child(5)\").attr(\"value\", response.items[4].id)\n $(\"ul:nth-child(5)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[4].images[0].url)\n $(\".album-page-name\").text(response.items[4].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(6)\").text(response.items[5].name)\n $(\"ul:nth-child(6)\").attr(\"value\", response.items[5].id)\n $(\"ul:nth-child(6)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[5].images[0].url)\n $(\".album-page-name\").text(response.items[5].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(7)\").text(response.items[6].name)\n $(\"ul:nth-child(7)\").attr(\"value\", response.items[6].id)\n $(\"ul:nth-child(7)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[6].images[0].url)\n $(\".album-page-name\").text(response.items[6].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(8)\").text(response.items[7].name)\n $(\"ul:nth-child(8)\").attr(\"value\", response.items[7].id)\n $(\"ul:nth-child(8)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[7].images[0].url)\n $(\".album-page-name\").text(response.items[7].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(9)\").text(response.items[8].name)\n $(\"ul:nth-child(9)\").attr(\"value\", response.items[8].id)\n $(\"ul:nth-child(9)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[8].images[0].url)\n $(\".album-page-name\").text(response.items[8].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(10)\").text(response.items[9].name)\n $(\"ul:nth-child(10)\").attr(\"value\", response.items[9].id)\n $(\"ul:nth-child(10)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[9].images[0].url)\n $(\".album-page-name\").text(response.items[9].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(11)\").text(response.items[10].name)\n $(\"ul:nth-child(11)\").attr(\"value\", response.items[10].id)\n $(\"ul:nth-child(11)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[10].images[0].url)\n $(\".album-page-name\").text(response.items[10].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(12)\").text(response.items[11].name)\n $(\"ul:nth-child(12)\").attr(\"value\", response.items[11].id)\n $(\"ul:nth-child(12)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[11].images[0].url)\n $(\".album-page-name\").text(response.items[11].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(13)\").text(response.items[12].name)\n $(\"ul:nth-child(13)\").attr(\"value\", response.items[12].id)\n $(\"ul:nth-child(13)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[12].images[0].url)\n $(\".album-page-name\").text(response.items[12].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(14)\").text(response.items[13].name)\n $(\"ul:nth-child(14)\").attr(\"value\", response.items[13].id)\n $(\"ul:nth-child(14)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[13].images[0].url)\n $(\".album-page-name\").text(response.items[13].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(15)\").text(response.items[14].name)\n $(\"ul:nth-child(15)\").attr(\"value\", response.items[14].id)\n $(\"ul:nth-child(15)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[14].images[0].url)\n $(\".album-page-name\").text(response.items[14].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(16)\").text(response.items[15].name)\n $(\"ul:nth-child(16)\").attr(\"value\", response.items[15].id)\n $(\"ul:nth-child(16)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[15].images[0].url)\n $(\".album-page-name\").text(response.items[15].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(17)\").text(response.items[16].name)\n $(\"ul:nth-child(17)\").attr(\"value\", response.items[16].id)\n $(\"ul:nth-child(17)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[16].images[0].url)\n $(\".album-page-name\").text(response.items[16].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(18)\").text(response.items[17].name)\n $(\"ul:nth-child(18)\").attr(\"value\", response.items[17].id)\n $(\"ul:nth-child(18)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[17].images[0].url)\n $(\".album-page-name\").text(response.items[17].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(19)\").text(response.items[18].name)\n $(\"ul:nth-child(19)\").attr(\"value\", response.items[18].id)\n $(\"ul:nth-child(19)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[18].images[0].url)\n $(\".album-page-name\").text(response.items[18].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n\n }\n})\n}", "function requestPlaylist(channelId, pageToken) {\n //$('#video-container').html('');\n var requestOptions = {\n channelId: channelId,\n part: 'snippet',\n maxResults: 50\n };\n if (pageToken) {\n requestOptions.pageToken = pageToken;\n }\n var request = gapi.client.youtube.playlists.list(requestOptions);\n request.execute(function(response) {\n // Only show pagination buttons if there is a pagination token for the\n // next or previous page of results.\n nextPageToken = response.result.nextPageToken;\n\n if (nextPageToken) {\n requestPlaylist(channelId, nextPageToken);\n }\n\n var playlists = response.result.items;\n if (playlists) {\n $.each(playlists, function(index, item) {\n displayResult(item);\n });\n } else {\n $('#list-container').html('Sorry you have no playlists');\n }\n });\n}", "static getPlaylistsByUserId(userId, quantity=9999, page=1) {\n return fetch(`http://localhost:8888/getplaylistsforuser/${userId}/${quantity}/${page}`, {\n }).then(response => {\n return response.json().then(data => {\n return data\n })\n })\n }", "function load_all_user_playlist(site_url)\n{\t\n\t$.ajax({\n\t\turl: site_url+\"video/load_all_user_playlist\",\n\t\tcache: false,\n\t\tsuccess: function(data){\t\t\t\n\t\t\tif (check_user_log_in()==1)\n\t\t\t{\n\t\t\t\tif (user_membership_type(site_url)==1){\n\t\t\t\t\t$('#display_user_playlist').html(data);\n\t\t\t\t}else{\n\t\t\t\t\t//open_messagebox(\"Alert\", \"<span style=\\\"color:#F00;\\\">Please upgrade your account view playlist!</span>\");\n\t\t\t\t\t$('#display_user_playlist').html(\"Please upgrade your account to view playlist!\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$('#display_user_playlist').html(\"Please Login To View Your Playlist\");\n\t\t\t}\n\t\t}\n\t});\n}", "function getUsers(ids) {\n return rp.get(\"https://api.twitch.tv/helix/users\", {\n headers: {\n \"Client-ID\": config[\"twitch-client-id\"],\n \"Authorization\": \"Bearer \" + config[\"twitch-access-token\"],\n },\n qs: {\n \"id\": ids,\n\n },\n json: true,\n });\n}", "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "function listUsers() {\n gapi.client.directory.users.list({\n 'customer': 'my_customer',\n 'maxResults': 100,\n 'orderBy': 'email',\n 'viewType': \"domain_public\"\n }).then(function(response) {\n var users = response.result.users;\n var menu = document.getElementById('menu-main');\n menu.className += \" show-toggle\";\n //appendPre('Directory Loaded, you may now Show Directory <a href=\"link\"> test </a>');\n if (users && users.length > 0) {\n for (i = 0; i < users.length; i++) {\n //console.log(user);\n var user = users[i];\n userlist.push(user)\n /*appendPre('-' + user.primaryEmail + ' (' + user.name.fullName + ')');\n if (user.organizations){\n appendPre(user.organizations[0].title);\n };\n if (user.thumbnailPhotoUrl){\n appendPre(user.thumbnailPhotoUrl)\n }*/\n }\n } else {\n appendPre('No users found.');\n }\n });\n }", "function requestUserUploadsPlaylistId() {\r\n \"use strict\";\r\n // See https://developers.google.com/youtube/v3/docs/channels/list\r\n var request = gapi.client.youtube.channels.list({\r\n mine: true,\r\n part: 'contentDetails'\r\n });\r\n request.execute(function (response) {\r\n $('#playlistClick').click(function () {\r\n var playlist = $('#playlist').val();\r\n var playlistId = playlist.substring(playlist.lastIndexOf(\"=\") + 1);\r\n requestVideoPlaylist(playlistId);\r\n });\r\n\r\n });\r\n}", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "async function fetchPlaylists() {\n const libPath = await window.api.invoke('store-get', 'library')\n if (libPath === undefined) {\n empty(playlistsElement)\n error.show('You must select an iTunes library. This can be done in the application settings.')\n return\n }\n\n try {\n await library.open(libPath)\n } catch(err) {\n error.show('Failed to open iTunes library')\n }\n\n try {\n const playlists = await library.getPlaylists()\n await empty(playlistsElement)\n\n Object.entries(playlists).forEach(([key, value]) => {\n const shouldExclude = excludes.some(item => value[item])\n const excludeDownloaded = value.name === 'Downloaded' && value.distinguished_kind !== 65\n if (!shouldExclude && !excludeDownloaded) {\n const playlist = document.createElement('a')\n const span = document.createElement('span')\n playlist.setAttribute('href', '#')\n playlist.setAttribute('data-playlist-id', value.playlist_id)\n playlist.classList.add('playlist-item')\n playlist.innerHTML = `${icons.playlist}`\n span.innerText = `${value.name}`\n playlist.append(span)\n\n playlist.addEventListener('click', async({ currentTarget }) => {\n window.api.send('store-set', 'last-playlist', currentTarget.getAttribute('data-playlist-id'))\n\n // Remove current 'active' class\n const active = document.querySelector('.active')\n if (active !== null) {\n active.classList.remove('active')\n }\n\n // Add 'active' class to clicked item\n currentTarget.classList.add('active')\n\n // Empty current playlist tracks\n await empty(list)\n\n // Get the playlist tracks\n const playlistItems = await library.getPlaylistItems(value)\n\n // Append each playlist track to the table\n Object.entries(playlistItems).forEach(async([key, value]) => {\n const track = await library.getTrackById(value.track_id)\n await list.append(table.buildRow(track))\n\n const trackName = document.getElementById('track-name')\n if (trackName.getAttribute('data-track-id') !== undefined) {\n const trackId = document.querySelector(`[data-id=\"${trackName.getAttribute('data-track-id')}\"]`)\n if (trackId) {\n trackId.classList.add('is-playing')\n trackId.querySelector('.play-button').innerHTML = icons.pause\n }\n }\n })\n })\n\n playlistsElement.append(playlist)\n }\n })\n\n // Get a list of all tracks for the search\n tracks = await library.getTracks()\n\n // Click on the last playlist that was viewed\n const lastPlaylist = await window.api.invoke('store-get', 'last-playlist')\n if (lastPlaylist !== undefined) {\n document.querySelector(`[data-playlist-id=\"${lastPlaylist}\"]`).click()\n }\n\n table.sort()\n } catch(err) {\n empty(playlistsElement)\n error.show('There was an error parsing the iTunes library')\n }\n}", "function getData() {\n function getHashParams() {\n var hashParams = {};\n var e, r = /([^&;=]+)=?([^&;]*)/g,\n q = window.location.hash.substring(1);\n while ( e = r.exec(q)) {\n hashParams[e[1]] = decodeURIComponent(e[2]);\n }\n return hashParams;\n };\n\n var params = getHashParams();\n var key = params.status;\n var err = params.error;\n var data = JSON.parse(params.user);\n user_playlists = data.playlists;\n if(key == \"fail\") {\n alert(\"User data not loaded. Please relogin\");\n };\n}", "function getListPlayer(listUsers){\r\n dbPlayer = listUsers;\r\n}", "function requestUserUploadsPlaylistId() {\n // See https://developers.google.com/youtube/v3/docs/channels/list\n var request = gapi.client.youtube.channels.list({\n mine: true,\n part: 'contentDetails'\n });\n request.execute(function(response) {\n playlistId = response.result.items[0].contentDetails.relatedPlaylists.uploads;\n requestVideoPlaylist(playlistId);\n });\n}", "function addingListUsers(users){\n for(let i = 0; i < users.length; i++){\n const HTMLString = playListTemplate(users[i])\n const HTMLTemplate = playListHTMLTemplate(HTMLString);\n $playlist.append(HTMLTemplate);\n }\n }", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "function getAllListsOfUser() {\n \n const allLists = storage.getItem('P1_todoUsersDB');\n \n for (const list of allLists) {\n if (currentUser.userId === list.userId) {\n userLists.push(list);\n }\n }\n \n return userLists;\n }", "function getUsers() {\r\n var message = \"type=allUser\";\r\n sendFriendData(message, 'showUser');\r\n return 0;\r\n}", "function requestUserUploadsPlaylistId() {\n var request = gapi.client.youtube.videos.list({\n part: 'snippet',\n chart: 'mostPopular',\n // myRating: 'like',\n maxResults: 20,\n });\n request.execute(function(response) {\n var foo = response.items;\n for(var i=0; i<foo.length; i++) {\n var str = response.items[i].id;\n $('#video-container').append(\"<iframe width='640' height='320' src='https://www.youtube.com/embed/\"+str+\"'>\");\n }\n })\n}", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "function getUserList(trail){\n TrailClient\n .getUserList(trail)\n .then(function(response){\n if(!response.data.users){\n vm.alert = \"No users have favorited this trail yet!\";\n }\n else{\n vm.alert = null;\n vm.trail.userList = response.data.users;\n }\n })\n }", "function getList(){\n\t\t// call ajax\n\t\tlet url = 'https://final-project-sekyunoh.herokuapp.com/get-user';\n\t\tfetch(url)\n\t\t.then(checkStatus)\n\t\t.then(function(responseText) {\n\t\t\tlet res = JSON.parse(responseText);\n\t\t\tlet people = res['people'];\n\t\t\tdisplayList(people);\n\t\t})\n\t\t.catch(function(error) {\n\t\t\t// show error\n\t\t\tdisplayError(error + ' while getting list');\n\t\t});\n\t}", "viewFriendsSongsInPlaylist(playlist_id){\n this.getPlaylist(playlist_id)\n }", "function getUserPlaylistIDs(){\n // Empty out the array (if previously called set)\n userPlaylistObjects = [];\n\n // AJAX Call to get the User's Playlists (using the Access Token)\n $.ajax({\n url: \"https://api.spotify.com/v1/users/\" + userSpotifyId + \"/playlists\",\n headers: {\n 'Authorization': 'Bearer ' + spotifyAccessToken\n }\n }).done(function(userPlaylistResponse){\n // Loop Through the Playlists and get the IDs\n for(var i = 0; i < userPlaylistResponse.items.length; i++){\n\n var newPlaylistObject = {\n name: userPlaylistResponse.items[i].name,\n playlistID: userPlaylistResponse.items[i].id,\n ownerID: userPlaylistResponse.items[i].owner.id,\n plalyistChildren: []\n };\n\n // Add Playlist IDs to array\n userPlaylistObjects.push(newPlaylistObject);\n }\n });\n }", "function getUsernameList() {\r\n\tvar userlist = getUsernames();\r\n\treturn userlist;\r\n}", "function getUsers() {\n fetch(userUrl)\n .then((res) => res.json())\n .then((users) => {\n sortUsers(users);\n displayLeaderBoard();\n })\n .catch((error) => console.error(\"ERROR:\", error));\n }", "function getUsers() {\n return getItem('users');\n}", "function processGetPlaylists(resultArr) {\n if ((!resultArr) || (resultArr == '')) {\n $('#playlistslist').empty();\n return;\n }\n var tmp = '', favourites = '', starred = '';\n\n for (var i = 0; i < resultArr.length; i++) {\n var li_html = '<li><a href=\"#\" onclick=\"return showTracklist(this.id);\" id=\"' + resultArr[i].uri + '\">';\n if(isSpotifyStarredPlaylist(resultArr[i])) {\n starred = li_html + '&#9733; Spotify Starred Tracks</a></li>' + tmp;\n } else if (isFavouritesPlaylist(resultArr[i])) {\n favourites = li_html + '&hearts; Musicbox Favourites</a></li>';\n } else {\n tmp = tmp + li_html + '<i class=\"' + getMediaClass(resultArr[i].uri) + '\"></i> ' + resultArr[i].name + '</a></li>';\n }\n };\n // Prepend the user's Spotify \"Starred\" playlist and favourites to the results. (like Spotify official client).\n tmp = favourites + starred + tmp;\n $('#playlistslist').html(tmp);\n scrollToTracklist();\n showLoading(false);\n}", "async function getData(userID) {\n console.log(\"Getting list of all playlists...\");\n\n const data = {};\n\n // get the first 50 playlists (if the user has that many)\n let playlistRequest = await spotifyApi.getUserPlaylists(userID, {\n limit: 50\n });\n\n // create an array with all the playlists\n // filter out spotify stuff because they could get mad that we're scraping their playlists (see: SongShift)\n data.playlists = playlistRequest.body.items.filter(x => x.owner.display_name != \"Spotify\");\n\n // while the user still has more playlists to go, get those too\n let i = 1;\n while (playlistRequest.body.next)\n {\n // get the next 50 playlists from the user (if they have that many)\n playlistRequest = await spotifyApi.getUserPlaylists(userID, {\n limit: 50,\n offset: 50 * i\n });\n\n // add the playlists to the array\n data.playlists.push(...playlistRequest.body.items);\n \n // increment counter for the offset\n i++;\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n console.log(\"Got list of all playlists!\");\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 4000));\n\n // for each playlist, get the tracks\n const artistIDs = [];\n for (const playlist of data.playlists)\n {\n console.log(`Downloading tracks information for ${playlist.name}...`);\n\n // get the list of tracks for the playlist\n let tracksRequest = await spotifyApi.getPlaylistTracks(playlist.id, {\n limit: 50\n });\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n\n // get audio features for tracks\n let trackIDs = tracksRequest.body.items.map(x => x.track.id);\n let audioFeaturesRequest = await spotifyApi.getAudioFeaturesForTracks(trackIDs);\n let features = audioFeaturesRequest.body.audio_features;\n tracksRequest.body.items.forEach((x, i) => x.track.audio_features = features[i]);\n\n // add the tracks to the tracks array\n playlist.tracks.list = tracksRequest.body.items;\n\n // if the playlist has more than 50 tracks, get those too\n let i = 1;\n while (tracksRequest.body.next)\n {\n // get the next 50 songs from the playlist\n tracksRequest = await spotifyApi.getPlaylistTracks(playlist.id, {\n limit: 50,\n offset: 50 * i\n });\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n\n // get audio features for tracks\n trackIDs = tracksRequest.body.items.map(x => x.track.id);\n audioFeaturesRequest = await spotifyApi.getAudioFeaturesForTracks(trackIDs);\n features = audioFeaturesRequest.body.audio_features;\n tracksRequest.body.items.forEach((x, i) => x.track.audio_features = features[i]);\n\n // add the tracks to the tracks array\n playlist.tracks.list.push(...tracksRequest.body.items);\n\n i++;\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n // get all unique artists from playlist\n playlist.tracks.list.forEach(obj => {\n obj.track.artists.forEach(x => {\n if (!artistIDs.includes(x.id))\n {\n artistIDs.push(x.id);\n }\n });\n });\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 2000));\n }\n\n console.log(\"Getting artists information...\");\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 4000));\n\n // download artist information\n data.artists = [];\n for (let i = 0; i < artistIDs.length; i += 50)\n {\n const artistsRequest = await spotifyApi.getArtists(artistIDs.slice(i, i + 50));\n data.artists.push(...artistsRequest.body.artists);\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n console.log(\"Playlist data download complete!\");\n\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n}", "all(){\n const playlists = this.repository.load();\n return playlists.map(playlist => new Playlist(playlist.name, playlist.songs));\n }", "function getStoredSelectedPlaylists(){\n chrome.storage.local.get({storedPlaylists: []}, function (result) {\n console.log(\"Getting playlists\");\n var pluginContainer = document.getElementById(\"vibe-playlist-container\");\n if(result.storedPlaylists.length > 0){\n console.log(\"Foound playlists\");\n selectedPlaylists = result.storedPlaylists; \n getCheckedPlaylists();\n loadPlaylistsOnPage();\n }\n else if(pluginContainer != null){\n console.log(\"No playlists found\");\n pluginContainer.parentNode.removeChild(pluginContainer);\n }\n else{\n console.log(\"Can not run \" + result.storedPlaylists);\n }\n });\n}", "function requestUserUploadsPlaylistId() {\n\t// See https://developers.google.com/youtube/v3/docs/channels/list\n\tvar request = gapi.client.youtube.channels.list({\n\t\tid:CHANNEL_ID,\n\t\tpart: 'contentDetails'\n\t});\n\trequest.execute(function(response) {\n\t\tplaylistId = response.result.items[0].contentDetails.relatedPlaylists.uploads;\n\t\trequestVideoPlaylist(playlistId);\n\t});\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "function getUsers(){\n return users;\n}", "function getPlaylist(info) {\n $http.get(\"/playlist/\" + $rootScope.userLog).then(function (response) {\n if (response.status == 200) {\n $scope.playlist = response.data.playlist;\n username.innerHTML = response.data.username;\n }\n });\n }", "function getPlaylistName(userid, playlistid) {\n $.ajax({\n type: 'GET',\n url:'https://api.spotify.com/v1/users/' + userid + '/playlists/' + playlistid,\n headers: {'Authorization': \"Bearer \" + access_token},\n success: function(data) {\n playlistListPlaceholder.innerHTML = playlistListTemplate({ playlistname: data.name });\n }\n });\n}", "function generatePlaylist(){\n return Promise.resolve(getUserId(accessToken))\n .then(() => makeNewPlaylist(uId));\n}", "function getUsers(users) {\n\tconst userList = JSON.parse(users);\n\tgetRepos(userList);\n\tdisplayUser(userList)\n}", "function listUsers(api, query) {\n return api_1.GET(api, '/users', { query })\n}", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}", "function getTaskLists() {\n\n}", "'boards.getLists' (boardId) {\n let userId = this.userId\n let lists = []\n let board = Boards.findOne({\"_id\": boardId});\n if (board) {\n let userRole = boardUtils.getUserRole(userId, board)\n if(canPerform(userRole, ACCESS_BOARD)){\n board.boardList.map((list) => {\n let theList = Meteor.call('list.getList',list._id)\n lists.push(theList)\n })\n return lists\n } else\n throw new Meteor.Error(403, \"You do not have permission to access the lists\")\n } else {\n throw new Meteor.Error(404, 'Board not found')\n }\n }", "getYourPlaylists() {\n let location = 'http://localhost:4567/getListPlaylist/' + this.state.user_id + '/' + this.state.token1 + '/' + this.state.token2;\n axios.get(location).then(function (response) {\n let playlist = response.data;\n this.setState({\n playlist: playlist\n });\n }.bind(this));\n }", "async getImages() {\n return await this.client.playlists.getImages(this.id);\n }", "static async getUsers() {\r\n try {\r\n const response = await fetch('https://json.medrating.org/users/');\r\n const data = await response.json();\r\n\r\n const users = data.map(\r\n user => user.username && user.email ? new User(user.id, user.username, user.email) : null\r\n ).filter(Boolean);\r\n\r\n for (const user of users) {\r\n await user.getAlbums();\r\n }\r\n\r\n this.users = await users;\r\n\r\n return this.users;\r\n\r\n } catch (e) {\r\n console.error(e);\r\n }\r\n }", "function printUserPlaylists() {\n $('#printPlaylist').empty();\n var ul = $('<ul>');\n ul.addClass('collection with-header');\n var liHeader = $('<li>');\n liHeader.addClass('collection-header');\n var hHeader = $('<h3>');\n hHeader.html(\"Playlists:\");\n ul.append(liHeader.append(hHeader));\n for (var i = 0; i < userPlaylistObjects.length; i++) {\n var li = $('<li>');\n li.attr({\n class: 'collection-item select-playlist valign-wrapper',\n draggable: 'true',\n ondragstart: 'drag(event)'\n });\n li.data('playlistObject', userPlaylistObjects[i]);\n li.html(userPlaylistObjects[i].name);\n\n var iTag = $('<i>');\n iTag.addClass('material-icons right');\n if (userPlaylistObjects[i].ownerID != userSpotifyId) {\n iTag.html(\"language\");\n }\n // iTag.html(\"playlist_add\");\n ul.append(li.append(iTag));\n\n }\n $('#printPlaylist').append(ul);\n }", "getPlaylist(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\t\tconst playlistId = args.playlistId;\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylist()');\n\t\t}\n\n\t\tif (!_.isString(playlistId)) {\n\t\t\tthrow new Error('A playlistId string is required for getPlaylist()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists/${playlistId}`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.access_token),\n\t\t\t\tquery: {}\n\t\t\t});\n\n\t\t\treturn this.makeRequest(args);\n\t\t});\n\t}", "function getUsers(options) {\n\n var deferred = $q.defer();\n\n var context = SP.ClientContext.get_current();\n var oList = context.get_web().get_siteUserInfoList();\n var collListItem = oList.getItems();\n context.load(collListItem);\n context.executeQueryAsync(success, fail);\n\n\n //return current Item Collection json\n function success() {\n // load query details to json object\n var tasksEntries = [];\n var itemsCount = collListItem.get_count();\n for (var i = 0; i < itemsCount; i++) {\n var user = collListItem.itemAt(i);\n var taskEntry = item.get_fieldValues();\n tasksEntries.push(helperService.parse(taskEntry, options.fields.mappingFromSP));\n }\n deferred.resolve(tasksEntries);\n\n }\n\n function fail(sender, args) {\n deferred.reject(args.get_message() + '\\n' + args.get_stackTrace());\n }\n\n\n return deferred.promise;\n\n\n }", "function getList(){\r\n // Re-add list items with any new information\r\n let dataSend = \"pullTasks=all\";\r\n let data = apiReq(dataSend, 2);\r\n}", "allPlaylistsList(){\n return this.state.playlists.map(current => {\n return (<Playlist playlist={current} key={current._id}/>)\n })\n }", "async function nowusers()\n{\n var users = await Viewers.SelectUser()\n return users\n}", "function getPlaylists(offset)\n{\n $.ajax({\n url: \"https://api.spotify.com/v1/me/playlists?limit=50&offset=\"+offset,\n type: \"GET\",\n async: false,\n beforeSend: function(xhr){xhr.setRequestHeader('Authorization', 'Bearer ' + _token );},\n success: function(data) { \n console.log(data);\n for(var i = 0; i < data.items.length; i++)\n {\n pLists.push(data.items[i].id);\n }\n numpLists = data.total;\n }\n });\n}", "function get_users(){\n var q = datastore.createQuery(USERS);\n\n return datastore.runQuery(q).then( (entities) => {\n return entities;\n });\n}", "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 }", "function fetchUsers() {\n skygear.publicDB.query(\n new skygear.Query(skygear.UserRecord)\n .contains('_id', this.props.conversation.participant_ids)\n ).then(userList => {\n const {title} = this.props.conversation;\n let names = userList\n .filter(u => u._id !== skygear.currentUser.id)\n .map(u => u.displayName)\n .join(', ');\n if (names.length > 30) {\n names = names.substring(0,27) + '...';\n }\n const users = {};\n userList.forEach(u => users[u._id] = u);\n this.setState({\n users,\n title: title || names,\n });\n });\n}", "function handlePlaylists(data) {\n // detect any error messages from BC\n if (!data || (data && data.error)) {\n displayError(LG.copy[\"playlist_error\"][LG.config.lang]);\n } else if (data && data.items) {\n playlists = data.items;\n buildApplication();\n }\n }", "function list (userNick, directoryId) {\n\t\t// return Directory.list({\n\t\t// \tnick: userNick,\n\t\t// \tid: directoryId\n\t\t// }).$promise;\n\t}", "function getCategoryPlaylists(catId, options, callback) {\r\n let url = 'https://api.spotify.com/v1/browse/categories/' + catId + '/playlists';\r\n return callSpotify(url, options, callback);\r\n}", "function getUsers() {\n\treturn fetch(userURL).then((resp) => resp.json())\n}", "function ListUsers(ws) {\n var returnMessage = {}\n returnMessage[\"type\"] = \"user-list\";\n returnMessage[\"data\"] = [];\n \n switch (ws.gamemode) {\n case \"server\":\n wss.clients.forEach(function each(client) {\n var user = {}\n user[\"user-id\"] = client.userId;\n user[\"user-name\"] = client.userName;\n user[\"lobby-id\"] = client.lobbyId;\n user[\"gamemode\"] = client.gamemode;\n returnMessage.data.push(user);\n });\n break;\n case \"player\" || \"spectator\":\n if (ws.lobbyId === -1) {\n SendUserError(ws, \"list-users\", \"not in a lobby\")\n return;\n }\n for (var i=0; i<lobbies[lobbyId][\"users\"].length; i++) {\n var user = {}\n user[\"user-id\"] = lobbies[lobbyId][\"users\"][i].userId;\n user[\"user-name\"] = lobbies[lobbyId][\"users\"][i].userName;\n user[\"lobby-id\"] = lobbies[lobbyId][\"users\"][i].lobbyId;\n user[\"gamemode\"] = lobbies[lobbyId][\"users\"][i].gamemode;\n returnMessage.data.push(user);\n }\n break;\n }\n ws.send(JSON.stringify(returnMessage));\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "async function playlistIndex(req, res, next) {\n try {\n const playlist = await Playlist.find().populate('users').populate('user')\n res.status(200).json(playlist)\n } catch (err) {\n next(err)\n }\n}", "function handleAPILoaded() {\n requestUserPlaylistId();\n}", "async getPlaylistsHandler(request, h) {\n try {\n const { id: credentialId } = request.auth.credentials;\n const playlists = await this._playlistsService.getPlaylists(credentialId);\n const response = h.response({\n status: 'success',\n data: {\n playlists: playlists,\n },\n });\n response.code(200);\n return response;\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n console.log(error);\n return response;\n }\n\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami',\n });\n response.code(500);\n console.log(error);\n return response;\n }\n }", "function getVideos() {\n //GET THE USER ID\n\n getAllVideos(id)\n .then(res => {\n setVideoList(res.video);\n })\n .catch(err => console.log(err));\n }" ]
[ "0.7729634", "0.7642737", "0.7618179", "0.750534", "0.74863684", "0.73074925", "0.73030305", "0.7225763", "0.71034527", "0.7084997", "0.70780045", "0.707389", "0.7035268", "0.6934694", "0.6895438", "0.6835713", "0.6753882", "0.6726697", "0.67081803", "0.6700946", "0.66518295", "0.6639129", "0.6539075", "0.65007406", "0.6495956", "0.6486277", "0.6467436", "0.64614373", "0.6396555", "0.6375165", "0.63478667", "0.6346415", "0.63455516", "0.6342834", "0.63257223", "0.6314693", "0.6299158", "0.6290424", "0.627746", "0.6271515", "0.6267875", "0.6215786", "0.6209395", "0.62065333", "0.61973727", "0.6192008", "0.6191488", "0.6190731", "0.61844456", "0.6146462", "0.61101764", "0.6104379", "0.60764503", "0.60659873", "0.6059662", "0.6055264", "0.60411566", "0.6040624", "0.60378397", "0.6029834", "0.60183674", "0.60169005", "0.6013821", "0.601308", "0.60130024", "0.6012178", "0.59855735", "0.59805024", "0.5977831", "0.5973281", "0.59731674", "0.5969209", "0.59642625", "0.596028", "0.59409493", "0.5936979", "0.5917727", "0.5915363", "0.5913147", "0.59099543", "0.5899752", "0.5892095", "0.5889043", "0.58775455", "0.5874163", "0.5862988", "0.58583385", "0.5849446", "0.5848023", "0.58337617", "0.58320683", "0.5827184", "0.5820906", "0.5818781", "0.58143985", "0.58143985", "0.5810074", "0.57994664", "0.57919157", "0.57894546" ]
0.6576692
22
! get a particular playlist
async function playlist(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId) .populate('songs') .populate('users') .populate('user') if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } res.status(200).json(playlist) } catch (e) { next(e) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\t\treturn pls.id;\n\t}", "playlist() {\n return Playlists.findOne(playlistId);\n }", "viewFriendsSongsInPlaylist(playlist_id){\n this.getPlaylist(playlist_id)\n }", "function getPlaylist() {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/me/playlists';\n xhr.open(\"GET\", url);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }", "function getPlaylistById(id){\n let playlistById = player.playlists.filter(playlist =>{\n if(playlist.id === id){\n return playlist;\n }\n })\n return playlistById[0];\n }", "getPlaylist(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\t\tconst playlistId = args.playlistId;\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylist()');\n\t\t}\n\n\t\tif (!_.isString(playlistId)) {\n\t\t\tthrow new Error('A playlistId string is required for getPlaylist()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists/${playlistId}`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.access_token),\n\t\t\t\tquery: {}\n\t\t\t});\n\n\t\t\treturn this.makeRequest(args);\n\t\t});\n\t}", "function getPlaylist(info) {\n $http.get(\"/playlist/\" + $rootScope.userLog).then(function (response) {\n if (response.status == 200) {\n $scope.playlist = response.data.playlist;\n username.innerHTML = response.data.username;\n }\n });\n }", "getPlaylistById(id) {\n let playlist = this.playlists.find((a)=>a.id===id);\n return this.returnIfExists(playlist, \"playlist\");\n }", "function getPlaylist(id, params) {\n return playlist.get(id, params).then(function(message) {\n message.results = _.shuffle(message.results);\n console.log(message);\n return message;\n }).catch(function(err) {\n console.error(err);\n throw err;\n });\n}", "function getSpotifyPlaylist(callback, category){\n\tconst settings = {\n\t\theaders: {'Authorization': \"Bearer \"+ AUTHORIZATION_CODE},\n\t\turl: `https://api.spotify.com/v1/browse/categories/${category}/playlists`,\n\t\tsuccess: callback,\n\t\terror: \"Error getting playlist\"\n\t};\n\t$.ajax(settings)\n}", "getPlaylist() {\n return this.playlist;\n }", "async function getPlaylistInfo() {\n var playlistInfo = await queryDbOnce('/Playlists/' + vue.playlist);\n var info = playlistInfo.val();\n vue.currentSongId = info.Current;\n vue.allowExplicit = info.Settings['Allow Explicit Songs'];\n vue.allowSpotify = info.Settings.Spotify;\n vue.allowYoutube = info.Settings.Youtube;\n}", "function getPlaylist() {\r\n return new Promise(function(resolve, reject) {\r\n var xhttp = new XMLHttpRequest();\r\n\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let playlist = JSON.parse(this.response);\r\n songs = [];\r\n\r\n for (var i = 0; i < playlist.length; i++) {\r\n playlistAdd(playlist[i]);\r\n songs.push(playlist[i]);\r\n \r\n }\r\n \r\n resolve(\"Got the playlist. Check song array.\");\r\n }\r\n };\r\n\r\n xhttp.onerror = function() {\r\n reject({\r\n status: this.status,\r\n statusText: this.statusText\r\n });\r\n };\r\n\r\n xhttp.open(\"GET\", \"playlist\", true);\r\n xhttp.send();\r\n });\r\n }", "getPlaylistItemWithId(id) {\n let that = this;\n if (that._playlist)\n return that._playlist.getItemWithId(id);\n else\n return undefined;\n }", "async fetch() {\n return await this.client.playlists.get(this.id, true);\n }", "function requestPlaylist() {\n var request = gapi.client.youtube.playlists.list({\n channelId : channelId,\n part: 'contentDetails',\n maxResults: 50\n });\n request.execute(function(response) {\n console.log(response);\n var playlistArr = response.result.items;\n for(var i = 0 ; i < playlistArr.length ; i++){\n var item = playlistArr[i];\n var playlistId = item.id;\n requestVideoPlaylist(playlistId);\n }\n \n });\n}", "function getPlaylistItems(data){\n\tgetPlaylistTracks(getTrackIDs, data.playlists.items[playlistLoop].id);\n}", "function requestPlaylist(playlistId) {\n const maxResults = 20;\n const playlistURL = `https://www.googleapis.com/youtube/v3/playlistItems?key=${apiKey}&playlistId=${playlistId}&part=snippet&maxResults=${maxResults}`;\n\n fetch(playlistURL)\n .then(res => res.json())\n .then(data => loadVideo(data));\n}", "function getPlaylistID() {\n const url = window.location.search;\n if (url.indexOf(\"?playlist_id=\") !== -1) {\n let currentPlaylist = url.split(\"=\")[1];\n return currentPlaylist;\n }\n }", "function getPlaylist(ApiKey, playlistID) {\n return new Promise(function(resolve, reject) {\n ypi.playlistInfo(ApiKey, playlistID, playlistItems => {\n //if no playlist is there ypi got an Error\n if(!playlistItems) return reject(new Error(\"Invalid playlist\"))\n //if no error resolve with Playlist\n resolve(playlistItems)\n })\n })\n}", "function loadPlaylist() {\n myPlayer.catalog.getPlaylist('4450721964001', function(error, playlist) {\n myPlayer.catalog.load(playlist);\n playlistLength = myPlayer.playlist().length;\n });\n }", "async getPlaylists() {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n const userID = await this.getUserID();\n //GET method\n try {\n const response = await fetch(\n 'https://api.spotify.com/v1/me/playlists?limit=50',\n { headers: headers }\n );\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items\n .filter(playlist => playlist.owner.id === userID)\n .map(playlist => {\n return {\n id: playlist.id,\n name: playlist.name,\n tracksURL: playlist.tracks.href,\n image: playlist.images[1],\n uri: playlist.uri,\n };\n });\n }\n } else {\n throw new Error('Request to GET Playlists Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "getPlaylist(playlistResolvable) {\n return __awaiter(this, void 0, void 0, function* () {\n const id = yield this.getId(playlistResolvable, 'playlist');\n return this.getItemById(entities_1.Playlist, id);\n });\n }", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "function getPlaylistSongs(value) {\n var songs = [];\n var index = 0;\n for (i = 1; i < user_playlists.length; i++) {\n if (value == user_playlists[i].name) {\n songs = user_playlists[i].songs;\n index = i;\n };\n };\n printFavoritesPlaylists(songs, 1, index);\n}", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "function getSong(videoId){\r\n for(var i = 0; i < data.songs.length; ++i){\r\n if(data.songs[i].videoId == videoId){\r\n return data.songs[i];\r\n }\r\n }\r\n}", "function getSpotifyPlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"?\", link.search(\"playlist\") + 9);\n if (indexEndOfID != -1) {\n id = link.slice(link.search(\"playlist\") + 9, indexEndOfID);\n } else {\n id = link.slice(link.search(\"playlist\") + 9);\n }\n //console.log(id);\n return id;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function getYouTubePlaylistID(link) {\n var id;\n var indexEndOfID = link.indexOf(\"&\", link.search(\"list=\") + 5);\n if (indexEndOfID != -1) {\n id = link.slice(((link.search(\"list=\")) + 5), indexEndOfID);\n } else {\n id = link.slice((link.search(\"list=\")) + 5);\n }\n //console.log(id);\n return id;\n}", "function loadPlaylist(){\n let playlistID = this.dataset.id; // this.dataset is an object containing all attributes with \"data-\" before\n spotupdtr.getMissingTracks(playlistID); // Fetching the missing tracks of the playlist\n}", "function requestUserUploadsPlaylistId() {\n var request = gapi.client.youtube.videos.list({\n part: 'snippet',\n chart: 'mostPopular',\n // myRating: 'like',\n maxResults: 20,\n });\n request.execute(function(response) {\n var foo = response.items;\n for(var i=0; i<foo.length; i++) {\n var str = response.items[i].id;\n $('#video-container').append(\"<iframe width='640' height='320' src='https://www.youtube.com/embed/\"+str+\"'>\");\n }\n })\n}", "function getParams() {\n var url = document.location.href;\n var paramList = url.split('?')[1].split('&');\n var userID = paramList[0].split('=')[1]; //the user's id\n var playlistID = paramList[1].split('=')[1]; //the playlist's id\n var playlistName = decodeURIComponent(paramList[2].split('=')[1]); //the name of the playlist\n\n document.getElementById('head').innerText = playlistName; //write playlist name to the head text\n\n //the path to get tracks from a playlist\n var trackURL = 'https://api.spotify.com/v1/users/' + userID + '/playlists/' + playlistID + '/tracks';\n showTracks(trackURL); //get the tracks from a playlist\n\n}", "function requestUserUploadsPlaylistId() {\r\n \"use strict\";\r\n // See https://developers.google.com/youtube/v3/docs/channels/list\r\n var request = gapi.client.youtube.channels.list({\r\n mine: true,\r\n part: 'contentDetails'\r\n });\r\n request.execute(function (response) {\r\n $('#playlistClick').click(function () {\r\n var playlist = $('#playlist').val();\r\n var playlistId = playlist.substring(playlist.lastIndexOf(\"=\") + 1);\r\n requestVideoPlaylist(playlistId);\r\n });\r\n\r\n });\r\n}", "function getPlaylistTracks(callback, playlistID){\n\tsettings = {\n\t\turl: `https://api.spotify.com/v1/users/Spotify/playlists/${playlistID}/tracks`,\n\t\theaders: {'Authorization': \"Bearer \"+ AUTHORIZATION_CODE},\n\t\tsuccess: callback,\n\t};\n\t$.ajax(settings);\n}", "function requestPlaylist(channelId, pageToken) {\n //$('#video-container').html('');\n var requestOptions = {\n channelId: channelId,\n part: 'snippet',\n maxResults: 50\n };\n if (pageToken) {\n requestOptions.pageToken = pageToken;\n }\n var request = gapi.client.youtube.playlists.list(requestOptions);\n request.execute(function(response) {\n // Only show pagination buttons if there is a pagination token for the\n // next or previous page of results.\n nextPageToken = response.result.nextPageToken;\n\n if (nextPageToken) {\n requestPlaylist(channelId, nextPageToken);\n }\n\n var playlists = response.result.items;\n if (playlists) {\n $.each(playlists, function(index, item) {\n displayResult(item);\n });\n } else {\n $('#list-container').html('Sorry you have no playlists');\n }\n });\n}", "function play_track_from_playlist()\n{\n\tvar selected_track_index = $('#radio_song_list').attr(\"selectedIndex\");\n\t\n\t// play the selected track from playlist...\n\tradio_playlist.play(selected_track_index);\n}", "getPlaylists(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylists()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.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}", "function playlist(id, fname, lname, status)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.id = id;\n\t\t\t\t\t\tthis.first_name=fname;\n\t\t\t\t\t\tthis.last_name=lname;\n\t\t\t\t\t\tthis.status = status;\n\t\t\t\t\t}", "function getRecommendedSong(){\n\tif (session_id !== undefined){\n\t\t$.getJSON(next_song_request + \"&_=\" + Math.floor(Math.random()*1000000), function(data) {\n\t\t\tif (data.response.status.message === \"Success\"){\n\t\t\t\tvar lastRecommendedSong = data.response.songs[0];\n\t\t\t\tconsole.log(session_id);\n\t\t\t\tconsole.log(data);\n\t\t\t\tconsole.log(lastRecommendedSong.artist_name + \" \" + lastRecommendedSong.title);\n\t\t\t\tplaylist.addSongByTitleAndArtist(lastRecommendedSong.title, lastRecommendedSong.artist_name);\n\t\t\t}\n\t\t});\n\t}\n}", "function getSongs() {\n\n var spotify = new Spotify(keys.spotify);\n\n var songName = process.argv[3];\n\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(data.tracks.items[0].artists[0].name);\n console.log(data.tracks.items[0].album.name);\n console.log(data.tracks.items[0].name);\n console.log(data.tracks.items[0].external_urls.spotify);\n });\n\n\n}", "function getMp3 ()\n{\n var url = controller_url + \"?action=lib_display\";\n\n // get mp3 file list in json\n $.getJSON(url, function (mp3)\n {\n // log('result :', mp3);\n\n if (mp3)\n {\n $.each(mp3, function(i, val){\n var pos = val.file.lastIndexOf(\"/\");\n\n path = val.file.substr(0, pos);\n file = val.file.substr(pos+1);\n\n $('#filelist').append(\"<li><span class='add_song' s_id='\" + val.s_id['$id'] + \"' path='\" + path + \"' title='click to add to playlist'>\" + file + \"</span><img s_id='\" + val.s_id['$id'] + \"' class='float_right_button tag' alt='[Tag]' title='show/edit tags' /></li>\");\n });\n\n // default initial action:\n // - add first song to playlist\n $('#filelist .add_song:first').trigger( \"click\" );\n // - load first song\n $('.play_song:first()').trigger('click');\n }\n });\n\n return;\n}", "getPlaying() {\n return apiClient.get(\n '/movie/now_playing?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3&language=en-US&page=1'\n )\n }", "function getRandomPlaylist() {\n\t var randomPlaylist = [];\n var randoNum = Math.floor(Math.random() * playlistIds.length);\n return playlistIds[randoNum];\n }", "function getPlaylistName(userid, playlistid) {\n $.ajax({\n type: 'GET',\n url:'https://api.spotify.com/v1/users/' + userid + '/playlists/' + playlistid,\n headers: {'Authorization': \"Bearer \" + access_token},\n success: function(data) {\n playlistListPlaceholder.innerHTML = playlistListTemplate({ playlistname: data.name });\n }\n });\n}", "getPlaylistItemWithIndex(index) {\n let that = this;\n if (that._playlist)\n return that._playlist.getItemWithIndex(id);\n else\n return undefined;\n }", "static getPlaylistDataById(playlistId) {\n return fetch(`http://localhost:8888/getplaylistdata/${playlistId}`, {\n }).then(response => {\n return response.json().then(data => {\n return data\n })\n })\n }", "async getPlaylistTracks(trackURL) {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n // GET method\n try {\n const response = await fetch(trackURL, { headers: headers });\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items.map(track => {\n return {\n id: track.track.id,\n name: track.track.name,\n artist: track.track.artists[0].name,\n album: track.track.album.name,\n uri: track.track.uri,\n preview: track.track.preview_url,\n };\n });\n }\n } else {\n throw new Error('Request to GET Top Tracks Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "async getPlaylists() {\n try {\n let playlists = await spotifyWebApi.getUserPlaylists();\n this.setState({\n playlists: playlists,\n loading: false,\n selectedPlaylist: {\n id: playlists.items[0].id, \n }\n });\n } catch (error) {\n console.error('Get User Playlists error: ', error);\n }\n }", "function playAplaylist(data, playCurrent = false) {\n\n let arr = []\n let songs = []\n console.log(data)\n if (data.length > 0) {\n data.map((song) => {\n console.log(song)\n arr.push(song.Content.videoId)\n songs.push(song.Content)\n })\n\n updatePlayerState({\n isPlaying: true,\n playlist: songs,\n songPlaying: songs[0],\n playedSongIndex: 0,\n playlistVideoIds: arr\n })\n }\n }", "async function downloadSong(playlistName, song, songID) {\r\n var playlist = await makePlaylist(playlistName, song, songID);\r\n console.log(playlist.Status);\r\n console.log(playlist.Message + '\\n');\r\n return { Message: playlist.Message, DownloadSatatus: playlist.Status };\r\n\r\n}", "function showUserPlaylists() {\n getUserPlaylists().then(text => {\n var playlists = JSON.parse(text);\n for (var playlist in playlists) {\n console.log(playlist);\n if (playlist != 'favourites') {\n createAsidePlaylist(playlists[playlist]);\n }\n };\n });\n}", "function loadPlaylist() {\n \n \n var embargo_str = (options.has_embargo) ? \" displaydatetime:[* TO NOW]\" : \"\";\n \n //LOAD THE JSON FOR THE PLAYLIST VIA SITE SEARCH\n var dataURL = 'https://www.washingtonpost.com/apps/national/proxy/methode/sitesearch/' + \n \t'?q=tag:\"' + options.video_tag + \n \t'\"&fq=contenttype:\"Video\"' + \n \t embargo_str + //if embargoed, add tonow\n \t'&start=0&' + \n \t'rows='+ options.max_videos +\n \t'&fl=embedcode,headline,subheadline,credit,blurb,imageurl,displaydatetime,pubdatetime,contentbinaryurl,smallthumburl,systemid&' + \n \t'wt=json&' +\n \t'omitHeader=true&' + \n \t'tracking=video-series-player-' + options.video_tag + \n \t'&json.wrf=jQuery.playlistLoaded';\n \t \t\n $.ajax({\n url: dataURL,\n dataType: 'jsonp',\n jsonpCallback: 'jQuery.playlistLoaded',\n context: document.body,\n cache: true\n })\n }", "function _readPlaylist () {\n\n\t\tthis.albums = (typeof this.settings.playlist.albums != 'undefined') ? this.settings.playlist.albums : [];\n\t\tthis.tracks = (typeof this.settings.playlist.tracks != 'undefined') ? this.settings.playlist.tracks : [];\n\n\t\t_sortTracks.apply(this);\n\n\t\tthis.currentSoundtrack = this.tracks[0].id;\n\n\t\tthis.debug('Playlist: '+ this.albums.length +' albums, '+ this.tracks.length +' soundtracks');\n\n\t}", "async getSongsFromPlaylist(request, h) {\n try {\n const { playlistId } = request.params;\n console.log(playlistId);\n const { id: credentialId } = request.auth.credentials;\n await this._playlistsService.verifyPlaylistAccess(\n playlistId,\n credentialId\n );\n const data = await this._playlistssongService.getSongsFromPlaylist(\n playlistId\n );\n const response = h.response({\n status: 'success',\n data: {\n songs: data,\n },\n });\n response.code(200);\n return response;\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n console.log(error);\n return response;\n }\n\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami',\n });\n response.code(500);\n console.log(error);\n return response;\n }\n }", "async readPlaylistId (req, res, playlistId) {\n try {\n if (typeof req.user === 'undefined' || req.user === null) {\n throw new Error('You are not connected')\n }\n const readStruct = {\n where: {\n PlaylistPlaylistId: playlistId\n }\n }\n CRUDController.read(req, res, Video, readStruct)\n } catch (err) {\n // 401 Unauthorized\n return res.status(401).send({\n error: err.message\n })\n }\n }", "function getPlaylistUri(id) {\n return new Promise(function (fulfill, reject) {\n \n // Ensure connection exists\n if (!pool) return reject(\"Not connected to DB.\");\n\n // Execute the query and transition promise state\n pool.query('SELECT `uri` FROM `playlist` WHERE `id` = ?', \n [id], function(error, results, fields) {\n\n if (results === undefined || results.length == 0) {\n return reject(error ? error : \n \"No results found for playlist with id \" + id);\n }\n\n return fulfill(results[0]['uri']);\n });\n });\n}", "function requestUserUploadsPlaylistId() {\r\n \"use strict\";\r\n // See https://developers.google.com/youtube/v3/docs/channels/list\r\n var request = gapi.client.youtube.channels.list({\r\n mine: true,\r\n part: 'contentDetails'\r\n });\r\n}", "function getSongs(callback) {\n\n}", "function requestUserPlaylistId() {\n // See https://developers.google.com/youtube/v3/docs/channels/list\n var request = gapi.client.youtube.channels.list({\n mine: true,\n part: 'contentDetails'\n });\n request.execute(function(response) {\n\n channelId = response.result.items[0].id;\n requestPlaylist(channelId);\n });\n}", "getCurrentPlaylistIndex() {\n let that = this;\n if (that._playlist)\n return that._playlist.getIndexForId(that.getCurrentPlaylistId());\n else\n return undefined;\n }", "function loadVid1(){\n player1.cuePlaylist({listType:\"search\",\n list: \"documentary \" + QueryString.NAinterest,\n videoCategoryID: 'Education',\n startSeconds:0,\n suggestedQuality:\"large\"});}", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "function requestPlaylists(accessToken) {\n const options = {\n method: 'GET',\n url:\n 'https://www.googleapis.com/youtube/v3/playlists?part=snippet&mine=true',\n headers: {\n Authorization: `Bearer ${accessToken}`,\n },\n json: true,\n }\n return request(options)\n}", "function songfind() {\n\nvar spotify = new Spotify(\n keys.spotify\n);\n var songTitle = process.argv.slice(2);\nspotify.search({ type: 'track', query: songTitle, limit: 1 }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n // console.log(\"Artist: \" + \"\");\n console.log(\"Song: \" + data.tracks.items[0].name);\n console.log(\"Spotify URL: \" + data.tracks.items[0].preview_url);\n console.log(\"Album Name:\" + data.tracks.items[0].album.name)\n\t\n})}", "function loadPlaylistData(player, result) {\n player_playlist[player].remove();\n\n var playlistItems = [];\n for (var i = 0; i < result.length; i++) {\n playlistItems.push({\n title: (result[i].name.length > 50 ? (result[i].name.substring(0, 50) + \"...\") : result[i].name),\n name: result[i].name,\n mp3: result[i].path,\n id: result[i].id\n });\n }\n player_playlist[player].setPlaylist(playlistItems);\n}", "function playFirstSong() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "function changePlaylist() {\n\t\t// clear track specific data\n\t\t$(\"#trackName\").empty();\n\t\t$(\"#trackRating\").val(\"(Rate track)\");\n\t\n\t\tvar playlistIndex = $(\"#playlist\").val();\n\t\tif (playlistIndex == \"select\") {\n\t\t\t$(\"#playlistPlayer\").empty();\n\t\t} else {\n\t\t\t// load selected playlist on page\n\t\t\tvar userLib = Library.forCurrentUser();\n\t\t\tuserLib.playlists.snapshot().done(function (snapshot) {\n\t\t\t\tvar playlist = snapshot.get(playlistIndex);\n\t\t\t\tlist = List.forPlaylist(playlist);\n\t\t\t\t$(\"#playlistPlayer\")\n\t\t\t\t\t.empty()\n\t\t\t\t\t.append(list.node);\n\t\t\t\tlist.init();\n\t\t\t});\n\t\t}\n\t}", "function getPlaylists(access_token, allCallSongs) {\n $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization':'Bearer ' + access_token\n },\n success: function(response) {\n $(\".recommendations\").show();\n generatePlaylistDropdown(response.items, allCallSongs);\n }\n });\n}", "function load_video_playlist(site_url, playlist_id)\n{\t\n\tif (playlist_id!=0){\n\t\t$.ajax({\n\t\t\tcache:false,\n\t\t\turl: site_url+\"video/load_playlist/\"+playlist_id+\"/\",\n\t\t\tsuccess: function(data){\n\t\t\t\t//alert(data);\n\t\t\t\t$('#playlist_video').html(data);\n\t\t\t}\n\t\t});\n\t}else{\n\t\t$('#playlist_video').html('Please select a playlist.');\n\t}\n}", "async function getPlaylists() {\n const result = await $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization': 'Bearer ' + access_token\n },\n error: function () {\n console.log(\"error fetching playlists!\");\n return;\n }\n });\n\n return result.items;\n}", "function openPlaylist(id) {\n playlist = document.querySelector('#'+id + \"_name\").innerHTML;\n document.querySelector('#navigator').pushPage('playlist.html');\n}", "function handlePlaylist(data, callback) {\n\t\tvar match = data.input.match(regExp.playlist);\n\t\tvar index;\n\t\tif(match) {\n\t\t\tindex = indexOfObject(playlists, 'title', match[1]);\n\t\t} else {\n\t\t\tconsole.log('Not a valid playlist');\n\t\t\tcallback(undefined);\n\t\t}\n\t\tif(index === -1) {\n\t\t\tconsole.log('Not a valid playlist');\n\t\t\tcallback(undefined);\n\t\t} else {\n\t\t\tconsole.log('A valid playlist');\n\t\t\tcallback(playlists[index]);\n\t\t}\n\t}", "function Playlist(name) {\n this.name = name;\n this.tracks = [];\n}", "async getPlaylistWithTracks(id) {\n const _this = this;\n const playlist = (await _this.props.spotifyAPI.getPlaylist(id)).body\n \n // if there is more tracks than the limit (100 by default)\n if (playlist.tracks.total > playlist.tracks.limit) {\n\n // Divide the total number of track by the limit to get the number of API calls\n for (let i = 1; i < Math.ceil(playlist.tracks.total / playlist.tracks.limit); i++) {\n\n const trackToAdd = (await _this.props.spotifyAPI.getPlaylistTracks(id, {\n offset: playlist.tracks.limit * i // Offset each call by the limit * the call's index\n })).body;\n\n // Push the retreived tracks into the array\n trackToAdd.items.forEach((item) => playlist.tracks.items.push(item));\n }\n }\n return playlist;\n }", "getCurrentPlaylistId() {\n let that = this;\n return that._status.currentItemId;\n }", "function song() {\n\tvar client = new Spotify(theKeys.spotifyKeys);\n\tvar playSong = process.argv[3];\n\t//retrieving Spotify song\n\tclient.search({ type: 'track', query: playSong, limit: 1}, function(error, data) {\n \t\tif (error) {\n \t\treturn console.log('Error occurred: ' + error);\n \t\t\t} else {\n\t\t\t\tvar artistNames = function (artist) { \n\t\t\t\treturn artist.name;\t\t\t\t\n \t\t\t}\n \t\t\tvar tracks=data.tracks.items;\n \t\t\tfor (var i=0; i<tracks.length; i++){\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t \tconsole.log('\\nArtist(s): ' + tracks[i].artists.map(artistNames));\n\t \tconsole.log('Song Name: ' + tracks[i].name);\n\t \tconsole.log('Preview Song: ' + tracks[i].preview_url);\n\t \tconsole.log('Album: ' + tracks[i].album.name);\n\t \tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\t}\t\n\t\t}\n\t});\n}", "function getVideosInPlaylist(name) {\r\n\tvar data = {};\r\n\tdata[\"playlistName\"] = name;\r\n\tvar js = JSON.stringify(data);\r\n\t\r\n\tvar xhr = new XMLHttpRequest();\r\n\txhr.open(\"POST\", getVideosInPlaylistURL, true);\r\n\txhr.send(js);\r\n\t\r\n\txhr.onloadend = function () {\r\n\t\tif (xhr.readyState == XMLHttpRequest.DONE) {\r\n\t\t\tconsole.log (\"XHR:\" + xhr.responseText);\r\n\t\t\tclearPlaylistVideos();\r\n\t\t\tprocessPlaylistVideos(xhr.responseText);\r\n\t\t} else {\r\n\t\t}\r\n\t};\r\n}", "function check_if_playlist_exist(site_url, playlist_caption)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_caption=\"+playlist_caption,\t\t\n\t\turl: site_url+\"video/check_playlist_name_exist/\"\t\t\n\t}).responseText;\n\t\n\treturn result;\n}", "function requestVideoPlaylist(playlist, pageToken) {\n node('#loading_hint').innerHTML = '取得播放清單';\n var requestOptions = {\n playlistId: playlist.id,\n part: 'snippet',\n maxResults: 50\n };\n if (pageToken) {\n requestOptions.pageToken = pageToken;\n }\n var request = gapi.client.youtube.playlistItems.list(requestOptions);\n request.execute(function(response) {\n var nextVis = nextPageToken ? 'visible' : 'hidden';\n var prevVis = prevPageToken ? 'visible' : 'hidden';\n\n var playlistItems = response.result.items;\n if (playlistItems) {\n playlist.videos = playlistItems;\n } else {\n console.log('Sorry you have no uploaded videos');\n }\n count++;\n if (count == playlistL) {\n initChannelList();\n }\n });\n }", "function getSpotifySongs(userId, playlistId, index, req) {\n return spotify.getPlaylistTracks(userId, playlistId, req.session.user.access_token, index)\n .catch(spotify.OldTokenError, function () {\n // statusCode 401: Unauthorized\n return spotify.refreshToken(req.session.user.refresh_token)\n .then(function (body) {\n util.saveToken(req, body.access_token, body.refresh_token);\n return spotify.getPlaylistTracks(userId, playlistId, body.access_token, index);\n });\n });\n}", "function getMusic(songName) {\n\n // If no song name, defaults The Sign by Ace\n if (!songName) {\n var songName = \"The Sign Ace\";\n }\n\n spotify.search({ type: 'track', query: songName }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n var trackObj = data.tracks.items[0];\n\n // Artist(s)\n console.log(`Artist: ${trackObj.artists[0].name}`);\n\n // The song's name\n console.log(`Song Name: ${trackObj.name}`);\n\n // A preview link of the song from Spotify\n console.log(`Preview Link: ${trackObj.external_urls.spotify}`);\n\n // The album that the song is from\n console.log(`Album Name: ${trackObj.album.name}`);\n });\n}", "function retrievePlaylist(type, ext) {\n\tvar file = \"\";\n\tvar tableref = \"\";\n\n\t// Header of file\n\tswitch(type) {\n\t\tcase \"album\":\n\t\t\tif(ext == \"csv\") {\n\t\t\t\tfile = pExport.texts.track + \";\" + pExport.texts.song + \";\" + pExport.texts.time + \"\\n\";\n\t\t\t}\n\t\t\ttableref = 'naboo_album_tracks';\n\t\t\tbreak;\n\t\tcase \"playlist\":\n\t\t\tif(ext == \"csv\") {\n\t\t\t\tfile = pExport.texts.song + \";\" + pExport.texts.artist + \";\" + pExport.texts.album + \";\" + pExport.texts.time + \"\\n\";\n\t\t\t}\n\t\t\ttableref = 'tab_track_list_content';\n\t\t\tbreak;\n\t\tdefault:\n\t}\n\n\t// Browse current table\n\t$('#' + tableref + ' table tbody tr.song').each(function(el) {\n\t\t// Build object with all information\n\t\tvar muz = {\n\t\t\ttrack: rewriting($(this).children('td.position').find('span.number').text().trim()),\n\t\t\tsong: rewriting($(this).children('td.track').find('div.ellipsis').children('a').text().trim()),\n\t\t\tartist: type == 'album' ? rewriting($('#naboo_album_artist').children('a').text()) : rewriting($(this).children('td.artist').children('div.ellipsis').children('a').text().trim()),\n\t\t\talbum: rewriting($(this).children('td.album').children('div.ellipsis').children('a').text().trim()),\n\t\t\ttime: $(this).children('td.length').text().trim()\n\t\t};\n\n\t\t// Add the wanted information\n\t\tif(ext == \"csv\") {\n\t\t\tswitch(type) {\n\t\t\t\tcase \"album\":\n\t\t\t\t\tfile += muz.track + \";\" + muz.song + \";\" + muz.time + \"\\n\";\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault: // playlist\n\t\t\t\t\tfile += muz.song + \";\" + muz.artist + \";\" + muz.album + \";\" + muz.time + \"\\n\";\n\t\t\t}\n\t\t} else {\n\t\t\tfile += muz.artist + \" - \" + muz.song + \"\\r\\n\";\n\t\t}\n\t});\n\n\treturn encodeURIComponent(file);\n}", "all(){\n const playlists = this.repository.load();\n return playlists.map(playlist => new Playlist(playlist.name, playlist.songs));\n }", "function searchSpotifyPlaylist(playlistID, message) {\n spotifyApi.getPlaylist(playlistID)\n .then(function (data) {\n data.body.tracks.items.forEach((track) => {\n var title = track.track.artists[0].name + \" - \" + track.track.name;\n //console.log(title);\n titles.push(title);\n })\n sendPlaylistEmbed(message);\n searching = true;\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "_get_data( playlist_id, element ) {\n\t\tconst query = {\n\t\t\tpart: 'snippet',\n\t\t\tplaylistId: playlist_id,\n\t\t\tmaxResults: this.max_results,\n\t\t\tkey: this.api_key\n\t\t};\n\n\t\tfetch( this.request_domain + '?' + object_to_query_string( query ) )\n\t\t\t.then( response => response.json() )\n\t\t\t.then( json_data => {\n\t\t\t\tthis._parse_data( json_data, element );\n\t\t\t})\n\t\t\t.catch( error => console.error( error ) ); // eslint-disable-line no-console\n\t}", "function get_playlists(APIKey , channelid , maxResults , callBackFunction ) {\n $.getJSON( \"https://www.googleapis.com/youtube/v3/playlists?part=snippet&channelId=\" + channelid + \"&maxResults=\" + maxResults + \"&fields=etag%2Citems%2Ckind%2CnextPageToken%2CpageInfo&key=\" + APIKey ,\n //callback\n function(data) {\n var playlistContainer = [];\n data.items.forEach( function (element){\n playlistContainer.push(new PlayListObj(element.id , element.snippet.title, element.snippet.description , element.snippet.publishedAt , element.snippet.thumbnails.default.url));\n }, this);\n\n callBackFunction(playlistContainer);\n });\n}", "async getSongOnPlaylists(playlistId){\n const query = {\n text: `SELECT songs.id, songs.title, songs.performer \n FROM songs JOIN playlistssongs ON songs.id = playlistssongs.song_id WHERE playlistssongs.playlist_id = $1`,\n values: [playlistId],\n }\n \n const result = await this._pool.query(query)\n \n return result.rows\n }", "function getStreamData(playlist, isFirst)\n {\n\n\n fetch(groovebox[\"pathToApi\"] +\"/?metadata&playlist=\"+ playlist).then(function (r)\n {\n\n // expect a json response\n return r.json();\n\n }).then(function (data)\n {\n\n setStreamData(data);\n\n });\n\n\n }", "function play_video_playlist(site_url, video_id)\n{\t\n\t$.ajax({\n\t\tcache:false,\n\t\turl: site_url+\"video/playlist_video/\"+video_id+\"/\",\t\t\t\t\n\t\tsuccess: function(data){\n\t\t\t//alert(data);\n\t\t\t$('#video_play').html(data);\n\t\t}\n\t});\t\n}", "function displayPlaylist() {\n\n var url = 'https://api.spotify.com/v1/users/spotify/playlists/';\n\n var playlistId = ($(this).data(\"playlistid\"));\nconsole.log(($(this).data(\"playlistid\")));\n\n url = url + playlistId \n\n return $.ajax({\n url: url,\n headers: {\n 'Authorization': 'Bearer ' + credentials.token\n }\n\n });\n}", "function playListAction(res){\n\n\tclient.playlist.listAction(function(data){\n\t\tcallbackResult(res,data);\n\t});\n\n}", "function retrieveSong(song) {\n // var song = userEntry[3]; // This has to be commented out in order for do-what-it-says to work... hmmmmmmmm probably a simple fix, but stuck.\n console.log(\"trying to retrieve song info...\")\n var songQuery = [];\n //\n for (i = 3; i < userEntry.length; i++) {\n songQuery.push(userEntry[i]);\n }\n \n var song = songQuery.join(\"+\");\n console.log(song);\n\n // search = song\n\n var spotify = new Spotify(myKeys.spotify);\n\n spotify.search({type: 'track', query: song}, function(err, data) {\n if (err) {\n console.log(\"Looks like an error... try a different SONG? || \" + err)\n }\n\n else {\n \n var songInfo = data.tracks.items[0]\n \n // Prints the artist(s), track name, preview url, and album name.\n console.log(\"Artist(s): \" + songInfo.album.artists[0].name); \n console.log(\"Song: \" + songInfo.name)\n console.log(\"Spotify Preview @: \" + songInfo.preview_url)\n console.log(\"Album: \" + songInfo.album.name);\n\t }\n });\n}", "async function songs(req, res, next) {\n try {\n const { playlistId } = req.params\n const playlist = await Playlist.findById(playlistId).populate('songs')\n if (!playlist) {\n throw new NotFound(`Playlist with id: ${playlistId} does not exist.`)\n }\n res.status(200).json(playlist.songs)\n } catch (err) {\n next(err)\n }\n}", "function getUserPlaylistSongs(currentPlaylist){\n // Empty out the object (if called another time)\n currentPlaylistSongObjects = [];\n // AJAX Call to get Selected Playlist's Songs and other info\n $.ajax({\n url: \"https://api.spotify.com/v1/users/\" + currentPlaylist.ownerID + \"/playlists/\" + currentPlaylist.playlistID + \"/tracks\",\n async : false,\n headers: {\n 'Authorization': 'Bearer ' + spotifyAccessToken\n }\n }).done(function(currentPlaylistResponse){\n\n // Loop Through the Playlists and get the IDs\n for(var i = 0; i < currentPlaylistResponse.items.length; i++){\n\n var newSongObject = {\n songName: currentPlaylistResponse.items[i].track.name,\n songID: currentPlaylistResponse.items[i].track.id,\n artistName: currentPlaylistResponse.items[i].track.artists[0].name,\n //albumCoverLink: currentPlaylistResponse.items[i].track.album.images[0].url\n };\n\n // Add Song Attributes Object to the PLay Array\n currentPlaylistSongObjects.push(newSongObject);\n }\n //console.log(currentPlaylistSongObjects)\n });\n }", "function getSpotify(song='The Sign', artist='Ace of Base') {\n\t// console.log(\"Spotify function ran\");\n\t// console.log(\"spotifyClient: \", spotifyClient);\n\n\tspotifyClient.search({type: 'track', query: song, artist: artist, limit: 1})\n\t\t.then(function(data) {\n\t\t\tvar firstItem=data.tracks.items[0];\n\t\t console.log(\"\\n\\n\" + \"SPOTIFY SONG RESULTS\".black.bgMagenta);\t\t\t\n\t\t\t// console.log (JSON.stringify(firstItem, null, 2));\n\t\t\tconsole.log(`Artist ${firstItem.album.artists[0].name.underline} | Song name ${firstItem.name} | Album name is ${firstItem.album.name}`);\n\t\t\tconsole.log(`Preview url ${firstItem.preview_url}`.white);\n\n\t\t}, function(err) {\n\t\t\tconsole.log('Sorry, I had a problem. ', err);\n\t\t});\n}", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }" ]
[ "0.8247424", "0.8247424", "0.7987782", "0.77777123", "0.75570565", "0.75111103", "0.75104743", "0.74973184", "0.7381728", "0.736393", "0.7302014", "0.7225632", "0.7215504", "0.7215188", "0.71851844", "0.7123066", "0.7065336", "0.70500124", "0.6993191", "0.69881153", "0.6968611", "0.69581586", "0.69526017", "0.68923765", "0.6881723", "0.6775399", "0.67549443", "0.6742045", "0.6734787", "0.6734294", "0.67311347", "0.67311347", "0.6697874", "0.66579705", "0.66468585", "0.66460663", "0.65552", "0.65391654", "0.65390307", "0.6537771", "0.6530272", "0.6513316", "0.6508944", "0.6496077", "0.64894557", "0.64881766", "0.64772344", "0.6455655", "0.6436656", "0.6428742", "0.64285016", "0.6413826", "0.64042205", "0.6398271", "0.6391558", "0.6387224", "0.63863647", "0.6380486", "0.63759553", "0.63727224", "0.6334189", "0.6329274", "0.6321979", "0.63165337", "0.6300019", "0.6278355", "0.62606144", "0.6259747", "0.6248653", "0.6207102", "0.6198272", "0.61828333", "0.6181713", "0.61797166", "0.6152689", "0.61525106", "0.6148949", "0.6142543", "0.61385065", "0.6126829", "0.6125164", "0.6121095", "0.6117475", "0.61153173", "0.6113289", "0.6113176", "0.61042494", "0.6104155", "0.6099159", "0.6094421", "0.60918325", "0.6090331", "0.6089655", "0.6086929", "0.60851234", "0.6082317", "0.6080772", "0.60699815", "0.6069605", "0.60652506" ]
0.6571977
36
! Get all songs from playlist
async function songs(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId).populate('songs') if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } res.status(200).json(playlist.songs) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "all(){\n const playlists = this.repository.load();\n return playlists.map(playlist => new Playlist(playlist.name, playlist.songs));\n }", "function getSongList(){\n\t\t\tSongSheetAPI.index(\n\t\t\t\tfunction success(data){\n\t\t\t\t\tconsole.log('success', data);\n\t\t\t\t\t$scope.songSheets = data;\n\t\t\t\t},\n\t\t\t\tfunction error(data){\n\t\t\t\t\tconsole.log('error', data);\n\t\t\t\t}\n\t\t\t);\n\t\t}", "function getPlaylistItems(data){\n\tgetPlaylistTracks(getTrackIDs, data.playlists.items[playlistLoop].id);\n}", "function getSongs(callback) {\n\n}", "function getAllTracks() {\n // TODO: Return array of objects.\n return tdInstance.playlist();\n }", "function getPlaylist() {\r\n return new Promise(function(resolve, reject) {\r\n var xhttp = new XMLHttpRequest();\r\n\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let playlist = JSON.parse(this.response);\r\n songs = [];\r\n\r\n for (var i = 0; i < playlist.length; i++) {\r\n playlistAdd(playlist[i]);\r\n songs.push(playlist[i]);\r\n \r\n }\r\n \r\n resolve(\"Got the playlist. Check song array.\");\r\n }\r\n };\r\n\r\n xhttp.onerror = function() {\r\n reject({\r\n status: this.status,\r\n statusText: this.statusText\r\n });\r\n };\r\n\r\n xhttp.open(\"GET\", \"playlist\", true);\r\n xhttp.send();\r\n });\r\n }", "async getPlaylists() {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n const userID = await this.getUserID();\n //GET method\n try {\n const response = await fetch(\n 'https://api.spotify.com/v1/me/playlists?limit=50',\n { headers: headers }\n );\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items\n .filter(playlist => playlist.owner.id === userID)\n .map(playlist => {\n return {\n id: playlist.id,\n name: playlist.name,\n tracksURL: playlist.tracks.href,\n image: playlist.images[1],\n uri: playlist.uri,\n };\n });\n }\n } else {\n throw new Error('Request to GET Playlists Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "function getSongs() {\n\n var spotify = new Spotify(keys.spotify);\n\n var songName = process.argv[3];\n\n spotify.search({ type: 'track', query: songName, limit: 1 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n\n console.log(data.tracks.items[0].artists[0].name);\n console.log(data.tracks.items[0].album.name);\n console.log(data.tracks.items[0].name);\n console.log(data.tracks.items[0].external_urls.spotify);\n });\n\n\n}", "function gotAllSongs(err) {\n console.log(\"gotAllSongs()\");\n\n // report an error, you'd want to do something better than this in production\n if (err) {\n console.log(\"error loading songs\");\n console.error(err);\n return;\n }\n\n // call functions to log and show the songs\n consoleLogSongs();\n showSongs();\n}", "function getUserPlaylistSongs(currentPlaylist){\n // Empty out the object (if called another time)\n currentPlaylistSongObjects = [];\n // AJAX Call to get Selected Playlist's Songs and other info\n $.ajax({\n url: \"https://api.spotify.com/v1/users/\" + currentPlaylist.ownerID + \"/playlists/\" + currentPlaylist.playlistID + \"/tracks\",\n async : false,\n headers: {\n 'Authorization': 'Bearer ' + spotifyAccessToken\n }\n }).done(function(currentPlaylistResponse){\n\n // Loop Through the Playlists and get the IDs\n for(var i = 0; i < currentPlaylistResponse.items.length; i++){\n\n var newSongObject = {\n songName: currentPlaylistResponse.items[i].track.name,\n songID: currentPlaylistResponse.items[i].track.id,\n artistName: currentPlaylistResponse.items[i].track.artists[0].name,\n //albumCoverLink: currentPlaylistResponse.items[i].track.album.images[0].url\n };\n\n // Add Song Attributes Object to the PLay Array\n currentPlaylistSongObjects.push(newSongObject);\n }\n //console.log(currentPlaylistSongObjects)\n });\n }", "function getPlaylistSongs(value) {\n var songs = [];\n var index = 0;\n for (i = 1; i < user_playlists.length; i++) {\n if (value == user_playlists[i].name) {\n songs = user_playlists[i].songs;\n index = i;\n };\n };\n printFavoritesPlaylists(songs, 1, index);\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getSongs() {\n\n spotify.search({ type: 'track', query: song }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n var songArr = data.tracks.items;\n \n //This for loop, loops through the array of songs that come up with every search.\n //The loop then pulls out the song name, album name, the artist's name, and the spotify link.\n for (var i = 0; i < songArr.length; i++) {\n \n console.log(i);\n console.log(\"Artist: \" + songArr[i].artists.map(getArtistsNames) + \n \"\\nSong: \" + songArr[i].name + \n \"\\nAlbum: \" + songArr[i].album.name + \n \"\\nLink: \" + songArr[i].external_urls.spotify);\n console.log(\"------------------------------------------\");\n }\n });\n}", "function getPlaylist() {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/me/playlists';\n xhr.open(\"GET\", url);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }", "function getPlaylists(access_token, allCallSongs) {\n $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization':'Bearer ' + access_token\n },\n success: function(response) {\n $(\".recommendations\").show();\n generatePlaylistDropdown(response.items, allCallSongs);\n }\n });\n}", "async function getPlaylists() {\n const result = await $.ajax({\n url: 'https://api.spotify.com/v1/me/playlists',\n headers: {\n 'Authorization': 'Bearer ' + access_token\n },\n error: function () {\n console.log(\"error fetching playlists!\");\n return;\n }\n });\n\n return result.items;\n}", "function getPlaylistTracks(playlistId, options, getAll, callback) {\r\n let url = 'https://api.spotify.com/v1/playlists/' + playlistId + '/tracks';\r\n if (getAll) {\r\n delete options.offset;\r\n delete options.limit;\r\n var tracks = [];\r\n function recurse(res) {\r\n tracks = tracks.concat(res.items);\r\n if(res.next && tracks.length > 0) {\r\n callSpotify(res.next, {}, recurse);\r\n } else {\r\n res.items = tracks;\r\n callback(res);\r\n }\r\n }\r\n return callSpotify(url, options, recurse);\r\n }\r\n return callSpotify(url, options, callback);\r\n}", "function listSongs () {\n $.getJSON(\"/songs\", function(songs){\n $.each(songs, function(index, song) {\n var the_song = new Song(song)\n $(\"#song_list\").append(the_song.formatSong())\n })\n })\n}", "loadSongs(songs) {\n for (var song of songs)\n {\n this.addSong(song, \"end\");\n }\n }", "getSongs() {\n\t\treturn this.songs;\n\t}", "getAllSongs() {\n Utils.get('/allSongs')\n .then((response) => {\n return response.json();\n })\n .then((json) => {\n Dispatcher.dispatch({\n type: ActionType.RECEIVE_ALL_SONGS,\n songs: json\n })\n })\n .catch((err) => {\n console.error('failed: ', err)\n })\n }", "function getSpotifySongs(userId, playlistId, index, req) {\n return spotify.getPlaylistTracks(userId, playlistId, req.session.user.access_token, index)\n .catch(spotify.OldTokenError, function () {\n // statusCode 401: Unauthorized\n return spotify.refreshToken(req.session.user.refresh_token)\n .then(function (body) {\n util.saveToken(req, body.access_token, body.refresh_token);\n return spotify.getPlaylistTracks(userId, playlistId, body.access_token, index);\n });\n });\n}", "function getSongsBySongArtist(song){\n var songs = []\n song.artist.forEach(function(artist){\n songs = songs.concat(artists[artist])\n })\n return songs\n}", "async getPlaylistWithTracks(id) {\n const _this = this;\n const playlist = (await _this.props.spotifyAPI.getPlaylist(id)).body\n \n // if there is more tracks than the limit (100 by default)\n if (playlist.tracks.total > playlist.tracks.limit) {\n\n // Divide the total number of track by the limit to get the number of API calls\n for (let i = 1; i < Math.ceil(playlist.tracks.total / playlist.tracks.limit); i++) {\n\n const trackToAdd = (await _this.props.spotifyAPI.getPlaylistTracks(id, {\n offset: playlist.tracks.limit * i // Offset each call by the limit * the call's index\n })).body;\n\n // Push the retreived tracks into the array\n trackToAdd.items.forEach((item) => playlist.tracks.items.push(item));\n }\n }\n return playlist;\n }", "viewFriendsSongsInPlaylist(playlist_id){\n this.getPlaylist(playlist_id)\n }", "async getPlaylistTracks(trackURL) {\n const accessToken = this.accessToken || this.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n // GET method\n try {\n const response = await fetch(trackURL, { headers: headers });\n if (response.ok) {\n const jsonResponse = await response.json();\n if (jsonResponse && jsonResponse !== {}) {\n return jsonResponse.items.map(track => {\n return {\n id: track.track.id,\n name: track.track.name,\n artist: track.track.artists[0].name,\n album: track.track.album.name,\n uri: track.track.uri,\n preview: track.track.preview_url,\n };\n });\n }\n } else {\n throw new Error('Request to GET Top Tracks Failed!');\n }\n } catch (err) {\n this.authFailed();\n console.log(err);\n }\n }", "function requestPlaylist() {\n var request = gapi.client.youtube.playlists.list({\n channelId : channelId,\n part: 'contentDetails',\n maxResults: 50\n });\n request.execute(function(response) {\n console.log(response);\n var playlistArr = response.result.items;\n for(var i = 0 ; i < playlistArr.length ; i++){\n var item = playlistArr[i];\n var playlistId = item.id;\n requestVideoPlaylist(playlistId);\n }\n \n });\n}", "async function getAllUserPlaylistTracks (uid, pid) {\n try {\n const spotify = createSpotify()\n let tracks = []\n // Batch size.\n const limit = 100\n // Track index.\n let offset = 0\n // Empty tracks guard variable.\n let empty = false\n while (!empty) {\n let options = { limit, offset }\n // Get tracks from playlist.\n const results = await spotify.getPlaylistTracks(uid, pid, options)\n .then(response => response.body.items )\n .catch(e => console.log(e) )\n // Add playlist tracks to tracks.\n if (results && results.length) {\n tracks = tracks.concat(results)\n // Offset track index for next batch.\n offset += 100\n } else {\n empty = true\n }\n }\n return tracks\n } catch (e) {\n throw e\n }\n}", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "async function loadSongs() {\n for await (const song of dbmanager.getAllSongs()) {\n win.webContents.send(\"add-song-to-list\", song);\n }\n}", "function gotAllSongs(err) {\r\n console.log(\"gotAllSongs()\");\r\n\r\n // report an error, you'd want to do something better than this in production\r\n if (err) {\r\n console.log(\"error loading songs\");\r\n console.error(err);\r\n return;\r\n }\r\n\r\n // call functions to log and show the books\r\n consoleLogSongs();\r\n showSongs();\r\n}", "async function fetchPlaylists() {\n const libPath = await window.api.invoke('store-get', 'library')\n if (libPath === undefined) {\n empty(playlistsElement)\n error.show('You must select an iTunes library. This can be done in the application settings.')\n return\n }\n\n try {\n await library.open(libPath)\n } catch(err) {\n error.show('Failed to open iTunes library')\n }\n\n try {\n const playlists = await library.getPlaylists()\n await empty(playlistsElement)\n\n Object.entries(playlists).forEach(([key, value]) => {\n const shouldExclude = excludes.some(item => value[item])\n const excludeDownloaded = value.name === 'Downloaded' && value.distinguished_kind !== 65\n if (!shouldExclude && !excludeDownloaded) {\n const playlist = document.createElement('a')\n const span = document.createElement('span')\n playlist.setAttribute('href', '#')\n playlist.setAttribute('data-playlist-id', value.playlist_id)\n playlist.classList.add('playlist-item')\n playlist.innerHTML = `${icons.playlist}`\n span.innerText = `${value.name}`\n playlist.append(span)\n\n playlist.addEventListener('click', async({ currentTarget }) => {\n window.api.send('store-set', 'last-playlist', currentTarget.getAttribute('data-playlist-id'))\n\n // Remove current 'active' class\n const active = document.querySelector('.active')\n if (active !== null) {\n active.classList.remove('active')\n }\n\n // Add 'active' class to clicked item\n currentTarget.classList.add('active')\n\n // Empty current playlist tracks\n await empty(list)\n\n // Get the playlist tracks\n const playlistItems = await library.getPlaylistItems(value)\n\n // Append each playlist track to the table\n Object.entries(playlistItems).forEach(async([key, value]) => {\n const track = await library.getTrackById(value.track_id)\n await list.append(table.buildRow(track))\n\n const trackName = document.getElementById('track-name')\n if (trackName.getAttribute('data-track-id') !== undefined) {\n const trackId = document.querySelector(`[data-id=\"${trackName.getAttribute('data-track-id')}\"]`)\n if (trackId) {\n trackId.classList.add('is-playing')\n trackId.querySelector('.play-button').innerHTML = icons.pause\n }\n }\n })\n })\n\n playlistsElement.append(playlist)\n }\n })\n\n // Get a list of all tracks for the search\n tracks = await library.getTracks()\n\n // Click on the last playlist that was viewed\n const lastPlaylist = await window.api.invoke('store-get', 'last-playlist')\n if (lastPlaylist !== undefined) {\n document.querySelector(`[data-playlist-id=\"${lastPlaylist}\"]`).click()\n }\n\n table.sort()\n } catch(err) {\n empty(playlistsElement)\n error.show('There was an error parsing the iTunes library')\n }\n}", "static getPlaylistAll (req, res) {\n\n Playlist.find().then(playLists => {\n\n const arrayToSend = []\n\n playLists.forEach(playList => { playList.users.forEach(u => { if (u.id === req.params.userId && playList.type === 'private') { arrayToSend.push(playList) } }) })\n playLists.forEach(playList => { if (playList.type === 'public') { arrayToSend.push(playList) } })\n playLists.forEach(p => {\n p.songs = _.sortBy(p.songs, ['grade'])\n\n })\n return res.json({ message: 'Your playLists', playLists: arrayToSend }) /* istanbul ignore next */\n }).catch(() => { return res.status(500).send({ message: 'Internal serveur error' }) })\n }", "async function fetchSavedSongs(access_token, refresh_token, url) {\n let songs = [];\n \n var options = {\n method: 'GET',\n headers: { 'Authorization': 'Bearer ' + access_token }\n };\n\n // fetch result from url provided\n let res = await fetch(url, options);\n let body = await res.json();\n\n // format response into simple list of song names and id's\n body.items && body.items.forEach((song) => {\n let track = song.track;\n songs.push({ id: track.id, name: track.name, uri: track.uri });\n });\n\n // return list of songs and url to next page of results (if exists)\n return { songs, next: body.next };\n}", "function spotifysong(song) {\n\n spotify.search({ type: 'track', query: song, limit: 20 }, function (err, data) {\n if (err) {\n return console.log('Error occurred: ' + error);\n }\n for (var i = 0; i < data.tracks.items.length; i++) {\n console.log(i);\n console.log(\"artist(s) : \" + data.tracks.items[i].album.artists[0].name);\n console.log(\"song name : \" + data.tracks.items[i].name);\n console.log(\"preview song : \" + data.tracks.items[i].preview_url)\n console.log(\"album : \" + data.tracks.items[i].album.name)\n console.log(\"----------------------------------------------\")\n }\n // console.log(data.tracks.items)\n\n });\n\n}", "async getSongsFromPlaylist(request, h) {\n try {\n const { playlistId } = request.params;\n console.log(playlistId);\n const { id: credentialId } = request.auth.credentials;\n await this._playlistsService.verifyPlaylistAccess(\n playlistId,\n credentialId\n );\n const data = await this._playlistssongService.getSongsFromPlaylist(\n playlistId\n );\n const response = h.response({\n status: 'success',\n data: {\n songs: data,\n },\n });\n response.code(200);\n return response;\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n console.log(error);\n return response;\n }\n\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami',\n });\n response.code(500);\n console.log(error);\n return response;\n }\n }", "function getPlaylistTracks(access_token, allCallSongs, request_url, playListTracks){\n var url = request_url || 'https://api.spotify.com/v1/playlists/' + $('select option:selected').val() + '/tracks'\n var playListTracks = (playListTracks || []);\n $.ajax({\n url: url,\n headers: {\n 'Authorization':'Bearer ' + access_token\n },\n success: function(response) {\n var tracks = generateTrackList(response.items, allCallSongs);\n console.log(tracks);\n tracks.map(function(track){\n playListTracks.push(track);\n })\n console.log(playListTracks);\n if(response.next) {\n getPlaylistTracks(access_token, allCallSongs, response.next, playListTracks);\n } else {\n console.log('done making spotify api requests for this playlist');\n $(\"#sortPane\").show();\n $(\"#controlPanel\").show();\n $('#playlistSwitcher').show();\n initNativePlays(playListTracks);\n writePlayListToPanel(playListTracks);\n initializePlayListControl(playListTracks);\n\n }\n }\n });\n}", "async fetch() {\n return await this.client.playlists.get(this.id, true);\n }", "async function fetchAllSavedSongs(access_token, refresh_token) {\n var songs = [];\n var features = [];\n var page = 0;\n var maxPage = 10;\n \n // specify url for first page of results\n let next = 'https://api.spotify.com/v1/me/tracks?limit=50';\n\n // start timer\n // var hrstart = process.hrtime()\n\n // fetch pages of results until we have fetched all results or exceed max pages\n while (next != null && page < maxPage) {\n // fetch songs\n let res = await fetchSavedSongs(access_token, refresh_token, next);\n songs = songs.concat(res.songs);\n\n // fetch audio features for songs fetched\n let audioFeatures = await getAudioFeatures(access_token, refresh_token, res.songs);\n features = features.concat(audioFeatures);\n \n // increment number of pages and set the url to the next page\n page++;\n next = res.next;\n }\n\n // TODO: remove this from prefetch function\n // let playlist = await previewPlaylist(access_token, refresh_token, songs, features, 30, null);\n\n // stop timer\n // var hrend = process.hrtime(hrstart);\n\n // log # of songs and elapsed time for testing\n // console.info(`Songs fetched: ${songs.length}`);\n // console.info('Execution time: %ds %dms', hrend[0], hrend[1] / 1000000)\n \n \n return {prefetchSongs: songs, prefetchFeatures: features}\n}", "function loadPlaylist() {\n myPlayer.catalog.getPlaylist('4450721964001', function(error, playlist) {\n myPlayer.catalog.load(playlist);\n playlistLength = myPlayer.playlist().length;\n });\n }", "function song() {\n spotify.search({\n type: 'track',\n query: search\n }, function (err, data) {\n if (err) {\n return console.log('ERROR! Search could not find results for: ' + err);\n } else {\n var results = data.tracks.items\n for (i = 0; i < results.length; i++) {\n console.log(\"================================================\");\n console.log(\"Artist: \" + results[i].artists[0].name);\n console.log(\"Song Name: \" + results[i].name);\n console.log(\"Follow this Spotify Link: \" + results[i].external_urls.spotify);\n console.log(\"Album Name: \" + results[i].album.name);\n };\n };\n });\n}", "function loadSongs() {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n for (var i = 0; i < songArray.length; i++) {\n var para = document.createElement('P');\n var t = document.createTextNode(songArray[i]);\n para.appendChild(t);\n document.querySelector('.songs').appendChild(para);\n }\n}", "getAllSongs(limit = 0, offset = 0) {\n\t\tvar query = `\n\t\tSELECT * FROM songs\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query]);\n\t}", "async function getData(userID) {\n console.log(\"Getting list of all playlists...\");\n\n const data = {};\n\n // get the first 50 playlists (if the user has that many)\n let playlistRequest = await spotifyApi.getUserPlaylists(userID, {\n limit: 50\n });\n\n // create an array with all the playlists\n // filter out spotify stuff because they could get mad that we're scraping their playlists (see: SongShift)\n data.playlists = playlistRequest.body.items.filter(x => x.owner.display_name != \"Spotify\");\n\n // while the user still has more playlists to go, get those too\n let i = 1;\n while (playlistRequest.body.next)\n {\n // get the next 50 playlists from the user (if they have that many)\n playlistRequest = await spotifyApi.getUserPlaylists(userID, {\n limit: 50,\n offset: 50 * i\n });\n\n // add the playlists to the array\n data.playlists.push(...playlistRequest.body.items);\n \n // increment counter for the offset\n i++;\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n console.log(\"Got list of all playlists!\");\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 4000));\n\n // for each playlist, get the tracks\n const artistIDs = [];\n for (const playlist of data.playlists)\n {\n console.log(`Downloading tracks information for ${playlist.name}...`);\n\n // get the list of tracks for the playlist\n let tracksRequest = await spotifyApi.getPlaylistTracks(playlist.id, {\n limit: 50\n });\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n\n // get audio features for tracks\n let trackIDs = tracksRequest.body.items.map(x => x.track.id);\n let audioFeaturesRequest = await spotifyApi.getAudioFeaturesForTracks(trackIDs);\n let features = audioFeaturesRequest.body.audio_features;\n tracksRequest.body.items.forEach((x, i) => x.track.audio_features = features[i]);\n\n // add the tracks to the tracks array\n playlist.tracks.list = tracksRequest.body.items;\n\n // if the playlist has more than 50 tracks, get those too\n let i = 1;\n while (tracksRequest.body.next)\n {\n // get the next 50 songs from the playlist\n tracksRequest = await spotifyApi.getPlaylistTracks(playlist.id, {\n limit: 50,\n offset: 50 * i\n });\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n\n // get audio features for tracks\n trackIDs = tracksRequest.body.items.map(x => x.track.id);\n audioFeaturesRequest = await spotifyApi.getAudioFeaturesForTracks(trackIDs);\n features = audioFeaturesRequest.body.audio_features;\n tracksRequest.body.items.forEach((x, i) => x.track.audio_features = features[i]);\n\n // add the tracks to the tracks array\n playlist.tracks.list.push(...tracksRequest.body.items);\n\n i++;\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n // get all unique artists from playlist\n playlist.tracks.list.forEach(obj => {\n obj.track.artists.forEach(x => {\n if (!artistIDs.includes(x.id))\n {\n artistIDs.push(x.id);\n }\n });\n });\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 2000));\n }\n\n console.log(\"Getting artists information...\");\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 4000));\n\n // download artist information\n data.artists = [];\n for (let i = 0; i < artistIDs.length; i += 50)\n {\n const artistsRequest = await spotifyApi.getArtists(artistIDs.slice(i, i + 50));\n data.artists.push(...artistsRequest.body.artists);\n\n // save progress\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n\n // wait a little bit as not to spam the API\n await new Promise(r => setTimeout(r, 500));\n }\n\n console.log(\"Playlist data download complete!\");\n\n fs.writeFileSync(`data/${userID}.json`, JSON.stringify(data));\n}", "async getPlaylists() {\n try {\n let playlists = await spotifyWebApi.getUserPlaylists();\n this.setState({\n playlists: playlists,\n loading: false,\n selectedPlaylist: {\n id: playlists.items[0].id, \n }\n });\n } catch (error) {\n console.error('Get User Playlists error: ', error);\n }\n }", "async function refreshPlaylistUrls(playlist) {\n var command = '/song/url?id='\n for(var i=0;i<playlist.length;i++) {\n command += playlist[i].id + ','\n }\n command = command.substr(0, command.length-1)\n url = host + command\n\n const res = await req('GET', url, '')\n let data = processHotSongs(res.body)\n addPlaylist(data.data)\n\n return data.data\n\n}", "function getPlaylistTracks(callback, playlistID){\n\tsettings = {\n\t\turl: `https://api.spotify.com/v1/users/Spotify/playlists/${playlistID}/tracks`,\n\t\theaders: {'Authorization': \"Bearer \"+ AUTHORIZATION_CODE},\n\t\tsuccess: callback,\n\t};\n\t$.ajax(settings);\n}", "async function getPlaylistItems(listId) {\n\t// See https://developers.google.com/youtube/v3/docs/playlistitems/list\n\tvar res = await youtube.playlistItems.list({\n\t\tplaylistId: listId,\n\t\tpart: 'snippet',\n\t})\n\n\tconst videoIds = res.data.items.map(\n\t\t({ snippet }) => snippet.resourceId.videoId\n\t)\n\n\t// Now that we know the IDs of all the videos in the uploads list,\n\t// we can retrieve information about each video.\n\treturn await getVideosMetadata(videoIds)\n}", "function getArtistSongs(artist_id) {\n url = '/get_artist_songs' + \"?artist_id=\" + artist_id;\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, true);\n request.setRequestHeader('Content-type', 'text/plain');\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n data = request.responseText;\n data = JSON.parse(data);\n temp_songs = data;\n printTracksToPage(data);\n };\n };\n request.send();\n}", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "function getTracks(playlist,offset)\n{\n $.ajax({\n url: \"https://api.spotify.com/v1/playlists/\"+playlist+\"/\"+\n \"tracks?market=ES&fields=items(added_by.id%2Ctrack(name%2Cid%2Chref%2Calbum(name%2Chref)))\"+\n \"&limit=100&offset=\"+offset,\n type: \"GET\",\n async: false,\n beforeSend: function(xhr){xhr.setRequestHeader('Authorization', 'Bearer ' + _token );},\n success: function(data) { \n console.log(data);\n for(var i = 0; i < data.items.length; i++)\n {\n tracks.push(data.items[i].track.id);\n trackNames.push(data.items[i].track.name);\n }\n numTracks = data.items.length;\n }\n }); \n}", "allPlaylistsList(){\n return this.state.playlists.map(current => {\n return (<Playlist playlist={current} key={current._id}/>)\n })\n }", "async getSongOnPlaylists(playlistId){\n const query = {\n text: `SELECT songs.id, songs.title, songs.performer \n FROM songs JOIN playlistssongs ON songs.id = playlistssongs.song_id WHERE playlistssongs.playlist_id = $1`,\n values: [playlistId],\n }\n \n const result = await this._pool.query(query)\n \n return result.rows\n }", "function getSongPlaylist() {\n axios.get(contextPath + \"/read\")\n .then(res => {\n table.innerHTML = \"\";\n\n const SongPlaylists = res.data;\n console.log(SongPlaylists);\n\n SongPlaylists.forEach(SongPlaylist => {\n const newSongPlaylist = renderSongPlaylist(SongPlaylist);\n console.log(\"New SongPlaylist: \", newSongPlaylist);\n table.appendChild(newSongPlaylist);\n });\n }).catch(err => console.error(err))\n}", "async function getPlaylistInfo() {\n var playlistInfo = await queryDbOnce('/Playlists/' + vue.playlist);\n var info = playlistInfo.val();\n vue.currentSongId = info.Current;\n vue.allowExplicit = info.Settings['Allow Explicit Songs'];\n vue.allowSpotify = info.Settings.Spotify;\n vue.allowYoutube = info.Settings.Youtube;\n}", "function loadPlaylist(){\n let playlistID = this.dataset.id; // this.dataset is an object containing all attributes with \"data-\" before\n spotupdtr.getMissingTracks(playlistID); // Fetching the missing tracks of the playlist\n}", "function getSongs(songData) { \n\t\tconsole.log(\"SongDataObj\", songData);\n\t\tlet songs = songData.songs;\n\n \t$.each(songs, (key, song) => {\n \t\t$showTitle.append(`<div>${song.song} by ${song.artist} on the album ${song.album}</div>`);\n \t});\n\t}", "async getAllMusicPlaylistHandler(request, h) {\n try {\n const { playlistId } = request.params;\n const { id: credentialId } = request.auth.credentials;\n\n // await this._service.verifyPlaylistsOwner(playlistId, credentialId);\n await this._service.verifyPlaylistAccess(playlistId, credentialId);\n\n const songs = await this._service.getAllMusicPlaylist(playlistId);\n\n return {\n status: 'success',\n data: {\n songs,\n },\n };\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n return response;\n }\n\n // Server ERROR!\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami.',\n\n });\n response.code(500);\n console.error(error);\n return response;\n }\n }", "function _readPlaylist () {\n\n\t\tthis.albums = (typeof this.settings.playlist.albums != 'undefined') ? this.settings.playlist.albums : [];\n\t\tthis.tracks = (typeof this.settings.playlist.tracks != 'undefined') ? this.settings.playlist.tracks : [];\n\n\t\t_sortTracks.apply(this);\n\n\t\tthis.currentSoundtrack = this.tracks[0].id;\n\n\t\tthis.debug('Playlist: '+ this.albums.length +' albums, '+ this.tracks.length +' soundtracks');\n\n\t}", "function playAplaylist(data, playCurrent = false) {\n\n let arr = []\n let songs = []\n console.log(data)\n if (data.length > 0) {\n data.map((song) => {\n console.log(song)\n arr.push(song.Content.videoId)\n songs.push(song.Content)\n })\n\n updatePlayerState({\n isPlaying: true,\n playlist: songs,\n songPlaying: songs[0],\n playedSongIndex: 0,\n playlistVideoIds: arr\n })\n }\n }", "function getAllPlaylists(options, userID) { \n var playlistsPromise = get(options);\n playlistsPromise.then(function (result) {\n var playlists = result.items;\n for (index in playlists) {\n var playlist = playlists[index];\n allTracksList[userID].push(playlist.tracks);\n }\n trackscount = 0\n for (index in allTracksList[userID]) {\n for (j in allTracksList[userID][index]) {\n trackscount += 1\n }\n }\n //paging\n if (result.next && allTracksList[userID].length < 75) {\n options['url'] = result.next;\n return getAllPlaylists(options, userID);\n } else {\n //Don't want to get rate-limited\n setTimeout(getAllTracks(userID), 5000);\n }\n });\n\n return playlistsPromise;\n }", "function getCustomSongs(i) {\n\t/* get songs list from json file */\n\t$.getJSON(\"songs.json\", function(data){\n\t\tplaylistsData[\"custom\"] = {\"id\": \"custom\", \"title\": \"Custom songs\"};\n\t\tplaylistsData[\"custom\"][\"songs\"] = data;\t\n\t\tcreatePlaylist();\n\t});\n}", "function playThatFunkyMusic(songName) {\n spotify\n .search({ type: \"track\", query: songName, limit: 5 })\n .then(function(response) {\n response.tracks.items.forEach(function(song) {\n console.log(\n `\n Artist(s): ${song.album.artists[0].name}\n Song Name: ${song.name}\n Preview Link: ${song.preview_url}\n Album: ${song.album.name}\n `\n );\n });\n\n // console.log(\n // `\n // Artist(s): ${response.tracks.items[0].album.artists[0].name}\n // Song Name: ${response.tracks.items[0].name}\n // Preview Link: ${response.tracks.items[0].preview_url}\n // Album: ${response.tracks.items[0].album.name}\n // `\n // );\n })\n .catch(function(err) {\n console.log(err);\n });\n}", "function getPlaylists() {\n\n\n \n var queryUrl = \"https://api.spotify.com/v1/me/playlists\"\n\n $.ajax({\n url: queryUrl,\n type: \"GET\",\n beforeSend: function (xhr) { xhr.setRequestHeader('Authorization', 'Bearer ' + _token); },\n success: function (response) {\n $(\"ul\").text(response.items[0].name)\n $(\"ul\").attr(\"value\", response.items[0].id)\n $(\"ul\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[0].images[0].url)\n $(\".album-page-name\").text(response.items[0].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(2)\").text(response.items[1].name)\n $(\"ul:nth-child(2)\").attr(\"value\", response.items[1].id)\n $(\"ul:nth-child(2)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[1].images[0].url)\n $(\".album-page-name\").text(response.items[1].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n\n $(\"ul:nth-child(3)\").text(response.items[2].name)\n $(\"ul:nth-child(3)\").attr(\"value\", response.items[2].id)\n $(\"ul:nth-child(3)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[2].images[0].url)\n $(\".album-page-name\").text(response.items[2].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(4)\").text(response.items[3].name)\n $(\"ul:nth-child(4)\").attr(\"value\", response.items[3].id)\n $(\"ul:nth-child(4)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[3].images[0].url)\n $(\".album-page-name\").text(response.items[3].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(5)\").text(response.items[4].name)\n $(\"ul:nth-child(5)\").attr(\"value\", response.items[4].id)\n $(\"ul:nth-child(5)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[4].images[0].url)\n $(\".album-page-name\").text(response.items[4].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(6)\").text(response.items[5].name)\n $(\"ul:nth-child(6)\").attr(\"value\", response.items[5].id)\n $(\"ul:nth-child(6)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[5].images[0].url)\n $(\".album-page-name\").text(response.items[5].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(7)\").text(response.items[6].name)\n $(\"ul:nth-child(7)\").attr(\"value\", response.items[6].id)\n $(\"ul:nth-child(7)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[6].images[0].url)\n $(\".album-page-name\").text(response.items[6].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(8)\").text(response.items[7].name)\n $(\"ul:nth-child(8)\").attr(\"value\", response.items[7].id)\n $(\"ul:nth-child(8)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[7].images[0].url)\n $(\".album-page-name\").text(response.items[7].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(9)\").text(response.items[8].name)\n $(\"ul:nth-child(9)\").attr(\"value\", response.items[8].id)\n $(\"ul:nth-child(9)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[8].images[0].url)\n $(\".album-page-name\").text(response.items[8].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(10)\").text(response.items[9].name)\n $(\"ul:nth-child(10)\").attr(\"value\", response.items[9].id)\n $(\"ul:nth-child(10)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[9].images[0].url)\n $(\".album-page-name\").text(response.items[9].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(11)\").text(response.items[10].name)\n $(\"ul:nth-child(11)\").attr(\"value\", response.items[10].id)\n $(\"ul:nth-child(11)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[10].images[0].url)\n $(\".album-page-name\").text(response.items[10].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(12)\").text(response.items[11].name)\n $(\"ul:nth-child(12)\").attr(\"value\", response.items[11].id)\n $(\"ul:nth-child(12)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[11].images[0].url)\n $(\".album-page-name\").text(response.items[11].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(13)\").text(response.items[12].name)\n $(\"ul:nth-child(13)\").attr(\"value\", response.items[12].id)\n $(\"ul:nth-child(13)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[12].images[0].url)\n $(\".album-page-name\").text(response.items[12].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(14)\").text(response.items[13].name)\n $(\"ul:nth-child(14)\").attr(\"value\", response.items[13].id)\n $(\"ul:nth-child(14)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[13].images[0].url)\n $(\".album-page-name\").text(response.items[13].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(15)\").text(response.items[14].name)\n $(\"ul:nth-child(15)\").attr(\"value\", response.items[14].id)\n $(\"ul:nth-child(15)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[14].images[0].url)\n $(\".album-page-name\").text(response.items[14].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n $(\"ul:nth-child(16)\").text(response.items[15].name)\n $(\"ul:nth-child(16)\").attr(\"value\", response.items[15].id)\n $(\"ul:nth-child(16)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[15].images[0].url)\n $(\".album-page-name\").text(response.items[15].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(17)\").text(response.items[16].name)\n $(\"ul:nth-child(17)\").attr(\"value\", response.items[16].id)\n $(\"ul:nth-child(17)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[16].images[0].url)\n $(\".album-page-name\").text(response.items[16].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(18)\").text(response.items[17].name)\n $(\"ul:nth-child(18)\").attr(\"value\", response.items[17].id)\n $(\"ul:nth-child(18)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[17].images[0].url)\n $(\".album-page-name\").text(response.items[17].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n $(\"ul:nth-child(19)\").text(response.items[18].name)\n $(\"ul:nth-child(19)\").attr(\"value\", response.items[18].id)\n $(\"ul:nth-child(19)\").on(\"click\", function () {\n $(\".album-cover-page\").attr(\"src\", response.items[18].images[0].url)\n $(\".album-page-name\").text(response.items[18].name)\n $(\".by-artist-album\").text(\"Created by\" + \" \" + response.items[0].owner.display_name)\n\n\n })\n\n\n }\n})\n}", "getAllTracks()\n {\n let res = [];\n \n for (let i=0; i<this.albums.length;i++){\n res = res.concat(this.albums[i].getTracks())\n }\n return res;\n\n }", "function getAllTracks(userID) {\n\n var options = {\n url: 'https://api.spotify.com/v1/me/artist',\n headers: { 'Authorization': 'Bearer ' + access_token },\n json: true\n };\n\n var TrackPromises = [];\n //iterate through playlists\n for (index in allTracksList[userID]) {\n var tracks = allTracksList[userID][index];\n options['url'] = tracks.href;\n //get tracks from playlist\n var TrackPromise = get(options);\n //make a new promise for each call\n TrackPromises.push(TrackPromise.then(function (result) {\n var tracks = result.items;\n //iterate through each track in the playlist\n for (index in tracks) {\n var track = tracks[index].track;\n trackScoreList[userID].push(track.popularity);\n //iterate through each track's artists\n for (index2 in track.artists) {\n var artist = track.artists[index2];\n if (trackArtistList[userID].indexOf(artist.href) < 0) {\n if (artist.href != null) { \n trackArtistList[userID].push(artist.href);\n }\n }\n }\n }\n }));\n }\n //wait for all track promises to resolve\n Promise.all(TrackPromises).then(function(arrayOfResults) {\n console.log(\"got all tracks\");\n setTimeout(getAllArtists(userID), 5000);\n });\n\n }", "async fetchSong(value) {\n let collection = [];\n const res = await fetch(`//ws.audioscrobbler.com/2.0/?method=track.search&track=${value}&api_key=77730a79e57e200de8fac0acd06a6bb6&format=json`)\n const data = await res.json()\n console.log(data);\n if (data.results) {\n for (let i = 0; i < 20; i++) {\n collection.push(data.results.trackmatches.track[i]);\n }\n console.log(collection);\n this.setState({ collection });\n return collection;\n }\n }", "getPlaylist() {\n return this.playlist;\n }", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "async playAll ({ state, dispatch }) {\n const plays = Object.keys(state.tracks)\n .map(track => dispatch('playTrack', track))\n\n const ids = await Promise.all(plays)\n return ids.flat()\n }", "function getPlaylists(){\n\n rp(requestPlaylists)\n .then(function(body) {\n var difference = diff(playlistsArray, body); // Compare old with new data\n if (difference) {\n io.emit('playlists', {\n playlists: body,\n userID: req.session.playlistOwner\n });\n }\n playlistsArray = body;\n })\n .catch(function(err) {\n console.log('error when loading playlists', err);\n socket.emit('offline' , err );\n // res.redirect('/');\n });\n }", "function loadPlaylistData(player, result) {\n player_playlist[player].remove();\n\n var playlistItems = [];\n for (var i = 0; i < result.length; i++) {\n playlistItems.push({\n title: (result[i].name.length > 50 ? (result[i].name.substring(0, 50) + \"...\") : result[i].name),\n name: result[i].name,\n mp3: result[i].path,\n id: result[i].id\n });\n }\n player_playlist[player].setPlaylist(playlistItems);\n}", "function processGetPlaylists(resultArr) {\n if ((!resultArr) || (resultArr == '')) {\n $('#playlistslist').empty();\n return;\n }\n var tmp = '', favourites = '', starred = '';\n\n for (var i = 0; i < resultArr.length; i++) {\n var li_html = '<li><a href=\"#\" onclick=\"return showTracklist(this.id);\" id=\"' + resultArr[i].uri + '\">';\n if(isSpotifyStarredPlaylist(resultArr[i])) {\n starred = li_html + '&#9733; Spotify Starred Tracks</a></li>' + tmp;\n } else if (isFavouritesPlaylist(resultArr[i])) {\n favourites = li_html + '&hearts; Musicbox Favourites</a></li>';\n } else {\n tmp = tmp + li_html + '<i class=\"' + getMediaClass(resultArr[i].uri) + '\"></i> ' + resultArr[i].name + '</a></li>';\n }\n };\n // Prepend the user's Spotify \"Starred\" playlist and favourites to the results. (like Spotify official client).\n tmp = favourites + starred + tmp;\n $('#playlistslist').html(tmp);\n scrollToTracklist();\n showLoading(false);\n}", "allTracks(){\n return this.collecTracks(this.collectAlbums());\n }", "getAlbums() {\n let results = [];\n\n if (!this.currentArtistName) {\n for (let i=0; i < this.albums.length; ++i) {\n results.push(this.albums[i].title);\n }\n\n return results;\n }\n else {\n let artistId = this._getArtistId();\n\n for (let i = 0; i < this.albums.length; ++i) {\n if (this.albums[i].artistId === artistId) {\n results.push(this.albums[i].title);\n }\n }\n }\n\n return results;\n }", "function spotifyIt(song) {\n // work on it\n if (song === \"\") {\n song = \"The Sign\";\n }\n\n spotify.search({ type: \"track\", query: song, limit: 1 }, function(err, data) {\n if (err) {\n return console.log(\"Error occurred: \" + err);\n }\n\n let tableArray = [];\n for (let i = 0; i < data.tracks.items.length; i++) {\n let result = {\n artist: data.tracks.items[i].album.artists[0].name,\n song_name: data.tracks.items[i].name,\n preview_url: data.tracks.items[i].preview_url,\n album_name: data.tracks.items[i].album.name\n };\n tableArray.push(result);\n }\n\n console.log(tableArray);\n });\n}", "function spotifySearch(){\n spotify.search({ type: 'track', query: songToSearch}, function(error, data){\n if(!error){\n for(var i = 0; i < data.tracks.items.length; i++){\n var song = data.tracks.items[i];\n console.log(\"Artist: \" + song.artists[0].name);\n console.log(\"Song: \" + song.name);\n console.log(\"Preview: \" + song.preview_url);\n console.log(\"Album: \" + song.album.name);\n console.log(\"-----------------------\");\n }\n } else{\n console.log('Error occurred.');\n }\n });\n }", "playlist() {\n return Playlists.findOne(playlistId);\n }", "function spotifyThisSong(songName) {\n console.log(\"spotify is working\");\n if (songName === undefined) {\n songName = \"What's my age again\";\n }\n \n spotify.search(\n {\n type: \"track\",\n query: songName\n },\n function(err, data) {\n if (err) {\n console.log(\"Error occurred: \" + err);\n return;\n }\n \n var songs = data.tracks.items;\n \n for (var i = 0; i < songs.length; i++) {\n console.log(i);\n console.log(\"artist(s): \" + songs[i].artists.map(getArtistNames));\n console.log(\"song name: \" + songs[i].name);\n console.log(\"preview song: \" + songs[i].preview_url);\n console.log(\"album: \" + songs[i].album.name);\n console.log(\"-----------------------------------\");\n }\n }\n );\n\n\n}", "function spotifyThisSong() {\n let song = \"The Sign Ace of Base\";\n if (searchTerm) {\n song = searchTerm;\n }\n spotify.request('https://api.spotify.com/v1/search?q=track:' + song + '&type=track&limit=10', function (error, response) {\n for (i = 0; i < 3; i++) {\n if (error) {\n return console.log(error);\n }\n console.log(\"\\nArtist: \" + response.tracks.items[i].artists[0].name + \"\\nSong: \" + response.tracks.items[i].name + \"\\nPreview: \" + response.tracks.items[i].preview_url + \"\\nAlbum: \" + response.tracks.items[i].album.name);\n };\n });\n}", "function getPlaylist(id, params) {\n return playlist.get(id, params).then(function(message) {\n message.results = _.shuffle(message.results);\n console.log(message);\n return message;\n }).catch(function(err) {\n console.error(err);\n throw err;\n });\n}", "function showUserPlaylists() {\n getUserPlaylists().then(text => {\n var playlists = JSON.parse(text);\n for (var playlist in playlists) {\n console.log(playlist);\n if (playlist != 'favourites') {\n createAsidePlaylist(playlists[playlist]);\n }\n };\n });\n}", "function getAlbumTracks(albumId, options, getAll, callback) {\r\n var url = 'https://api.spotify.com/v1/albums/' + albumId + '/tracks';\r\n if (getAll) {\r\n delete options.offset;\r\n delete options.limit;\r\n var tracks = [];\r\n url += \"?limit=50\";\r\n function recurse(res) {\r\n tracks = tracks.concat(res.items);\r\n if(res.next && tracks.length > 0) {\r\n callSpotify(res.next, {}, recurse);\r\n } else {\r\n res.items = tracks;\r\n callback(res);\r\n }\r\n }\r\n return callSpotify(url, {}, recurse);\r\n }\r\n return callSpotify(url, options, callback);\r\n}", "function searchSpotifyPlaylist(playlistID, message) {\n spotifyApi.getPlaylist(playlistID)\n .then(function (data) {\n data.body.tracks.items.forEach((track) => {\n var title = track.track.artists[0].name + \" - \" + track.track.name;\n //console.log(title);\n titles.push(title);\n })\n sendPlaylistEmbed(message);\n searching = true;\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "searchSong(song = \"The Sign\") {\n let params = {\n type: 'track',\n query: song,\n limit: 5\n }\n\n console.log(`\\n=======\\nSearching for the song \"${song}\"`);\n this.api.search(params, function(err, data) {\n if (err) {\n console.log('Error occurred: ' + err);\n return;\n }\n else if (data.tracks.items.length === 0) {\n console.log(\"No song found.\");\n return;\n }\n // console.log(data);\n\n console.log(`\\n=======\\nSeach result for the song \"${song}\"`);\n let items = data.tracks.items;\n for (let i = 0; i < items.length; i++ ) {\n let artist = items[i].artists.map(a => a.name).join(\", \");\n let songName = items[i].name;\n let link = items[i].external_urls.spotify;\n let album = items[i].album.name;\n\n console.log(\"- \" + (i + 1) + \" -\");\n console.log(`\\tArtist(s): ${artist}`);\n console.log(`\\tSong Name: ${songName}`);\n console.log(`\\tLink: ${link}`);\n console.log(`\\tAlbum: ${album}`);\n }\n });\n }", "function getAllTracks(userID) {\n\n var options = {\n url: 'https://api.spotify.com/v1/me/artist',\n headers: { 'Authorization': 'Bearer ' + access_token },\n json: true\n };\n\n var TrackPromises = [];\n //Gets tracks from a playlist using the playlist's link\n for (index in allTracksList[userID]) {\n var tracks = allTracksList[userID][index];\n options['url'] = tracks.href;\n var TrackPromise = get(options);\n TrackPromises.push(TrackPromise.then(function (result) {\n var tracks = result.items;\n for (index in tracks) {\n var track = tracks[index].track;\n trackScoreList[userID].push(track.popularity);\n for (index2 in track.artists) {\n var artist = track.artists[index2];\n if (trackArtistList[userID].indexOf(artist.href) < 0) {\n if (artist.href != null) { \n trackArtistList[userID].push(artist.href);\n }\n }\n }\n }\n }));\n }\n\n Promise.all(TrackPromises).then(function(arrayOfResults) {\n console.log(\"got all tracks\");\n console.log(trackArtistList)\n setTimeout(getAllArtists(userID), 5000);\n });\n\n }", "function getAllPlaylists(options, userID) { \n //get a user's public playlists \n var playlistsPromise = get(options);\n playlistsPromise.then(function (result) {\n var playlists = result.items;\n //iterate through all playlists\n for (index in playlists) {\n var playlist = playlists[index];\n allTracksList[userID].push(playlist.tracks);\n }\n trackscount = 0\n //count number of playlists\n for (index in allTracksList[userID]) {\n for (j in allTracksList[userID][index]) {\n trackscount += 1\n }\n }\n //paging\n if (result.next && allTracksList[userID].length < 75) {\n options['url'] = result.next;\n return getAllPlaylists(options, userID);\n } else {\n //Don't want to get rate-limited\n setTimeout(getAllTracks(userID), 5000);\n }\n });\n\n return playlistsPromise;\n }", "function getMp3 ()\n{\n var url = controller_url + \"?action=lib_display\";\n\n // get mp3 file list in json\n $.getJSON(url, function (mp3)\n {\n // log('result :', mp3);\n\n if (mp3)\n {\n $.each(mp3, function(i, val){\n var pos = val.file.lastIndexOf(\"/\");\n\n path = val.file.substr(0, pos);\n file = val.file.substr(pos+1);\n\n $('#filelist').append(\"<li><span class='add_song' s_id='\" + val.s_id['$id'] + \"' path='\" + path + \"' title='click to add to playlist'>\" + file + \"</span><img s_id='\" + val.s_id['$id'] + \"' class='float_right_button tag' alt='[Tag]' title='show/edit tags' /></li>\");\n });\n\n // default initial action:\n // - add first song to playlist\n $('#filelist .add_song:first').trigger( \"click\" );\n // - load first song\n $('.play_song:first()').trigger('click');\n }\n });\n\n return;\n}", "addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }", "function getTracksById(ids, accessToken, username) {\n let trackRequest = spotifyGetTracks(accessToken, ids);\n trackRequest.then(resp => {\n console.log(resp);\n let songs = resp.tracks.map(song => new Song(song));\n console.log(resp, songs);\n displaySongs(songs, username);\n }, err => {\n console.log(err);\n });\n}", "async function getAllUserPlaylists (uid) {\n try {\n const spotify = createSpotify()\n let playlists = []\n const limit = 50\n // Playlist index.\n let offset = 0\n // Empty playlist guard variable.\n let empty = false\n while (!empty) {\n let options = { limit, offset }\n // Get user playlists.\n const results = await spotify.getUserPlaylists(uid, options)\n .then(response => response.body.items )\n // Add playlists to results.\n if (results && results.length) {\n playlists = playlists.concat(results)\n // Offset playlist index for next batch.\n offset += 50\n } else {\n empty = true\n }\n }\n return playlists\n } catch (e) {\n throw e\n }\n}", "function getTracks(user_id, playlist_id) {\n return new Promise(function(resolve, reject) {\n let xhr = new XMLHttpRequest();\n let url = 'https://api.spotify.com/v1/users/' + user_id + '/playlists/' + playlist_id + '/tracks';\n xhr.open(\"GET\", url);\n xhr.setRequestHeader('Authorization', 'Bearer ' + access_token);\n xhr.onload = () => resolve(xhr.responseText);\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n }", "function fetch_musics(){\n $.ajax({\n url:'fetch-music.php',\n method:\"POST\",\n data:{songs:songs},\n dataType:\"json\",\n success:function(data){\n var obj = JSON.parse(JSON.stringify(data));\n \n for ( var i in obj){\n playlist.push(obj[i].file);\n title.push(obj[i].music);\n poster.push(obj[i].image);\n artists.push(obj[i].artist);\n }\n add_to_list();\n }\n });\n}", "function searchMusic(name){\n if(!name){\n name = \"The sigin\";\n }\n spotify.search({ type: 'track', query: name }, function(err, data) {\n if (err) {\n return console.log('Error occurred: ' + err);\n }\n for (var i = 0; i < 5; i++) {\n console.log(\"Artist Name: \"+data.tracks.items[i].artist[0].name); \n console.log(\"Song name: \"+data.tracks.items[i].name);\n console.log(\"Link: \"+data.tracks.items[i].album.name);\n console.log(\"Album\"+data.tracks.items[i].preview_url);\n console.log(\"-------------------------------------\");\n }\n });\n}", "async function getSongsapi() {\n let songs = await fetch(\"https://shazam.p.rapidapi.com/songs/list-artist-top-tracks?id=xxxxxxxx&locale=en-US\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"xxxxxxxxxxxxxxxxx\",\n \"x-rapidapi-host\": \"shazam.p.rapidapi.com\"\n }\n });\n let songsJson = await songs.json();\n let tracks = songsJson.tracks;\n let count = tracks.length - 1;\n displaySongs(tracks, count, true);\n\n}", "function allAccessSearch() {\n var deferred = Q.defer();\n\n that.pm.search(query, 25, function(err, data) {\n if (err) { deferred.reject(err); return; }\n\n var songs = (data.entries || []).map(function(res) {\n var ret = {};\n\n ret.score = res.score;\n\n if (res.type == \"1\") {\n ret.type = \"track\";\n ret.track = that._parseTrackObject(res.track);\n }\n else if (res.type == \"2\") {\n ret.type = \"artist\";\n ret.artist = res.artist;\n }\n else if (res.type == \"3\") {\n ret.type = \"album\";\n ret.album = res.album;\n }\n\n return ret;\n });\n\n deferred.resolve(songs);\n });\n\n return deferred.promise;\n }", "getSongs() {\n let allConstants = this.allConstants\n axios({\n method: allConstants.method.GET,\n url: allConstants.getSongs,\n header: allConstants.header\n })\n .then((res) => {\n this.setState({ songs: res.data });\n this.setState({ songsList: res.data });\n this.setState({ isDataLoaded: true });\n })\n .catch((err) => {\n console.log('Error occurred...', err)\n })\n }", "function getUserPlaylistIDs(){\n // Empty out the array (if previously called set)\n userPlaylistObjects = [];\n\n // AJAX Call to get the User's Playlists (using the Access Token)\n $.ajax({\n url: \"https://api.spotify.com/v1/users/\" + userSpotifyId + \"/playlists\",\n headers: {\n 'Authorization': 'Bearer ' + spotifyAccessToken\n }\n }).done(function(userPlaylistResponse){\n // Loop Through the Playlists and get the IDs\n for(var i = 0; i < userPlaylistResponse.items.length; i++){\n\n var newPlaylistObject = {\n name: userPlaylistResponse.items[i].name,\n playlistID: userPlaylistResponse.items[i].id,\n ownerID: userPlaylistResponse.items[i].owner.id,\n plalyistChildren: []\n };\n\n // Add Playlist IDs to array\n userPlaylistObjects.push(newPlaylistObject);\n }\n });\n }", "function getAll(){\n\tvar pictures = document.getElementById(\"picture\");\n\taudio.src = SingleList[i].audio;\n\tpictures.src = SingleList[i].picture;\n\t$('#nowplay').html(SingleList[i].artistSong());\n\t\n\taudio.play();\n\n}" ]
[ "0.78318757", "0.7406652", "0.7400498", "0.7354724", "0.7221659", "0.7216712", "0.71547866", "0.714415", "0.7100625", "0.7099683", "0.7091057", "0.7070224", "0.7070224", "0.7065635", "0.70155627", "0.6933792", "0.6918889", "0.6836246", "0.6812394", "0.67817247", "0.677996", "0.6778886", "0.6778493", "0.6745888", "0.67387664", "0.6728626", "0.67200965", "0.6702199", "0.6693372", "0.6674293", "0.66678303", "0.66631854", "0.66490954", "0.6645744", "0.66407967", "0.6631549", "0.663034", "0.66143435", "0.6594694", "0.6588718", "0.6566789", "0.65577227", "0.6544391", "0.65232074", "0.65181804", "0.6500665", "0.6456948", "0.644542", "0.6429957", "0.6427299", "0.6423976", "0.6422012", "0.6418874", "0.6414351", "0.6410676", "0.64095694", "0.6403165", "0.6403145", "0.6400203", "0.6392211", "0.63871825", "0.63706136", "0.63642454", "0.6361372", "0.6359854", "0.6356635", "0.63540924", "0.6352781", "0.63506997", "0.63456565", "0.6336814", "0.6336291", "0.6335723", "0.63272595", "0.6324943", "0.6317002", "0.6311398", "0.6309573", "0.6305467", "0.62839615", "0.62775254", "0.62719584", "0.62672806", "0.6254437", "0.62460387", "0.62402624", "0.6236922", "0.62267834", "0.6219779", "0.62136316", "0.620503", "0.62047875", "0.62034976", "0.619949", "0.6198666", "0.61981386", "0.61978936", "0.6197278", "0.61798626", "0.6179524" ]
0.685145
17
! Create a playlist
async function add(req, res, next) { try { req.body.user = req.currentUser req.body.users = req.currentUser const playlist = await Playlist.create(req.body) await playlist.save() const user = await User.findById(req.currentUser._id) user.playlists.push(playlist) const savedUser = await user.save() res.status(200).json(savedUser) } catch (e) { next(e) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createPlaylist() {\n\t\t// create request\n\t\tvar request = {};\n\t\trequest[\"artistPool\"] = artistPool;\n\t\t\n\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\trequestBuilder.postRequest(common.generatePlaylistURL, onCreatePlaylist, JSON.stringify(request));\n\t}", "function createPlaylist() {\n var name = prompt(\"What do you want to call your playlist?\");\n if ((name == null) || (name == \"\")) {\n name = \"default\";\n };\n\n var playlist = {\"name\": name, \"songs\":[]};\n user_playlists.push(playlist);\n showLocalPlaylists();\n}", "function createPlaylist(callback){\n\t\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId + '/playlists';\n\t\t$.ajax(url, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: JSON.stringify({\n\t\t\t\t'name': 'Metly: A ' + desiredMood + \" Journey to \" + toStation,\n\t\t\t\t'public': false\n\t\t\t}),\n\t\t\tdataType: 'json',\n\t\t\theaders: {\n\t\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tcallback(data, openPlaylist);\n\t\t\t},\n\t\t\terror: function(data) {\n\t\t\t\tcallback(null);\n\t\t\t}\n\t\t});\n}", "function mashlistCreatePlaylist($_mashlist) {\n models.Playlist.create($_mashlist.find('h3').text()).done(function (playlist) {\n playlist.load(['tracks']).done(function (_playlist) {\n models.Playlist.fromURI($_mashlist.attr('data-uri')).load(['tracks']).done(function (templist) {\n templist.tracks.snapshot(0, 1000).done(function(snapshot) {\n _playlist.tracks.add(snapshot.toArray());\n });\n });\n });\n });\n }", "function createSpotifyPlaylist(message) {\n spotifyApi.createPlaylist('MaeshBot\\'s Playlist', { 'description': 'Playlist converted from YouTube by MaeshBot :)', 'public': true })\n .then(function (data) {\n var spotifyPlaylistId = data.body.id;\n titles.forEach((title) => {\n // search for title\n searchAndAdd(title, spotifyPlaylistId);\n // add first track to playlist\n })\n message.channel.send(\"Here's the link to the playlist: \" + String(data.body.external_urls.spotify));\n console.log('Created playlist!', data.body);\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "function createPlaylistCall (playlist: Playlist): Promise {\n return rpc('CreatePlaylist', {playlist})\n}", "function makePlaylist(playlistName, song, songID) {\r\n var path = __dirname + '\\\\Music\\\\' + Folder + '\\\\';\r\n song = cleaner.cleanString(song);\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n fs.exists(path + playlistName + '.m3u', (exist) => {\r\n if (exist) {\r\n fs.exists(path + song + '.mp3', async (exist) => {\r\n if (!exist) {\r\n var status = await download(song, songID);\r\n mp3Duration(path + song + '.mp3', function (err, duration) {\r\n if (err) return console.log(err.message);\r\n fs.appendFile(path + playlistName + '.m3u', '#EXTINF:' + duration + ',' + song + '\\r\\n' + song + '.mp3\\r\\n', (err) => {\r\n if (err) throw err;\r\n resolve({ Message: 'Added ' + song + ' to ' + playlistName, Status: status });\r\n });\r\n });\r\n }\r\n else {\r\n resolve({ Message: 'Song already exist: ' + song, Status: 'Not downloaded again' });\r\n }\r\n })\r\n }\r\n });\r\n }, 2);\r\n });\r\n}", "function createPlaylist() {\n\tvar html = '<li data-i=\"all\">All</li>';\n\t$.each(playlistsData, function(k, v){\n\t\thtml += '<li data-i=\"'+ k +'\">'+ v.title +'</li>';\n\t});\n\t$playlist.html(html);\n}", "function playlist(id, fname, lname, status)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.id = id;\n\t\t\t\t\t\tthis.first_name=fname;\n\t\t\t\t\t\tthis.last_name=lname;\n\t\t\t\t\t\tthis.status = status;\n\t\t\t\t\t}", "addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }", "function makeNewPlaylist(uId){\n if(!uId){\n console.warn('No user id found. Aborting makeNewPlaylist()');\n return;\n }\n \n return fetch(`https://api.spotify.com/v1/users/${uId}/playlists`, {\n method: 'POST',\n headers: {\n Authorization: 'Bearer ' + accessToken\n },\n body: JSON.stringify({\n name: 'unSpottedSleep',\n public: false,\n description: 'Currently you\\'ll probably want to delete this, or else it\\'ll stack up.'\n })\n })\n .then(response => response.json())\n .then(obj => postResp = obj)\n .catch(err => console.error(`An error occured in making a new playlist. Message was: ${err.message}`));\n}", "function createPlaylist(name,id){\n var list = $('#playlists > ul')[0];\n \n var li = document.createElement('li');\n $(li).addClass('dropdown');\n \n // assing playlist id to <li> element\n $(li).attr('value',String(id));\n \n var img = document.createElement('img');\n $(img).attr('src','media/playlist.svg');\n \n var playlist_name = document.createElement('span');\n $(playlist_name).addClass('playlist_name').click(function(e){\n showPlaylistContent($(this).parent().attr('value'));\n }).text(name);\n \n var dropdown_content = document.createElement('div');\n $(dropdown_content).addClass('dropdown_content').hide();\n \n var play = document.createElement('button');\n $(play).addClass('playlist_btn').text('Play').click(function(e){\n playPlaylist(this);\n });\n\n var edit = document.createElement('button');\n $(edit).addClass('playlist_btn').text('Edit songs').click(function(e){\n editPlaylistModal(this);\n });\n\n var delete_btn = document.createElement('button');\n $(delete_btn).addClass('playlist_btn').text('Delete')\n .css('background-color','#ee1111').click(function(){\n deletePlaylistAlert(this);\n });\n \n var playlist_song_list = document.createElement('ul');\n $(playlist_song_list).addClass('playlist_song_list');\n \n dropdown_content.appendChild(play);\n dropdown_content.appendChild(edit);\n dropdown_content.appendChild(delete_btn);\n dropdown_content.appendChild(playlist_song_list);\n \n li.appendChild(img);\n li.appendChild(playlist_name);\n li.appendChild(dropdown_content);\n list.appendChild(li);\n\n return li;\n}", "function generatePlaylist(){\n return Promise.resolve(getUserId(accessToken))\n .then(() => makeNewPlaylist(uId));\n}", "async createPlaylist(title, visibility) {\n\t\tif (!visibility) visibility = 'public';\n\n\t\tconst headers = this.#genHeaders(['Content-Type', 'Authorization']);\n\t\tconst data = {\n\t\t\ttitle: title,\n\t\t\tvisibility: visibility\n\t\t};\n\n\t\tconst response = await RequestInterface.sendRequest('POST', `${this.#proxyUrl}/${this.#baseUrl}/users/${this.#uid}/playlists/create`, data, headers);\n\t\tif (!response || !response.result.kind) return false;\n\n\t\tconsole.log(response.result.kind);\n\t\treturn response.result.kind;\n\t}", "function Playlist(name) {\n this.name = name;\n this.tracks = [];\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "createNewPlaylist (name, json, key = false) {\n // Create new playlist reference with id.\n let nameRef\n if (key) {\n this.playlistsRefs.child(key).set({'name': name, name_lower: name.toLowerCase()})\n nameRef = key\n } else {\n nameRef = this.playlistsRefs.push({'name': name, name_lower: name.toLowerCase()}).ref.key\n }\n // Using ID + name push new song.\n this.playlists.child(nameRef).set({'name': name, name_lower: name.toLowerCase()})\n\n this.playlistSongAdd(nameRef, json)\n }", "function onCreatePlaylist(response) {\n\t\talert(response.result + response.error + response.errorText);\n\t}", "function setUpPlaylist(input){\n var player=input.player, playlistId=input.playlistId, div=input.div, \n actionClick=input.actionClick, actionEnter=input.actionEnter, actionLeave=input.actionLeave;\n styleNowPlaying=input.styleNowPlaying, styleNotPlaying=input.styleNotPlaying;\n //div.style.display=\"block\";\n var sampleNode=div.getElementsByClassName('sampleNode')[0].cloneNode(true);\n while (div.firstChild) {\n div.removeChild(div.firstChild);\n }\n div.appendChild(sampleNode);\n var templateNode = sampleNode.cloneNode(true);\n sampleNode.style.display = \"none\";\n //get playlist video Ids as array\n var playlist=[],item=[],len;\n var styled=false;\n followPlaylist(player, div, styleNowPlaying, styleNotPlaying);\n if(typeof playlistId===\"string\"){//use playlistId, Max 50 items\n playlistInfo(playlistId,getlist);\n }\n else {//use Array, no maximun\n playlist=playlistId;\n len=playlist.length;\n for(var i=0;i<len;i++){\n display(i);\n }\n } \n function getlist(data1){\n len=data1.items.length;//test2.innerHTML+=\" playlistData:\"+len;\n for(var i=0;i<len;i++){\n playlist[i]=data1.items[i].contentDetails.videoId;\n display(i); \n }\n }\n function display(i){\n videoInfo(playlist[i],construction);\n function construction(data){\n\n //item[i]=div.getElementsByClassName('sampleNode')[0].cloneNode(true);//true:clone with all descendants\n item[i] = templateNode.cloneNode(true); //true:clone with all descendants\n // item[i].style.display=\"block\";\n if(item[i].getElementsByClassName(\"title\")[0]!=null) \n item[i].getElementsByClassName(\"title\")[0].innerHTML=data.items[0].snippet.title;\n if(item[i].getElementsByClassName(\"channelTitle\")[0]!=null)\n item[i].getElementsByClassName(\"channelTitle\")[0].innerHTML=data.items[0].snippet.channelTitle;\n if(item[i].getElementsByClassName(\"thumbnail\")[0]!=null){ \n var image=document.createElement('img');\n //image.setAttribute('src',data.items[0].snippet.thumbnails.default.url);\n image.setAttribute('src', 'http://img.youtube.com/vi/' + playlist[i] + '/default.jpg');\n item[i].getElementsByClassName(\"thumbnail\")[0].appendChild(image);\n }\n\n item[i].className += \" playlistItem \"+i+\" \"+playlist[i];\n //item[i].id=\"position:\"+i;\n //test2.innerHTML+=item[i].id;\n if(input.actionClick!=null) item[i].addEventListener(\"click\",click);\n if(input.actionEnter!=null)item[i].addEventListener(\"mouseenter\",cursorEnter);//better to use css :hover\n if(input.actionLeave!=null)item[i].addEventListener(\"mouseleave\",cursorLeave);\n //insert item in the right order\n if (i === len - 1) {\n div.appendChild(item[i]);\n //div.getElementsByClassName('sampleNode')[0].style.display = \"none\";\n }\n for(var j=i+1;j<len;j=j+1){\n if(item[j]!=undefined){\n div.insertBefore(item[i], item[j]);\n break;\n }\n if(j===len-1) div.appendChild(item[i]);\n }\n\n //check if now playing\n if(styled===false){\n var videoId=getQueryVariable(player.getVideoUrl(),'v');\n if(playlist[i]===videoId) {\n var event={data:player.getPlayerState()};\n if (styleNowPlaying) styleNowPlaying(event, item[i]);\n styled=true;\n } \n }\n function click(event){\n //loadVideo(player,playlist[i]);\n actionClick(event,i,item[i]);\n }\n function cursorEnter(event){\n actionEnter(event,i,item[i]);\n }\n function cursorLeave(event){\n actionLeave(event,i,item[i]);\n }\n }\n } \n function followPlaylist(player, playlistDiv,styleNowPlaying,styleNotPlaying) {\n //but eventlistenr seems always happen before div setting\n // test2.innerHTML+=\" eventListener\";\n player.addEventListener(\"onStateChange\",nowPlaying);\n function nowPlaying(event){\n //if(event.data===-1){\n var videoId=getQueryVariable(player.getVideoUrl(),'v');\n var itemDiv=playlistDiv.getElementsByClassName(videoId)[0];\n var listItems=playlistDiv.getElementsByClassName(\"playlistItem\");\n if(styleNotPlaying!=null) {for(var i=0;i<listItems.length;i++) styleNotPlaying(event,listItems[i]);}\n if(styleNowPlaying!=null) styleNowPlaying(event,itemDiv);\n //}\n }\n } \n}", "async createPlaylist(playlistId) {\n if (!this._auth()) return;\n let playlist = ss.Playlist.findById(playlistId);\n if (!playlist.youtubeId) {\n try {\n let response = await this._createPlaylist(playlist);\n console.info('Successfully created YouTube playlist ' + playlist.name);\n playlist.youtubeId = response.data.id;\n playlist.update();\n } catch (err) {\n this.addAlert('Unable to create YouTube playlist ' + playlist.name);\n console.error(err);\n if (err.message == 'invalid_grant') {\n this.service = undefined;\n const settings = new ss.SoulSifterSettings();\n settings.putString('google.oauthRefreshToken', '');\n settings.save();\n }\n return;\n }\n }\n try {\n await this._updatePlaylistEntries(playlist);\n // if (!!playlist.query) {\n // let songs = ss.SearchUtil.searchSongs(playlist.query,\n // /* bpm */ 0,\n // /* key */ '',\n // playlist.styles,\n // /* songsToOmit */ [],\n // /* limit */ 200,\n // /* energy */ 0,\n // /* musicVideoMode */ false,\n // /* orderBy */ 0,\n // /* errorCallack */ (msg) => { this.addAlert(msg, 5); });\n // for (let i = 0; i < songs.length; ++i) {\n // await this._addSongToPlaylist(songs[i], playlist);\n // await this.sleep();\n // }\n // }\n } catch (err) {\n this.addAlert('Unable to add song to YouTube playlist ' + playlist.name);\n console.error(err);\n return;\n }\n }", "function addToPlaylist(songsList){\n for(var i=0; i<songsList.length; i++){\n // Getting metadata for the audio file\n id3({ file: songsList[i].toString(), type: id3.OPEN_LOCAL }, function(err, tags) {\n if(tags){\n tableRow = document.createElement(\"tr\")\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.title)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.album)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.artist)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n tableRow.setAttribute(\"id\", i)\n document.getElementById('playlist-body').appendChild(tableRow)\n }\n });\n }\n}", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "function populatePlaylist() {\n\n for (i in playlist) {\n // Display the search results and an add button to vote section\n var playlistContainer = document.createElement('div');\n playlistContainer.className = \"current\";\n\n var playlistTitle = document.createElement('h4');\n playlistTitle.innerHTML = playlist[i].title;\n\n var playlistThumbnail = document.createElement('img');\n playlistThumbnail.src = playlist[i].imgSrc;\n\n $('#playback-bar').append(playlistContainer);\n playlistContainer.append(playlistThumbnail);\n playlistContainer.append(playlistTitle);\n\n playlistContainer.id = playlist[i].songId;\n\n // console.log(playlistContainer.id);\n }\n }", "savePlaylist() {\n\t\tlet trackURIs = [];\n\t\tfor(let i = 0; i < this.state.playlistTracks.length; i++) {\n\t\t\ttrackURIs.push(this.state.playlistTracks[i].uri);\n\t\t}\n\t\tSpotify.savePlaylist(this.state.playlistName, trackURIs);\n\t\tthis.setState({playlistName: 'New Playlist', playlistTracks: []});\n\t}", "function createPlaylist(targetName) {\n\n //Whatever name in that div is cleared out.\n targetDiv.innerHTML = \"\";\n\n //What ever name is passed through the argument is converted to lowercase, in case the name at the end of the URL is typed in a weird way: pAtriCk GaRvIn, etc.\n targetName = targetName.toLowerCase();\n\n //This sorts the setlists array by the \"Number.\" This number refers to which song this was in the series. Our first song — \"Tears Of A Clown\" — will be 1 under \"Number.\" The 100th post, \"Thank You For Being A Friend,\" will be 100 under \"Number.\"\n setlists.sort(function(a, b) {\n\n var aConcat = Number(a[\"Number\"]);\n var bConcat = Number(b[\"Number\"]);\n\n if (aConcat > bConcat) {\n return 1;\n } else if (aConcat < bConcat) {\n return -1;\n } else {\n return 0;\n }\n });\n\n for (var i in setlists) {\n\n\n //For each song in the list, there might be multiple names in the Person field. We separate those by splitting with a \", \".\n var names = setlists[i].Person.split(\", \");\n\n //The Javascript then checks to see if the name is a proper match with what's in the array.\n for (var j in names) {\n var match = names[j];\n var matchName = \"\" + names[j] + \"\"\n match = match.split(\" \").join(\"\").split(\".\").join(\"\").split(\"-\").join(\"\");\n match = match.toLowerCase();\n\n if (personNames.indexOf(matchName) < 0) {\n if (matchName !== \"XXXXXXX\" && matchName !== \"\" && matchName !== \"each of you fine folks\") {\n personNames.push(matchName);\n }\n\n }\n\n //The JavaScript then creates divs of the songs based picked for that person.\n if (targetName === match) {\n var holder, songinfo, bandName, bandNameText, songName, songNameText, songLink, songLinkDiv, songLinkDivText, audioLinks;\n instancesOfTarget++;\n document.getElementById('name').innerHTML = '';\n\n document.getElementById('name').innerHTML = 'Cover songs picked especially for ' + matchName + ' to <a href=\"https://popcultureexperiment.com/2018/04/02/thank-you-for-being-a-friend-cover-songs-uncovered/\" target=\"_blank\">thank you for being a friend</a> and thank you for supporting the <a href=\"https://popcultureexperiment.com/cover-songs-uncovered/\" target=\"_blank\">first 100 Cover Songs Uncovered</a> posts';\n\n //This makes the holder.\n holder = document.createElement('div');\n holder.classList.add('holder');\n holder.classList.add('clearboth');\n targetDiv.appendChild(holder);\n\n //This makes the elements with the band name.\n songinfo = document.createElement('div');\n songinfo.setAttribute('class', 'songinfo');\n holder.appendChild(songinfo);\n bandName = document.createElement('div');\n bandName.setAttribute('class', 'bandname');\n bandNameText = document.createTextNode(setlists[i].Band);\n bandName.appendChild(bandNameText);\n songinfo.appendChild(bandName)\n\n //This makes the elements with the song name.\t\n songName = document.createElement('div');\n songName.setAttribute('class', 'songname');\n songNameText = document.createTextNode(setlists[i].Song);\n songName.appendChild(songNameText);\n songinfo.appendChild(songName);\n\n //This makes the elements with the link to the post.\t\n songLink = document.createElement('a');\n songLink.href = setlists[i].Link;\n songLink.setAttribute('target', '_blank');\n songLinkDiv = document.createElement('div');\n songLinkDiv.setAttribute('class', 'visitPost');\n songLinkDivText = document.createTextNode('VIEW POST');\n songLinkDiv.appendChild(songLinkDivText);\n songLink.appendChild(songLinkDiv);\n songinfo.appendChild(songLink);\n\n //This makes the div for the audio links.\n audioLinks = document.createElement('div');\n audioLinks.setAttribute('class', 'audiolinks');\n holder.appendChild(audioLinks);\n\n //If the song has a YouTube link, this creates a div for the link with an image of the YouTube logo.\t\n if (setlists[i].Youtube !== \"\" && setlists[i].Youtube !== 0) {\n var Youtube, YoutubeImg;\n\n Youtube = document.createElement('a');\n Youtube.href = setlists[i].Youtube;\n Youtube.setAttribute(\"target\", \"_blank\");\n\n YoutubeImg = document.createElement(\"img\");\n YoutubeImg.src = \"http://patrickgarvin.com/images/youtubelogo.jpg\"\n YoutubeImg.setAttribute('class', 'buttons');\n\n Youtube.appendChild(YoutubeImg);\n audioLinks.appendChild(Youtube);\n\n }\n\n //If the song has a Spotify link, this creates a div for the link with an image of the Spotify logo.\n\n if (setlists[i].Spotify !== \"\" && setlists[i].Spotify !== 0) {\n var Spotify, SpotifyImg;\n\n Spotify = document.createElement('a');\n Spotify.href = setlists[i].Spotify;\n Spotify.setAttribute(\"target\", \"_blank\");\n\n SpotifyImg = document.createElement(\"img\");\n SpotifyImg.src = \"http://patrickgarvin.com/images/spotify.png\"\n SpotifyImg.setAttribute('class', 'buttons');\n\n Spotify.appendChild(SpotifyImg);\n audioLinks.appendChild(Spotify);\n\n }\n\n //If the song has an Apple link, this creates a div for the link with an image of the Apple logo.\n if (setlists[i].AppleMusic !== \"\" && setlists[i].AppleMusic !== 0) {\n var appleMusic, appleMusicImg;\n\n appleMusic = document.createElement('a');\n appleMusic.href = setlists[i].AppleMusic;\n appleMusic.setAttribute(\"target\", \"_blank\");\n\n appleMusicImg = document.createElement(\"img\");\n appleMusicImg.src = \"http://patrickgarvin.com/images/appleMusic.png\"\n appleMusicImg.setAttribute('class', 'buttons');\n\n appleMusic.appendChild(appleMusicImg);\n audioLinks.appendChild(appleMusic);\n\n }\n\n\n\n }\n }\n }\n\n socialHolder = document.createElement('div');\n socialHolder.setAttribute('class', 'socialHolder');\n targetDiv.appendChild(socialHolder);\n\n Facebook = document.createElement('a');\n Facebook.href = 'https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2Fpatrickgarvin.com%2Fcsu100%2F%23_' + targetName + '&amp;src=sdkpreparse'\n Facebook.setAttribute(\"target\", \"_blank\");\n FacebookImg = document.createElement(\"img\");\n FacebookImg.src = \"http://patrickgarvin.com/images/facebook.jpg\"\n FacebookImg.setAttribute('class', 'buttons');\n Facebook.appendChild(FacebookImg);\n socialHolder.appendChild(Facebook);\n FacebookImg.style.margin = \"20px\";\n\n\n TwitterURL = \"%23_\" + targetName\n Twitter = document.createElement('a');\n Twitter.href = 'http://twitter.com/share?text=To mark 100 Cover Songs Uncovered posts, @popexperiment made a special best-of playlist http://patrickgarvin.com/csu100/' + TwitterURL;\n Twitter.setAttribute(\"target\", \"_blank\");\n TwitterImg = document.createElement(\"img\");\n TwitterImg.src = \"http://patrickgarvin.com/images/twitter.jpg\"\n TwitterImg.setAttribute('class', 'buttons');\n Twitter.appendChild(TwitterImg);\n socialHolder.appendChild(Twitter);\n TwitterImg.style.margin = \"20px\";\n\n }", "function renderPlaylist() {\n\t$('#playlist li').html('');\n\n\tgetPlaylist().forEach(function(item) {\n\t\tvar element;\n\t\tvar li = $('<li>')\n\t\t\t.attr('song', item.genre)\n\t\t\t.attr('cover', item.artwork_url)\n\t\t\t.attr('artist', item.title)\n\t\t\t.attr('id', item.id)\n\t\t\t.click(function(id) {\n\t\t\t$('#playlist li').removeClass(\"active\");\n\t\t\t play(li.attr('id'));\n\t\t\t li.addClass(\"active\");\n\t\t })\n\t\t\t.text(item.genre)\n\t\t\t.text(item.title);\n\t\t$('#playlist').append(li);\n\t});\n}", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "function buildVideoPlaylist(o, className, config) {\n config = config || playlistConfig;\n var playlistContainer = document.getElementById(playlistConfig.playlistContainer);\n var embedContainer = document.getElementById(playlistConfig.embedContainer);\n\n var group = new Element('div').addClassName(className).addClassName('playlist-group');\n playlistContainer.appendChild(group);\n\n for(var i=0; i<o.photos.length; i++) {\n var video = o.photos[i];\n\n // The item itself\n var item = new Element('a', {className:'playlist-item', href:'#', rel:video.photo_id});\n item.observe('click', function(e){\n $$('.playlist-item-selected').each(function(o){o.removeClassName('playlist-item-selected');});\n $(this).addClassName('playlist-item-selected');\n embedContainer.innerHTML = getEmbed(config, 'photo_id', this.getAttribute('rel'));\n Event.stop(e);\n });\n group.appendChild(item);\n\n // Thumbnail\n var thumb = new Element('div', {'className': 'playlist-thumb'});\n var thumb_image = new Element('img', {src:'http://' + config.domain + video.quad50_download});\n thumb.appendChild(thumb_image);\n item.appendChild(thumb);\n\n // Title\n var title = new Element('div', {'className': 'playlist-title'});\n if (video.content_text.length>config.truncate_title) {\n title.innerHTML = video.content_text.substring(0,config.truncate_title) + '...';\n } else {\n title.innerHTML = video.content_text;\n }\n item.appendChild(title);\n\n // Display first item on the list in the embed container\n if (!embedContainer.innerHTML) {\n item.addClassName('playlist-item-selected');\n embedContainer.innerHTML = getEmbed(config, 'photo_id', video.photo_id);\n }\n }\n}", "async savePlaylist(bot, message, settings, msg) {\n\t\t// Get songs to add to playlist\n\t\tlet res;\n\t\ttry {\n\t\t\tres = await bot.manager.search(message.args[1], message.author);\n\t\t} catch (err) {\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/ERROR', err.message);\n\t\t}\n\n\t\t// Workout what to do with the results\n\t\tif (res.loadType == 'NO_MATCHES') {\n\t\t\t// An error occured or couldn't find the track\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/NO_SONG');\n\t\t} else if (res.loadType == 'PLAYLIST_LOADED' || res.loadType == 'TRACK_LOADED') {\n\t\t\t// Save playlist to database\n\t\t\tconst newPlaylist = new PlaylistSchema({\n\t\t\t\tname: message.args[0],\n\t\t\t\tsongs: res.tracks.slice(0, message.author.premium ? 200 : 100),\n\t\t\t\ttimeCreated: Date.now(),\n\t\t\t\tthumbnail: res.playlist?.selectedTrack.thumbnail ?? res.tracks[0].thumbnail,\n\t\t\t\tcreator: message.author.id,\n\t\t\t\tduration: res.playlist?.duration ?? res.tracks[0].duration,\n\t\t\t});\n\t\t\tnewPlaylist.save().catch(err => bot.logger.error(err.message));\n\n\t\t\t// Show that playlist has been saved\n\t\t\tconst embed = new MessageEmbed()\n\t\t\t\t.setAuthor(newPlaylist.name, message.author.displayAvatarURL())\n\t\t\t\t.setDescription([\t`Created a playlist with name: **${message.args[0]}**.`,\n\t\t\t\t\t`Playlist duration: ${bot.timeFormatter.getReadableTime(parseInt(newPlaylist.duration))}.`,\n\t\t\t\t\t`Added **${(res.loadType == 'PLAYLIST_LOADED') ? res.playlist.name : res.tracks[0].title}** (${res.tracks.length} tracks) to **${message.args[0]}**.`].join('\\n'))\n\t\t\t\t.setFooter(`ID: ${newPlaylist._id} • Songs: ${newPlaylist.songs.length}/${(message.author.premium) ? '200' : '100'}`)\n\t\t\t\t.setTimestamp();\n\t\t\tmsg.edit('', embed);\n\t\t} else {\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.send(`\\`${message.args[1]}\\` is not a playlist`);\n\t\t}\n\t}", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "createPlaylist() {\n if (this.state.modalInput === \"\") {\n alert(\"Name your playlist\");\n }\n spotifyApi\n .createPlaylist({ name: this.state.modalInput })\n .then(res => this.setState({ playlistId: res.id }));\n // Wait 1 second to addTracks() while setting state\n setTimeout(() => this.addTracks(), 1000);\n this.setState({ modalInput: \"\" });\n }", "function _createPlaylistTrack(cover, title) {\n\n\t\t\tif(!options.playlist) { return false; }\n var coverDom = cover ? '<img src=\"'+cover+'\" style=\"border: 1px solid '+options.strokeColor+';\" />' : '<div class=\"fap-cover-replace-small\" style=\"background: '+options.wrapperColor+'; border: 1px solid '+options.strokeColor+';\"></div>';\n\n\t\t\t$playlistWrapper.append('<li class=\"clearfix\">'+coverDom+'<span>'+title+'</span><div class=\"fap-remove-track\">&times;</div></li>');\n\t\t\tvar listItem = $playlistWrapper.children('li').last().css({'marginBottom': 0, 'height': 'auto'});\n\n\t\t\tif(navigator.appVersion.indexOf(\"MSIE 7.\")==-1) {\n\t\t\t\tif(!cover) { _createCoverReplacement(listItem.children('.fap-cover-replace-small').get(0), 20, 20); }\n\t\t\t}\n\n\t\t\t//Playlist Item Event Handlers\n\t\t\tif($elem.jquery >= \"1.7\"){\n\t\t\t\tlistItem.on('click', 'span', _selectTrackFromPlaylist);\n\t\t\t\tlistItem.on('click', '.fap-remove-track', _removeTrackFromPlaylist);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlistItem.delegate('span', 'click', _selectTrackFromPlaylist);\n\t\t\t\tlistItem.delegate('.fap-remove-track', 'click', _removeTrackFromPlaylist);\n\t\t\t}\n\n\t\t\tfunction _selectTrackFromPlaylist() {\n\t\t\t\tvar $listItem = $(this).parent();\n\t\t\t\tif($listItem.hasClass('fap-prevent-click')) {\n\t\t\t\t\t$listItem.removeClass('fap-prevent-click');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tvar index = $playlistWrapper.children('li').index($listItem);\n\t\t\t\t\t$.fullwidthAudioPlayer.selectTrack(index, true);\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfunction _removeTrackFromPlaylist() {\n\t\t\t\tvar $this = $(this),\n\t\t\t\t\tindex = $this.parent().parent().children('li').index($this.parent());\n\n\t\t\t\ttracks.splice(index, 1);\n\t\t\t\t$this.parent().remove();\n\n\t\t\t\tif(index == currentIndex) {\n\t\t\t\t\tcurrentIndex--;\n\t\t\t\t\tindex = index == tracks.length ? 0 : index;\n\t\t\t\t $.fullwidthAudioPlayer.selectTrack(index, paused ? false : true);\n\t\t\t\t}\n\t\t\t\telse if(index < currentIndex) {\n\t\t\t\t\tcurrentIndex--;\n\t\t\t\t}\n\n\t\t\t\t$playlistWrapper.getNiceScroll().resize();\n\t\t\t\tif(options.storePlaylist) { amplify.store('fap-playlist', JSON.stringify(tracks)); }\n\t\t\t};\n\n\t\t\t$playlistWrapper.getNiceScroll().resize();\n\n\t\t}", "onAddToPlaylist(index) {\n const { addToPlaylist, addClipToPlaylist, clip } = this.props;\n\n // Add the clip to playlist.list\n addToPlaylist(clip.list[index]);\n\n // Set in the clip that is part of the playlist\n addClipToPlaylist(clip.list[index].id);\n }", "static addPlaylist(playlist) {\n return fetch('http://localhost:8888/insertplaylist/', {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(playlist)\n })\n }", "function createSong() {\n var playSong = document.createElement(\"audio\");\n// var songId = $(\".playback-section\").attr('id');\n// var folderPath = $(\".playback-section\").attr('name');\n// var songPath = folderPath + songId + \".mp3\";\n// playSong.setAttribute(\"src\", songPath);\n\n //\n // Monitors when the song play button is clicked\n //\n $(\".song__button-play\").click(function() {\n var btnType = $(this).attr('name');\n var songId = this.parentNode.id;\n var folderPath = $(\"#\"+songId).attr('name');\n if (btnType == \"f\") {\n var songPath = folderPath + songId + \"-f.mp3\";\n playSong.setAttribute(\"src\", songPath);\n } else {\n if (btnType == \"b\") {\n var songPath = folderPath + songId + \"-b.mp3\";\n playSong.setAttribute(\"src\", songPath);\n } else {\n var songPath = folderPath + songId + \"-b.mp3\";\n playSong.setAttribute(\"src\", songPath);\n playSong.currentTime = btnType;\n }\n }\n playSong.play();\n });\n //////////////////////////////////////////////////////////////////////////////\n\n //\n // Monitors when the song stop button is clicked\n //\n $(\".song__button-stop\").click(function() {\n playSong.pause();\n });\n //////////////////////////////////////////////////////////////////////////////\n}", "function addToPlaylist(trackId, playlist) {\n spotifyApi.addTracksToPlaylist(playlist, [`spotify:track:${trackId}`])\n .then(function (data) {\n console.log('Added tracks to playlist!');\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "savePlaylist() {\n const playlistUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, playlistUris).then(response => {\n if (response) {\n this.setState({ playlistName: \"New Playlist\",\n playlistTracks : [] });\n }});\n }", "function addSongToExistingPlaylist(sname, surl, playlistName) {\n let reqPlaylist = playlistsArr.find((list) => list.name == playlistName);\n reqPlaylist.song.push({ songName: sname, songurl: surl });\n}", "function createSongsList(i) {\n\tvar html = \"\";\n\tvar songsData = [];\n\n\tif (i == \"all\") {\n\t\t$.each(playlistsData, function(k, v){\n\t\t\tif (k != \"custom\") {\n\t\t\t\t$.each(v.songs, function(k2, v2){\n\t\t\t\t\tsongsData.push(v2);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t} else {\n\t\tsongsData = playlistsData[i].songs;\n\t}\n\n\tif (i != \"custom\") {\n\t\tsongsData = shuffleObj(songsData);\n\t}\n\n\t$.each(songsData, function(k, v){\n\t\tif (i == \"custom\") {\n\t\t\tvar faClass = \"fa-music\";\n\t\t\tif (v.url.indexOf(\"youtube\") > -1) {\n\t\t\t\tfaClass = \"fa-video-camera\";\n\t\t\t}\n\t\t\thtml += '<li data-id=\"'+k+'\" data-custom=\"1\"><i class=\"fa '+ faClass +'\"></i>'+v.title+'</li>';\n\t\t} else {\n\t\t\thtml += '<li data-id=\"'+ v.videoId +'\">'+ v.title +'</li>';\n\t\t}\n\t});\n\t$songsList.html(html);\t\n}", "function generatePlaylist() {\n $.ajax({\n method: \"PUT\",\n url: `/api/playlists/${getPlaylistID()}`,\n data: { completed: true },\n }).then(window.location.replace(\"/complete\"));\n }", "function createPlayer(playerParameters, playerID, videoID, playlistID) {\n\n // set player's id in playerParameters\n if (playlistID != null) {\n playerParameters.playerVars.playlist = '' + playlistID + '';\n playerParameters.playerVars.list = '' + playlistID + '';\n\n } else {\n playerParameters.videoId = videoID;\n }\n\n // init new YT player\n var ytPlayer = new YT.Player(playerID, playerParameters);\n\n // app.players holds ref to all players in page\n app.ytPlayers.push(ytPlayer);\n\n // init YT player listeners\n ytPlayer.addEventListener('onReady', function(event) {\n // init PlayerManager Object\n YTManager = new PlayerManager(ytPlayer, videoID);\n });\n\n}", "function showLocalPlaylists() {\n str = \"<div class='here' style='color: black'><h1 >Our Genres!</h1></div>\";\n str += \"<button class='menu_button' onclick='createPlaylist()'>Create New Playlist</button><br><br>\";\n \n if(user_playlists.length == 0) {\n document.getElementById(\"list-homepage-songs\").innerHTML = str;\n }\n else {\n for (i = 1; i < user_playlists.length; i++) {\n str += \"<div class='addedPlaylist'>\";\n str += \"<button class='playlist_button' value='\" + user_playlists[i].name + \"' onclick='getPlaylistSongs(this.value)'>\" + user_playlists[i].name + \"</button>\";\n str += \"<button type='button' value='\" + user_playlists[i].name + \"'onclick='deletePlaylist(this.value)'><i class='fa fa-minus' style='color:black; size: 10px'></i></button>\";\n str += \"</div><br>\";\n };\n document.getElementById(\"list-homepage-songs\").innerHTML = str;\n };\n }", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "async function btnCreatePlaylistClick() {\n var name = $(\"#ed-newplaylistname\");\n var desc = $(\"#ed-newplaylistdesc\");\n var errtext = $(\"#text-createerror\");\n\n if (name.val().trim().length == 0) {\n errtext.html('<span style=\"color: yellow;\">Please input a name!</span>');\n name.focus();\n return;\n }\n \n errtext.html('<img class=\"loading\" src=\"images/loading.gif\"> Processing...');\n var rtn = await insertPlaylist(name.val(), desc.val());\n if (typeof rtn === \"string\") {\n errtext.html('Playlist created! <a href=\"https://www.youtube.com/playlist?list=' + rtn + '\" target=\"_blank\">Check it out</a>');\n } else {\n rtn.result.error.message = rtn.result.error.message.replace('<a href=\"/youtube/v3/getting-started#quota\">quota</a>', '<a href=\"https://console.cloud.google.com/iam-admin/quotas\" target=\"_blank\">quota</a>')\n errtext.html('<span style=\"color: yellow;\">Error ' + rtn.result.error.code + ': ' + rtn.result.error.message + '</span><br>');\n }\n}", "function openPlaylist(id) {\n playlist = document.querySelector('#'+id + \"_name\").innerHTML;\n document.querySelector('#navigator').pushPage('playlist.html');\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "generateNewPlaylist(){\n var currentdate = new Date(); \n var datetime = (currentdate.getMonth()+1) + \"/\"\n + currentdate.getDate() + \"/\" \n + currentdate.getFullYear() + \"-\" \n + currentdate.getHours() + \":\" \n + currentdate.getMinutes() + \":\" \n + currentdate.getSeconds();\n\n const playlistName = \"Super Spotify Playlist \" + datetime;\n const _this = this;\n //Using the Spotify API to generate a playlist\n //so that songs can be added to it \n _this.props.spotifyAPI.createPlaylist(playlistName,{ 'description': 'This is the Generated Playlist', 'public': true })\n .then(function(data) {\n console.log('Created playlist!');\n //setting the generate playlist ID to the \n //variable in this state\n _this.setState({\n GenPlaylistID: data.body.id,\n })\n }, function(err) { \n console.log('Something went wrong in creating a new playlist', err);\n });\n }", "function Playlist(playlistName, numOfTracks, playlistImgs, tracksLink) {\n\t\tthis.playlistName = playlistName;\n\t\tthis.numOfTracks = numOfTracks;\n\t\tthis.tracksLink = tracksLink;\n\t\tthis.playlistImg = \"http://placehold.it/64x64\";\n\n\t\tif(playlistImgs.length !== 0){\n\t\t\n\t\t\tthis.playlistImg = playlistImgs[0].url;\n\n\t\t}\n\t}", "function create_new_playlist(site_url)\n{\n\t$.ajax({\n\t\tcache: false,\n\t\turl: site_url+\"video/create_new_playlist/\",\t\t\n\t\ttype: 'GET',\n\t\tdata: '',\n\t\tsuccess: function(data){\n\t\t\t//alert(data);\n\t\t\t//location.reload(true);\n\t\t\t/*if (call=='redirect'){\n\t\t\t\twindow.location=site_url+\"home/index/playlist\";\n\t\t\t}*/\n\t\t\t\n\t\t\t$('#user_playlist_section').html(data);\t\t\t\n\t\t\t$('#playlist_title').css('display', 'none');\n\t\t\t$('#playlist_caption').val('');\n\t\t\t$('#playlist_title_save').css('display', 'block');\t\n\t\t\t$('#playlist_save_button').css('display', 'block');\n\t\t\t$('#playlist_cancel_button').css('display', 'none');\n\t\t\t$('#playlist_rename_button').css('display', 'none');\n\t\t\t$('#create_new_playlist_span').css('display', 'none');\n\t\t\tvar js = 'submit_save_playlist_form(\"'+site_url+'\")';\n\t\t\t$('#playlist_save_link').attr('onclick', js);\t\t\t\n\t\t\t$('#total_videos').val(0);\n\t\t\t$('#count_video').html(0);\n\t\t\t$('#video_duration').html('00:00:00');\n\t\t\t$('#playlist_controls').css('display', 'none');\n\t\t}\n\t});\t\n}", "function createSeedPlaylist(variety) { \n //hacky\n var temp =[];\n $.each(songSeedList, function(i, el){\n if($.inArray(el, temp) === -1) temp.push(el);\n });\n songSeedList = temp;\n\n // while (songSeedList.length > 5) {\n // songSeedList = songSeedList.splice(4,3);\n // }\n console.log(songSeedList);\n // for (var i = 0; i < 20; i++) {\n // if (songSeedList.length > 5) {\n // console.log('here');\n // songSeedList = songSeedList.splice(4,1);\n // console.log('new: ' + songSeedList)\n // }\n // }\n var url = 'http://developer.echonest.com/api/v4/playlist/static?api_key=' + apiKey + '&callback=?';\n $.getJSON(url, \n { \n 'track_id': songSeedList, 'format':'jsonp', \n 'bucket': [ 'id:spotify', \n 'tracks'], 'limit' : true,\n 'variety' : variety,\n 'results': 10, 'type':'song-radio', \n }, \n function(data) {\n info(\"\");\n $(\"#results\").empty();\n if (! ('songs' in data.response)) {\n info(\"Can't find that artist\");\n } else {\n $(\"#all_results\").show();\n var tracks = \"\";\n for (var i = 0; i < data.response.songs.length; i++) {\n var song = data.response.songs[i];\n var tid = song.tracks[0].foreign_id.replace('spotify:track:', '');\n tracks = tracks + tid + ',';\n }\n var tembed = embed.replace('TRACKS', tracks);\n tembed = tembed.replace('PREFEREDTITLE' + ' playlist');\n var li = $(\"<span>\").html(tembed);\n $(\"#results\").append(li);\n }\n }\n );\n}", "function playlistAdd(songName) {\r\n if (songButtons[songName] != undefined) {\r\n return false;\r\n }\r\n \r\n var songButton = document.createElement(\"button\");\r\n var songButtonText = document.createElement(\"span\");\r\n\r\n songButtonText.appendChild(document.createTextNode(songName));\r\n songButtonText.classList.add(\"songText\");\r\n\r\n songButton.appendChild(songButtonText);\r\n songButton.classList.add(\"btn\", \"btn-lg\", \"song\");\r\n songButton.setAttribute(\"type\", \"button\");\r\n songButton.addEventListener(\"click\", function() {\r\n streamSong(songName);\r\n });\r\n\r\n songPlaylist.appendChild(songButton);\r\n songButtons[songName] = {\r\n button: songButton,\r\n index: songs.length\r\n }\r\n\r\n return true;\r\n }", "async function btnClonePlaylistClick() {\n var name = $(\"#ed-clonename\").val();\n var errtext = $(\"#text-cloneerror\");\n var link = $(\"#ed-clonelink\").val();\n var playlist;\n\n if (name.trim().length == 0) {\n errtext.html('<span style=\"color: yellow;\">Please give a name to the new playlist!</span>');\n return;\n }\n\n playlist = getPlaylistId($(\"input[name=cloneplaylist]:checked\"), link, errtext);\n if (playlist === undefined) {\n return;\n }\n\n if (isCloneWorking) {\n errtext.html('<span style=\"color: yellow;\">Another clone job is going on, please wait until it finishes.</span>');\n return;\n } else {\n isCloneWorking = true;\n }\n\n errtext.html('<img class=\"loading\" src=\"images/loading.gif\"><label id=\"clonestatus\">Creating playlist...</label>');\n var clonestatus = $(\"#clonestatus\");\n var createdPlaylist = await(insertPlaylist(name, \"\"));\n if (typeof createdPlaylist === \"string\") {\n clonestatus.html('Playlist created. Now start copying items...');\n } else {\n errtext.html('<span style=\"color: yellow;\">Error ' + createdPlaylist.result.error.code + ': ' + createdPlaylist.result.error.message + '</span><br>');\n isCloneWorking = false;\n return;\n }\n\n var currItem = 0, totalItem = -1;\n var success, i;\n\n /**\n * Handle response according to type\n * @param {boolean} type true: for liked videos; false: for other playlists\n * @param {object} response the response object\n * @return {boolean} true: the request is successful; false: the request has failed\n */\n var funcHandleResponse = async function(type, response) {\n var rtn;\n\n if (response !== undefined) {\n if (response.status === 200) {\n if (totalItem == -1) {\n totalItem = response.result.pageInfo.totalResults;\n }\n\n for (i = 0; i < response.result.items.length; i++) {\n if (type) {\n rtn = await insertPlaylistItem(createdPlaylist, response.result.items[i].id);\n } else {\n rtn = await insertPlaylistItem(createdPlaylist, response.result.items[i].snippet.resourceId.videoId);\n }\n if (rtn !== undefined) {\n if (rtn.status === 200) {\n currItem++;\n clonestatus.html(\"Copying items: \" + currItem + \"/\" + totalItem);\n } else {\n errtext.html('<span style=\"color: yellow;\">Error ' + rtn.result.error.code + ': ' + rtn.result.error.message + '</span><br>');\n return false;\n }\n } else {\n displayErr(errtext, rtn);\n return false;\n }\n }\n return true;\n } else {\n errtext.html('<span style=\"color: yellow;\">Error ' + response.result.error.code + ': ' + response.result.error.message + '</span><br>');\n return false;\n }\n } else {\n displayErr(errtext, response);\n return false;\n }\n };\n\n if (playlist == \"likedvideos\") {\n // Use \"list liked videos\" method for like videos since I don't know how\n // to get playlist id of liked videos (this is a special playlist) :)\n success = await getAllLikedVideos(async function(response) {\n return await funcHandleResponse(true, response);\n });\n } else {\n // Use \"list playlist items\" method for other playlists\n success = await getAllPlaylistVideos(playlist, async function(response) {\n return await funcHandleResponse(false, response);\n });\n }\n\n // Finished!\n isCloneWorking = false;\n if (success) {\n errtext.html('Successfully cloned the selected playlist! <a href=\"https://www.youtube.com/playlist?list=' + createdPlaylist + '\" target=\"_blank\">Check it out</a>');\n }\n}", "function updatePlaylist(playlist, artist, song) {\n //var playlist = {artist: song};\n playlist[artist] = song\n return\n}", "function requestPlaylist() {\n var request = gapi.client.youtube.playlists.list({\n channelId : channelId,\n part: 'contentDetails',\n maxResults: 50\n });\n request.execute(function(response) {\n console.log(response);\n var playlistArr = response.result.items;\n for(var i = 0 ; i < playlistArr.length ; i++){\n var item = playlistArr[i];\n var playlistId = item.id;\n requestVideoPlaylist(playlistId);\n }\n \n });\n}", "function createRandomizedPlaylist() {\n // First, copy the playlist\n let temp = [...playlist];\n randomizedPlaylist = [];\n\n // Next copy one at a time at random\n for (let i = 0; i < playlist.length; i++) {\n let j = Math.floor(Math.random() * temp.length);\n console.log(\"Pushing position: \" + j);\n randomizedPlaylist.push(temp.splice(j,1));\n }\n\n if (playlistRandom) {\n // If playing a random playlist, then reset the index to start over.\n currentPlaylistIndex = 0;\n }\n console.log(\"Playlist.length = \" + playlist.length + \" Randomized list length: \" + randomizedPlaylist.length);\n console.log(\"Playlist: \" + JSON.stringify(playlist));\n console.log(\"Randomized: \" + JSON.stringify(randomizedPlaylist));\n}", "function addTracksPlaylist(playlistId, tracks, accessToken) {\n // curl -i -X POST \"https://api.spotify.com/v1/playlists/7oi0w0SLbJ4YyjrOxhZbUv/tracks?uris=spotify%3Atrack%3A4iV5W9uYEdYUVa79Axb7Rh,spotify%3Atrack%3A1301WleyT98MSxVHPZCA6M\" -H \"Authorization: Bearer {your access token}\" -H \"Accept: application/json\"\n const uris = tracks.map(t => t.uri).join(',');\n\n return axios({\n method: 'post',\n baseURL: 'https://api.spotify.com/v1',\n url: `/playlists/${playlistId}/tracks`,\n headers: {\n Authorization: 'Bearer ' + accessToken\n },\n params: {\n uris\n }\n });\n}", "function CreatePlaylistController($scope, $log, YouTubeUtils) {\n var $ctrl = this;\n\n $ctrl.reset = reset;\n $ctrl.update = update;\n $ctrl.changeStatus = changeStatus;\n $ctrl.status = YouTubeUtils.getInitialStatus();\n $ctrl.master = {title:'', description:''};\n\n function reset(){\n $ctrl.userlist = angular.copy($ctrl.master);\n }\n\n function changeStatus(){\n $ctrl.status = YouTubeUtils.swapPrivacy($ctrl.status);\n }\n\n function update(userlist){\n $ctrl.master = angular.copy(userlist);\n $scope.$close({playlist: $ctrl.master, status: $ctrl.status});\n }\n\n $ctrl.reset();\n }", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris).then(() => {\n this.setState({ \n playlistName: 'New playlist',\n playlistTracks: []\n })\n })\n }", "savePlaylist(name, arrayURIs) {\n if (!name || !arrayURIs.length) {\n return;\n }\n\n const accessToken = Spotify.getAccessToken();\n const headers = { Authorization: `Bearer ${accessToken}` };\n let userId; \n \n // GET user's spotify id/username\n return fetch('https://api.spotify.com/v1/me', {\n headers: headers\n })\n .then(response => response.json())\n .then(jsonData => {\n userId = jsonData.id;\n //using the userId, POST request to create new playlist to user's Spotify account, & return playlist ID\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists`, {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({ name: name })\n })\n .then(response => response.json())\n .then(jsonData => {\n const playlistID = jsonData.id;\n // using userId and playlistID, POST request to add track URIs to playlist\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists/${playlistID}/tracks`, {\n method: 'POST',\n headers: headers,\n body: JSON.stringify({ uris: arrayURIs})\n });\n });\n });\n }", "function _drawPlaylist() {\n let template = ''\n let mySongs = store.State.playlist\n mySongs.forEach(song => template += song.playlistTemplate)\n document.querySelector(\"#playlist\").innerHTML = template\n}", "function loadPlaylistData(player, result) {\n player_playlist[player].remove();\n\n var playlistItems = [];\n for (var i = 0; i < result.length; i++) {\n playlistItems.push({\n title: (result[i].name.length > 50 ? (result[i].name.substring(0, 50) + \"...\") : result[i].name),\n name: result[i].name,\n mp3: result[i].path,\n id: result[i].id\n });\n }\n player_playlist[player].setPlaylist(playlistItems);\n}", "function Playlist(){\n\n this.list = new Array();\n\n this.add = function add(songid){\n \tthis.list.push(songid);\n }\n\n this.remove = function remove(songid){\n\n\tif(list.length == 0){\n\t\tconsole.log(\"empty list!\");\n\t\treturn false;\n\t}\n\t\t\n\tfor(var i=0;i<list.length;i++){\n\t\tif(list[i] == songid){\n\t\t\tlist.splice(i,1);\n\t\t}\n\t}\n\t\t\n }\n\n this.getNext = function getNext(){\n\tcurrent = current<this.list.length?current:0;\n \treturn this.list[current++];\n }\n \n this.getPrevious = function getPrevious(){\n\tcurrent = current>-1?current:0;\n \treturn this.list[current--];\n }\n\n this.getList = function getList(){\n\treturn this.list;\n }\n\n this.empty = function empty(){\n\tthis.list = new Array();\n }\n \n}", "function addTracksToPlaylist(data, callback){\n\tsessionStorage.songs = JSON.stringify(MASTER_TRACKLIST); \n\tsessionStorage.spotifyUserId = JSON.stringify(spotifyUserId);\n\n\tplaylistId = data.id;\n\tsessionStorage.playlistId = JSON.stringify(playlistId);\n\tvar tracks = [];\n\tfor(var i = 0; i < MASTER_TRACKLIST.length; i++){\n\t\ttracks.push(MASTER_TRACKLIST[i].id);\n\t}\n\tvar tracksString = tracks.join(\",spotify:track:\");\n\t\n\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId +\n\t'/playlists/' + playlistId +\n\t'/tracks?uris='+encodeURIComponent(\"spotify:track:\"+tracksString);\n\t$.ajax(url, {\n\t\tmethod: 'POST',\n\t\tdataType: 'text',\n\t\theaders: {\n\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tsuccess: function(d) {\n\t\t\tcallback(d, data.external_urls.spotify);\n\t\t},\n\t\terror: function(r) {\n\t\t\tcallback(null, null);\n\t\t}\n\t});\n}", "function loadPlaylist() {\n myPlayer.catalog.getPlaylist('4450721964001', function(error, playlist) {\n myPlayer.catalog.load(playlist);\n playlistLength = myPlayer.playlist().length;\n });\n }", "function handleStartButton() {\n let lists = calculatePlaylistWeight();\n\n if (lists.length == 0) {\n alert(\"Error: No playlists chosen\");\n return;\n }\n\n //\n let songRand = Math.random();\n let playlistId = -1;\n for (let i = 0; i < lists.length; i++) {\n if (songRand < lists[i][0]) {\n playlistId = lists[i][1];\n break;\n }\n }\n\n if (playlistId == -1) {\n console.log(\"error: no playlist detected\");\n return;\n }\n\n //at this point, playlistId contains a playlist ID\n // now turn it into a spotify URI and pass it to playSong\n // example uri: spotify:album:1Je1IMUlBXcx1Fz0WE7oPT\n // https://developer.spotify.com/documentation/web-api/reference/player/start-a-users-playback/\n\n let playlist = \"spotify:playlist:\" + playlistId;\n playSong(playlist);\n\n}", "function fillPlaylist() {\n console.log('[DEBUG] fillPlaylist function called.');\n playlist = vidIDPool.slice();\n console.log('[DEBUG] Playlist filled.');\n console.log('[DEBUG] Playlist = ' + playlist);\n}", "savePlaylist(name, trackUris) {\n //first make sure name and trackuris actually have values saved to them\n if (!name || !trackUris.length) return;\n //variables: for current user's access token (grabbed from the method above)\n const accessToken = Spotify.getAccessToken();\n //for Authorization parameter in implicit grant flow request format\n const headers = {\n Authorization: `Bearer ${accessToken}`\n };\n //empty variable for user's ID\n let userId;\n //make request that returns user's Spotify username\n return fetch(`https://api.spotify.com/v1/me`, {\n headers: headers\n }\n //convert response to JSON\n ).then(response => response.json()\n //save the response id to the user's ID variable\n ).then(jsonResponse => {\n userId = jsonResponse.id;\n //Use the returned userId to make POST request with Spotify endpoint\n //to request creation of new playlist\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists`, {\n headers: headers,\n method: 'POST',\n //key value for name is one of the parameters for this method\n body: JSON.stringify({\n name: name\n })\n }).then(response => response.json()\n ).then(jsonResponse => {\n //get the playlist with the response id\n const playlistId = jsonResponse.id;\n return fetch(`https://api.spotify.com/v1/users/${userId}/playlists/${playlistId}/tracks`, {\n headers: headers,\n method: 'POST',\n body: JSON.stringify({\n uris: trackUris\n })\n });\n });\n });\n }", "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "constructor(PlaylistID, PlaylistName, LoadedSongsList, PLbar) {\n this.PlaylistID = PlaylistID;\n this.PlaylistName = PlaylistName;\n this.LoadedSongsList = LoadedSongsList\n this.PLbar = PLbar\n this.songsIDs = [];\n this.songsNames = [];\n this.loadSongsInPlaylist()\n }", "function _drawPlaylist() {\n let playlist = store.State.playlist;\n console.log(playlist);\n let template = \"\";\n playlist.forEach(song => (template += song.playlistTemplate));\n document.getElementById(\"playlist\").innerHTML = template;\n}", "function openPlaylist(name) {\n var playlistJSON = JSON.parse(localStorage.getItem(name));\n songs = [];\n var html = '<ol>';\n var counter = 0;\n playlistJSON.songs.forEach(song => {\n if (song) {\n html += \"<li>\" + song.url + '<button onclick=\"loadSong('+counter+')\">Play</button><br></li>';\n songs.push({\n id: counter,\n name: song.name,\n url: song.url\n });\n counter++;\n }\n });\n html += \"</ol>\"\n var mainContent = document.getElementById(\"playlist-content\");\n if (mainContent) {\n mainContent.innerHTML = html;\n console.log(\"opened playlist: \" + name);\n }\n}", "function addSong(){\r\n var song = {};\r\n \r\n // prompt user for data\r\n song.title = prompt(\"please enter the title of the song\");\r\n song.artist = prompt(\"please enter the name of the artist of the song\");\r\n song.videoId = prompt(\"please enter the video id\");\r\n data.songs.push(song);\r\n\r\n // if the current playist isnt also the all songs playlist\r\n if(current_playlist.songs != data.songs){\r\n // add song to data\r\n var songCopy = {};\r\n songCopy.title = song.title;\r\n songCopy.artist = song.artist;\r\n songCopy.videoId = song.videoId;\r\n current_playlist.songs.push(songCopy);\r\n }\r\n updateSongPane();\r\n}", "function uploadFile(player) {\n var files;\n var uploadedFiles = $(\"#audio_file_player\" + player).prop('files');\n\n var playlistItems = [];\n for (var i = 0; i < uploadedFiles.length; i++) {\n player_playlist[player].add({\n title: (uploadedFiles[i].name.length > 50 ? (uploadedFiles[i].name.substring(0, 50) + \"...\") : uploadedFiles[i].name),\n name: uploadedFiles[i].name,\n mp3: URL.createObjectURL(uploadedFiles[i]),\n id: \"-1\"\n });\n }\n}", "addSong(){\n const url = urlInput.value\n const id = url.substr(url.indexOf(\"=\") + 1)\n const title = titleInput.value\n \n var validate = validation()\n if(!validate.isValidInput(playList, id, url, title)){\n return validate.render()\n }\n \n const song = {\n id: id,\n title: title\n }\n \n selectedVideo = id \n playList.push(song)\n this.render()\n }", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "function renderPlaylist(songs){\n\tAUTHORIZATION_CODE = JSON.parse(sessionStorage.access);\n\tspotifyUserId = JSON.parse(sessionStorage.spotifyUserId);\n\tspotifyLink = JSON.parse(sessionStorage.link);\n\tfirstPlaylist = JSON.parse(sessionStorage.firstPlaylist);\n\tif(firstPlaylist){\n\t\tfirstPlaylist = false;\n\t\tsessionStorage.firstPlaylist = JSON.stringify(firstPlaylist);\n\t}\n\n\tplaylistId = JSON.parse(sessionStorage.playlistId);\n\t//spotifyUserId = JSON.parse(sessionStorage.spotifyUserId);\n\tfromStation = JSON.parse(sessionStorage.fromStation);\n\ttoStation = JSON.parse(sessionStorage.toStation);\n\tmood = JSON.parse(sessionStorage.mood);\n\n\t$('.js-playlist-title').html(`<p><span class=\"subtle\" style=\"font-size: 30px;\">A</span> <span style=\"text-transform: capitalize;\">${mood}</span> <span class=\"subtle\" style=\"font-size: 30px\">journey from</span><br> ${fromStation} <span class=\"subtle\" style=\"font-size: 30px\">to<br></span> ${toStation}</span></p>`);\n\t$('.js-playlist').html(`\n\t\t<div id=\"cover\"></div><iframe id=\"iframe\" src=\"https://open.spotify.com/embed?uri=spotify:user:${spotifyUserId}:playlist:${playlistId}\"\n width=\"100%\" height=\"80\" frameborder=\"0\" style=\"border-radius: 10px\" allowtransparency=\"true\"></iframe>\n `);\n\t$('#cover').on('click', function(event) {\n window.open(`https://open.spotify.com/user/${spotifyUserId}/playlist/${playlistId}`);\n\n\t});\n\n\tsongs.forEach(item => {\n\t\tvar duration = convertTrackTime(item.duration_ms);\n\t\t$(\".js-playlist\").append(`\n\t\t\t<div class=\"js-playlist-entry\">\n\t\t\t\t<p class=\"js-song-name\">${item.name} <span class=\"subtle\">by ${item.artist}</span></p>\n\t\t\t<p class=\"js-song-time\">${duration}</p>\n\t\t\t</div>\t\n\t\t`);\n\t});\n}", "function CreateSongList(Artist) {\n\t\tvar directory = Artist + \"/\";\n\t\tvar extension = '.pdf';\n\t\tvar i=0;\n\n\t\t//alert('CREATE SONG LIST');\n\t\t\n\t\t/* Get the ARRAY of SONGS from the ARTIST's DIRECTORY */\n\t\tjQuery.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: 'UpdateSongList.php',\n\t\t\tdataType: 'HTML',\n\t\t\tdata: { \"field1\": encodeURI(directory)},\n\t\t\tsuccess: function (response) {\n\t\t\t\tsuccessCallBack(response);\n\t\t\t},\n\t\t\terror: function () {\n\t\t\t\talert(\"error in ajax\");\n\t\t\t}\n\t\t});\n\t\treturn;\n }", "function onYouTubeIframeAPIReady() {\r\n var numPl = Math.floor((Math.random() * 38) + 1);\r\n var player = new YT.Player(\"player\", {\r\n height: '390',\r\n width: '640',\r\n playerVars: {\r\n listType:'playlist',\r\n list:'PLtGGAyMRLY7_ItP_oOEwWEt_h5CEsu2md',\r\n index: numPl,\r\n autoplay: 0,\r\n },\r\n events: {\r\n 'onReady': function (event) {\r\n //event.target.cuePlaylist({list: \"PLFgquLnL59anYA8FwzqNFMp3KMcbKwMaT\"});\r\n //event.target.playVideo();\r\n setTimeout(function() {\r\n\t\t event.target.setShuffle({'shufflePlaylist' : true});\r\n\t\t }, 1000);\r\n\t\t }\r\n\t\t }\r\n\t\t });\r\n }", "function setPlaylist(mood) {\n if (mood === \"Happy\") {\n var userPlaylists = happyPlaylistIDs;\n } else if (mood === \"Sad\") {\n var userPlaylists = sadPlaylistIDs;\n } else if (mood === \"Party\" || mood === \"Excited\") {\n var userPlaylists = excitedPlaylistIDs;\n } else if (mood === \"Chill\") {\n var userPlaylists = chillPlaylistIDs;\n } else if (mood === \"Classy\") {\n var userPlaylists = classyPlaylistIDs;\n }\n console.log(\"Playlists\");\n var randomID = Math.floor(Math.random() * userPlaylists.length);\n var playlistID = userPlaylists[randomID];\n var embedURL = `https://open.spotify.com/embed/playlist/${playlistID}`;\n console.log(randomID);\n $(spotifyPlayer).attr(\"src\", embedURL);\n }", "function changePlaylist() {\n\t\t// clear track specific data\n\t\t$(\"#trackName\").empty();\n\t\t$(\"#trackRating\").val(\"(Rate track)\");\n\t\n\t\tvar playlistIndex = $(\"#playlist\").val();\n\t\tif (playlistIndex == \"select\") {\n\t\t\t$(\"#playlistPlayer\").empty();\n\t\t} else {\n\t\t\t// load selected playlist on page\n\t\t\tvar userLib = Library.forCurrentUser();\n\t\t\tuserLib.playlists.snapshot().done(function (snapshot) {\n\t\t\t\tvar playlist = snapshot.get(playlistIndex);\n\t\t\t\tlist = List.forPlaylist(playlist);\n\t\t\t\t$(\"#playlistPlayer\")\n\t\t\t\t\t.empty()\n\t\t\t\t\t.append(list.node);\n\t\t\t\tlist.init();\n\t\t\t});\n\t\t}\n\t}", "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePlaylistID, this.props.trackInfo.uri);\n } else {\n this.props.addSongToDB(this.props.session.connected_session.data.joinCode, this.props.trackInfo, this.props.userId);\n }\n notify.show(\"Added song \" + this.props.trackInfo.name, \"success\", 2000);\n }", "function requestVideoPlaylist(playlistId) {\n\n var requestOptions = {\n playlistId: playlistId,\n part: 'snippet',\n maxResults: 50\n };\n var request = gapi.client.youtube.playlistItems.list(requestOptions);\n request.execute(function(response) {\n var playlistItems = response.result.items;\n if (playlistItems) {\n var url = '/video/addVideosFromPlaylist' ;\n var playlistVideoArr = [];\n var urlBase = 'https://www.youtube.com/watch?'\n $.each(playlistItems, function(index, item) { \n var videoModel = {};\n videoModel.videoId = item.snippet.resourceId.videoId;\n videoModel.title = item.snippet.title;\n videoModel.publishedTime = item.snippet.publishedAt;\n videoModel.playlistId = item.snippet.playlistId;\n videoModel.channelId = item.snippet.channelId;\n videoModel.source = 'youtube';\n videoModel.watchTime=0;\n videoModel.likeTime=0;\n videoModel.dislikeTime=0;\n videoModel.url='https://www.youtube.com/embed/'+videoModel.videoId;\n videoModel.urlFull = urlBase + 'v=' + videoModel.videoId +'&list=' + videoModel.playlistId;\n playlistVideoArr.push(videoModel);\n displaySaveResult(videoModel);\n });\n var serverData = {data : playlistVideoArr};\n Ajax.post(url,serverData);\n } else {\n $('#video-container').html('Sorry you have no uploaded videos');\n }\n });\n}", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(playlistTrack => playlistTrack.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris);\n // Once the playlist is save set the state back to empty\n this.setState({\n playlistName: \"Dan's Playlist\",\n searchResults: [],\n playlistTracks: []\n });\n }", "function addQueryPlaylist(url, quality, from, to, split){\n\treturn addQuery(url, TYPE_YTPL, quality, from, to, split);\n}", "function convertYouTubePlaylist(playlistID, message) {\n google.youtube('v3').playlistItems.list({\n key: process.env.YOUTUBE_TOKEN,\n part: 'snippet',\n playlistId: playlistID,\n maxResults: 50,\n }).then((response) => {\n const { data } = response;\n data.items.forEach((item) => {\n var title = item.snippet.title;\n title = title.replace(/f(ea)?t.|Lyrics|((Official )?(Lyric )?(Music )?(Video|Audio))|MV|M\\/V/gi, ' ');\n var newTitle = \"\";\n for (i = 0; i < title.length; i++) {\n var currChar = title.charAt(i);\n var letterNumber = /^[0-9a-zA-Z]+$/;\n if (letterNumber.test(String(currChar))) {\n newTitle = newTitle.concat(\"\", String(currChar));\n } else {\n newTitle = newTitle.concat(\"\", \" \");\n }\n }\n titles.push(newTitle);\n //message.channel.send(newTitle);\n //console.log(newTitle);\n })\n createSpotifyPlaylist(message);\n \n\n }).catch((err) => console.log(err));\n}", "playUrl (url, options) {\n\n let that = this;\n\n log.info (\"%s - Try to play url - %s\", that._name, url);\n\n if (that._playlist)\n delete that._playlist;\n that._playlist = new Playlist(that._name, that);\n\n return that._playlist.addUrlPromise(url, options)\n .catch (function(err) {\n log.error(\"%s - Error playing playlist - %s\", that._name, err.stack);\n return Promise.reject(err);\n });\n }", "function getPlaylist() {\r\n return new Promise(function(resolve, reject) {\r\n var xhttp = new XMLHttpRequest();\r\n\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let playlist = JSON.parse(this.response);\r\n songs = [];\r\n\r\n for (var i = 0; i < playlist.length; i++) {\r\n playlistAdd(playlist[i]);\r\n songs.push(playlist[i]);\r\n \r\n }\r\n \r\n resolve(\"Got the playlist. Check song array.\");\r\n }\r\n };\r\n\r\n xhttp.onerror = function() {\r\n reject({\r\n status: this.status,\r\n statusText: this.statusText\r\n });\r\n };\r\n\r\n xhttp.open(\"GET\", \"playlist\", true);\r\n xhttp.send();\r\n });\r\n }", "function getRandomPlaylist() {\n\t var randomPlaylist = [];\n var randoNum = Math.floor(Math.random() * playlistIds.length);\n return playlistIds[randoNum];\n }", "function attachPlaylistToScreen(screen_id, playlist_id) {\n return $.post('/api/screen/playlist', {\n screen: {\n screenId: screen_id,\n playlistId: playlist_id\n }\n });\n }", "function createSongListNode(songs, groupname, grouptype, linker) {\n var listgroup = document.createElement(\"ul\");\n listgroup.setAttribute(\"class\",\"list-group\");\n for (var i=0; i<songs.length; i++) {\n var li = document.createElement(\"li\");\n li.setAttribute(\"class\",\"list-group-item\");\n var a = document.createElement(\"a\");\n a.setAttribute(\"href\",\"#\");\n linker(li, i, songs[i].id, groupname, grouptype);\n a.appendChild(document.createTextNode(songs[i].name));\n li.appendChild(a);\n listgroup.appendChild(li);\n }\n return listgroup;\n}", "async addPlaylists({name, owner}) {\n const id = `playlist-${nanoid(16)}`\n\n const query = {\n text: 'INSERT INTO playlists VALUES($1, $2, $3) RETURNING id',\n values: [id, name, owner],\n }\n\n const result = await this._pool.query(query)\n\n if (!result.rows[0].id) {\n throw new InvariantError('Playlist gagal ditambahkan')\n }\n return result.rows[0].id\n }", "init() {\n if (!this.player) return\n this.settings()\n this.listeners()\n //if (this.hasPlaylist) this.buildPlaylist()\n if (this.hasPlaylist) this.buildPlaylist()\n }", "function addToPlaylist(userId, playlistId, uris) {\n return axios({\n method: \"post\",\n url: `https://api.spotify.com/v1/users/${userId}/playlists/${playlistId}/tracks`,\n data: { uris }\n });\n}", "function showUserPlaylists() {\n getUserPlaylists().then(text => {\n var playlists = JSON.parse(text);\n for (var playlist in playlists) {\n console.log(playlist);\n if (playlist != 'favourites') {\n createAsidePlaylist(playlists[playlist]);\n }\n };\n });\n}", "function playAplaylist(data, playCurrent = false) {\n\n let arr = []\n let songs = []\n console.log(data)\n if (data.length > 0) {\n data.map((song) => {\n console.log(song)\n arr.push(song.Content.videoId)\n songs.push(song.Content)\n })\n\n updatePlayerState({\n isPlaying: true,\n playlist: songs,\n songPlaying: songs[0],\n playedSongIndex: 0,\n playlistVideoIds: arr\n })\n }\n }", "function playFirstSong() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "getPlaylist(args) {\n\t\targs = args || {};\n\t\tconst accountId = _.get(args, 'accountId', this.accountId);\n\t\tconst playlistId = args.playlistId;\n\n\t\tif (!_.isString(accountId)) {\n\t\t\tthrow new Error('An accountId string is required for getPlaylist()');\n\t\t}\n\n\t\tif (!_.isString(playlistId)) {\n\t\t\tthrow new Error('A playlistId string is required for getPlaylist()');\n\t\t}\n\n\t\treturn this.getAccessToken(args).then(auth => {\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}/playlists/${playlistId}`,\n\t\t\t\tcontentType: Client.DEFAULT_CONTENT_TYPE,\n\t\t\t\tauthorization: this.getBearerAuthorization(auth.access_token),\n\t\t\t\tquery: {}\n\t\t\t});\n\n\t\t\treturn this.makeRequest(args);\n\t\t});\n\t}", "function getPlaylist(info) {\n $http.get(\"/playlist/\" + $rootScope.userLog).then(function (response) {\n if (response.status == 200) {\n $scope.playlist = response.data.playlist;\n username.innerHTML = response.data.username;\n }\n });\n }" ]
[ "0.8496287", "0.79689324", "0.78499043", "0.7636809", "0.7602199", "0.7497411", "0.7393057", "0.72285223", "0.7168682", "0.7143466", "0.7082736", "0.70825046", "0.70363915", "0.6951491", "0.693889", "0.6926295", "0.687626", "0.687626", "0.6835355", "0.67928886", "0.67730933", "0.6696076", "0.66951275", "0.66481495", "0.66434485", "0.6627921", "0.66257954", "0.65984553", "0.6586783", "0.6534506", "0.6491839", "0.64885813", "0.6457131", "0.64478046", "0.64282393", "0.64134884", "0.6412477", "0.63931197", "0.6388042", "0.63730234", "0.6351149", "0.6346284", "0.6336396", "0.6331005", "0.6319653", "0.63174486", "0.63171", "0.6294465", "0.6294465", "0.6277748", "0.627311", "0.624623", "0.62335795", "0.62179613", "0.6214567", "0.6212947", "0.62080675", "0.6205157", "0.61890876", "0.6189081", "0.61880237", "0.61838806", "0.61810756", "0.6172035", "0.6170917", "0.6169938", "0.61672014", "0.6165088", "0.6153685", "0.6139762", "0.6132028", "0.6121682", "0.61214316", "0.6119112", "0.6101161", "0.60930145", "0.6075334", "0.6061456", "0.6056957", "0.6040801", "0.6030038", "0.60299456", "0.60064936", "0.59814113", "0.59777516", "0.5973516", "0.59660894", "0.5963606", "0.5952541", "0.5951362", "0.5950911", "0.5942837", "0.594178", "0.59359443", "0.59174293", "0.59168506", "0.5915199", "0.5911475", "0.59101814", "0.5909298", "0.5902376" ]
0.0
-1
! Edit an playlist
async function edit(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId) if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } if (!playlist.public && !playlist.users.includes(req.currentUser._id)) { throw new NotAuthorized() } const editedPlaylist = await Playlist.updateOne( { _id: playlistId }, req.body ) if (editedPlaylist.nModified < 1) { res.sendStatus(304) } res.status(200).json(await Playlist.findById(playlistId)) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function changePlaylist() {\n\t\t// clear track specific data\n\t\t$(\"#trackName\").empty();\n\t\t$(\"#trackRating\").val(\"(Rate track)\");\n\t\n\t\tvar playlistIndex = $(\"#playlist\").val();\n\t\tif (playlistIndex == \"select\") {\n\t\t\t$(\"#playlistPlayer\").empty();\n\t\t} else {\n\t\t\t// load selected playlist on page\n\t\t\tvar userLib = Library.forCurrentUser();\n\t\t\tuserLib.playlists.snapshot().done(function (snapshot) {\n\t\t\t\tvar playlist = snapshot.get(playlistIndex);\n\t\t\t\tlist = List.forPlaylist(playlist);\n\t\t\t\t$(\"#playlistPlayer\")\n\t\t\t\t\t.empty()\n\t\t\t\t\t.append(list.node);\n\t\t\t\tlist.init();\n\t\t\t});\n\t\t}\n\t}", "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "function updatePlaylist(playlist, artist, song) {\n //var playlist = {artist: song};\n playlist[artist] = song\n return\n}", "function playlist(id, fname, lname, status)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.id = id;\n\t\t\t\t\t\tthis.first_name=fname;\n\t\t\t\t\t\tthis.last_name=lname;\n\t\t\t\t\t\tthis.status = status;\n\t\t\t\t\t}", "function updatePlaylist() {\n var channel = $('#channelsscroller a.active').attr('rel');\n if (typeof channel !== 'string') {\n return;\n }\n var chaninfo = getChanInfo(channel);\n $.ajax({\n dataType: 'json',\n url: playlist + '&loc=' + chaninfo.internal + '&cuttime=1&limit=4',\n success: function(data) {\n if (data.status != \"ok\") {\n return;\n }\n $('#track-artist').text(data.tracks[0].artist);\n $('#track-title').text(data.tracks[0].title);\n $('#track-album').text(data.tracks[0].album);\n if (data.tracks[0].coverurl == \"\" || data.tracks[0].coverurl == null) {\n $('#cover').attr('src', \"images/cover.png\");\n } else {\n $('#cover').attr('src', data.tracks[0].coverurl.replace(/SL75_\\.jpg$/, 'SL320_.jpg'));\n\n\n }\n $(\"#plist\").html(\"\");\n $.tmpl(\"TplPlaylist\", data.tracks).appendTo(\"#pllist\");\n }\n });\n }", "function openPlaylist(data, link){\n\tspotifyLink = link;\n\tsessionStorage.link = JSON.stringify(spotifyLink);\n\tsessionStorage.access = JSON.stringify(AUTHORIZATION_CODE);\n\t$(\"#js-journey-form\").unbind().submit();\n}", "function updatePlayist(title, description, playlistID) {\n \n $.post(domain+'includes/ajax/handlePlaylist.php', \n { \n title:title,\n description:description,\n playlistID:playlistID,\n task: 'update' \n }, \n function(response){\n if(response == 1) {\n var playlistRow = $('[data-playlistid=\"'+playlistID+'\"]');\n playlistRow.find('.title').text(title);\n playlistRow.find('.description').text(description);\n \n triggerNotification(\"Playlist was updated.\");\n playlistRow.removeClass('.hovered');\n\n $('#cancel').trigger('click');\n } else {\n triggerNotification(\"Playlist wasn't updated.\");\n } \n });\n\n}", "@action handlePlaylistClick(dom, playlist) {\n // we need to set the activePlaylistItem as well\n // todo: this will probably break if we have an empty playlist\n const activePlaylistItem = playlist.items[0];\n\n UIStore.get().updateControlPanelState({\n activePlaylist: playlist,\n activePlaylistItem: activePlaylistItem,\n });\n }", "onAddToPlaylist(index) {\n const { addToPlaylist, addClipToPlaylist, clip } = this.props;\n\n // Add the clip to playlist.list\n addToPlaylist(clip.list[index]);\n\n // Set in the clip that is part of the playlist\n addClipToPlaylist(clip.list[index].id);\n }", "function generatePlaylist() {\n $.ajax({\n method: \"PUT\",\n url: `/api/playlists/${getPlaylistID()}`,\n data: { completed: true },\n }).then(window.location.replace(\"/complete\"));\n }", "function editItemById(smid) {\n THK.DB.findByVideoID(smid, function(res){\n if(res==undefined)\n return ;\n \n g_videoEditID = smid;\n \n // popup a edit window\n j_edit_window = j_edit_window || $(\"#edit_window\");\n j_edit_window.fadeIn(200);\n \n var edit_content = $(\"div#edit_content\");\n edit_content.html($(\n '<label>'+_locale[pn]['videoTitle']+'</label> <input id=\"edit_title\" value=\"'+res.title+'\"></input> <br>' +\n '<!--label>'+_locale[pn]['videoPath']+'</label> <input id=\"edit_dir\" value=\"'+res.dir+'\"></input> <br-->' +\n '<label>'+_locale[pn]['videoComment']+'</label> <textarea id=\"edit_comment\">'+res.comment+'</textarea> <br>' +\n '<input type=\"button\" class=\"submit-button\" value=\"Update\">'\n ));\n \n /* edit_window save button */\n $(\"input.submit-button\").click(function(e){ saveEditInfo(); });\n });\n}", "function setPlaylist(mood) {\n if (mood === \"Happy\") {\n var userPlaylists = happyPlaylistIDs;\n } else if (mood === \"Sad\") {\n var userPlaylists = sadPlaylistIDs;\n } else if (mood === \"Party\" || mood === \"Excited\") {\n var userPlaylists = excitedPlaylistIDs;\n } else if (mood === \"Chill\") {\n var userPlaylists = chillPlaylistIDs;\n } else if (mood === \"Classy\") {\n var userPlaylists = classyPlaylistIDs;\n }\n console.log(\"Playlists\");\n var randomID = Math.floor(Math.random() * userPlaylists.length);\n var playlistID = userPlaylists[randomID];\n var embedURL = `https://open.spotify.com/embed/playlist/${playlistID}`;\n console.log(randomID);\n $(spotifyPlayer).attr(\"src\", embedURL);\n }", "function openPlaylist(id) {\n playlist = document.querySelector('#'+id + \"_name\").innerHTML;\n document.querySelector('#navigator').pushPage('playlist.html');\n}", "function user_change_song(){\n\t\t$('#play').hide();\n\t\t$('#stop').show();\n\t\t//Each track in the playlist has correlating data attributes from the front-end.\n\t\t//The song attribute loads the song file, while the rel keeps the playlist array\n\t\t//index in line properly.\n\t\tvar track = $(this).attr('song');\n\t\tplaylist_index = $(this).attr('rel');\n\t\t//Display track info in the correct location, change which song is 'active', play track!\n\t\ttrack_info.innerHTML = $(this).text();\n\t\t$(playlist_track).removeClass('active');\n\t\t$(this).addClass('active');\n\t\taudio.src=dir+track;\n\t\taudio.play();\n\t}", "function edit(id){\n var form = $('#edit_form');\n if (form[0].line.value == id) {\n change();\n return;\n }\n \n var art = form.children('[name=artist]');\n var son = form.children('[name=song]');\n var line = $('#line_'+id).children('.info');\n \n form.insertBefore(line);\n \n form.show();\n art.show();\n son.show();\n art.focus();\n \n form[0].line.value = id;\n form[0].artist.value = line.children('.artist').text();\n art.select();\n // Trim the #location from the end of the song\n var match = line.children('.song').text().match(\"^(.+) #[^#]+$\")\n form[0].song.value = match ? match[1] : \"\";\n form[0].song_id.value = null;\n}", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "function editSong() {\n\t$.mobile.changePage( \"#editSongPage\", { transition: \"slideup\" });\n\t$(\"#playerPagePopup\").popup( \"close\" ); // This needs to be after the changePage call as the page wont open if its called first\n\tif(currentSongID == 0) // Again since we are dealing with the database, we need this ID to continue\n\t\treturn;\n\t\n\thidePlayerControls(); // Just hide the player controls\n\t// Set the inputs with the current songs data\n\t$(\"#editInputTitle\").val(currentSongData.title);\n\t$(\"#editInputArtist\").val(currentSongData.artist);\n\t$(\"#editInputAlbum\").val(currentSongData.album);\n\t$(\"#editInputGenre\").val(currentSongData.genre);\n}", "function updatePlaylist(playlist, artistName, songTitle){\n return Object.assign( playlist, {[artistName]: songTitle});\n}", "function editTrack(element, id) {\n document.getElementById('edit_input').value = Data.Tracks[id-1];\n State.Editing.Set(id);\n DOM.Modal.Open('edit_modal');\n document.getElementById('edit_input').focus();\n}", "async onChangePlaylist(id) {\n if(id !== null){\n await Spotify.getPlaylist(id).then(data => {\n let playlistName = data[0].playlistName;\n data.shift();\n this.setState({playlistName: playlistName, playlistTracks: data, playlistTracksOriginal: data, selectedPlaylistId: id});\n });\n } else {\n this.setState({\n playlistTracks: [],\n playlistTracksOriginal: [],\n selectedPlaylistId: null\n });\n }\n }", "viewFriendsSongsInPlaylist(playlist_id){\n this.getPlaylist(playlist_id)\n }", "handleSavePlaylist(event){\n SpotifySave.makePlaylist(this.state.playListName,this.state.playList).then(\n this.setState({playList: [],\n playListName: '',\n saveClass:'hidden'\n }),\n document.getElementById('PlayListName').value=''\n )\n }", "savePlaylist() {\n\t\tlet trackURIs = [];\n\t\tfor(let i = 0; i < this.state.playlistTracks.length; i++) {\n\t\t\ttrackURIs.push(this.state.playlistTracks[i].uri);\n\t\t}\n\t\tSpotify.savePlaylist(this.state.playlistName, trackURIs);\n\t\tthis.setState({playlistName: 'New Playlist', playlistTracks: []});\n\t}", "function openPlaylist(name) {\n var playlistJSON = JSON.parse(localStorage.getItem(name));\n songs = [];\n var html = '<ol>';\n var counter = 0;\n playlistJSON.songs.forEach(song => {\n if (song) {\n html += \"<li>\" + song.url + '<button onclick=\"loadSong('+counter+')\">Play</button><br></li>';\n songs.push({\n id: counter,\n name: song.name,\n url: song.url\n });\n counter++;\n }\n });\n html += \"</ol>\"\n var mainContent = document.getElementById(\"playlist-content\");\n if (mainContent) {\n mainContent.innerHTML = html;\n console.log(\"opened playlist: \" + name);\n }\n}", "function mashlistChangeTrack() {\n var $_mashlist = $('.mashlist[data-playing=\"1\"]');\n models.player.load(['context', 'playing', 'track']).done(function (player) {\n if (player.playing && player.context.uri == $_mashlist.attr('data-uri')) {\n models.Playlist.fromURI(playHistory).load(['tracks']).done(function (history) {\n history.tracks.add(player.track);\n listHistory.refresh();\n $('.sp-list-item').on('dblclick', function (e) {\n e.stopImmediatePropagation();\n });\n });\n }\n });\n }", "function redirect_to_play_option(site_url, playlist_id)\n{\n\twindow.location.href = site_url+'video/play_option/'+playlist_id+'/playlist/';\n}", "function updatePlaylist(obj , artistName , songTitle)\n{\n obj[artistName] = songTitle;\n return obj;\n}", "function play_track_from_playlist()\n{\n\tvar selected_track_index = $('#radio_song_list').attr(\"selectedIndex\");\n\t\n\t// play the selected track from playlist...\n\tradio_playlist.play(selected_track_index);\n}", "function doEditInShowList(li){\n\n li.children[1].innerText = document.getElementById(\"task\").value ;\n li.id = document.getElementById(\"task\").value ;\n\n }", "savePlaylist() {\n // Get a list of track URIs provided by Spotify, these are needed for defining the playlist\n let tracks = this.state.playlistTracks.map(track => track.uri);\n // savePlaylist is Promise based. Once the playlist is saved, reset the application state.\n Spotify.savePlaylist(this.state.playlistName, tracks).then(() => {\n //Reset the state when done saving.\n this.setState({\n searchResults: [],\n playlistTracks: []\n })\n // Set the playlist name to empty.\n document.getElementsByClassName(\"Playlist-name\")[0].value = 'New Playlist';\n });\n }", "savePlaylist() {\n const playlistUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, playlistUris).then(response => {\n if (response) {\n this.setState({ playlistName: \"New Playlist\",\n playlistTracks : [] });\n }});\n }", "function ChangeArtist() {\n \t\tvar SelectedArtist = document.getElementById('FolderListId');\n\t\tCreateSongList(encodeURI(SelectedArtist.value));\n \t\treturn;\n \t}", "updatePlaylistName(name){\n this.setState({playlistName: name});\n }", "updatePlaylistName(name) {\n this.setState({playlistName: name})\n }", "static addPlaylist(playlist) {\n return fetch('http://localhost:8888/insertplaylist/', {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(playlist)\n })\n }", "function displaySongUpdateStatus(data) {\r\n\tvar obj = JSON.parse(data);\r\n\tvar cssSelector = {\r\n\t\tjPlayer: \"#jquery_jplayer_2\",\r\n\t\tcssSelectorAncestor: \"#jp_container_2\"\r\n\t};\r\n\tvar playlist = [];\r\n\tvar options = {\r\n\t\tswfPath: \"js\",\r\n\t\tsupplied: \"mp3\",\r\n\t\tuseStateClassSkin: true\r\n\t};\r\n\tvar myPlaylist = new jPlayerPlaylist(cssSelector, playlist, options);\r\n\t/*Loop through the JSon array and add it to the playlist*/\r\n\tvar l=obj.length;\r\n\tfor (var i=0;i<l; i++) {\r\n \tmyPlaylist.add({\r\n\t\t\ttitle: obj[i].title,\r\n\t\t\tmp3: obj[i].mp3\r\n\t\t});\r\n\t}\r\n}", "function playMusic(id) {\n\n var url = \"api/playlist.php?type=songs&id=\" + id;\n $.get(url, function(response, songs) {\n console.log(response.data.songs);\n console.log('dsadasd');\n var object = response.data.songs;\n\n $('.songsList').empty();\n object.forEach(function(songs, album) {\n\n var li = $(\"<li class=\\\"songName \\\"><span id='songNameList' class='playIcon'></span><a href=\\\"javascript:void(0);\\\">\" +\n songs.name + \"</a></li>\");\n\n $('.songsList').append(li);\n\n li.click(function() {\n $(\"audio\").attr(\"src\", songs.url);\n isPlaying = true;\n $(\".playItemSmall .fa\").removeClass('fa-play').addClass('fa-pause');\n $('.name').html(`Now Playing: ${songs.name}`);\n $(document).attr('title', $('.name').html());\n $('.songsList i').remove();\n $(this).prepend(`<i class=\"fa fa-play\"></i>`);\n\n });\n\n })\n\n\n $('.songsList li:first-child').click();\n\n $(\"#player .buttons .btn-edit .fa\").attr(\"data-edit\", id);\n\n //$(\"audio\").attr(\"src\", object[0].url);\n\n\n var isPlaying = true;\n\n $(\".playItemSmall .fa\").removeClass('fa-play').addClass('fa-pause');\n\n $(\".playItemSmall\").click(function() {\n if (isPlaying) {\n\n $(\"audio\").trigger('pause');\n $('.playListImage').removeClass('rotatingImage');\n $(\".playItemSmall .fa\").removeClass('fa-pause').addClass('fa-play');\n\n isPlaying = false;\n } else {\n\n $(\"audio\").trigger('play');\n $('.playListImage').addClass('rotatingImage');\n $(\".playItemSmall .fa\").removeClass('fa-play').addClass('fa-pause');\n isPlaying = true;\n }\n });\n\n\n\n });\n}", "function updateMusicUI(artist_name,song_title) {\n\n\tvar playlist_name = \"\";\n\tswitch(current_mood) {\n\tcase mood.HAPPY:\n\t\tplaylist_name = \"Happy Playlist\"\n\n\t\tbreak;\n\tcase mood.SAD:\n\t\tplaylist_name = \"Sad Playlist\"\n\t\tbreak;\n\tcase mood.ANGRY:\n\t\tplaylist_name = \"Angry Playlist\"\n\t\tbreak;\n\tdefault: // default is happy\n\t\tplaylist_name = \"Happy Playlist\"\t\t\t\n\t}\n\t\n\t$(\"#div_artistname\").text(artist_name);\n\t$(\"#div_songtitle\").text(song_title);\n\t$(\"#div_playlist\").text(playlist_name);\n\t\n}", "@action handlePlayButtonClick() {\n this.currentPlayState = PlaylistModel.playState.PLAYING;\n }", "function emitPlaylist(event){ if (event.which == 13) {addPlaylist();}}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "updatePlaylistName(name) {\n this.setState( { playlistName : name });\n }", "function getPlaylist(info) {\n $http.get(\"/playlist/\" + $rootScope.userLog).then(function (response) {\n if (response.status == 200) {\n $scope.playlist = response.data.playlist;\n username.innerHTML = response.data.username;\n }\n });\n }", "addSong(){\n const url = urlInput.value\n const id = url.substr(url.indexOf(\"=\") + 1)\n const title = titleInput.value\n \n var validate = validation()\n if(!validate.isValidInput(playList, id, url, title)){\n return validate.render()\n }\n \n const song = {\n id: id,\n title: title\n }\n \n selectedVideo = id \n playList.push(song)\n this.render()\n }", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "function editItem() {\n todoItem = _.first(todo.where({ todo_id: todo_id }));\n log.debug('[TodoListNewEdit] : Editing todo Item', todoItem);\n\n // Set the title to Edit\n Alloy.Globals.Menu.setTitle(\"Edit Task\");\n\n $.textFieldName.value = todoItem.get('name');\n $.textFieldContent.value = todoItem.get('content');\n\n}", "function queueSong(text) {\n // submit form to add new song to the playlist\n $(\"#uri\").val(text);\n $(\"#uri\").click();\n}", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris).then(() => {\n this.setState({ \n playlistName: 'New playlist',\n playlistTracks: []\n })\n })\n }", "updatedPlaylistName(name) {\n this.setState({ playlistName: name });\n }", "function editItem(id) {\n\t\t[...todo].map((item) => {\n\t\t\tif (item.id === id) {\n\t\t\t\tfetch(`http://127.0.0.1:3010/tasks/${id}`, {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\theaders: { 'Content-Type': 'application/json' },\n\t\t\t\t\tbody: JSON.stringify({ id: item.id, text: editText, completed: item.completed, tag: item.tag, lastMod: new Date().getTime(), displayDate: new Date().toLocaleString(), outOfTime: item.outOfTime, alarm: item.alarm })\n\t\t\t\t}).then((resp) => resp.json())\n\t\t\t\t\t.then((data) => { console.log(data) });\n\t\t\t\twindow.location.reload()\n\n\t\t\t}\n\t\t\treturn item\n\t\t})\n\t\tsetEdit(null)\n\t\tsetEditText('')\n\t}", "function handlePlaylist(data, callback) {\n\t\tvar match = data.input.match(regExp.playlist);\n\t\tvar index;\n\t\tif(match) {\n\t\t\tindex = indexOfObject(playlists, 'title', match[1]);\n\t\t} else {\n\t\t\tconsole.log('Not a valid playlist');\n\t\t\tcallback(undefined);\n\t\t}\n\t\tif(index === -1) {\n\t\t\tconsole.log('Not a valid playlist');\n\t\t\tcallback(undefined);\n\t\t} else {\n\t\t\tconsole.log('A valid playlist');\n\t\t\tcallback(playlists[index]);\n\t\t}\n\t}", "function loadPlayList(entries){\n\tupdateControls(entries.length);\n\tfillVideoList(entries, \"#playlist-list\", function(event) {\n\t\tvar data = $.toJSON(event.data.video);\n\t\tvar playBtn = {\n\t\t\tclick: function () { \n\t\t\t\tvar url = server + \"/control/play\";\n\t\t\t\t$.post(url, data, loadPlayList, \"json\");\n\t\t\t},\n\t\t\tclose: true\n\t\t};\n\t\tvar deleteBtn = {\n\t\t\tclick: function () {\n\t\t\t\tvar url = server + \"/playlist\";\n\t\t\t\t$.ajax({url: url, type: 'DELETE', data: data, dataType: 'json', success: loadPlayList});\n\t\t\t},\n\t\t\tclose: true\n\t\t};\n\t\tvar buttons = { 'Play': playBtn, 'Skip': deleteBtn };\n\t\tfor(operationKey in event.data.video.operations){\n\t\t\tvar operation = event.data.video.operations[operationKey];\n\t\t\tvar type = event.data.video.type;\n\t\t\tvar buttonClick = function(e, type, operation, data){\n\t\t\t\tvar successFunction = function(){ \n\t\t\t\t\tshowNotification(operation.successMessage); \n\t\t\t\t}\n\t\t\t\tvar url = server + \"/\" + type + \"-\" + operation.name;\n\t\t\t\t$.post(url, data).done(successFunction, \"json\");\n\t\t\t}\n\t\t\tbuttons[operation.text] = { \n\t\t\t\tclick: buttonClick,\n\t\t\t\targs: new Array(type, operation, data),\n\t\t\t\tclose: true\n\t\t\t};\n\t\t}\n\t\t$(document).simpledialog2({\n\t\t\tmode: 'button',\n\t\t\theaderText: event.data.video.title,\n\t\t\theaderClose: true,\n\t\t\tbuttons : buttons\n\t\t});\n\t});\n}", "function changeNowPlaying(index) {\n\t$('#now-playing').remove();\n\t$('#video-' + index).append('<span id=\"now-playing\">now playing!</span></a></li>');\n}", "function deletePlaylist(value) {\n var index;\n for (i = 1; i < user_playlists.length; i++) {\n if(user_playlists[i].name == value) {\n index = i;\n };\n };\n user_playlists.splice(index, 1);\n showLocalPlaylists()\n}", "@action handlePlaylistItemClick(dom, playlistItem) {\n // TODO: here we need to tell the backend to switch to this scene?\n // not sure what I need to do here yet\n\n UIStore.get().updateControlPanelState({\n activePlaylistItem: playlistItem,\n });\n }", "function renderPlaylist() {\n\t$('#playlist li').html('');\n\n\tgetPlaylist().forEach(function(item) {\n\t\tvar element;\n\t\tvar li = $('<li>')\n\t\t\t.attr('song', item.genre)\n\t\t\t.attr('cover', item.artwork_url)\n\t\t\t.attr('artist', item.title)\n\t\t\t.attr('id', item.id)\n\t\t\t.click(function(id) {\n\t\t\t$('#playlist li').removeClass(\"active\");\n\t\t\t play(li.attr('id'));\n\t\t\t li.addClass(\"active\");\n\t\t })\n\t\t\t.text(item.genre)\n\t\t\t.text(item.title);\n\t\t$('#playlist').append(li);\n\t});\n}", "async savePlaylist(bot, message, settings, msg) {\n\t\t// Get songs to add to playlist\n\t\tlet res;\n\t\ttry {\n\t\t\tres = await bot.manager.search(message.args[1], message.author);\n\t\t} catch (err) {\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/ERROR', err.message);\n\t\t}\n\n\t\t// Workout what to do with the results\n\t\tif (res.loadType == 'NO_MATCHES') {\n\t\t\t// An error occured or couldn't find the track\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/NO_SONG');\n\t\t} else if (res.loadType == 'PLAYLIST_LOADED' || res.loadType == 'TRACK_LOADED') {\n\t\t\t// Save playlist to database\n\t\t\tconst newPlaylist = new PlaylistSchema({\n\t\t\t\tname: message.args[0],\n\t\t\t\tsongs: res.tracks.slice(0, message.author.premium ? 200 : 100),\n\t\t\t\ttimeCreated: Date.now(),\n\t\t\t\tthumbnail: res.playlist?.selectedTrack.thumbnail ?? res.tracks[0].thumbnail,\n\t\t\t\tcreator: message.author.id,\n\t\t\t\tduration: res.playlist?.duration ?? res.tracks[0].duration,\n\t\t\t});\n\t\t\tnewPlaylist.save().catch(err => bot.logger.error(err.message));\n\n\t\t\t// Show that playlist has been saved\n\t\t\tconst embed = new MessageEmbed()\n\t\t\t\t.setAuthor(newPlaylist.name, message.author.displayAvatarURL())\n\t\t\t\t.setDescription([\t`Created a playlist with name: **${message.args[0]}**.`,\n\t\t\t\t\t`Playlist duration: ${bot.timeFormatter.getReadableTime(parseInt(newPlaylist.duration))}.`,\n\t\t\t\t\t`Added **${(res.loadType == 'PLAYLIST_LOADED') ? res.playlist.name : res.tracks[0].title}** (${res.tracks.length} tracks) to **${message.args[0]}**.`].join('\\n'))\n\t\t\t\t.setFooter(`ID: ${newPlaylist._id} • Songs: ${newPlaylist.songs.length}/${(message.author.premium) ? '200' : '100'}`)\n\t\t\t\t.setTimestamp();\n\t\t\tmsg.edit('', embed);\n\t\t} else {\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.send(`\\`${message.args[1]}\\` is not a playlist`);\n\t\t}\n\t}", "function giveBackIndexAndStartPlaylist(index, time) {\n const arrayOfVideoIds = musicList.map((song) => song.videoId);\n setShowControls(true);\n whenUnPause();\n setDuration(time);\n setCurrentIndex(index);\n player.internalPlayer.loadPlaylist(arrayOfVideoIds, index);\n }", "function getPlaylist() {\n\treturn playlist;\n}", "function getPlaylist() {\n\treturn playlist;\n}", "function edit(key, mvName) {\n var itemName = prompt(\"Update the item name\", mvName);\n if (itemName && itemName.length > 0) {\n var updateListRef = buildEndPoint(key);\n updateListRef.update({\n name: itemName\n });\n }\n}", "edit(listKey=null) {\n \t\tthis.props.activeList(listKey);\n \t\tthis.props.history.push(\"/editlist\");\n \t}", "function playFirstSong() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(playlistTrack => playlistTrack.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris);\n // Once the playlist is save set the state back to empty\n this.setState({\n playlistName: \"Dan's Playlist\",\n searchResults: [],\n playlistTracks: []\n });\n }", "function rename_current_playlist_title(site_url, playlist_caption, playlist_id)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_caption=\"+playlist_caption+\"&playlist_id=\"+playlist_id,\n\t\turl: site_url+\"video/rename_playlist_title/\"\t\t\n\t}).responseText;\t\n\treturn result;\n}", "function editTodoList() {\n var listId = document.forms.todoForm.listId.value;\n var name = document.forms.editListForm.name.value;\n var rssAllowed = 0;\n if (document.forms.editListForm.rssAllowed.checked) {\n rssAllowed = 1;\n }\n $(\"editListDiv\").style.display='none';\n dwr.engine.beginBatch();\n todo_lists.editTodoList(listId, name, rssAllowed);\n todos.forceGetCurrentTodoLists(replyCurrentTodoLists);\n renderTable();\n dwr.engine.endBatch();\n tracker('/ajax/editTodoList');\n}", "function updatePlaylist(newHtml) {\n var oldHtml = $('#playlist').html();\n \n // See http://code.google.com/p/google-diff-match-patch/wiki/API\n // for documentation on the Diff, Match, and Patch Library.\n var differ = new diff_match_patch();\n var diffs = differ.diff_main(oldHtml, newHtml);\n differ.diff_cleanupSemantic(diffs);\n \n // Keep track of all additions and removals. Many people might be editing\n // at once, so we can't assume there will only be one changed element.\n var additionIds = [];\n var removalIds = [];\n $.each(diffs, function(i, diff) {\n // diff[0] values:\n // 1 => addition\n // 0 => equivalent\n // -1 => removal\n // diff[1] is the corresponding snippet of text.\n \n // Find all the Id: comment strings, if any.\n var matches = diff[1].match(GLOBAL_ID_REGEX);\n if (matches) {\n $.each(matches, function(j, match) {\n // Grab the id value from the comment string.\n // It would be nice to do this from the original regex using\n // capturing () there, but string.match(//g) doesn't respect them.\n var id = match.match(CAPTURE_ID_REGEX)[1];\n if (diff[0] == 1) {\n additionIds.push(id);\n } else if (diff[0] == -1) {\n removalIds.push(id);\n }\n });\n }\n });\n \n // If we don't have any removal animation, then fire the addition\n // animation right away. Otherwise, wait until the removal animation\n // completes (more or less) before handling additions.\n var additionsTimeoutInterval = 0;\n if (removalIds.length) {\n additionsTimeoutInterval = ANIMATION_TIMEOUT;\n }\n \n $.each(removalIds, function(i, removalId) {\n // Start these removal animations before we have replaced the old HTML.\n var element = $(document.getElementById(removalId));\n element.hide('blind', { direction: 'vertical' }, ANIMATION_TIMEOUT);\n });\n \n setTimeout(function() {\n // This executes unconditionally, since we always want to update the\n // HTML even if we don't have any additions.\n $('#playlist').html(newHtml);\n handleUpdatesTo('playlist');\n \n $.each(additionIds, function(i, additionId) {\n var element = $(document.getElementById(additionId));\n element.hide();\n element.show('blind', { direction: 'vertical' }, ANIMATION_TIMEOUT);\n });\n }, additionsTimeoutInterval);\n }", "updatePlaylistName(name) {\n\t\tthis.setState({playlistName: name});\n\t}", "updatePlaylistName(event){\n // update the state with the new PlayList name\n this.setState({ playlistName:event.target.value });\n }", "function playListAction(res){\n\n\tclient.playlist.listAction(function(data){\n\t\tcallbackResult(res,data);\n\t});\n\n}", "function getPlaylist() {\n\t\treturn pls.id;\n\t}", "function setUpPlaylist(input){\n var player=input.player, playlistId=input.playlistId, div=input.div, \n actionClick=input.actionClick, actionEnter=input.actionEnter, actionLeave=input.actionLeave;\n styleNowPlaying=input.styleNowPlaying, styleNotPlaying=input.styleNotPlaying;\n //div.style.display=\"block\";\n var sampleNode=div.getElementsByClassName('sampleNode')[0].cloneNode(true);\n while (div.firstChild) {\n div.removeChild(div.firstChild);\n }\n div.appendChild(sampleNode);\n var templateNode = sampleNode.cloneNode(true);\n sampleNode.style.display = \"none\";\n //get playlist video Ids as array\n var playlist=[],item=[],len;\n var styled=false;\n followPlaylist(player, div, styleNowPlaying, styleNotPlaying);\n if(typeof playlistId===\"string\"){//use playlistId, Max 50 items\n playlistInfo(playlistId,getlist);\n }\n else {//use Array, no maximun\n playlist=playlistId;\n len=playlist.length;\n for(var i=0;i<len;i++){\n display(i);\n }\n } \n function getlist(data1){\n len=data1.items.length;//test2.innerHTML+=\" playlistData:\"+len;\n for(var i=0;i<len;i++){\n playlist[i]=data1.items[i].contentDetails.videoId;\n display(i); \n }\n }\n function display(i){\n videoInfo(playlist[i],construction);\n function construction(data){\n\n //item[i]=div.getElementsByClassName('sampleNode')[0].cloneNode(true);//true:clone with all descendants\n item[i] = templateNode.cloneNode(true); //true:clone with all descendants\n // item[i].style.display=\"block\";\n if(item[i].getElementsByClassName(\"title\")[0]!=null) \n item[i].getElementsByClassName(\"title\")[0].innerHTML=data.items[0].snippet.title;\n if(item[i].getElementsByClassName(\"channelTitle\")[0]!=null)\n item[i].getElementsByClassName(\"channelTitle\")[0].innerHTML=data.items[0].snippet.channelTitle;\n if(item[i].getElementsByClassName(\"thumbnail\")[0]!=null){ \n var image=document.createElement('img');\n //image.setAttribute('src',data.items[0].snippet.thumbnails.default.url);\n image.setAttribute('src', 'http://img.youtube.com/vi/' + playlist[i] + '/default.jpg');\n item[i].getElementsByClassName(\"thumbnail\")[0].appendChild(image);\n }\n\n item[i].className += \" playlistItem \"+i+\" \"+playlist[i];\n //item[i].id=\"position:\"+i;\n //test2.innerHTML+=item[i].id;\n if(input.actionClick!=null) item[i].addEventListener(\"click\",click);\n if(input.actionEnter!=null)item[i].addEventListener(\"mouseenter\",cursorEnter);//better to use css :hover\n if(input.actionLeave!=null)item[i].addEventListener(\"mouseleave\",cursorLeave);\n //insert item in the right order\n if (i === len - 1) {\n div.appendChild(item[i]);\n //div.getElementsByClassName('sampleNode')[0].style.display = \"none\";\n }\n for(var j=i+1;j<len;j=j+1){\n if(item[j]!=undefined){\n div.insertBefore(item[i], item[j]);\n break;\n }\n if(j===len-1) div.appendChild(item[i]);\n }\n\n //check if now playing\n if(styled===false){\n var videoId=getQueryVariable(player.getVideoUrl(),'v');\n if(playlist[i]===videoId) {\n var event={data:player.getPlayerState()};\n if (styleNowPlaying) styleNowPlaying(event, item[i]);\n styled=true;\n } \n }\n function click(event){\n //loadVideo(player,playlist[i]);\n actionClick(event,i,item[i]);\n }\n function cursorEnter(event){\n actionEnter(event,i,item[i]);\n }\n function cursorLeave(event){\n actionLeave(event,i,item[i]);\n }\n }\n } \n function followPlaylist(player, playlistDiv,styleNowPlaying,styleNotPlaying) {\n //but eventlistenr seems always happen before div setting\n // test2.innerHTML+=\" eventListener\";\n player.addEventListener(\"onStateChange\",nowPlaying);\n function nowPlaying(event){\n //if(event.data===-1){\n var videoId=getQueryVariable(player.getVideoUrl(),'v');\n var itemDiv=playlistDiv.getElementsByClassName(videoId)[0];\n var listItems=playlistDiv.getElementsByClassName(\"playlistItem\");\n if(styleNotPlaying!=null) {for(var i=0;i<listItems.length;i++) styleNotPlaying(event,listItems[i]);}\n if(styleNowPlaying!=null) styleNowPlaying(event,itemDiv);\n //}\n }\n } \n}", "function play_video_playlist(site_url, video_id)\n{\t\n\t$.ajax({\n\t\tcache:false,\n\t\turl: site_url+\"video/playlist_video/\"+video_id+\"/\",\t\t\t\t\n\t\tsuccess: function(data){\n\t\t\t//alert(data);\n\t\t\t$('#video_play').html(data);\n\t\t}\n\t});\t\n}", "render(){\n let songs = this.state.songs.map(function(song, index){\n return <PlayListItem key={index} song={song} />\n });\n // onClick this._updatePlayList is saying when the button is clicked\n // the updatePlaylist function will run\n return(\n <div>\n <input type='button' className=\"btn btn-default\" value='Update Playlist' onClick={this._updatePlayList} />\n { songs }\n </div>\n )\n\n}", "updatePlaylistName(name) {\n this.setState({playlistname: name}) //step 57\n }", "function editItem(id){\n sendRequest(\n 'usergroups',\n {\n 'action': 'getEditItemForm',\n 'id': id\n }, function(data){\n $('#listcontent').css('display','none');\n $('#editorholder').html(data);\n });\n}", "function addSongToPlaylist() {\n let listEle = document.getElementById('newplaylistName');\n if (listEle.value.length == 0 || listEle.value == \"\") {\n listEle.focus();\n alert('Enter valid playlist name');\n }\n else {\n let songData = {\n name: document.getElementById('newplaylistName').value,\n song: [\n {\n songName: document.getElementById('songtitle').value,\n songurl: document.getElementById('songurl').value\n }\n ]\n }\n\n if (playlistsArr.length === 0) {\n playlistsArr.push(songData);\n addPlaylistsName();\n }\n else {\n let i = 0;\n for (i = 0; i < playlistsArr.length; i++) {\n\n if (playlistsArr[i].name == songData.name) {\n addSongToExistingPlaylist(songData.song[0].songName, songData.song[0].songurl, songData.name);\n break;\n }\n\n }\n if (i == playlistsArr.length) {\n playlistsArr.push(songData);\n addPlaylistsName();\n }\n }\n }\n reloadPlaylists();\n}", "function sendEditSong() {\n\tif(currentSongID == 0) // Again since we are dealing with the database, we need this ID to continue\n\t\treturn;\n\t\n\t// Send the backend the edit request\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: backend_url+\"/index.php\",\n\t\tdata: encodeURI(\"cmd=editSong&id=\"+currentSongID+\"&title=\"+$(\"#editInputTitle\").val()+\"&artist=\"+$(\"#editInputArtist\").val()+\"&album=\"+$(\"#editInputAlbum\").val()+\"&genre=\"+$(\"#editInputGenre\").val()),\n\t\tcache: false,\n\t\tsuccess: function(result){\n\t\t\tvar jsonResponse = jQuery.parseJSON(result);\n\t\t\tif(jsonResponse.status === \"success\") {\n\t\t\t\t// Update the local variabled with the new info\n\t\t\t\t$(\"#songTitle\").html($(\"#editInputTitle\").val()+\"<br><span class='songTitleArtist'>\"+$(\"#editInputArtist\").val()+\"</span>\");\n\t\t\t\tcurrentSongData.title = $(\"#editInputTitle\").val();\n\t\t\t\tcurrentSongData.artist = $(\"#editInputArtist\").val();\n\t\t\t\tcurrentSongData.album = $(\"#editInputAlbum\").val();\n\t\t\t\tcurrentSongData.genre = $(\"#editInputGenre\").val();\n\t\t\t\t// If this song is in the main page playlist, edit the row with the new data\n\t\t\t\tif(currentSong != -1) {\n\t\t\t\t\t$(\"#playlistSongsRow\"+currentSong).html('<div id=\"songPlaylistPlaying\"></div>'+currentSongData.title+'<br>'+currentSongData.artist+'<div class=\"songPlaylistArt\" style=\"background-image:url(\\''+currentSongData.artwork+'\\');\"></div>');\n\t\t\t\t}\n\t\t\t\tshowPlayer(); // Were done here, show the player and controls again\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// just in case the backend has some time of issue\n\t\t\t\t$(\"#songLoader\").hide();\n\t\t\t\tnavigator.notification.alert(\n\t\t\t\t\tjsonResponse.reason, // message\n\t\t\t\t\t'', // callback\n\t\t\t\t\t'Error', // title\n\t\t\t\t\t'Close' // buttonName\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n}", "function play(e){\n var id = e.id;\n var arr = byId(\"i\"+id ).value.split(\";\");\n \n // var jsonObj = JSON.parse(jsonStr);\n $(\"#h1\").html(id);\n $(\"#list\").hide();\n $(\"#video\").show();\n \n //config the video tag property\n $(\"#video\").attr({\n \"src\":arr[0],\n \"controls\":true,\n \"loop\":true,\n \"autoplay\":true,\n \"type\":arr[1]\n });\n}", "async function getPlaylistInfo() {\n var playlistInfo = await queryDbOnce('/Playlists/' + vue.playlist);\n var info = playlistInfo.val();\n vue.currentSongId = info.Current;\n vue.allowExplicit = info.Settings['Allow Explicit Songs'];\n vue.allowSpotify = info.Settings.Spotify;\n vue.allowYoutube = info.Settings.Youtube;\n}", "playlist() {\n return Playlists.findOne(playlistId);\n }", "editTodo(id, newTitle) {\n this.todoList.forEach(element => {\n if (id === element.id) {\n element.title = newTitle;\n }\n });\n }", "getPlaylist() {\n return this.playlist;\n }", "changeToPlaylist(){\n this.setState({\n queueView: true,\n friendView: false,\n artistView: false,\n searchView: false\n })\n }", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n}", "function addTrackPlaylist(_this,objectId){\r\n\t//chiama il controller per aggiungere la song alla playlist\r\n\tvar json_playlist = {};\r\n\t\r\n\ttypeOpt = $(_this).text();\r\n\tswitch(typeOpt){\r\n\t\tcase ' add to playlist':\r\n\t\t\tjson_playlist.request = \"addSong\";\r\n\t\t\tbreak;\r\n\t\tcase ' remove':\r\n\t\t\tjson_playlist.request = \"removeSong\";\r\n\t\t\tbreak;\r\n\t}\r\n\tjson_playlist.songId = objectId;\r\n\t$.ajax({\r\n data: json_playlist,\r\n type: \"POST\",\r\n url: \"../controllers/request/playlistRequest.php\"\r\n })\r\n .done(function(response, status, xhr) {\r\n if (typeOpt === ' add to playlist') {\r\n\t\t\tloadBoxPlayList();\r\n\t\t\t$(_this).text(' remove');\r\n } else {\r\n\t\t\tplaylist = myPlaylist.playlist;\r\n\t\t\tjQuery.each(playlist, function (index, obj){\r\n\t if (obj.objectId == objectId){\r\n\t myPlaylist.remove(index);\r\n\t\r\n\t } // if condition end\r\n\t $(_this).text(' add to playlist');\r\n\t });\r\n\t\t\t\r\n\t\t\t\r\n }\r\n code = xhr.status;\r\n message = $.parseJSON(xhr.responseText).status;\r\n console.log(\"Code: \" + code + \" | Message: \" + message);\r\n })\r\n .fail(function(xhr) {\r\n message = $.parseJSON(xhr.responseText).status;\r\n code = xhr.status;\r\n console.log(\"Code: \" + code + \" | Message: \" + message);\r\n });\r\n\t\r\n\t\r\n\t//controllare il risultato dal controller\r\n\t\r\n\t//aggiungere alla playlist\r\n\t\r\n}", "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePlaylistID, this.props.trackInfo.uri);\n } else {\n this.props.addSongToDB(this.props.session.connected_session.data.joinCode, this.props.trackInfo, this.props.userId);\n }\n notify.show(\"Added song \" + this.props.trackInfo.name, \"success\", 2000);\n }", "function changeTrack(url) {\n\t// Remove any existing instances of the Stratus player\n\t$('#stratus').remove();\n\n\t// Create a new Stratus player using the clicked song's permalink URL\n\t$.stratus({\n key: \"b3179c0738764e846066975c2571aebb\",\n auto_play: true,\n align: \"bottom\",\n links: url\n });\n}", "function displayResult(item) {\n var id = item.id;\n var title = item.snippet.title;\n var line = '<p>'\n + listIndex++ + ' : '\n + '<a href=\"https://www.youtube.com/playlist?list=' + id + '\" target=\"_blank\">' + id + '</a>' + ' : '\n + title + '</p>';\n\n $('#list-container').append(line);\n playlistList.push({\n id: id,\n title: title\n });\n}", "listClips(clip, index) {\n const {\n playlist, openForm, addPersistClip, removePersistClip,\n } = this.props;\n const { list, now } = playlist;\n let playingNow = false;\n let tags = '';\n\n // Check what clip is playing in the moment\n if ((list[now].id) === clip.id) {\n playingNow = true;\n }\n\n // Show the tags as on string\n for (let i = 0; i < clip.tags.length; i += 1) {\n tags += ` #${clip.tags[i].charAt(0).toUpperCase() + clip.tags[i].slice(1)}`;\n }\n\n return (\n <Fragment key={clip.id}>\n <ListItem style={{ paddingRight: 6 }}>\n <Avatar>\n {clip.persist\n ? (\n <IconButton onClick={() => removePersistClip(clip)}>\n <SaveIcon />\n </IconButton>\n ) : (\n <IconButton onClick={() => addPersistClip(clip)}>\n <ClipIcon />\n </IconButton>\n )\n }\n </Avatar>\n <ListItemText primary={clip.title} secondary={tags} />\n {clip.playlist\n // If the clip is in the playlist can not be edited or deleted\n ? (\n (playingNow\n // If the player if playing the clip can not be removed from the playlist\n ? (\n <Fragment>\n <IconButton disabled>\n <PlaylistRemoveIcon />\n </IconButton>\n <IconButton disabled>\n <EditIcon />\n </IconButton>\n <IconButton disabled>\n <DeleteIcon />\n </IconButton>\n </Fragment>\n ) : (\n <Fragment>\n <IconButton onClick={() => this.onRemove(clip.id)}>\n <PlaylistRemoveIcon />\n </IconButton>\n <IconButton disabled>\n <EditIcon />\n </IconButton>\n <IconButton disabled>\n <DeleteIcon />\n </IconButton>\n </Fragment>\n )\n )\n ) : (\n <Fragment>\n <IconButton onClick={() => this.onAddToPlaylist(index)}>\n <PlaylistAddIcon />\n </IconButton>\n <IconButton>\n <EditIcon onClick={() => openForm('edit', clip)} />\n </IconButton>\n <IconButton aria-label=\"Delete\" onClick={() => this.handleOpenDialog(clip.id, clip.persist)}>\n <DeleteIcon />\n </IconButton>\n </Fragment>\n )}\n </ListItem>\n <Divider />\n </Fragment>\n );\n }", "function Playlist(name) {\n this.name = name;\n this.tracks = [];\n}", "function changeTrack(url) {\n\t// Remove any existing instances of the Stratus player\n $('#stratus').remove();\n\n\t// Create a new Stratus player using the clicked song's permalink URL\n\t$.stratus({\n key: \"b3179c0738764e846066975c2571aebb\",\n auto_play: true,\n align: \"bottom\",\n links: url\n });\n}", "function _drawPlaylist() {\n let playlist = store.State.playlist;\n console.log(playlist);\n let template = \"\";\n playlist.forEach(song => (template += song.playlistTemplate));\n document.getElementById(\"playlist\").innerHTML = template;\n}", "function savePlaylists() {\n localStorage.setItem('playlist', JSON.stringify(playlists));\n}", "function changeTrack(url) {\r\n\t// Remove any existing instances of the Stratus player\r\n\t$('#stratus').remove();\r\n\r\n\t// Create a new Stratus player using the clicked song's permalink URL\r\n\t$.stratus({\r\n key: \"b3179c0738764e846066975c2571aebb\",\r\n auto_play: true,\r\n align: \"bottom\",\r\n links: url\r\n });\r\n}" ]
[ "0.72387946", "0.72387946", "0.71672624", "0.71059185", "0.7048705", "0.69723386", "0.6793613", "0.65327156", "0.64126205", "0.63669467", "0.6366396", "0.6308043", "0.6300009", "0.6291067", "0.6290152", "0.62217593", "0.61737186", "0.6169132", "0.61675686", "0.6126235", "0.6114435", "0.61135894", "0.6086449", "0.6070664", "0.6048535", "0.60442436", "0.6025586", "0.6018594", "0.6004604", "0.59964275", "0.5976356", "0.5963417", "0.5962491", "0.5956317", "0.59561306", "0.59493476", "0.5936644", "0.5936037", "0.593535", "0.5931875", "0.59245664", "0.5916422", "0.5905032", "0.59017575", "0.5869367", "0.5865586", "0.5859618", "0.5859493", "0.585456", "0.58430606", "0.5840661", "0.5835938", "0.58261335", "0.58208734", "0.58148986", "0.5813178", "0.5799768", "0.57946527", "0.5778806", "0.57766765", "0.57748526", "0.5774851", "0.576924", "0.5768662", "0.5768662", "0.5765668", "0.57484585", "0.574622", "0.5734809", "0.57346904", "0.57177293", "0.5709033", "0.57075375", "0.5704557", "0.5699642", "0.5689303", "0.5689091", "0.5675036", "0.56740457", "0.56600165", "0.56582797", "0.5652513", "0.5642612", "0.5634338", "0.5633745", "0.5611618", "0.5610549", "0.56104326", "0.5596136", "0.5595929", "0.5592501", "0.5589808", "0.5589508", "0.55881566", "0.55860114", "0.55856276", "0.5576884", "0.5574651", "0.5573436", "0.5570455" ]
0.67938304
6
! Delete a playlist
async function remove(req, res, next) { try { const { playlistId } = req.params const playlist = await Playlist.findById(playlistId) if (!playlist.public && !playlist.users.includes(req.currentUser._id)) { throw new NotAuthorized() } await Playlist.deleteOne({ _id: playlist._id }) res.sendStatus(202) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deletePlaylist(value) {\n var index;\n for (i = 1; i < user_playlists.length; i++) {\n if(user_playlists[i].name == value) {\n index = i;\n };\n };\n user_playlists.splice(index, 1);\n showLocalPlaylists()\n}", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n}", "function removeFromPlaylist(playlist, artistName)\n{\n delete playlist[artistName]\n}", "deletePlaylist(id) {\n /* Elimina de unqfy la playlist con el id indicado */\n this._validarExistenciaPlaylist(id, \"deletePlaylist\");\n this._playlists = this._playlists.filter((p) => p.id !== id);\n return this._playlists;\n }", "function removeFromPlaylist(playlist, artistName) {\n// delete playlist.artist;\n delete playlist[artistName];\n return\n}", "async deletePlaylists(id) {\n const query = {\n text: 'DELETE FROM playlists WHERE id = $1 RETURNING id',\n values: [id],\n }\n \n const result = await this._pool.query(query)\n if (!result.rows.length) {\n throw new NotFoundError('Playlist gagal dihapus, Id tidak ditemukan')\n }\n }", "function delete_current_playlist(site_url, playlist_id)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_id=\"+playlist_id,\t\t\n\t\turl: site_url+\"video/remove_user_playlist/\"\n\t}).responseText;\n\t\n\t//alert(result);\n\treturn result;\t\n}", "function deletePlaylist(playlistID, playlistRow) {\n \n $.post(domain+'includes/ajax/handlePlaylist.php', \n { \n playlistID:playlistID,\n task: 'delete' \n }, \n function(response){\n if(response == 1) {\n triggerNotification(\"Playlist was deleted.\");\n playlistRow.fadeOut(150).remove();\n \n if($('#playlists li').length == 0)\n $('#playlists').append(\"<p align='center'>Add some playlists!</p>\").hide().fadeIn(150);\n } else {\n triggerNotification(\"Playlist wasn't deleted.\");\n } \n });\n\n}", "function removeFromPlaylist(playlist, artistName){\n a = {playlist:artistName};\n delete a.playlist;\n return a;\n}", "function removeFromPlaylist(playlist, artistName) {\n delete playlist[artistName];\n return playlist\n}", "async deleteMusicIdPlaylistHandler(request, h) {\n try {\n this._validator.validatePlaylistsongPayload(request.payload);\n\n const { songId } = request.payload;\n const { playlistId } = request.params;\n const { id: credentialId } = request.auth.credentials;\n\n // Verisikasi Owner Playlist dan Lagu\n // await this._service.verifyPlaylistsOwner(playlistId, credentialId);\n await this._service.verifyPlaylistAccess(playlistId, credentialId);\n await this._service.verifyMusicByIdPlaylist(songId);\n\n // Proses Delete Music Dalam Playlist\n await this._service.deleteMusicPlaylist(\n playlistId, songId, credentialId,\n );\n return {\n status: 'success',\n message: 'Lagu berhasil dihapus dari playlist',\n };\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n return response;\n }\n\n // Server ERROR!\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami.',\n\n });\n response.code(500);\n console.error(error);\n return response;\n }\n }", "async deleteSongFromPlaylists(playlistId, songId) {\n const query = {\n text: 'DELETE FROM playlistssongs WHERE playlist_id = $1 AND song_id = $2 RETURNING id',\n values: [playlistId, songId],\n }\n \n const result = await this._pool.query(query)\n if (!result.rows.length) {\n throw new InvariantError('Lagu gagal dihapus')\n }\n }", "async deleteSongFromPlaylist(request, h) {\n try {\n const { id: credentialId } = request.auth.credentials;\n const { songId } = request.payload;\n const { playlistId } = request.params;\n await this._songsService.verifySongId(songId);\n await this._playlistsService.verifyPlaylistAccess(\n playlistId,\n credentialId\n );\n await this._playlistssongService.deleteSongFromPlaylist(\n playlistId,\n songId\n );\n const response = h.response({\n status: 'success',\n message: 'Lagu berhasil dihapus dari playlist',\n });\n response.code(200);\n return response;\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n console.log(error);\n return response;\n }\n\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami',\n });\n response.code(500);\n console.log(error);\n return response;\n }\n }", "function deleteTrack(trackID, playlistID) {\n var track = $(this).parent();\n var playlist = $('[data-playlistid=\"'+playlistID+'\"]');\n var currentCount = parseInt(playlist.find('.trackCount').text());\n\n $.post(domain+'includes/ajax/handleTrack.php', \n { \n trackID: trackID,\n playlistID: playlistID,\n task:'delete'\n }, \n function(response) {\n\n if(response == 1) {\n playlist.find('.trackCount').text(currentCount-1);\n triggerNotification(\"Track removed.\");\n track.slideUp(250).delay(250).remove();\n }\n else\n triggerNotification(\"Track wasn't removed.\");\n\n });\n}", "deleteTrackFromPlaylists(track){\n let playlistsWithTrack = this.playlists.filter((pl)=> pl.tracks.includes(track));\n playlistsWithTrack.forEach((pl)=>pl.tracks.splice(pl.tracks.indexOf(track), 1));\n }", "function removeSong() {\n}", "deleteTrack(artistName, albumName, trackName){\n let artistFromTheTrack = this.getArtistByName(artistName);\n let albumFromTheArtist = this.getAlbumInArtist(artistFromTheTrack, albumName);\n let trackToDelete = this.deleteTrackFromAlbum(albumFromTheArtist, trackName);\n this.deleteTrackFromPlaylists(trackToDelete);\n this.notificationObserver.update(this);\n trackToDelete = null;\n }", "function remove_from_playlist(genre) {\n playlist_dict.delete(genre);\n}", "deleteSong(id){\n if(!confirm(\"Are you sure you want to delete the song?\")) return\n playList = playList.filter(song => song.id !== id )\n this.render()\n }", "function confirmDeleteTube(tubeId) {\n deleteTube(tubeId);\n var element = $('#delete_tube_' + tubeId);\n element.prev().remove();\n element.next().remove();\n element.remove();\n\n restart();\n}", "async function removeSong(req, res, next) {\n try {\n const { playlistId, songId } = req.params\n const playlist = await Playlist.findById(playlistId).populate('songs')\n if (!playlist) {\n throw new NotFound(`Playlist with id: ${playlistId} does not exist.`)\n }\n if (!playlist.public && !playlist.users.includes(req.currentUser._id)) {\n throw new NotAuthorized()\n }\n const song = playlist.songs.findIndex((song) => song.equals(songId))\n if (song === -1) {\n throw new NotFound(`Song with id: ${songId} does not exist.`)\n }\n playlist.songs.splice(song, 1)\n const playlistWithDeletedSong = await playlist.save()\n res.status(200).json(playlistWithDeletedSong.songs)\n } catch (err) {\n next(err)\n }\n}", "function deleteSong(artistId, albumId, songId) {\n $.ajax({\n type: \"DELETE\",\n url: \"artists\" + artistId + \"albums\" + albumId + \"songs\" + \".json\",\n contentType: \"application/json\",\n datatype: \"json\"})\n\n .done(function(data) {\n $('#song_\"'+songId+'\"').remove();\n });\n}", "delete(req, res) {\n db.polls.destroy({\n where: {\n id: parseInt(req.params.id)\n }\n })\n .then(poll => {\n res.json({\n msg: \"Successful DELETE to '/polls' route\",\n id: req.params.id\n });\n });\n }", "removeMusic(e){\n let id = e.target.id\n let music = JSON.parse(localStorage.getItem('music'));\n for (let c = 0 ; c < music.result.length ;c++){\n if(music.result[c].name === id){\n music.result.splice(c,1)\n }\n }\n localStorage.setItem('music',JSON.stringify(music))\n window.location.href= '/display/my%20list'\n }", "async function btnDeleteItemsClick() {\n var checkedItems = $(\"input[name=manageitems]:checked\");\n var errtext = $(\"#text-manageerror\");\n\n if (isManageWorking) {\n errtext.html('<span style=\"color: yellow;\">Another management job is going on, please wait until it finishes.</span>');\n return;\n } else {\n isManageWorking = true;\n }\n if (checkedItems.length === 0) {\n errtext.html('<span style=\"color: yellow;\">No playlist item selected</span>');\n isManageWorking = false;\n return;\n }\n if (!confirm(\"Are you sure want to delete \" + checkedItems.length + \" items? This cannot be undone.\")) {\n isManageWorking = false;\n return;\n }\n\n errtext.html('<img class=\"loading\" src=\"images/loading.gif\"><label id=\"deletestatus\">Deleting...</label>');\n var deleteStatus = $(\"#deletestatus\");\n var rtn;\n var id;\n\n for (var i = 0; i < checkedItems.length; i++) {\n id = managePlaylist[parseInt(checkedItems[i].value)][1];\n if (id === undefined) {\n errtext.html('<span style=\"color: yellow;\">Sorry, changing liked videos list not yet supported :(</span>');\n isManageWorking = false;\n return;\n }\n deleteStatus.html(\"Deleting item: \" + id + \" (\" + (i + 1) + \"/\" + checkedItems.length + \")\");\n rtn = await removePlaylistItem(id);\n if (rtn !== undefined) {\n if (rtn.status !== 200 && rtn.status !== 204) {\n errtext.html('<span style=\"color: yellow;\">Error ' + rtn.result.error.code + ': ' + rtn.result.error.message + '</span><br>');\n isManageWorking = false;\n return;\n }\n } else {\n displayErr(errtext, rtn);\n isManageWorking = false;\n return;\n }\n }\n\n // Finished!\n errtext.html(\"Deleted \" + checkedItems.length + \" items. Please click Load button if the playlist is not updated.\");\n isManageWorking = false;\n await btnLoadItemsClick();\n loadUserPlaylist();\n}", "function deleteItemById(smid) {\n var r = confirm(_locale[pn]['delete_confirm']);\n if(r==true) {\n THK.DB.deleteById(smid, function(ret) {\n if(ret.rowsAffected==1) {\n // delete ok\n // remove li item.\n $(\"#\"+smid).remove();\n VideoCounter -= 1;\n TotalVideo -= 1;\n updateCounter();\n } else {\n \n }\n });\n \n THK.DB.deleteQueueById(smid);\n } else {\n // do nothing\n \n }\n}", "function deleteFromQueue(id) {\n database.ref(path + 'songs/' + id).remove();\n}", "function deletePlaylist(playlistId) {\n var prompt = confirm(\"Are you sure you want to delte this playlist?\");\n\n if(prompt == true) {\n\n console.log(\"playlist deleted\")\n $.post(\"include_files/form_handlers/ajax/deletePlaylist.php\", { playlistId: playlistId })\n .done(function(error) {\n\n if(error != \"\") {\n alert(error);\n return;\n }\n\n //do something when ajax returns\n openPage(\"yourMusic.php\");\n });\n\n\n }\n}", "function deleteSong(req, res){\n req.user.song.pull(req.params.id);\n req.user.save();\n res.redirect('/');\n}", "function deleteFromFavorites(value) {\n var index;\n for (i = 0; i < user_playlists[0].songs.length; i++) {\n if(user_playlists[0].songs.href == value) {\n index = i;\n }\n }\n user_playlists[0].songs.splice(index, 1);\n printFavoritesPlaylists(user_playlists[0].songs, 0, 0);\n}", "delete(opts) {\n\t\treturn new Promise((resolve, reject) => {\n\t\t\t// Delete from the database.\n\t\t\tthis.db.query(deleteQuery, [opts.userId, opts.songId], (err, res) => {\n\t\t\t\tif (err)\n\t\t\t\t\treturn reject(err);\n\n\t\t\t\tresolve();\n\t\t\t});\n\t\t});\n\t}", "[types.DELETE_SONG](state, payload) {\n let i;\n for (i = 0; i < state.songList.length; i++) {\n if (state.songList[i].vid === payload) {\n // check if this song is the current song\n if (i === state.curSongIdx) {\n state.curSongIdx = -1;\n }\n // remove\n state.songList.splice(i, 1);\n // if i < curSongIdx, the curSongIdx need to be update\n if (i < state.curSongIdx) {\n state.curSongIdx -= 1;\n }\n return;\n }\n }\n }", "deleteTask(id) {\n var index = this.list.map(i => i.id).indexOf(id);\n this.list.splice(index, 1);\n ls.deleteItem(id);\n }", "function deleteSingleItem() {\n var msg;\n if (files[currentFileIndex].metadata.video) {\n msg = navigator.mozL10n.get('delete-video?');\n }\n else {\n msg = navigator.mozL10n.get('delete-photo?');\n }\n if (confirm(msg)) {\n deleteFile(currentFileIndex);\n }\n}", "function remove_video_playlist(site_url, video_id)\n{\n\tvar playlist_id = $('#playlist_id').val();\n\tvar playlist_type = $('#playlist_type').val();\n\t\n\t//alert(video_id+' '+playlist_id+' '+playlist_type);\n\t\n\t$.ajax({\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_id=\"+playlist_id+\"&playlist_type=\"+playlist_type+\"&video_id=\"+video_id,\n\t\tdataType: \"json\",\n\t\turl: site_url+\"video/remove_video_playlist/\",\n\t\tsuccess: function(data){\n\t\t\t//alert(json_decode(data.video_ids));\n\t\t\t//$('#playlist_video_display').html(data.form);\t\n\t\t\tdisplay_current_playlist(site_url);\n\t\t\t\n\t\t\t/*if ($('#playlist_play_video_id').val()==video_id){\n\t\t\t\t$('#video_play').html('play');\t\n\t\t\t}*/\n\t\t}\n\t});\n\t\n}", "async function deleteSong(req, res){\n try {\n var id = req.body._id;\n await songsController.songDeleted(id);\n res.status(200).send('Se elimino la cancion correctamente');\n } catch (e) {\n res.status(500).send('No se encontro la cancion a eliminar ' + e);\n }\n}", "function deleteProject() {\n\n const CANCEL_ID = 1;\n dialog.showMessageBox({\n buttons: ['Delete Project','Cancel'],\n cancelId: CANCEL_ID,\n defaultId: CANCEL_ID,\n type: 'question',\n title: 'Confirm Delete',\n message: 'This project and all its media will be deleted. Are you sure?',\n }, function(response) {\n\n if (response!==CANCEL_ID) {\n\n // Remove the audio and layout files\n var layout = synthea.currentProjectDef.documentRoot+'/layout.json';\n var audio = synthea.currentProjectDef.documentRoot+'/audio';\n if( fs.existsSync(audio) && fs.existsSync(layout)) {\n fs.readdirSync(audio).forEach(function(file,index){\n fs.unlinkSync(audio + '/' + file);\n });\n fs.rmdirSync(audio);\n fs.unlinkSync(layout);\n fs.rmdir(synthea.currentProjectDef.documentRoot);\n }\n\n\n // Close it\n synthea.closeProject();\n }\n\n });\n}", "function removeTodoById(id, li) {\n connection.remove({\n from: 'tasks',\n where: {\n id: id\n }\n }).then(() => {\n li.remove()\n // alert('Todo removed')\n })\n}", "function deleteItem(id) {\n executeHTTPRequest(id, 'DELETE', '/remove')\n}", "function delete_artist(id){\n console.log(\"INSIDE DELETE_ARTIST\");\n\n const key = datastore.key([ARTIST, parseInt(id,10)]);\n\n return datastore.get(key).then( result => {\n console.log(\"EXITING DELETE_ARTIST\");\n\n //Delete the artist\n return datastore.delete(key);\n }).catch( err => {\n return false;\n });\n}", "function deleteListItem() {\n item.remove();\n }", "removePodcast(e){\n let id = e.target.id\n console.log(id)\n let podcast = JSON.parse(localStorage.getItem('podcast'));\n for (let c = 0 ; c < podcast.result.length ;c++){\n if(podcast.result[c].name === id){\n podcast.result.splice(c,1)\n }\n }\n localStorage.setItem('podcast',JSON.stringify(podcast))\n window.location.href= '/display/my%20list'\n }", "function removeResults(songMetaData) {\n playlist.shift(songMetaData);\n // console.log(playlist);\n saveFile();\n}", "function delSong(e) {\n var song_id = e.target.id\n var artist_id = song_id.substr(0, song_id.indexOf(\"d\"));\n var song_id = song_id.substr(song_id.indexOf(\"l\") + 1, song_id.length);\n $.ajax({\n type: 'DELETE',\n url: 'http://localhost:3001/songs/' + artist_id,\n dataType: 'text',\n data: song_id,\n processData: false,\n encode: true,\n success: function(data, textStatus, jQxhr) {\n console.log(data);\n get_artists();\n },\n error: function(jqXhr, textStatus, errorThrown) {\n alert(errorThrown);\n }\n });\n}", "function deleteDone(doneUl, doneLi, json) {\n\tconst configObj = {\n\t\tmethod: \"DELETE\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t\"Accept\": \"application/json\"\n\t\t}\n\t}\n\n\tfetch(`http://localhost:3000/tasks/${json.id}`, configObj)\n\n\tdoneUl.removeChild(doneLi);\n}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "function delItem(id) {\n connection.query(\"DELETE FROM itemList where id = ?\", [id], function(\n error,\n results,\n fields\n ) {\n if (error) throw error;\n console.log(results);\n });\n }", "function deleteVideo(video) {\n\t\tconsole.log(\"deleteVideo button clicked\");\n\t\t// Send message to the server to delete the video\n\t\t$http.delete(colabConfig.colabServerBaseURL + \"/uploaded_videos/\" + video.file_name);\n\t\t\n\t\t// Remove the video from the list being displayed\n\t\t$scope.videoList.splice( $scope.videoList.indexOf(video), 1 );\n\t}", "deleteArtist(artistName){\n let artistToDelete = this.getArtistByName(artistName);\n let artistAlbums = artistToDelete.albums;\n let artistTracks = this.collecTracks(artistAlbums);\n artistTracks.forEach((t)=> this.deleteTrackFromPlaylists(t));\n artistAlbums.forEach((a)=> a.tracks.forEach((t)=> this.deleteTrackFromAlbum(a, t.name)));\n artistToDelete.albums.forEach((a)=> this.deleteAlbumFromArtist(artistToDelete, a.name));\n this.artists.splice(this.artists.indexOf(artistToDelete), 1);\n this.notificationObserver.update(this);\n artistToDelete = null;\n }", "delete() {\n\t\tconst player = this.props.player.get('name');\n\t\tthis.props.onDelete(player);\n\t}", "deleteTrack(id) {\n /* Elimina de unqfy el track con el id indicado */\n const tracks = this.getAlbumById(id).deleteTrack(id);\n return tracks;\n }", "function remove_video() {\n\n\n\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onRequestFileSystemSuccess, null);\n\n function onRequestFileSystemSuccess(fileSystem) {\n\n fileSystem.root.getFile(\"GymWijzer/Video/\" + trahsname + \".mp4\", {\n create: false,\n exclusive: false\n }, gotRemoveFileEntry, fail);\n\n }\n\n\n\n function gotRemoveFileEntry(fileEntry) {\n console.log(fileEntry);\n fileEntry.remove(success, fail);\n }\n\n function success(entry) {\n console.log(\"Removal succeeded\");\n $(\"#videolistul li\").remove();\n fn_subtitle_videolist(array, window.localStorage.getItem(\"videoid\"));\n jQuery.fancybox.open(\"#remove\");\n\n\n\n }\n\n function fail(error) {\n console.log(\"Error removing file: \" + error.code);\n }\n\n}", "function deletePlayingSong (id) {\n $.ajax({\n url: '/song/' + id,\n type: 'DELETE',\n success: function (result) {\n // Do something with the result\n console.log('This should be removed from the database' + result)\n voteCount = 3\n updateList()\n }\n })\n}", "handleRemove(key,link){\n // Removing the item from songs object so it can render the correct tracks\n let songObj = {}\n let songsItems = [];\n for(let i=0;i!==songs.items.length;i++){\n if(key!==i){\n let obj = {};\n obj = Object.assign({},obj,{\n image:songs.items[i].image,\n name:songs.items[i].name,\n title:songs.items[i].title,\n uri:songs.items[i].uri\n })\n songsItems.push(obj);\n }\n }\n newItems.splice(key,1);\n songObj=Object.assign({},songObj,{\n items:songsItems\n })\n songs = songObj;\n // For making the remove\n let items = []\n let tracks = {};\n let obj = {};\n obj = Object.assign({},obj,{\n uri:link,\n positions:[key]\n })\n items.push(obj)\n tracks = Object.assign({},tracks,{\n tracks:items\n })\n // Calling remove\n this.props.removeTrackFromPlaylist(spotifyApi,this.props.playlist.id,tracks.tracks);\n }", "removeSong(selectedSong){\r\n this.userSetlist.pop(selectedSong);\r\n }", "'click .delete'() {\n \t\tMeteor.call('lists.remove', this._id, (error) => {\n\t\t\tif (error) {\n\t\t\t\tBert.alert( 'An error occured: ' + error + '! Only the creator of the list can delete it.', 'danger', 'growl-top-right' );\n\t\t\t} else {\n\t\t\t\tBert.alert( 'List removed successfully!', 'success', 'growl-top-right' );\n\t\t\t\tFlowRouter.go('/');\n\t\t\t}\n\t\t});\n\t}", "onRemove(id) {\n const { removeVideo, removeClipFromPlaylist, playlist } = this.props;\n\n // find the index of the clip to remove by its ID\n const index = playlist.list.map(e => e.id).indexOf(id);\n\n // Check if the next clip in the list is playing\n if (playlist.now === index + 1) {\n removeVideo(id, true);\n } else {\n removeVideo(id, false);\n }\n // Set in the clip.list that the actual clip is not in the playlist\n removeClipFromPlaylist(id);\n }", "function deleteListPanel() {\n var listPlayerPanel = document.getElementById(\"current-player-panel\");\n while (listPlayerPanel.hasChildNodes()) {\n listPlayerPanel.removeChild(listPlayerPanel.firstChild);\n }\n}", "function removeSong(song) {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n var index = songArray.indexOf(song)\n songArray.splice(index, 1)\n store.setItem('songs', JSON.stringify(songArray))\n}", "function sendDeleteSong() {\n\t$(\"#playerPagePopup\").popup( \"close\" );\n\tif(currentSongID == 0) // We need the database ID to do this so cant continue...\n\t\treturn;\n\t\n\t$(\"#jPlayer_instance\").jPlayer( \"clearMedia\" ); // Stop playing the song \n\t$(\"#songPlaylistPlaying\").remove(); // Remove the currently playing instance from the main page playlist (if it exists)\n\t$(\"#playerPlayPause\").removeClass(\"pause\");\n\t$(\"#playerPlayPause\").addClass(\"play\");\n\t$(\"#songArt\").css(\"background-image\", \"url('')\");\n\t$(\"#songTitle\").html(\"\");\n\tplayer_playing = false;\n\t$(\"#downloadProgress\").css(\"width\", \"0%\");\n\t$(\"#songProgress\").css(\"width\", \"0%\");\n\t$(\"#timeLeft\").text(\"0:00\");\n\t$(\"#timeRight\").text(\"0:00\");\n\t$(\"#songLoader\").show();\n\tcurrentSongData = null; // Clear our reference variable\n\t\n\t// Send the delete request\n\tvar dataString = 'cmd=delete';\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: backend_url+\"/index.php\",\n\t\tdata: encodeURI('cmd=delete'+\"&id=\"+currentSongID),\n\t\tcache: false,\n\t\tsuccess: function(result){\n\t\t\tvar jsonResponse = jQuery.parseJSON(result);\n\t\t\tif(jsonResponse.status === \"success\") {\n\t\t\t\t// Check to see if the currentSong array id matches, if it does remove the row from the main page playlist\n\t\t\t\tif(loadedPlaylist[currentSong].id == currentSongID) {\n\t\t\t\t\t$(\"#playlistSongsRow\"+currentSong).remove();\n\t\t\t\t}\n\t\t\t\tcurrentSong = 0; // Reset the next 2 variables now that weve made the check above\n\t\t\t\tcurrentSongID = 0;\n\t\t\t\t$(\"#songLoader\").hide();\n\t\t\t\tshowMainPage(); // Open the main page back up\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// This should rarely happen but just in case the backend has an issue\n\t\t\t\t$(\"#songLoader\").hide();\n\t\t\t\tnavigator.notification.alert(\n\t\t\t\t\tjsonResponse.reason, // message\n\t\t\t\t\t'', // callback\n\t\t\t\t\t'Error', // title\n\t\t\t\t\t'Close' // buttonName\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n}", "function deleteItem(id){\r\n $.ajax(\r\n {\r\n url: 'http://157.230.17.132:3019/todos/' + id,\r\n method: 'DELETE',\r\n success: function(dataResponse){\r\n getList();\r\n },\r\n error: function(){\r\n alert(\"Non è possibile cancellare l'elemento!\")\r\n }\r\n }\r\n );\r\n }", "function deleteMedia(id, i) {\n var config = {\n params: {\n 'api_password': CONSTANTS.WISTIA.password,\n }\n };\n $http.delete(CONSTANTS.WISTIA.mediaActionUrl+id+'.json', config).then(function (res) {\n // start uploading the video once the video count goes below 3\n if (i == 0)\n data.submit();\n }, function (err) {\n showMessage(\"Oops again! Error while deleting the media\");\n });\n }", "function deleteItem(e) {\n // retrieve the name of the task we want to delete. We need\n // to convert it to a number before trying it use it with IDB; IDB key\n // values are type-sensitive.\n let noteId = Number(e.target.parentNode.getAttribute('data-note-id'));\n\n // open a database transaction and delete the task, finding it using the id we retrieved above\n let transaction = db.transaction(['notes_os'], 'readwrite');\n let objectStore = transaction.objectStore('notes_os');\n let request = objectStore.delete(noteId);\n\n // report that the data item has been deleted\n transaction.oncomplete = function() {\n // delete the parent of the button\n // which is the list item, so it is no longer displayed\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n console.log('Note ' + noteId + ' deleted.');\n\n // Again, if list item is empty, display a 'No notes stored' message\n if(!list.firstChild) {\n let listItem = document.createElement('li');\n listItem.textContent = 'No notes stored.';\n list.appendChild(listItem);\n }\n };\n}", "function deleteButtonPressed(todo) {\n db.remove(todo);\n}", "function deleteMedia(id) {\n Media.delete(id)\n .then(function onSuccess(response) {\n console.log(response);\n })\n .catch(function onError(response) {\n console.log(response);\n });\n }", "delete(req, res) {\n Game.destroy({\n where: {\n id: req.params.id\n }\n })\n .then((deletedRecords) => {\n res.status(200).json(deletedRecords);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "delete(groceryListId, itemName, callback) {\n GroceryItem.findOne({where: {groceryListID: groceryListId, name: itemName}})\n .then((item) => {\n item.destroy()\n .then(() => {\n callback(null);\n })\n .catch((err) => {\n callback(err);\n }) \n })\n .catch((err) => {\n callback(err);\n })\n }", "deleteVideo(videoId) {\n const uid = this.context.user.uid\n ref.child(`/users/${uid}/favorites/${videoId}`).remove()\n }", "function deleteVideo(videoName) {\r\n\tvar requestData = '{'\r\n\t\t\t+ '\"command\" : \"deleteVideo\",'\r\n\t\t\t+ '\"arguments\" : {'\r\n\t\t\t+ '\"video\" : \"' + videoName + '\"'\r\n\t\t\t+ '}'\r\n\t\t\t+ '}';\r\n\tmakeAsynchronousPostRequest(requestData, refresh, null);\t// Defined in \"/olive/scripts/master.js\".\r\n}", "function deleteTask(description) {\n\tvar username = localStorage.getItem(\"username\"); \n\tdatabase.ref('/task/'+username+'/'+description).remove();\n\tswal('Task deleted','','success').then((result) => {\n\t\twindow.location.reload();\n\t});\n\t\n\t\n}", "deleteAlbum(artistName, albumName){\n let artistWithAlbum = this.getArtistByName(artistName);\n let albumToDelete = this.getAlbumInArtist(artistWithAlbum, albumName);\n let tracksFromAlbumToDelete = albumToDelete.tracks;\n tracksFromAlbumToDelete.forEach((t)=> this.deleteTrackFromPlaylists(t));\n albumToDelete.tracks.forEach((t)=> this.deleteTrackFromAlbum(albumToDelete, t.name));\n this.deleteAlbumFromArtist(artistWithAlbum, albumToDelete.name);\n this.notificationObserver.update(this);\n albumToDelete =null;\n }", "function clearPlaylistVideos(){\r\n\tvar tableHeaderRowCount = 1;\r\n\tvar table = document.getElementById(\"videosTableP\");\r\n\tvar rowCount = table.rows.length;\r\n\tfor (var i = tableHeaderRowCount; i < rowCount; i++) {\r\n\t table.deleteRow(tableHeaderRowCount);\r\n\t}\r\n}", "function deleteStory(title) {\r\n if(stories.has(title)) {\r\n\tstories.delete(title);\r\n } else {\r\n alert(\"Story not in database!\");\r\n }\r\n}", "function DeleteArtistById(req, res) {\n\t// Deletes the artist by ID, get ID by req.params.artistId\n}", "function deleteVideo(ctx) {\n /* Current window.timeline item */\n const targetNode = window.references[ctx.target.id]\n\n /* Linking the previous node */\n if (targetNode.prev) {\n targetNode.prev.next = targetNode.next\n }\n\n /* Linking the next node */\n if (targetNode.next) {\n targetNode.next.prev = targetNode.prev\n }\n\n /* Edge case when the deleted item is the head */\n if (window.timeline === targetNode) {\n window.timeline = targetNode.next\n }\n\n /* Updating the overall video duration */\n window.timelineDuration -= targetNode.data.metadata.duration\n \n /* Forcing the memory cleanup */\n delete targetNode\n \n /* UI removing animation */\n ctx.target.style.animation = 'disappear 0.5s'\n setTimeout(() => {\n $(ctx.target).remove()\n renderPreviousTimelineDimensions()\n }, 400)\n}", "function deleteListItem(e) {\n\t\te.remove();\n\t}", "async function removeAllTracksFromPlaylist (uid, pid, tracks) {\n try {\n const spotify = createSpotify()\n // Batch size.\n const limit = 100\n while (tracks.length) {\n const batch = tracks.splice(0, limit)\n // Remove tracks.\n await spotify.removeTracksFromPlaylist(uid, pid, batch)\n .catch(e => console.log(e))\n }\n } catch (e) {\n throw e\n }\n}", "deleteList(listID){\n let index = _store.State.lists.findIndex(list => list.id == listID)\n _store.State.lists.splice(index, 1)\n _store.saveState()\n }", "function deleteListElement() {\n\tvar deleteItem = document.querySelector('li');\n\tdeleteItem.parentNode.removeChild(deleteItem);\n\tvar deleteButton = document.getElementById('delete');\n\tdeleteButton.remove();\n}", "function remove(q, cb) {\n mongodb.collections['track']\n .deleteOne(q)\n .then(cb, (error) => console.trace('track.remove() error:', error));\n}", "delete(id, item) {\n this.tasks = this.tasks.filter(task => task.id !== id);\n\n localStorage.setItem(this.storageList, JSON.stringify(this.tasks));\n item.remove();\n }", "function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}", "function deleteItem() {\n var id = $(this).parent().attr('data-id');\n\n $.ajax(\n {\n url: 'http://157.230.17.132:3017/todos/' + id,\n method: 'DELETE',\n success: function() {\n getAllItemsSaved();\n },\n error: function() {\n alert(\"Attenzione, non sono riuscito a eliminare l'elemento\");\n }\n }\n );\n}", "function deleteListItem() {\n\tthis.parentNode.remove();\n}", "'click .js-media-delete-button'( e, t ) {\n e.preventDefault();\n\n let cur = $( '#cb-current' ).val()\n , idx = P.indexOf( `${cur}` );\n\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-media-toolbar' ).hide();\n $('#frameBorder').remove();\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\n\n //console.log( pp.find({}).fetch() );\n }", "removeTrack(track){\nlet playlistTracks = this.state.playlistTracks;\nlet index = playlistTracks.findIndex(track => track.id = playlistTracks.id);\nplaylistTracks.splice(index,1);\nthis.setState({playlistTracks:playlistTracks});\n}", "function actionDelete(p){\n\tsrc = collection[p].name;\n\t\n\tif($('#'+src).hasClass('isLocked')){\n\t\talert(\"Ce dossier est protégé contre la suppression\");\n\t\treturn false;\n\t}\n\n\tmessage = $('#'+src).hasClass('isDir')\n\t\t? \"Voulez vous supprimer ce dosssier et TOUT son contenu ?\"\n\t\t: \"Voulez vous supprimer ce fichier ?\";\n\n\tif(!confirm(message)){\n\t\t//log_(\"REMOVE CANCELED BY USER\");\n\t\treturn false;\n\t}\n\t\n\tvar get = $.ajax({\n\t\turl: 'helper/action',\n\t\tdataType: 'json',\n\t\tdata: {'action':'remove', 'src':collection[p].url}\n\t});\n\t\n\tget.done(function(r) {\n//\t\tif(r.callBack != null) eval(r.callBack);\n\t\tif(r.success == 'true'){\n\t\t\t$('div[id=\"'+src+'\"]').fadeTo(218,0, function() {\n\t\t\t\t$(this).remove();\n\t\t\t});\n\t\t\tmakeDragAndDrop();\n\t\t}\n\t});\n}", "redisDelete(url) {\n client.del(url.shortURL, (err, reply) => {\n if (err) reject(err);\n });\n }", "function deleteItemList(url) {\n // Get itemList from local storage and convert it into a JSON\n let itemLists = JSON.parse(localStorage.getItem(\"itemLists\"));\n // Loop through itemLists\n for (let i = 0; i < itemLists.length; i++) {\n if (itemLists[i].url == url) {\n // Remove from array\n itemLists.splice(i, 1);\n }\n }\n // Reset it back to local storage with added new itemList\n localStorage.setItem(\"itemLists\", JSON.stringify(itemLists));\n\n // Re-fetch itemLists\n fetchItemLists();\n}", "async removeFavoriteStory(storyId) {\n // this function should return the newly created story so it can be used in\n // the script.js file where it will be appended to the DOM\n // remove story from list\n\n try {\n const response = await axios.delete(\n `${BASE_URL}/users/${this.username}/favorites/${storyId}`,\n { data: {token: this.loginToken} }\n );\n this.favorites.splice(\n this.favorites.findIndex((item) => item.storyId == storyId), 1\n );\n } catch (error) {\n axiosErrorHandler(error);\n }\n }", "function close_video_playlist_anyway()\n{\n\tcloseBox();\n}", "confirmDelete() {\n SongApi.delete(this.state._id);\n this.props.history.push('/');\n }", "function delete_li(rm){\nrm.parentNode.remove()\nsweetAlertSuccessMsg(\"Deleted Successfully\")\n}", "function delete_work(id){\n console.log(\"INSIDE DELETE_WORK\");\n const key = datastore.key([WORK, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n\n //Delete the artwork\n return datastore.delete(key).then(()=>{\n console.log(\"EXITING DELETE WORK\");\n return true;\n });\n }).catch( err => {\n return false;\n });\n}", "removeTrack(track){\n // set variables\n let tempPlaylist = this.state.playlistTracks;\n\n // loop through the PlayList until a match is found\n // for the track to be removed and remove it\n for(let i=0; i < tempPlaylist.length; i++){\n if(track.id === tempPlaylist[i].id){\n tempPlaylist.splice(i,1);\n }\n }\n // update the state with the tempPlaylist\n this.setState({ playlistTracks:tempPlaylist });\n }", "function delete_list_player() {\n var listPlayerDisplayed = document.getElementById(\"list-players-content\");\n while (listPlayerDisplayed.hasChildNodes()) {\n listPlayerDisplayed.removeChild(listPlayerDisplayed.firstChild);\n }\n}", "'playerDelete'(playerRow){\n Atendence.remove({player: playerRow._id});\n Players.remove({_id: playerRow._id});\n }", "function deleteFilm(){\n\tdeleteId = $('#deleteId').val();\n\tdeleteAjax(\"https://eloquent-yew-227217.appspot.com/DeleteFilm?ID=\"+deleteId+\"\",\"#results\");\n}", "function deleteListItem() {\r\n\t// In order to delete entire list item we have to use parent method > without parent method we would only delete our delete button\r\n\t$(this).parent().fadeOut(1000, function(){\r\n\t\t$(this).remove();\r\n\t});\r\n\r\n\t// This deletes list items in our local storage\r\n\tlocalStorage.removeItem(\"list\", $('#List').html());\r\n}", "function deleteItem( id ) {\n $http.delete( storelist_url + '/' + id ).then(\n function(response) {\n console.log(response);\n deferred.resolve(response);\n },\n function(error) {\n deferred.reject(error);\n }\n );\n return deferred.promise;\n }" ]
[ "0.730405", "0.7262527", "0.72271025", "0.7222468", "0.721535", "0.70198643", "0.70174205", "0.6970261", "0.69445425", "0.6927156", "0.6892451", "0.67835784", "0.66737837", "0.6604392", "0.654236", "0.64380807", "0.6422916", "0.63487345", "0.6336617", "0.6295552", "0.62832344", "0.62789243", "0.6249934", "0.6231796", "0.6205197", "0.6197146", "0.61810356", "0.6176089", "0.61512643", "0.6150766", "0.61395836", "0.6100858", "0.6099666", "0.6091904", "0.60791266", "0.6078501", "0.60638285", "0.60409135", "0.60388994", "0.6021477", "0.6017329", "0.5991646", "0.5982406", "0.5981325", "0.5953905", "0.5948447", "0.59294504", "0.59199584", "0.58890426", "0.58649087", "0.58647513", "0.5859412", "0.58432364", "0.58379734", "0.5832871", "0.5831102", "0.5802069", "0.5797384", "0.5787136", "0.57744116", "0.57654715", "0.57610965", "0.57450044", "0.5743109", "0.5742326", "0.57413554", "0.57407343", "0.5736858", "0.57321465", "0.5722799", "0.5720565", "0.57151985", "0.57099247", "0.57030535", "0.5698193", "0.56957036", "0.5688749", "0.56721365", "0.5665872", "0.5662702", "0.5658558", "0.5655766", "0.5653352", "0.56513864", "0.56503135", "0.5645027", "0.56438994", "0.56424725", "0.5642074", "0.5641836", "0.56221044", "0.56216574", "0.56172377", "0.56102586", "0.5608549", "0.5605982", "0.5605513", "0.5603374", "0.55893993", "0.5581375" ]
0.6419524
17
! Add a song to a playlist
async function addSong(req, res, next) { console.log('Adding song to playlist') try { const { playlistId, songId } = req.params req.body.user = req.currentUser console.log('request params: ', req.params) const playlist = await Playlist.findById(playlistId) // console.log('Playlist User', typeof playlist.user) // console.log('Req Current User', typeof req.currentUser._id) // console.log(playlist.public) // console.log('current user owns playlist?', playlist.user._id.equals(req.currentUser._id)) if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } if (!playlist.public && !playlist.user._id.equals(req.currentUser._id)) { throw new NotAuthorized() } const song = await Song.findById(songId) playlist.songs.push(song) const playlistWithNewSong = await playlist.save() res.status(200).json(playlistWithNewSong.songs) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addSongToPlaylist (e) {\n if (this.props.canAddDirectly) {\n this.props.addSong(this.props.activePlaylistID, this.props.trackInfo.uri);\n } else {\n this.props.addSongToDB(this.props.session.connected_session.data.joinCode, this.props.trackInfo, this.props.userId);\n }\n notify.show(\"Added song \" + this.props.trackInfo.name, \"success\", 2000);\n }", "function addToPlaylist(trackId, playlist) {\n spotifyApi.addTracksToPlaylist(playlist, [`spotify:track:${trackId}`])\n .then(function (data) {\n console.log('Added tracks to playlist!');\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function addSongToExistingPlaylist(sname, surl, playlistName) {\n let reqPlaylist = playlistsArr.find((list) => list.name == playlistName);\n reqPlaylist.song.push({ songName: sname, songurl: surl });\n}", "addPlaylist(playlist)\n {\n if(this.name === null) {\n this.name = playlist.name;\n }\n for (let song of playlist.songs) {\n let newSong = new Song('', '', song);\n this.songs.push(newSong);\n }\n }", "async function addSong(song){\n \n}", "function addSong(song) {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n songArray.push(song)\n store.setItem('songs', JSON.stringify(songArray))\n}", "async function addSong(type, id, title, artist, album, duration, data = null) {\n const song = {\n type,\n id,\n title,\n artist,\n album,\n duration,\n dateAdded: Date.now(),\n data\n };\n\n let songs = await getSongs();\n songs.push(song);\n await set('pwamp-songs', songs);\n}", "function updatePlaylist(playlist, artistName, songTitle)\n{\n playlist[artistName] = songTitle\n}", "function addTracksToPlaylist(data, callback){\n\tsessionStorage.songs = JSON.stringify(MASTER_TRACKLIST); \n\tsessionStorage.spotifyUserId = JSON.stringify(spotifyUserId);\n\n\tplaylistId = data.id;\n\tsessionStorage.playlistId = JSON.stringify(playlistId);\n\tvar tracks = [];\n\tfor(var i = 0; i < MASTER_TRACKLIST.length; i++){\n\t\ttracks.push(MASTER_TRACKLIST[i].id);\n\t}\n\tvar tracksString = tracks.join(\",spotify:track:\");\n\t\n\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId +\n\t'/playlists/' + playlistId +\n\t'/tracks?uris='+encodeURIComponent(\"spotify:track:\"+tracksString);\n\t$.ajax(url, {\n\t\tmethod: 'POST',\n\t\tdataType: 'text',\n\t\theaders: {\n\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tsuccess: function(d) {\n\t\t\tcallback(d, data.external_urls.spotify);\n\t\t},\n\t\terror: function(r) {\n\t\t\tcallback(null, null);\n\t\t}\n\t});\n}", "function updatePlaylist(playlist, artist, song) {\n //var playlist = {artist: song};\n playlist[artist] = song\n return\n}", "function addSong(){\r\n var song = {};\r\n \r\n // prompt user for data\r\n song.title = prompt(\"please enter the title of the song\");\r\n song.artist = prompt(\"please enter the name of the artist of the song\");\r\n song.videoId = prompt(\"please enter the video id\");\r\n data.songs.push(song);\r\n\r\n // if the current playist isnt also the all songs playlist\r\n if(current_playlist.songs != data.songs){\r\n // add song to data\r\n var songCopy = {};\r\n songCopy.title = song.title;\r\n songCopy.artist = song.artist;\r\n songCopy.videoId = song.videoId;\r\n current_playlist.songs.push(songCopy);\r\n }\r\n updateSongPane();\r\n}", "add(url, track) {\n this.queue.push(url);\n this.trackInfo.push(track);\n return this.emit('song added', url, track);\n }", "async savePlaylist(bot, message, settings, msg) {\n\t\t// Get songs to add to playlist\n\t\tlet res;\n\t\ttry {\n\t\t\tres = await bot.manager.search(message.args[1], message.author);\n\t\t} catch (err) {\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/ERROR', err.message);\n\t\t}\n\n\t\t// Workout what to do with the results\n\t\tif (res.loadType == 'NO_MATCHES') {\n\t\t\t// An error occured or couldn't find the track\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.error(settings.Language, 'MUSIC/NO_SONG');\n\t\t} else if (res.loadType == 'PLAYLIST_LOADED' || res.loadType == 'TRACK_LOADED') {\n\t\t\t// Save playlist to database\n\t\t\tconst newPlaylist = new PlaylistSchema({\n\t\t\t\tname: message.args[0],\n\t\t\t\tsongs: res.tracks.slice(0, message.author.premium ? 200 : 100),\n\t\t\t\ttimeCreated: Date.now(),\n\t\t\t\tthumbnail: res.playlist?.selectedTrack.thumbnail ?? res.tracks[0].thumbnail,\n\t\t\t\tcreator: message.author.id,\n\t\t\t\tduration: res.playlist?.duration ?? res.tracks[0].duration,\n\t\t\t});\n\t\t\tnewPlaylist.save().catch(err => bot.logger.error(err.message));\n\n\t\t\t// Show that playlist has been saved\n\t\t\tconst embed = new MessageEmbed()\n\t\t\t\t.setAuthor(newPlaylist.name, message.author.displayAvatarURL())\n\t\t\t\t.setDescription([\t`Created a playlist with name: **${message.args[0]}**.`,\n\t\t\t\t\t`Playlist duration: ${bot.timeFormatter.getReadableTime(parseInt(newPlaylist.duration))}.`,\n\t\t\t\t\t`Added **${(res.loadType == 'PLAYLIST_LOADED') ? res.playlist.name : res.tracks[0].title}** (${res.tracks.length} tracks) to **${message.args[0]}**.`].join('\\n'))\n\t\t\t\t.setFooter(`ID: ${newPlaylist._id} • Songs: ${newPlaylist.songs.length}/${(message.author.premium) ? '200' : '100'}`)\n\t\t\t\t.setTimestamp();\n\t\t\tmsg.edit('', embed);\n\t\t} else {\n\t\t\tmsg.delete();\n\t\t\treturn message.channel.send(`\\`${message.args[1]}\\` is not a playlist`);\n\t\t}\n\t}", "addSong(songInfo, position) {\n if (position == \"start\")\n {\n //this.songs.unshift(songInfo);\n //Adds song to right after the currently playing song\n this.songs.splice( this.position + 1, 0, songInfo);\n }\n else if (position == \"end\")\n {\n this.songs.push(songInfo);\n }\n\n //Probably tries to update for everyone too\n }", "addSong(input) {\n this.songs.push(input);\n }", "function addSongToDatabase(song) {\nsongDatabase.push(song);\n}", "function createSpotifyPlaylist(message) {\n spotifyApi.createPlaylist('MaeshBot\\'s Playlist', { 'description': 'Playlist converted from YouTube by MaeshBot :)', 'public': true })\n .then(function (data) {\n var spotifyPlaylistId = data.body.id;\n titles.forEach((title) => {\n // search for title\n searchAndAdd(title, spotifyPlaylistId);\n // add first track to playlist\n })\n message.channel.send(\"Here's the link to the playlist: \" + String(data.body.external_urls.spotify));\n console.log('Created playlist!', data.body);\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function addSongToPlayList(obj){\r\n PlayList.push(obj);\r\n ShowSongs(obj);\r\n}", "function addPlaylist(playlist_name){\n console.log('creating playlist',playlist_name);\n\n var data = {\n playlist_name: playlist_name\n };\n\n requests.createPlaylist(data, (x) => {\n if (x['status'] === 200){\n console.log('-- DONE: createPlaylist');\n\n // remove <html> for playlists and refetch playlists.\n $('#playlists > ul').empty();\n showMyPlaylists();\n }\n else {\n alert('Error while creating playlist');\n }\n });\n}", "function updatePlaylist(playlist, artistName, songTitle){\n \n playlist[artistName] = \"songTitle\";\n \n}", "addSong(){\n const url = urlInput.value\n const id = url.substr(url.indexOf(\"=\") + 1)\n const title = titleInput.value\n \n var validate = validation()\n if(!validate.isValidInput(playList, id, url, title)){\n return validate.render()\n }\n \n const song = {\n id: id,\n title: title\n }\n \n selectedVideo = id \n playList.push(song)\n this.render()\n }", "function addTrack(ID) {\n var query = \" SELECT concat('file://','/', u.rpath)\";\n query += \" FROM tracks t, urls u\";\n query += \" where t.id=\"+ID;\n query += \" and t.url=u.id\";\n var result = sql(query);\n Amarok.Playlist.addMedia(new QUrl(result[0]));\n}", "handleAdd(image,name,title,link){\n this.props.addTrackToPlaylist(spotifyApi,[link],this.props.playlist.id);\n // Assigning the track to a variable so it can be shown\n let newObj = {};\n let songObj = {};\n newObj = Object.assign({},newObj,{\n image:image,\n name:name,\n title:title,\n uri:link,\n })\n newItems.push(newObj);\n songs = newItems;\n songObj = Object.assign({},songObj,{\n items:newItems\n })\n songs = songObj\n }", "function add_to_playlist(genre, link) {\n\tif (genre.length > 0 && link.length > 0) {\n\t\tif (link.startsWith('https://www.youtube.com')) {\n\t\t\tplaylist_dict[genre] = link;\n\t\t\t// Update text file to reflect addition\n\t\t\tvar fs = require(\"fs\");\n\t\t\tfs.appendFile(\"./playlist.txt\", genre + \";\" + link + \";\\r\\n\", function (err) {\n\t\t\tif (err) throw err;\n\t\t\t});\n\t\t\treturn true;\n\t\t}\n\t} \n return false;\n}", "add(name, songs = []){\n this.repository.create(name, songs);\n }", "function addTracksPlaylist(playlistId, tracks, accessToken) {\n // curl -i -X POST \"https://api.spotify.com/v1/playlists/7oi0w0SLbJ4YyjrOxhZbUv/tracks?uris=spotify%3Atrack%3A4iV5W9uYEdYUVa79Axb7Rh,spotify%3Atrack%3A1301WleyT98MSxVHPZCA6M\" -H \"Authorization: Bearer {your access token}\" -H \"Accept: application/json\"\n const uris = tracks.map(t => t.uri).join(',');\n\n return axios({\n method: 'post',\n baseURL: 'https://api.spotify.com/v1',\n url: `/playlists/${playlistId}/tracks`,\n headers: {\n Authorization: 'Bearer ' + accessToken\n },\n params: {\n uris\n }\n });\n}", "static addPlaylist(playlist) {\n return fetch('http://localhost:8888/insertplaylist/', {\n method: 'PUT',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(playlist)\n })\n }", "savePlaylist() {\n const playlistUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, playlistUris).then(response => {\n if (response) {\n this.setState({ playlistName: \"New Playlist\",\n playlistTracks : [] });\n }});\n }", "function setPlaylist(p) {\n\tplaylist = p;\n}", "function setPlaylist(p) {\n\tplaylist = p;\n}", "savePlaylist() {\n\t\tlet trackURIs = [];\n\t\tfor(let i = 0; i < this.state.playlistTracks.length; i++) {\n\t\t\ttrackURIs.push(this.state.playlistTracks[i].uri);\n\t\t}\n\t\tSpotify.savePlaylist(this.state.playlistName, trackURIs);\n\t\tthis.setState({playlistName: 'New Playlist', playlistTracks: []});\n\t}", "function addToPlaylist(songsList){\n for(var i=0; i<songsList.length; i++){\n // Getting metadata for the audio file\n id3({ file: songsList[i].toString(), type: id3.OPEN_LOCAL }, function(err, tags) {\n if(tags){\n tableRow = document.createElement(\"tr\")\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.title)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.album)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n rowElement = document.createElement(\"td\")\n textElement = document.createTextNode(tags.artist)\n rowElement.appendChild(textElement)\n tableRow.appendChild(rowElement)\n tableRow.setAttribute(\"id\", i)\n document.getElementById('playlist-body').appendChild(tableRow)\n }\n });\n }\n}", "function createPlaylist() {\n\t\t// create request\n\t\tvar request = {};\n\t\trequest[\"artistPool\"] = artistPool;\n\t\t\n\t\tvar requestBuilder = new SpotifyRequestBuilder();\n\t\trequestBuilder.postRequest(common.generatePlaylistURL, onCreatePlaylist, JSON.stringify(request));\n\t}", "onAddToPlaylist(index) {\n const { addToPlaylist, addClipToPlaylist, clip } = this.props;\n\n // Add the clip to playlist.list\n addToPlaylist(clip.list[index]);\n\n // Set in the clip that is part of the playlist\n addClipToPlaylist(clip.list[index].id);\n }", "function addToPlaylist(userId, playlistId, uris) {\n return axios({\n method: \"post\",\n url: `https://api.spotify.com/v1/users/${userId}/playlists/${playlistId}/tracks`,\n data: { uris }\n });\n}", "function playlistAdd(songName) {\r\n if (songButtons[songName] != undefined) {\r\n return false;\r\n }\r\n \r\n var songButton = document.createElement(\"button\");\r\n var songButtonText = document.createElement(\"span\");\r\n\r\n songButtonText.appendChild(document.createTextNode(songName));\r\n songButtonText.classList.add(\"songText\");\r\n\r\n songButton.appendChild(songButtonText);\r\n songButton.classList.add(\"btn\", \"btn-lg\", \"song\");\r\n songButton.setAttribute(\"type\", \"button\");\r\n songButton.addEventListener(\"click\", function() {\r\n streamSong(songName);\r\n });\r\n\r\n songPlaylist.appendChild(songButton);\r\n songButtons[songName] = {\r\n button: songButton,\r\n index: songs.length\r\n }\r\n\r\n return true;\r\n }", "async addSongToPlaylists(playlistId, songId) {\n const query = {\n text: 'INSERT INTO playlistssongs (playlist_id, song_id) VALUES($1, $2) RETURNING id',\n values: [playlistId, songId],\n }\n \n const result = await this._pool.query(query)\n if (!result.rows.length) {\n throw new InvariantError('Lagu gagal ditambahkan ke playlist')\n }\n }", "function addAlbum(albumID) {\n var query = \" SELECT concat('file://','/', u.rpath)\";\n query += \" FROM tracks t, urls u\";\n query += \" where t.album=\"+albumID;\n query += \" and t.url=u.id\";\n query += \" order by t.discnumber, t.tracknumber\";\n var result = sql(query);\n for (var i=0; i < result.length; i++) {\n Amarok.Playlist.addMedia(new QUrl(result[i]));\n }\n}", "function handlePlaylistSongAdded(songIndex){\n // first Song added\n if(songIndex==0){\n\td3.select(\"#playlistPlayButton\")\n\t .attr(\"disabled\",null);\n\tvar song = playlist.getSong(songIndex);\n\tvar releaseIndex = song.releaseIndex;\n\tvar release = playlist.getRelease(releaseIndex);\n\tvar videoId = release.videoId;\n\ttry{\n\t player.cueVideoById(videoId);\n\t}catch(error){\n\t console.log(error);\n\t playlist.list=[];\n\t}\n }\n displayPlaylist();\n}", "function createPlaylist() {\n var name = prompt(\"What do you want to call your playlist?\");\n if ((name == null) || (name == \"\")) {\n name = \"default\";\n };\n\n var playlist = {\"name\": name, \"songs\":[]};\n user_playlists.push(playlist);\n showLocalPlaylists();\n}", "function addNewMusic(){\n\tlet title = document.getElementById(\"inputSong\").value;\n\tlet artist = document.getElementById(\"inputArtist\").value;\n\tlet album = document.getElementById(\"inputAlbum\").value;\n\tlet songObj = {\"title\": title, \"artist\": artist, \"album\": album};\n\t// console.log(\"songObj\", songObj);\n\tLoader.addToLibrary(songObj);\n\tLoader.showSongs(callBack);\n\n\tclearTextInputs();\n}", "function addNewMusic(responseText, songData) {\n let newSongData = responseText;\n // console.log(\"TESTING\", musicProgram.testVar);\n newSongData.forEach(function(object){\n songData.unshift(object);\n songPrint(songData);\n });\n }", "function addTrackPlaylist(_this,objectId){\r\n\t//chiama il controller per aggiungere la song alla playlist\r\n\tvar json_playlist = {};\r\n\t\r\n\ttypeOpt = $(_this).text();\r\n\tswitch(typeOpt){\r\n\t\tcase ' add to playlist':\r\n\t\t\tjson_playlist.request = \"addSong\";\r\n\t\t\tbreak;\r\n\t\tcase ' remove':\r\n\t\t\tjson_playlist.request = \"removeSong\";\r\n\t\t\tbreak;\r\n\t}\r\n\tjson_playlist.songId = objectId;\r\n\t$.ajax({\r\n data: json_playlist,\r\n type: \"POST\",\r\n url: \"../controllers/request/playlistRequest.php\"\r\n })\r\n .done(function(response, status, xhr) {\r\n if (typeOpt === ' add to playlist') {\r\n\t\t\tloadBoxPlayList();\r\n\t\t\t$(_this).text(' remove');\r\n } else {\r\n\t\t\tplaylist = myPlaylist.playlist;\r\n\t\t\tjQuery.each(playlist, function (index, obj){\r\n\t if (obj.objectId == objectId){\r\n\t myPlaylist.remove(index);\r\n\t\r\n\t } // if condition end\r\n\t $(_this).text(' add to playlist');\r\n\t });\r\n\t\t\t\r\n\t\t\t\r\n }\r\n code = xhr.status;\r\n message = $.parseJSON(xhr.responseText).status;\r\n console.log(\"Code: \" + code + \" | Message: \" + message);\r\n })\r\n .fail(function(xhr) {\r\n message = $.parseJSON(xhr.responseText).status;\r\n code = xhr.status;\r\n console.log(\"Code: \" + code + \" | Message: \" + message);\r\n });\r\n\t\r\n\t\r\n\t//controllare il risultato dal controller\r\n\t\r\n\t//aggiungere alla playlist\r\n\t\r\n}", "addTracks() {\n let { playlistId, tracks } = this.state;\n spotifyApi.addTracksToPlaylist(playlistId, tracks);\n }", "function updatePlaylist(){\n\tvar songs = JSON.parse(sessionStorage.getItem(\"songs\"));\n\t$(renderPlaylist(songs));\n}", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(track => track.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris).then(() => {\n this.setState({ \n playlistName: 'New playlist',\n playlistTracks: []\n })\n })\n }", "function playFirstSong() {\n setTrack(tempPlaylist[0], tempPlaylist, true);\n}", "function searchAndAdd(title, playlistToAdd) {\n spotifyApi.searchTracks(title)\n .then(function (data) {\n var firstTrack = data.body.tracks.items[0].id;\n addToPlaylist(firstTrack, playlistToAdd);\n console.log('Searched for track', data.body);\n }, function (err) {\n console.log('Something went wrong!', err);\n });\n}", "function makePlaylist(playlistName, song, songID) {\r\n var path = __dirname + '\\\\Music\\\\' + Folder + '\\\\';\r\n song = cleaner.cleanString(song);\r\n return new Promise(resolve => {\r\n setTimeout(() => {\r\n fs.exists(path + playlistName + '.m3u', (exist) => {\r\n if (exist) {\r\n fs.exists(path + song + '.mp3', async (exist) => {\r\n if (!exist) {\r\n var status = await download(song, songID);\r\n mp3Duration(path + song + '.mp3', function (err, duration) {\r\n if (err) return console.log(err.message);\r\n fs.appendFile(path + playlistName + '.m3u', '#EXTINF:' + duration + ',' + song + '\\r\\n' + song + '.mp3\\r\\n', (err) => {\r\n if (err) throw err;\r\n resolve({ Message: 'Added ' + song + ' to ' + playlistName, Status: status });\r\n });\r\n });\r\n }\r\n else {\r\n resolve({ Message: 'Song already exist: ' + song, Status: 'Not downloaded again' });\r\n }\r\n })\r\n }\r\n });\r\n }, 2);\r\n });\r\n}", "addTrack(track) {\n let tracks = this.state.playlistTracks;\n if (tracks.find((currentTrack) => currentTrack.id === track.id)) {\n return;\n }\n tracks.push(track);\n this.setState({ playlistTracks: tracks });\n }", "addTrack(track) {\n\t\tconst addingTrack = (track) => this.setState({playlistTracks: [...this.state.playlistTracks, track]});\n\t\taddingTrack(track);\n\t\tthis.removeTrack(track, false);\n\t}", "function createPlaylist(callback){\n\t\tvar url = 'https://api.spotify.com/v1/users/' + spotifyUserId + '/playlists';\n\t\t$.ajax(url, {\n\t\t\tmethod: 'POST',\n\t\t\tdata: JSON.stringify({\n\t\t\t\t'name': 'Metly: A ' + desiredMood + \" Journey to \" + toStation,\n\t\t\t\t'public': false\n\t\t\t}),\n\t\t\tdataType: 'json',\n\t\t\theaders: {\n\t\t\t\t'Authorization': 'Bearer ' + AUTHORIZATION_CODE,\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tcallback(data, openPlaylist);\n\t\t\t},\n\t\t\terror: function(data) {\n\t\t\t\tcallback(null);\n\t\t\t}\n\t\t});\n}", "addTrack(track) {\n/* if (!this.state.playlistTracks.includes(track)) { // Step 41\n this.setState({playlistTracks: this.state.playlistTracks.splice(this.state.playlistTracks.count,0,track.id)}); //add a track at the end of the playlist\n*/\n if (this.state.playlistTracks.indexOf(track) === -1) {\n const newPlayList = this.state.playlistTracks;\n newPlayList.push(track);\n this.setState({playListTracks: newPlayList})\n // this.setState({playlistTracks: this.state.playlistTracks.push(track)});\n }\n }", "addTrack(track) {\n let playlistTracks = this.state.playlistTracks;\n if (playlistTracks.find(savedTrack => savedTrack.id === track.id)) {\n return;\n }\n playlistTracks.unshift(track);\n this.setState({ playlistTracks: playlistTracks });\n }", "function addTracksSC( url, playnow ){\n\t//var hardUrl = '/deep-house-amsterdam/jay-west-deep-house-amsterdam';\n\t//scplayer.add_tracks(hardUrl);\n\tvar found_at_index = scplayer.add_tracks(url);\n\t\n\tif ( found_at_index == 'current_track'){\n\t\t//alert(\"it's the current track!\");\n\t}\n\t\n\tif ( found_at_index != 'current_track'){\n\n\t\tvar $pl = $(\"#playlist\");\t\t\n\t\t\n\t\tif ( found_at_index > 0 ){\n\t\t\t$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')' ).remove();\n\t\t}\n\t\t//if ( found_at_index == 0 ) {\n\t\t\t//var x=0;\n\t\t\tvar playlist = scplayer.playlist();\n\t\t\tvar l= playlist.length;\n\t\t\tl = l-1;\n\n\t\t\tvar $li = jQuery(\"<li/>\", {\"html\": \"<span>loading..</span>\"}).data('index', l).appendTo($pl);\n\n\t\t\t//lookup the track info\n\t\t\tscplayer.track_info(l).done(function(track){\n\t\t\t\t//console.log(track);\n\t\t\t\t$li.html('<span><div class=\"playlist-track-wrapper\"><img class=\\\"playlist_artwork\\\" src=\\\"' + track.artwork_url + '\\\"/>' + track.title + '</span><a href=\"' + track.permalink_url + '\" target=\"_blank\" class=\"soundcloud-logo-small\">View on Soundcloud</a></div>');\n\t\t\t\t//scplayer.goto(jQuery(this).data('index', l) ).play();\n\t\t\t\t//scplayer.goto(jQuery(this).data('index', l)).play();\n\t\t\t});\n\t\t//}\n\n\t\t//else {\n\t\t\t/* Remove n-th li (where the track was found, since we append to the end )*/\n\t\t\t//$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')').clone().appendTo($pl);\n\t\t\t//$pl.find( 'li:nth-child(' + ( found_at_index + 1 ) + ')' ).remove();\n\t\t//}\n\n\t\tif ( playnow == true ){\n\t\t\t$(\"#playlist li:last\").find('span').click();\n\t\t\t//alert('clicked');\n\t\t\t//var track = scplayer.current_track;\n\t\t\t//$(\"#now_playing\").html(track.title);\n\t\t}\t\n\t}\n}", "function addSongs (songs) {\n\n function addSong (songTitle) {\n var songModel = new Song.Model({ title: songTitle })\n App.library.add(songModel)\n }\n\n if(typeof songs === 'object') {\n Object.keys(songs).forEach(function (key) { addSong(key) })\n return\n } else if(typeof songs === 'string') {\n addSong(songs)\n } else {\n throw new Error('song must be of type object or string')\n }\n }", "async function addToNext(uri){\n \tconst newTrack = {\n \turi: uri[0],\n \tprovider: \"queue\",\n metadata: {\n is_queued: true, \n }\n }\n const currentQueue = Spicetify.Queue?.next_tracks\n currentQueue.unshift(newTrack)\n await Spicetify.CosmosAsync.put(\"sp://player/v2/main/queue\", {\n revision: Spicetify.Queue?.revision,\n next_tracks: currentQueue,\n prev_tracks: Spicetify.Queue?.prev_tracks\n }).catch( (err) => {\n \tconsole.error(\"Failed to add to queue\",err);\n \t Spicetify.showNotification(\"Unable to Add\");\n \t})\n \tSpicetify.showNotification(\"Added to Play Next\");\n }", "addTrack(track) {\n const alreadyInPlaylist = this.state.playlistTracks.some((el) => {\n return el.id === track.id;\n });\n if (!alreadyInPlaylist) {\n const newPlaylist = this.state.playlistTracks.concat(track);\n this.setState({ playlistTracks : newPlaylist });\n }\n }", "function playlist(id, fname, lname, status)\n\t\t\t\t\t{\n\t\t\t\t\t\tthis.id = id;\n\t\t\t\t\t\tthis.first_name=fname;\n\t\t\t\t\t\tthis.last_name=lname;\n\t\t\t\t\t\tthis.status = status;\n\t\t\t\t\t}", "handleNewSong(event) {\n console.log('New song: ');\n console.log(event)\n\n const added = this.state.playlist.slice();\n added.push(event);\n\n this.setState({ playlist: added });\n }", "function uploadFile(player) {\n var files;\n var uploadedFiles = $(\"#audio_file_player\" + player).prop('files');\n\n var playlistItems = [];\n for (var i = 0; i < uploadedFiles.length; i++) {\n player_playlist[player].add({\n title: (uploadedFiles[i].name.length > 50 ? (uploadedFiles[i].name.substring(0, 50) + \"...\") : uploadedFiles[i].name),\n name: uploadedFiles[i].name,\n mp3: URL.createObjectURL(uploadedFiles[i]),\n id: \"-1\"\n });\n }\n}", "function nextSong() {\n checkPlayPause();\n if (playlist_index == (playlist.length - 1)) {\n playlist_index = 0;\n playAudio();\n }\n else {\n playlist_index++;\n playAudio();\n }\n}", "playUrl (url, options) {\n\n let that = this;\n\n log.info (\"%s - Try to play url - %s\", that._name, url);\n\n if (that._playlist)\n delete that._playlist;\n that._playlist = new Playlist(that._name, that);\n\n return that._playlist.addUrlPromise(url, options)\n .catch (function(err) {\n log.error(\"%s - Error playing playlist - %s\", that._name, err.stack);\n return Promise.reject(err);\n });\n }", "function addNewArtist() {\n var $artist = $(\"#newArtist\");\n var $song = $(\"#newSong\");\n var $album = $(\"#newAlbum\");\n var newObj = { \"Song\": $song.val(), \"Artist\": $artist.val(), \"Album\": $album.val()};\n\n musicProgram.songData.unshift(newObj);\n musicProgram.songPrint(musicProgram.songData);\n addDeleteButtons();\n}", "function show_playlist(playlist) {\n\t\tvar list = '';\n\t\tplaylist.forEach(function(song) {\n\t\t\tlist += '<li>' + song.songname + '</li>';\n\t\t});\n\t\t$('#songlist').append(list);\n\t}", "function play_track_from_playlist()\n{\n\tvar selected_track_index = $('#radio_song_list').attr(\"selectedIndex\");\n\t\n\t// play the selected track from playlist...\n\tradio_playlist.play(selected_track_index);\n}", "AddToQueue(song, msg) {\n if(this.queue.length < 1) {\n this.queue.push(song);\n this.Play(msg);\n }\n else {\n msg.channel.send(\"`\" + song.name + \"` **added to queue.**\");\n this.queue.push(song);\n }\n }", "function Playlist(name) {\n this.name = name;\n this.tracks = [];\n}", "addTrack(track){\n // set variables\n let trackMatch = false;\n let tempPlaylist = this.state.playlistTracks;\n\n // loop through the playlist and test in the track\n // being added is already in the playlist\n for(let i=0; i < tempPlaylist.length; i++){\n if(track.id === tempPlaylist[i].id){\n trackMatch = true;\n }\n }\n\n // add the track if it isn't already in the PlayList\n if(!trackMatch){\n tempPlaylist.push(track);\n // update the state with the tempPlaylist\n this.setState({ playlistTracks:tempPlaylist });\n }\n }", "function add_to_playlist(kodi,paths,pid,callback){\n\n\t// If no PID was given, figure it out by asking kodi client and then\n\t// Recall the same function with the PID provided\n\tif(pid == null){\n\n\t\tget_playlistid(kodi,function(pid){\n\t\t\tadd_to_playlist(kodi,paths,pid,callback);\n\t\t});\n\t} else {\n\t\t// End of Recursion. No more items to add to playlist\n\t\tif(paths.length == 0){\n\t\t\t// Return\n\t\t\tcallback();\n\t\t\treturn;\n\t\t}\n\n\t\t// Remove the first item from the array\n\t\tvar item = paths.shift();\n\t\t//Msg\n\t\tvar msg = {\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid: 1,\n\t\t\tmethod: \"Playlist.Add\",\n\t\t\tparams: {\n\t\t\t\tplaylistid:pid,\n\t\t\t\titem: {file:item}\n\t\t\t}\n\t\t}\n\t\t// Call the same function again with the reduced arr\n\t\tkodi_request(msg,function(resp){\n\t\t\tadd_to_playlist(kodi,paths,pid,callback);\n\t\t});\n\n\n\t}\n}", "function appendToSongDisplay(song, index) {\n /*\n Grabs the playlist element we will be appending to.\n */\n var playlistElement = document.querySelector('.white-player-playlist');\n\n /*\n Creates the playlist song element\n */\n var playlistSong = document.createElement('div');\n playlistSong.setAttribute('class', 'white-player-playlist-song amplitude-song-container amplitude-play-pause');\n playlistSong.setAttribute('data-amplitude-song-index', index);\n\n /*\n Creates the playlist song image element\n */\n var playlistSongImg = document.createElement('img');\n playlistSongImg.setAttribute('src', song.cover_art_url);\n\n /*\n Creates the playlist song meta element\n */\n var playlistSongMeta = document.createElement('div');\n playlistSongMeta.setAttribute('class', 'playlist-song-meta');\n\n /*\n Creates the playlist song name element\n */\n var playlistSongName = document.createElement('span');\n playlistSongName.setAttribute('class', 'playlist-song-name');\n playlistSongName.innerHTML = song.name;\n\n /*\n Creates the playlist song artist album element\n */\n var playlistSongArtistAlbum = document.createElement('span');\n playlistSongArtistAlbum.setAttribute('class', 'playlist-song-artist');\n playlistSongArtistAlbum.innerHTML = song.artist + ' &bull; ' + song.album;\n\n /*\n Appends the name and artist album to the playlist song meta.\n */\n playlistSongMeta.appendChild(playlistSongName);\n playlistSongMeta.appendChild(playlistSongArtistAlbum);\n\n /*\n Appends the song image and meta to the song element\n */\n playlistSong.appendChild(playlistSongImg);\n playlistSong.appendChild(playlistSongMeta);\n\n /*\n Appends the song element to the playlist\n */\n playlistElement.appendChild(playlistSong);\n}", "function addSong(req, res) {\n \n //Variables\n let result = {};\n \n try {\n //Define the song list for the session\n if (req.session.songs == undefined) {\n req.session.songs = [];\n }\n\n //Fail: No Song Provided\n if (req.query.song == undefined) {\n result = {result: \"Please provide a song to add to the list.\"};\n }\n \n //Fail: Song Already Present\n else if (req.session.songs.includes(req.query.song)) {\n result = {result: \"You've already favorited this song.\"};\n }\n\n //Success: Song addition process begins\n else {\n req.session.songs.push(req.query.song);\n result = {songs: req.session.songs};\n }\n }\n catch (e) {\n result = {'error' : e.message};\n }\n\n //Respond with the data\n res.writeHead(200, {'Content-Type': 'application/json'});\n res.write(JSON.stringify(result));\n res.end('');\n}", "function addSongToPlaylist() {\n let listEle = document.getElementById('newplaylistName');\n if (listEle.value.length == 0 || listEle.value == \"\") {\n listEle.focus();\n alert('Enter valid playlist name');\n }\n else {\n let songData = {\n name: document.getElementById('newplaylistName').value,\n song: [\n {\n songName: document.getElementById('songtitle').value,\n songurl: document.getElementById('songurl').value\n }\n ]\n }\n\n if (playlistsArr.length === 0) {\n playlistsArr.push(songData);\n addPlaylistsName();\n }\n else {\n let i = 0;\n for (i = 0; i < playlistsArr.length; i++) {\n\n if (playlistsArr[i].name == songData.name) {\n addSongToExistingPlaylist(songData.song[0].songName, songData.song[0].songurl, songData.name);\n break;\n }\n\n }\n if (i == playlistsArr.length) {\n playlistsArr.push(songData);\n addPlaylistsName();\n }\n }\n }\n reloadPlaylists();\n}", "async function syncPlaylist (playlist, tracks) {\n try {\n const results = { added: 0, removed: 0 }\n // Exit early on empty tracks.\n if (!tracks.length) return results\n const spotify = createSpotify()\n const uid = playlist.user\n const name = playlist.name\n\n // Search for user playlist.\n const result = await searchUserPlaylists(uid, name)\n\n // Store playlist ID if available.\n let pid = result[0] ? result[0].id : null\n\n if (!pid) {\n // Create user playlist if it doesn't exist.\n pid = await spotify.createPlaylist(uid, name)\n .then(response => response.body.id)\n .catch(e => console.log(e))\n }\n\n // Exit early if playlist couldn't be created.\n if (!pid) return\n\n // Get all track IDs from user playlist.\n const playlistTracks = await getAllUserPlaylistTracks(uid, pid)\n .then(response => response.map(item => item.track.id))\n .catch(e => console.log(e))\n\n if (playlistTracks) {\n // Build remove array to store tracks in playlist that are not included\n // within tracks argument.\n const remove = playlistTracks.reduce((items, item) => {\n const index = tracks.indexOf(item)\n if (index < 0) {\n results.removed = results.removed + 1\n tracks.splice(index, 1)\n items.push({ uri: `spotify:track:${item}` })\n }\n return items\n }, [])\n\n if (remove) {\n // Remove tracks from playlist.\n await removeAllTracksFromPlaylist(uid, pid, remove)\n .catch(e => console.log(e))\n }\n }\n\n if (tracks.length) {\n // Build tracks to add that are not present in playlist, so duplicated\n // tracks aren't added.\n const add = tracks.reduce((items, item) => {\n const index = playlistTracks.indexOf(item)\n if (index < 0) {\n results.added = results.added + 1\n items.push(`spotify:track:${item}`)\n }\n return items\n }, [])\n\n if (add.length) {\n // Add tracks to playlist.\n await addAllTracksToPlaylist(uid, pid, add)\n .catch(e => console.log(e))\n }\n }\n\n return results\n } catch (e) {\n throw e\n }\n}", "function mashlistCreatePlaylist($_mashlist) {\n models.Playlist.create($_mashlist.find('h3').text()).done(function (playlist) {\n playlist.load(['tracks']).done(function (_playlist) {\n models.Playlist.fromURI($_mashlist.attr('data-uri')).load(['tracks']).done(function (templist) {\n templist.tracks.snapshot(0, 1000).done(function(snapshot) {\n _playlist.tracks.add(snapshot.toArray());\n });\n });\n });\n });\n }", "pushTrack() {\n console.log('pushing a song to the local DB')\n }", "function addToPlaying(){\n Chord.audio.playing.push(this);\n }", "async createPlaylist(playlistId) {\n if (!this._auth()) return;\n let playlist = ss.Playlist.findById(playlistId);\n if (!playlist.youtubeId) {\n try {\n let response = await this._createPlaylist(playlist);\n console.info('Successfully created YouTube playlist ' + playlist.name);\n playlist.youtubeId = response.data.id;\n playlist.update();\n } catch (err) {\n this.addAlert('Unable to create YouTube playlist ' + playlist.name);\n console.error(err);\n if (err.message == 'invalid_grant') {\n this.service = undefined;\n const settings = new ss.SoulSifterSettings();\n settings.putString('google.oauthRefreshToken', '');\n settings.save();\n }\n return;\n }\n }\n try {\n await this._updatePlaylistEntries(playlist);\n // if (!!playlist.query) {\n // let songs = ss.SearchUtil.searchSongs(playlist.query,\n // /* bpm */ 0,\n // /* key */ '',\n // playlist.styles,\n // /* songsToOmit */ [],\n // /* limit */ 200,\n // /* energy */ 0,\n // /* musicVideoMode */ false,\n // /* orderBy */ 0,\n // /* errorCallack */ (msg) => { this.addAlert(msg, 5); });\n // for (let i = 0; i < songs.length; ++i) {\n // await this._addSongToPlaylist(songs[i], playlist);\n // await this.sleep();\n // }\n // }\n } catch (err) {\n this.addAlert('Unable to add song to YouTube playlist ' + playlist.name);\n console.error(err);\n return;\n }\n }", "savePlaylist() {\n const trackUris = this.state.playlistTracks.map(playlistTrack => playlistTrack.uri);\n Spotify.savePlaylist(this.state.playlistName, trackUris);\n // Once the playlist is save set the state back to empty\n this.setState({\n playlistName: \"Dan's Playlist\",\n searchResults: [],\n playlistTracks: []\n });\n }", "addTrack(track) {\n let tracks = this.state.playlistTracks;\n // Don't let users add a song more than once.\n if (!tracks.includes(track)) {\n tracks.push(track);\n this.setState({playlistTracks: tracks});\n } else {\n console.log('Duplicate. Track not added.');\n }\n }", "function advanceToNextSong () {\n // Remove current song from the playlist\n self.playlist.pop();\n\n // Pick next song and play it\n if (self.playlist.size()) {\n var song = self.playlist.front();\n updateCurrentSong(song);\n }\n }", "function loadResults(songMetaData) {\n playlist.unshift(songMetaData);\n // console.log(playlist);\n saveFile();\n}", "function queueSong(text) {\n // submit form to add new song to the playlist\n $(\"#uri\").val(text);\n $(\"#uri\").click();\n}", "addTrack(track) {\n let tracks = this.state.playlistTracks;\n if(tracks.find( savedTrack => \n savedTrack.id === track.id)) {\n return;\n } \n\n tracks.push(track);\n this.setState({ playlistTracks: tracks });\n }", "createNewPlaylist (name, json, key = false) {\n // Create new playlist reference with id.\n let nameRef\n if (key) {\n this.playlistsRefs.child(key).set({'name': name, name_lower: name.toLowerCase()})\n nameRef = key\n } else {\n nameRef = this.playlistsRefs.push({'name': name, name_lower: name.toLowerCase()}).ref.key\n }\n // Using ID + name push new song.\n this.playlists.child(nameRef).set({'name': name, name_lower: name.toLowerCase()})\n\n this.playlistSongAdd(nameRef, json)\n }", "function addToQueue(msg, song) {\n\tif (!queues[msg.guild.id]) {\n\t\tqueues[msg.guild.id] = {\"songs\": [], \"queuemessageid\": null};\n\t}\n\n\tqueues[msg.guild.id].songs.push(song);\n\n\tmsg.channel.sendMessage(getQueueMessage(msg))\n\t\t.catch(e => {\n\t\t\tconsole.log(e);\n\t\t});\n\n\tif (queues[msg.guild.id].songs.length == 1) {\n\t\tplayNextInQueue(msg);\n\t}\n}", "add(media) {\n if (media === null) {\n return;\n }\n this.element.classList.add(\"loading\");\n if (this.list.has(createHash(media))) {\n this.element.classList.remove(\"loading\");\n return Promise.resolve();\n }\n if (media.type.match(\"audio\") != \"audio\" &&\n media.type.match(\"video\") != \"video\") {\n this.element.classList.remove(\"loading\");\n return Promise.resolve();\n }\n let adding = new PlaylistItem({\n type: media.type.match(\"audio\") == \"audio\" ? \"audio\" : \"video\",\n media,\n playlist: this\n });\n return adding.then((item) => {\n this.list.set(item.hash, item);\n if (!this.selectedItem) {\n this.onItemSelected(item.hash);\n }\n this.element.classList.remove(\"loading\");\n return item;\n });\n }", "function addPlaylistToQueue(playlist, channel) {\n\t\tplaylist = JSON.parse(JSON.stringify(playlist));\n\t\tplaylist.carsts.forEach(function(carst) {\n\t\t\tcarst.channel = channel;\n\t\t\taddCarstToQueue(carst);\n\t\t});\n\t}", "function syncSong (db, song, oldItems, libraryId, artistId, albumId) {\n\n\tlet id = oldItems.songs[song.path];\n\n\tif (id) {\n\n\t\tdelete oldItems.songs[song.path];\n\t\treturn Promise.resolve(id);\n\n\t} else {\n\n\t\tlet query = `INSERT INTO songs\n\t\t\t(name, number, artist, album, path, library)\n\t\t\tVALUES (?, ?, ?, ?, ?, ?)`;\n\t\tlet params = [song.name, song.number, artistId, albumId, song.path,\n\t\t\tlibraryId];\n\n\t\treturn db.insert(query, params);\n\n\t}\n\n}", "playSong(){\n spotifyApi.play({});\n }", "function showPlaylist(name, url) {\n $('#loggedin').hide();\n $('#songlist').show();\n $('#playlist_title').append('<h3>' + name + '</h3>');\n apiHelper(url, function(items) {\n items.forEach(function(i) {\n $('#playlist_title').append('<li id=' + i + '> <a href=\"#\">' + i.track.name + '</a> </li>');\n $('#playlist_title').append(generateStars());\n })\n })\n }", "function updatePlaylist(playlist, artistName, songTitle){\n return Object.assign( playlist, {[artistName]: songTitle});\n}", "function addQueryPlaylist(url, quality, from, to, split){\n\treturn addQuery(url, TYPE_YTPL, quality, from, to, split);\n}", "addTrack(track)\n {if (this.state.playlistTracks.find(savedTrack =>\n savedTrack.id === track.id)) {return;}\n else { this.state.playlistTracks.push(track) };\n let playlistTracks = this.state.playlistTracks;\n this.setState({playlistTracks:playlistTracks});\n}", "function addSongs(music) {\n musicProgram.addMoreSongsButton()\n .then(function(json) {\n console.log(\"ADD MORE SONGS\");\n musicProgram.addNewMusic(json, musicProgram.songData);\n $moreButton.prop('disabled', true);\n\n addDeleteButtons();\n\n });\n}", "function uploadSong() {\r\n var xhttp = new XMLHttpRequest();\r\n var songFile = upload.files[0];\r\n var formData = new FormData();\r\n\r\n // Clear file from input so reuploading same file triggers change event\r\n upload.value = null;\r\n \r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4) {\r\n log(this.response);\r\n let res = JSON.parse(this.response);\r\n if (res[\"err\"]) {\r\n popup(\"fade-in\", \"fade-out\", 1000, 2000, `Upload failed: ${res[\"err\"]}`);\r\n } else {\r\n let songName = res[\"song\"];\r\n if (playlistAdd(songName) === true) {\r\n songs.push(songName);\r\n popup(\"fade-in\", \"fade-out\", 1000, 3000, `${songName} UPLOADED`);\r\n } else {\r\n popup(\"fade-in\", \"fade-out\", 1000, 2000, `${songName} REPLACED`); \r\n }\r\n }\r\n }\r\n };\r\n \r\n formData.append(\"songFile\", songFile);\r\n xhttp.open(\"POST\", \"upload\", true);\r\n xhttp.send(formData);\r\n }", "function play(guild, connection, song, message, songInfo) {\n\tconst serverQueue = queue.get(guild.id);\n\n\tif (!song) {\n\t\tserverQueue.voiceChannel.leave();\n\t\tqueue.delete(guild.id);\n\t\treturn;\n\t}\n\n\tmessage.channel.send(`${song.title} has been added to the queue!`);\n\tlet stream = ytdl.downloadFromInfo(songInfo, {filter: 'audioonly'});\n\tlet dispatcher = connection.playStream(stream)\n\t\t.on('end', () => {\n\t\t\tmessage.channel.send(`Finished playing: ${song.title}`);\n\t\t\tserverQueue.songs.shift();\n\t\t\tplay(guild, serverQueue.songs[0]);\n\t\t})\n\t\t.on('error', error => {\n\t\t\tconsole.error(error);\n\t\t});\n\tdispatcher.setVolumeLogarithmic(serverQueue.volume / 5);\n}", "function mashlistChangeTrack() {\n var $_mashlist = $('.mashlist[data-playing=\"1\"]');\n models.player.load(['context', 'playing', 'track']).done(function (player) {\n if (player.playing && player.context.uri == $_mashlist.attr('data-uri')) {\n models.Playlist.fromURI(playHistory).load(['tracks']).done(function (history) {\n history.tracks.add(player.track);\n listHistory.refresh();\n $('.sp-list-item').on('dblclick', function (e) {\n e.stopImmediatePropagation();\n });\n });\n }\n });\n }", "function doPlaylist() {\n var size = playlist = findAll('.playlist li');\n itemOnClick = function () {\n currentTrackID = this.getAttribute('data-trackid');\n find('h1').innerHTML = find('strong', this).textContent;\n find('h2').innerHTML = find('span', this).textContent;\n size = getTitleFontSize(find('h2').textContent, find('.controls').getBoundingClientRect().width - 160);\n find('h2').style.fontSize = size + 'px';\n find('.currentTrack img').src = find('img', this).getAttribute('src');\n find('.play-pause').style.top = size / 4 + 'px';\n find('figcaption').innerHTML = find('strong', this).textContent + '<br>' + this.getAttribute('data-album');\n SC.get('/tracks/' + currentTrackID).then(function (track) {\n disablePlay();\n clearInterval(scTimer);\n if (scPlayer) {\n scPlayer.pause();\n }\n find('.loaded').style.width = 0;\n find('.fa-pause').style.display = 'none';\n find('.fa-play').style.display = 'block';\n currentTrackInfo = track;\n find('.duration').innerHTML = toMMSS(currentTrackInfo.duration);\n find('.played').innerHTML = toMMSS(0);\n doPlay(true);\n\n });\n scrollAnimation.setEndValue(0);\n buildUI();\n }\n for (var i = 0, l = playlist.length; i < l; i++) {\n playlist[i].addEventListener('click', itemOnClick);\n }\n }", "savePlaylist() {\n let trackURIs = this.state.playlistTracks.map( track => track.uri);\n //console.log(trackURIs);\n spotify.savePlaylistToSpotify(this.state.playlistName, trackURIs);\n this.setState({\n playlistTracks: [],\n playlistName: 'New Playlist'\n });\n }" ]
[ "0.7873342", "0.7677184", "0.7629552", "0.76132697", "0.7579313", "0.74951136", "0.73436534", "0.73266304", "0.7267012", "0.72642636", "0.72255635", "0.71655977", "0.7118015", "0.7117786", "0.71171945", "0.70826054", "0.70504457", "0.70440406", "0.70247734", "0.70065856", "0.69352067", "0.69224566", "0.69088614", "0.6901123", "0.68947005", "0.6893743", "0.68786097", "0.6788379", "0.6763617", "0.6763617", "0.6758637", "0.67537105", "0.67494553", "0.674855", "0.67351043", "0.672842", "0.67197746", "0.6694322", "0.6688985", "0.66792315", "0.6674894", "0.66203356", "0.66193885", "0.66182977", "0.66160077", "0.66100836", "0.66027087", "0.6595045", "0.6590414", "0.65645003", "0.655916", "0.65546817", "0.65391284", "0.65369266", "0.6520871", "0.650954", "0.6496623", "0.64932394", "0.6491306", "0.6464893", "0.64536446", "0.64467293", "0.6441253", "0.6439817", "0.6437924", "0.64351404", "0.64190954", "0.6418117", "0.6407576", "0.6405201", "0.63940513", "0.6384186", "0.6380827", "0.6355419", "0.6350589", "0.63496965", "0.63459647", "0.63445747", "0.63286996", "0.6314663", "0.6298202", "0.6292889", "0.62917066", "0.6289939", "0.628142", "0.62814", "0.62723064", "0.6265841", "0.6249969", "0.62453866", "0.6235146", "0.6233681", "0.6222003", "0.6196219", "0.6183569", "0.6182805", "0.617777", "0.6176256", "0.6171033", "0.61688656" ]
0.64850163
59
! Remove a song from a playlist
async function removeSong(req, res, next) { try { const { playlistId, songId } = req.params const playlist = await Playlist.findById(playlistId).populate('songs') if (!playlist) { throw new NotFound(`Playlist with id: ${playlistId} does not exist.`) } if (!playlist.public && !playlist.users.includes(req.currentUser._id)) { throw new NotAuthorized() } const song = playlist.songs.findIndex((song) => song.equals(songId)) if (song === -1) { throw new NotFound(`Song with id: ${songId} does not exist.`) } playlist.songs.splice(song, 1) const playlistWithDeletedSong = await playlist.save() res.status(200).json(playlistWithDeletedSong.songs) } catch (err) { next(err) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeFromPlaylist(playlist, artistName)\n{\n delete playlist[artistName]\n}", "function removeFromPlaylist(playlist, artistName){\n delete playlist[artistName];\n}", "function removeFromPlaylist(playlist, artistName) {\n// delete playlist.artist;\n delete playlist[artistName];\n return\n}", "function removeSong() {\n}", "function removeFromPlaylist(playlist, artistName) {\n delete playlist[artistName];\n return playlist\n}", "function removeSong(song) {\n if (!store.getItem('songs')) createStore()\n var songArray = JSON.parse(store.getItem('songs'))\n var index = songArray.indexOf(song)\n songArray.splice(index, 1)\n store.setItem('songs', JSON.stringify(songArray))\n}", "removeSong(selectedSong){\r\n this.userSetlist.pop(selectedSong);\r\n }", "function removeFromPlaylist(playlist, artistName){\n a = {playlist:artistName};\n delete a.playlist;\n return a;\n}", "deleteTrackFromPlaylists(track){\n let playlistsWithTrack = this.playlists.filter((pl)=> pl.tracks.includes(track));\n playlistsWithTrack.forEach((pl)=>pl.tracks.splice(pl.tracks.indexOf(track), 1));\n }", "function deletePlaylist(value) {\n var index;\n for (i = 1; i < user_playlists.length; i++) {\n if(user_playlists[i].name == value) {\n index = i;\n };\n };\n user_playlists.splice(index, 1);\n showLocalPlaylists()\n}", "function remove_from_playlist(genre) {\n playlist_dict.delete(genre);\n}", "removeTrack(track){\nlet playlistTracks = this.state.playlistTracks;\nlet index = playlistTracks.findIndex(track => track.id = playlistTracks.id);\nplaylistTracks.splice(index,1);\nthis.setState({playlistTracks:playlistTracks});\n}", "removeTrack(track){\n // set variables\n let tempPlaylist = this.state.playlistTracks;\n\n // loop through the PlayList until a match is found\n // for the track to be removed and remove it\n for(let i=0; i < tempPlaylist.length; i++){\n if(track.id === tempPlaylist[i].id){\n tempPlaylist.splice(i,1);\n }\n }\n // update the state with the tempPlaylist\n this.setState({ playlistTracks:tempPlaylist });\n }", "handleRemove(key,link){\n // Removing the item from songs object so it can render the correct tracks\n let songObj = {}\n let songsItems = [];\n for(let i=0;i!==songs.items.length;i++){\n if(key!==i){\n let obj = {};\n obj = Object.assign({},obj,{\n image:songs.items[i].image,\n name:songs.items[i].name,\n title:songs.items[i].title,\n uri:songs.items[i].uri\n })\n songsItems.push(obj);\n }\n }\n newItems.splice(key,1);\n songObj=Object.assign({},songObj,{\n items:songsItems\n })\n songs = songObj;\n // For making the remove\n let items = []\n let tracks = {};\n let obj = {};\n obj = Object.assign({},obj,{\n uri:link,\n positions:[key]\n })\n items.push(obj)\n tracks = Object.assign({},tracks,{\n tracks:items\n })\n // Calling remove\n this.props.removeTrackFromPlaylist(spotifyApi,this.props.playlist.id,tracks.tracks);\n }", "function removeResults(songMetaData) {\n playlist.shift(songMetaData);\n // console.log(playlist);\n saveFile();\n}", "removeTrack(track) {\n let tracks = this.state.playlistTracks;\n tracks.splice(tracks.indexOf(track), 1);\n //tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);\n this.setState({ playlistTracks: tracks });\n }", "removeMusic(e){\n let id = e.target.id\n let music = JSON.parse(localStorage.getItem('music'));\n for (let c = 0 ; c < music.result.length ;c++){\n if(music.result[c].name === id){\n music.result.splice(c,1)\n }\n }\n localStorage.setItem('music',JSON.stringify(music))\n window.location.href= '/display/my%20list'\n }", "removeTrack(track) {\n if (this.state.playlistTracks.indexOf(track) > -1) { //step 49\n const newPlayList = this.state.playListTracks;\n newPlayList.splice(newPlayList.indexOf(track),1);\n// newPlayList.filter(this.playlistTracks.indexOf(track));\n// this.setState({playListTracks: his.playlistTracks.splice(this.playListTracks.indexOf(track),1)}) //remove the track from playlist at index of given track\n this.setState({playListTracks: newPlayList});\n }\n }", "onRemove(id) {\n const { removeVideo, removeClipFromPlaylist, playlist } = this.props;\n\n // find the index of the clip to remove by its ID\n const index = playlist.list.map(e => e.id).indexOf(id);\n\n // Check if the next clip in the list is playing\n if (playlist.now === index + 1) {\n removeVideo(id, true);\n } else {\n removeVideo(id, false);\n }\n // Set in the clip.list that the actual clip is not in the playlist\n removeClipFromPlaylist(id);\n }", "removeTrack(track, removePlaylist) {\n\t\tif(removePlaylist) {\n\t\t\tconst ids = this.collectIds(true);\n\t\t\tlet trackIndex = -1;\n\t\t\tfor(let i = 0; i < ids.length; i++) {\n\t\t\t\tif (ids[i] === track.id) {\n\t\t\t\t\ttrackIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (trackIndex !== -1) {\n\t\t\t\tconst newPlaylist = this.state.playlistTracks;\n\t\t\t\tnewPlaylist.splice(trackIndex, 1);\n\t\t\t\tthis.setState({playlistTracks: newPlaylist});\n\t\t\t\tthis.search(this.state.term);\n\t\t\t}\n\t\t} else {\n\t\t\tconst ids = this.collectIds(false);\n\t\t\tlet trackIndex = -1;\n\t\t\tfor(let i = 0; i < ids.length; i++) {\n\t\t\t\tif (ids[i] === track.id) {\n\t\t\t\t\ttrackIndex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (trackIndex !== -1) {\n\t\t\t\tconst newResults = this.state.searchResults;\n\t\t\t\tnewResults.splice(trackIndex, 1);\n\t\t\t\tthis.setState({searchResults: newResults});\n\t\t\t}\n\t\t}\n\t\t\n\t}", "removeTrack(track) {\n let tracks = this.state.playlistTracks;\n tracks = tracks.filter((currentTrack) => currentTrack.id !== track.id);\n this.setState({ playlistTracks: tracks });\n }", "removeTrack(track) {\n let tracks = this.state.playlistTracks;\n tracks = tracks.filter(currentTrack => currentTrack.id !== track.id);\n\n this.setState({ playlistTracks: tracks });\n }", "deleteTrack(artistName, albumName, trackName){\n let artistFromTheTrack = this.getArtistByName(artistName);\n let albumFromTheArtist = this.getAlbumInArtist(artistFromTheTrack, albumName);\n let trackToDelete = this.deleteTrackFromAlbum(albumFromTheArtist, trackName);\n this.deleteTrackFromPlaylists(trackToDelete);\n this.notificationObserver.update(this);\n trackToDelete = null;\n }", "function deleteFromFavorites(value) {\n var index;\n for (i = 0; i < user_playlists[0].songs.length; i++) {\n if(user_playlists[0].songs.href == value) {\n index = i;\n }\n }\n user_playlists[0].songs.splice(index, 1);\n printFavoritesPlaylists(user_playlists[0].songs, 0, 0);\n}", "function deleteSong(artistId, albumId, songId) {\n $.ajax({\n type: \"DELETE\",\n url: \"artists\" + artistId + \"albums\" + albumId + \"songs\" + \".json\",\n contentType: \"application/json\",\n datatype: \"json\"})\n\n .done(function(data) {\n $('#song_\"'+songId+'\"').remove();\n });\n}", "[types.DELETE_SONG](state, payload) {\n let i;\n for (i = 0; i < state.songList.length; i++) {\n if (state.songList[i].vid === payload) {\n // check if this song is the current song\n if (i === state.curSongIdx) {\n state.curSongIdx = -1;\n }\n // remove\n state.songList.splice(i, 1);\n // if i < curSongIdx, the curSongIdx need to be update\n if (i < state.curSongIdx) {\n state.curSongIdx -= 1;\n }\n return;\n }\n }\n }", "function delete_current_playlist(site_url, playlist_id)\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_id=\"+playlist_id,\t\t\n\t\turl: site_url+\"video/remove_user_playlist/\"\n\t}).responseText;\n\t\n\t//alert(result);\n\treturn result;\t\n}", "removeTrack(track) {\n // Remove the track instance from the playlistTracks array by filtering the ID.\n let trackList = this.state.playlistTracks.filter(playlistTrack => {\n return playlistTrack.id !== track.id;\n })\n this.setState({playlistTracks: trackList});\n }", "removeTrack(track) {\n this.setState({\n playlistTracks: this.state.playlistTracks.filter(\n playlistTrack => playlistTrack.id !== track.id)\n });\n }", "deletePlaylist(id) {\n /* Elimina de unqfy la playlist con el id indicado */\n this._validarExistenciaPlaylist(id, \"deletePlaylist\");\n this._playlists = this._playlists.filter((p) => p.id !== id);\n return this._playlists;\n }", "deleteSong(id){\n if(!confirm(\"Are you sure you want to delete the song?\")) return\n playList = playList.filter(song => song.id !== id )\n this.render()\n }", "function deleteSong(req, res){\n req.user.song.pull(req.params.id);\n req.user.save();\n res.redirect('/');\n}", "removeSound({ commit }, { url }) {\n commit({ type: \"removeSound\", url });\n }", "function cleanUpSongs(event) {\n event.preventDefault();\n\n $( \".song\" ).each(function() {\n var songId = $(this).attr('id');\n $(this).remove()\n $.ajax({\n type: \"DELETE\",\n url: \"/artists/\" + artistId() + \"/api/songs/\" + songId + \".json\",\n contentType: \"application/json\",\n dataType: \"json\"\n });\n });\n\n }", "removeTrack(track) {\n const newPlaylist = this.state.playlistTracks.filter((el) => {\n return el.id !== track.id;\n })\n this.setState({ playlistTracks : newPlaylist });\n }", "RemovePlaying(name) {\n if(this.IsPlaying(name)) {\n for(let i = 0; i < this.playingSounds.length; ++i) {\n if(this.playingSounds[i].name == name) {\n this.playingSounds.splice(i, 1);\n return;\n }\n }\n }\n }", "async function remove(req, res, next) {\n try {\n const { playlistId } = req.params\n const playlist = await Playlist.findById(playlistId)\n if (!playlist.public && !playlist.users.includes(req.currentUser._id)) {\n throw new NotAuthorized()\n }\n await Playlist.deleteOne({ _id: playlist._id })\n res.sendStatus(202)\n } catch (err) {\n next(err)\n }\n}", "async deleteSongFromPlaylists(playlistId, songId) {\n const query = {\n text: 'DELETE FROM playlistssongs WHERE playlist_id = $1 AND song_id = $2 RETURNING id',\n values: [playlistId, songId],\n }\n \n const result = await this._pool.query(query)\n if (!result.rows.length) {\n throw new InvariantError('Lagu gagal dihapus')\n }\n }", "async deleteSongFromPlaylist(request, h) {\n try {\n const { id: credentialId } = request.auth.credentials;\n const { songId } = request.payload;\n const { playlistId } = request.params;\n await this._songsService.verifySongId(songId);\n await this._playlistsService.verifyPlaylistAccess(\n playlistId,\n credentialId\n );\n await this._playlistssongService.deleteSongFromPlaylist(\n playlistId,\n songId\n );\n const response = h.response({\n status: 'success',\n message: 'Lagu berhasil dihapus dari playlist',\n });\n response.code(200);\n return response;\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n console.log(error);\n return response;\n }\n\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami',\n });\n response.code(500);\n console.log(error);\n return response;\n }\n }", "function deleteFromQueue(id) {\n database.ref(path + 'songs/' + id).remove();\n}", "function removeSong(req, res) {\n \n //Variables\n let result = {};\n \n try {\n //Define the song list for the session\n if (req.session.songs == undefined) {\n req.session.songs = [];\n }\n\n //Fail: No Song Provided\n if (req.query.song == undefined) {\n result = {result: \"Please provide a song to remove from the list.\"};\n }\n \n //Fail: Song Not Found\n else if (!req.session.songs.includes(req.query.song)) {\n result = {result: \"The provided song is has not been favorited.\"};\n }\n\n //Success: Song removal process begins\n else {\n req.session.songs = req.session.songs.filter(item => item !== req.query.song);\n result = {songs: req.session.songs};\n }\n }\n catch (e) {\n result = {'error' : e.message};\n }\n\n //Respond with the data\n res.writeHead(200, {'Content-Type': 'application/json'});\n res.write(JSON.stringify(result));\n res.end('');\n}", "function remove(q, cb) {\n mongodb.collections['track']\n .deleteOne(q)\n .then(cb, (error) => console.trace('track.remove() error:', error));\n}", "function removeQueueItem(msg, args) {\n if(isNaN(args)) {\n throw \"Invalid position.\"\n }\n let pos = Number(args);\n if(pos % 1 != 0)\n throw \"Invalid position\";\n let queue = globals.connections[msg.guild.id].queue;\n if(pos < 2 || pos > queue.length)\n throw \"Invalid position.\";\n msg.channel.send(\"**Song** `\" + queue[pos - 1].name + \"` **removed from queue.**\");\n queue.splice(pos - 1, 1)\n}", "async function removeAllTracksFromPlaylist (uid, pid, tracks) {\n try {\n const spotify = createSpotify()\n // Batch size.\n const limit = 100\n while (tracks.length) {\n const batch = tracks.splice(0, limit)\n // Remove tracks.\n await spotify.removeTracksFromPlaylist(uid, pid, batch)\n .catch(e => console.log(e))\n }\n } catch (e) {\n throw e\n }\n}", "async deleteMusicIdPlaylistHandler(request, h) {\n try {\n this._validator.validatePlaylistsongPayload(request.payload);\n\n const { songId } = request.payload;\n const { playlistId } = request.params;\n const { id: credentialId } = request.auth.credentials;\n\n // Verisikasi Owner Playlist dan Lagu\n // await this._service.verifyPlaylistsOwner(playlistId, credentialId);\n await this._service.verifyPlaylistAccess(playlistId, credentialId);\n await this._service.verifyMusicByIdPlaylist(songId);\n\n // Proses Delete Music Dalam Playlist\n await this._service.deleteMusicPlaylist(\n playlistId, songId, credentialId,\n );\n return {\n status: 'success',\n message: 'Lagu berhasil dihapus dari playlist',\n };\n } catch (error) {\n if (error instanceof ClientError) {\n const response = h.response({\n status: 'fail',\n message: error.message,\n });\n response.code(error.statusCode);\n return response;\n }\n\n // Server ERROR!\n const response = h.response({\n status: 'error',\n message: 'Maaf, terjadi kegagalan pada server kami.',\n\n });\n response.code(500);\n console.error(error);\n return response;\n }\n }", "_clearSong() {\n if (this.howl) this.howl.stop().unload();\n if (this.interval) clearInterval(this.interval);\n }", "deleteArtist(artistName){\n let artistToDelete = this.getArtistByName(artistName);\n let artistAlbums = artistToDelete.albums;\n let artistTracks = this.collecTracks(artistAlbums);\n artistTracks.forEach((t)=> this.deleteTrackFromPlaylists(t));\n artistAlbums.forEach((a)=> a.tracks.forEach((t)=> this.deleteTrackFromAlbum(a, t.name)));\n artistToDelete.albums.forEach((a)=> this.deleteAlbumFromArtist(artistToDelete, a.name));\n this.artists.splice(this.artists.indexOf(artistToDelete), 1);\n this.notificationObserver.update(this);\n artistToDelete = null;\n }", "removePodcast(e){\n let id = e.target.id\n console.log(id)\n let podcast = JSON.parse(localStorage.getItem('podcast'));\n for (let c = 0 ; c < podcast.result.length ;c++){\n if(podcast.result[c].name === id){\n podcast.result.splice(c,1)\n }\n }\n localStorage.setItem('podcast',JSON.stringify(podcast))\n window.location.href= '/display/my%20list'\n }", "removeTrackId(id){\r\n const index = this.getTracks().findIndex((track) => track.id === id);\r\n if(index > -1){\r\n this.getTracks().splice(index, 1);\r\n }\r\n }", "function remove_video_playlist(site_url, video_id)\n{\n\tvar playlist_id = $('#playlist_id').val();\n\tvar playlist_type = $('#playlist_type').val();\n\t\n\t//alert(video_id+' '+playlist_id+' '+playlist_type);\n\t\n\t$.ajax({\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"playlist_id=\"+playlist_id+\"&playlist_type=\"+playlist_type+\"&video_id=\"+video_id,\n\t\tdataType: \"json\",\n\t\turl: site_url+\"video/remove_video_playlist/\",\n\t\tsuccess: function(data){\n\t\t\t//alert(json_decode(data.video_ids));\n\t\t\t//$('#playlist_video_display').html(data.form);\t\n\t\t\tdisplay_current_playlist(site_url);\n\t\t\t\n\t\t\t/*if ($('#playlist_play_video_id').val()==video_id){\n\t\t\t\t$('#video_play').html('play');\t\n\t\t\t}*/\n\t\t}\n\t});\n\t\n}", "removeFromLocalStorage() {\n const songsInStorage = localStorage.getItem(\"Songs\");\n let currentArray = [];\n if (songsInStorage) {\n currentArray = JSON.parse(songsInStorage);\n const index = this.indexContainingID(currentArray, this.props.info.id);\n if (index > -1) {\n currentArray.splice(index, 1);\n }\n }\n localStorage.removeItem(\"Songs\");\n localStorage.setItem(\"Songs\", JSON.stringify(currentArray));\n }", "removeTrack() {\n\t\tthis.props.onRemove(this.props.track, true);\n\t}", "function deletePlaylist(playlistID, playlistRow) {\n \n $.post(domain+'includes/ajax/handlePlaylist.php', \n { \n playlistID:playlistID,\n task: 'delete' \n }, \n function(response){\n if(response == 1) {\n triggerNotification(\"Playlist was deleted.\");\n playlistRow.fadeOut(150).remove();\n \n if($('#playlists li').length == 0)\n $('#playlists').append(\"<p align='center'>Add some playlists!</p>\").hide().fadeIn(150);\n } else {\n triggerNotification(\"Playlist wasn't deleted.\");\n } \n });\n\n}", "removeTrack() {\n this.props.onRemove(this.props.track);\n }", "deleteAlbum(artistName, albumName){\n let artistWithAlbum = this.getArtistByName(artistName);\n let albumToDelete = this.getAlbumInArtist(artistWithAlbum, albumName);\n let tracksFromAlbumToDelete = albumToDelete.tracks;\n tracksFromAlbumToDelete.forEach((t)=> this.deleteTrackFromPlaylists(t));\n albumToDelete.tracks.forEach((t)=> this.deleteTrackFromAlbum(albumToDelete, t.name));\n this.deleteAlbumFromArtist(artistWithAlbum, albumToDelete.name);\n this.notificationObserver.update(this);\n albumToDelete =null;\n }", "function disLikeTrack(){\n\tvar removeLikexhrq = new XMLHttpRequest();\n\tvar songId = event.target.id.substring(16);\n\tconsole.log(songId);\n\tvar removeLikeURL = 'http://127.0.0.1:3000/removeLikeSong?songID=' + songId + '&userID=' + sessionStorage.getItem('user_id');\n\tremoveLikexhrq.open('get', removeLikeURL, true);\n\n\tremoveLikexhrq.onreadystatechange = function(){\n\t\tif(removeLikexhrq.readyState === XMLHttpRequest.DONE){\n\t\t\tvar responseStatus = JSON.parse(removeLikexhrq.responseText);\n\t\t\tif(responseStatus['message'] === 'bad'){\n\t\t\t\talert('update failed!');\n\t\t\t}else{\n\t\t\t\talert('remove the song from your favorite collection');\n\t\t\t\t// remove the DOM of current song\n\t\t\t\tvar removeLi = document.getElementById('ripple-music-like-li-' + songId);\n\t\t\t\tvar parentUl = document.getElementById('sub-content-content');\n\t\t\t\tparentUl.removeChild(removeLi);\n\t\t\t}\n\t\t}\n\t};\n\tremoveLikexhrq.send(null);\n}", "deleteTrackFromAlbum(album, trackName){\n let track = this.returnIfExists(album.tracks.find((t)=>t.name===trackName), \"track \" + trackName);\n album.tracks.splice(album.tracks.indexOf(track), 1);\n return track;\n }", "function removeTodoById(id, li) {\n connection.remove({\n from: 'tasks',\n where: {\n id: id\n }\n }).then(() => {\n li.remove()\n // alert('Todo removed')\n })\n}", "removeTrack() {\n this.props.onRemove(this.props.track);\n }", "function deleteTrack(trackID, playlistID) {\n var track = $(this).parent();\n var playlist = $('[data-playlistid=\"'+playlistID+'\"]');\n var currentCount = parseInt(playlist.find('.trackCount').text());\n\n $.post(domain+'includes/ajax/handleTrack.php', \n { \n trackID: trackID,\n playlistID: playlistID,\n task:'delete'\n }, \n function(response) {\n\n if(response == 1) {\n playlist.find('.trackCount').text(currentCount-1);\n triggerNotification(\"Track removed.\");\n track.slideUp(250).delay(250).remove();\n }\n else\n triggerNotification(\"Track wasn't removed.\");\n\n });\n}", "removeSound({commit}, data){\n commit('removeActiveSound', data)\n }", "function stopSong(){\n activeSong.currentTime = 0;\n activeSong.pause();\n}", "function removeMusic(keys) {\n musicLine[keys].remove();\n }", "function delSong(e) {\n var song_id = e.target.id\n var artist_id = song_id.substr(0, song_id.indexOf(\"d\"));\n var song_id = song_id.substr(song_id.indexOf(\"l\") + 1, song_id.length);\n $.ajax({\n type: 'DELETE',\n url: 'http://localhost:3001/songs/' + artist_id,\n dataType: 'text',\n data: song_id,\n processData: false,\n encode: true,\n success: function(data, textStatus, jQxhr) {\n console.log(data);\n get_artists();\n },\n error: function(jqXhr, textStatus, errorThrown) {\n alert(errorThrown);\n }\n });\n}", "async deletePlaylists(id) {\n const query = {\n text: 'DELETE FROM playlists WHERE id = $1 RETURNING id',\n values: [id],\n }\n \n const result = await this._pool.query(query)\n if (!result.rows.length) {\n throw new NotFoundError('Playlist gagal dihapus, Id tidak ditemukan')\n }\n }", "function deletePlayingSong (id) {\n $.ajax({\n url: '/song/' + id,\n type: 'DELETE',\n success: function (result) {\n // Do something with the result\n console.log('This should be removed from the database' + result)\n voteCount = 3\n updateList()\n }\n })\n}", "async function deleteSong(req, res){\n try {\n var id = req.body._id;\n await songsController.songDeleted(id);\n res.status(200).send('Se elimino la cancion correctamente');\n } catch (e) {\n res.status(500).send('No se encontro la cancion a eliminar ' + e);\n }\n}", "async removeFavoriteStory(story){\n console.debug(\"removeFavoriteStory input\", story);\n //Find story in favoriteStory array and remove\n \n this.favorites = (this.favorites.filter(favoriteStory => { \n return favoriteStory.storyId !== story.storyId}));\n \n // Update un-favorite story in API\n await axios.delete(\n `${BASE_URL}/users/${this.username}/favorites/${story.storyId}`, \n {params: {token: this.loginToken}});\n \n }", "function removeItem(item){\r\n exec(\"py remove.py \" + item[0] + \" \" + item[1]);\r\n}", "function remove_video() {\n\n\n\n window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, onRequestFileSystemSuccess, null);\n\n function onRequestFileSystemSuccess(fileSystem) {\n\n fileSystem.root.getFile(\"GymWijzer/Video/\" + trahsname + \".mp4\", {\n create: false,\n exclusive: false\n }, gotRemoveFileEntry, fail);\n\n }\n\n\n\n function gotRemoveFileEntry(fileEntry) {\n console.log(fileEntry);\n fileEntry.remove(success, fail);\n }\n\n function success(entry) {\n console.log(\"Removal succeeded\");\n $(\"#videolistul li\").remove();\n fn_subtitle_videolist(array, window.localStorage.getItem(\"videoid\"));\n jQuery.fancybox.open(\"#remove\");\n\n\n\n }\n\n function fail(error) {\n console.log(\"Error removing file: \" + error.code);\n }\n\n}", "removePlayer(player){\n this.roster.splice(roster.indexOf(player), roster.lastIndesOf(player));\n }", "function removeEmptySongs(){\r\n $(\".EMPTY_SONG\").remove();\r\n}", "removeTrack(){\n this.props.onRemove(this.props.track);\n }", "function removeOldList() {\n var myNode = document.getElementById(\"songlist\");\n\n while(myNode !== null) {\n myNode.remove();\n myNode = document.getElementById(\"songlist\");\n }\n\n}", "remove(video) {\n\t\tthis.videos = this.videos.filter(v => v !== video);\n\t\tthis.emit('change');\n\t}", "removeAudioBook(e){\n let id = e.target.id\n console.log(id)\n let audiobook = JSON.parse(localStorage.getItem('audiobook'));\n for (let c = 0 ; c < audiobook.result.length ;c++){\n if(audiobook.result[c].book === id){\n audiobook.result.splice(c,1)\n }\n }\n localStorage.setItem('audiobook',JSON.stringify(audiobook))\n window.location.href= '/display/my%20list'\n }", "removeFromList(name) {\n console.log(\"Requested to remove word \" + name);\n let success = this.list.delete(name);\n console.log(\"Remove \" + name + \" success: \" + success);\n }", "remove(url) {\n\t\tfor (var i = 0; i < this.queue.length; i++) {\n\t\t\tvar currentItem = this.queue[i];\n\t\t\tif (currentItem.url == url) {\n\t\t\t\tthis.queue.splice(i, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "remove() {\n player.dispose();\n }", "function removeFromDatabase(index) {\n\tvar removed = positionArray.splice(index, 1); //removes sound once it's played\n\tconsole.log(removed[0]);\n\tremoved = sndArray.splice(index, 1);\n\tconsole.log(removed[0]);\n\t\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}", "removeVideo(key) {\n\t\txhr.post('http://playlist-royletzchange.rhcloud.com/remove/' + key\n\t\t, (err, req, body) => {\n\n\t\t\tif(err) {\n\t\t\t\t\t\t\n\t\t\t\tconsole.error('opps! Something went wrong.')\n\t\t\t\t\t\treturn false\n\t\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tapp.me.collect.remove(key)\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t})\n\t}", "function preventRepeatingSong() {\n let currentVideo = player.getVideoUrl();\n let currentVideoId = currentVideo.slice(currentVideo.indexOf(\"v=\"),currentVideo.length);\n currentVideoId = currentVideoId.slice(2, currentVideoId.length);\n musicArray.splice(musicArray.indexOf(currentVideoId), 1);\n musicArray.push(currentVideoId);\n}", "function clearNotIn(list) {\n app.db.songs.remove({location: { $nin: list }}, {multi: true}, function(err, numRemoved) {\n console.log(numRemoved + ' tracks deleted');\n });\n}", "function removerMedia(html_id)\n{\n\t$(\"#\"+html_id).remove();\n}", "function removerMedia(html_id)\n{\n\t$(\"#\"+html_id).remove();\n}", "function clearActiveList(){\n\t$('.playlist-item').each(function() {\n\t\t$(this).removeClass('active-song');\n\t});\n}", "async removeFavoriteStory(storyId) {\n // this function should return the newly created story so it can be used in\n // the script.js file where it will be appended to the DOM\n // remove story from list\n\n try {\n const response = await axios.delete(\n `${BASE_URL}/users/${this.username}/favorites/${storyId}`,\n { data: {token: this.loginToken} }\n );\n this.favorites.splice(\n this.favorites.findIndex((item) => item.storyId == storyId), 1\n );\n } catch (error) {\n axiosErrorHandler(error);\n }\n }", "function deleteItemById(smid) {\n var r = confirm(_locale[pn]['delete_confirm']);\n if(r==true) {\n THK.DB.deleteById(smid, function(ret) {\n if(ret.rowsAffected==1) {\n // delete ok\n // remove li item.\n $(\"#\"+smid).remove();\n VideoCounter -= 1;\n TotalVideo -= 1;\n updateCounter();\n } else {\n \n }\n });\n \n THK.DB.deleteQueueById(smid);\n } else {\n // do nothing\n \n }\n}", "removeItem(_item) { }", "subscriberPlayerRemove(EventName, player){\n let array = this.state.players;\n let index = array.indexOf(player.player)\n array.splice(index, 1);\n this.setState({players: array });\n this.setState({currentPlayer: null});\n PubSub.publish('currentPlayer', null);\n }", "async onPlayerRemoved(player) {}", "function removeAudioFile() {\n var audioFile = Ti.Filesystem.getFile(res.data.filePath);\n audioFile.deleteFile();\n }", "function removeItem()\r\n{\r\n\tconst item = this.parentNode.parentNode;\r\n\tconst currentListId = item.parentNode.id;\r\n\tconst text = item.innerText;\r\n\r\n\titem.remove();\r\n\r\n\tif (currentListId === \"todo-list\") \r\n\t{\r\n\t\ttodo.splice(todo.indexOf(text),1);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcompleted.splice(completed.indexOf(text),1);\r\n\t}\r\n\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "function removeFromLS(taskItem){\r\n // from store in local stroage\r\n let tasks;\r\n if(localStorage.getItem('tasks')===null){\r\n tasks=[];\r\n }\r\n else{\r\n tasks=JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n let li = taskItem;\r\n li.removeChild(li.lastChild); //<a>x</a> ei item ta remove hoa jabe karon ata local stroage a ni\r\n\r\n tasks.forEach(function(task, index){ // local stroage er upore\r\n if(li.textContent.trim()===task){\r\n tasks.splice(index, 1); // task ke remove korbe\r\n }\r\n });\r\n\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n\r\n}", "removePlayer(player)\n {\n\n for(let i = 0;i<this.joueurs.length;i++)\n if(player.name === this.joueurs[i].name)\n this.joueurs.splice(i,1);\n\n }", "function sendDeleteSong() {\n\t$(\"#playerPagePopup\").popup( \"close\" );\n\tif(currentSongID == 0) // We need the database ID to do this so cant continue...\n\t\treturn;\n\t\n\t$(\"#jPlayer_instance\").jPlayer( \"clearMedia\" ); // Stop playing the song \n\t$(\"#songPlaylistPlaying\").remove(); // Remove the currently playing instance from the main page playlist (if it exists)\n\t$(\"#playerPlayPause\").removeClass(\"pause\");\n\t$(\"#playerPlayPause\").addClass(\"play\");\n\t$(\"#songArt\").css(\"background-image\", \"url('')\");\n\t$(\"#songTitle\").html(\"\");\n\tplayer_playing = false;\n\t$(\"#downloadProgress\").css(\"width\", \"0%\");\n\t$(\"#songProgress\").css(\"width\", \"0%\");\n\t$(\"#timeLeft\").text(\"0:00\");\n\t$(\"#timeRight\").text(\"0:00\");\n\t$(\"#songLoader\").show();\n\tcurrentSongData = null; // Clear our reference variable\n\t\n\t// Send the delete request\n\tvar dataString = 'cmd=delete';\n\t$.ajax({\n\t\ttype: \"POST\",\n\t\turl: backend_url+\"/index.php\",\n\t\tdata: encodeURI('cmd=delete'+\"&id=\"+currentSongID),\n\t\tcache: false,\n\t\tsuccess: function(result){\n\t\t\tvar jsonResponse = jQuery.parseJSON(result);\n\t\t\tif(jsonResponse.status === \"success\") {\n\t\t\t\t// Check to see if the currentSong array id matches, if it does remove the row from the main page playlist\n\t\t\t\tif(loadedPlaylist[currentSong].id == currentSongID) {\n\t\t\t\t\t$(\"#playlistSongsRow\"+currentSong).remove();\n\t\t\t\t}\n\t\t\t\tcurrentSong = 0; // Reset the next 2 variables now that weve made the check above\n\t\t\t\tcurrentSongID = 0;\n\t\t\t\t$(\"#songLoader\").hide();\n\t\t\t\tshowMainPage(); // Open the main page back up\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// This should rarely happen but just in case the backend has an issue\n\t\t\t\t$(\"#songLoader\").hide();\n\t\t\t\tnavigator.notification.alert(\n\t\t\t\t\tjsonResponse.reason, // message\n\t\t\t\t\t'', // callback\n\t\t\t\t\t'Error', // title\n\t\t\t\t\t'Close' // buttonName\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t});\n}", "deleteTrack(id) {\n /* Elimina de unqfy el track con el id indicado */\n const tracks = this.getAlbumById(id).deleteTrack(id);\n return tracks;\n }", "function removeFromList() {\n $('.js-watchlist-results').on('click', '.js-remove-title', function (event) {\n let titleId = $(this).attr('title-id');\n let elem = $(this);\n $.ajax({\n type: \"DELETE\",\n url: '/users/me/item/' + titleId,\n data: JSON.stringify({\n titleId: titleId\n }),\n dataType: 'json',\n contentType: \"application/json; charset=utf-8\",\n success: function () {\n elem.closest('.js-list-item').remove();\n },\n error: function (data) {\n if (data.status === 404) {\n console.log(`404 Error`);\n }\n }\n });\n });\n}", "'click .js-media-delete-button'( e, t ) {\n e.preventDefault();\n\n let cur = $( '#cb-current' ).val()\n , idx = P.indexOf( `${cur}` );\n\n \t\tP.removeAt( idx );\n $( `#${cur}` ).remove();\n $( '#cb-current' ).val('');\n $( '#cb-media-toolbar' ).hide();\n $('#frameBorder').remove();\n pp.update( { _id: Session.get('my_id') },\n { $pull: { pages:{ id: cur} } });\n\n //console.log( pp.find({}).fetch() );\n }" ]
[ "0.81049955", "0.81025904", "0.79697376", "0.791647", "0.77599853", "0.7546924", "0.74673355", "0.74498385", "0.72700375", "0.7218919", "0.7213729", "0.7039262", "0.702661", "0.7024118", "0.7022187", "0.6930981", "0.69285554", "0.68981445", "0.68799055", "0.68553925", "0.67834806", "0.67809373", "0.6729044", "0.67171866", "0.67047906", "0.6691961", "0.66518074", "0.6642318", "0.6629633", "0.66236675", "0.65892273", "0.6550987", "0.6541718", "0.65340966", "0.65290195", "0.65112126", "0.6489417", "0.6474525", "0.6460155", "0.6443253", "0.6434761", "0.6348389", "0.6327286", "0.6301065", "0.6287936", "0.628429", "0.6277729", "0.6257508", "0.6255015", "0.6253647", "0.622418", "0.62216425", "0.61843354", "0.6166537", "0.6161983", "0.6161138", "0.6160562", "0.61562645", "0.6151586", "0.6148513", "0.6143218", "0.6098459", "0.60794485", "0.6072973", "0.60636437", "0.605745", "0.6024639", "0.6003363", "0.60002106", "0.59925246", "0.5977076", "0.59759736", "0.59705967", "0.59644914", "0.5960829", "0.5959807", "0.5958531", "0.5956131", "0.5949598", "0.5946145", "0.59440696", "0.5941429", "0.59226334", "0.5920979", "0.59091365", "0.59091365", "0.5900833", "0.59002364", "0.588595", "0.58670676", "0.58625776", "0.5860838", "0.5852622", "0.58517146", "0.5847572", "0.58439046", "0.5825731", "0.5824983", "0.5807864", "0.58001155" ]
0.72030795
11
NOTE: This is currently pretty much hardcoded to GCS we'll need to make this pluginable at some stage
function publishContent(currentDirectory, statyckConfig, callback) { if (!(typeof currentDirectory === 'string')) { throw new TypeError("Value of argument \"currentDirectory\" violates contract.\n\nExpected:\nstring\n\nGot:\n" + _inspect(currentDirectory)); } if (!(statyckConfig instanceof Object)) { throw new TypeError("Value of argument \"statyckConfig\" violates contract.\n\nExpected:\nObject\n\nGot:\n" + _inspect(statyckConfig)); } if (!(typeof callback === 'function')) { throw new TypeError("Value of argument \"callback\" violates contract.\n\nExpected:\nFunction\n\nGot:\n" + _inspect(callback)); } // Calculate the path to the content we have built const contentDir = _path2.default.resolve(currentDirectory, statyckConfig.general.outputDirSymlink); const execOptions = { cwd: contentDir }; // TODO: Add a check that we can read the dir _fs2.default.access(contentDir, _fs2.default.constants.R_OK, FAErr => { if (FAErr) { return callback(FAErr, null, null); } (0, _child_process.exec)(`gsutil mb -l EU gs://${ statyckConfig.publishing.bucketHame }`, execOptions, (MBErr, MBStdout, MBStderr) => { // Ugly but basically, don't error out if the bucket exists already if (MBErr && MBStderr.indexOf("already exists") === -1) { return callback(MBErr, MBStdout, MBStderr); } const metadata = `-h "Cache-Control: public, max-age=10"`; (0, _child_process.exec)(`gsutil -m ${ metadata } rsync -d -r . gs://${ statyckConfig.publishing.bucketHame }`, execOptions, (SErr, SStdout, SStderr) => { return callback(SErr, SStdout, SStderr); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function main(\n bucketName = 'my-bucket',\n contents = 'these are my file contents',\n destFileName = 'file.txt',\n generationMatchPrecondition = 0\n) {\n // [START storage_upload_without_authentication]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The contents that you want to upload\n // const contents = 'these are my contents';\n\n // The new ID for your GCS file\n // const destFileName = 'your-new-file-name';\n\n // Imports the Google Cloud Node.js client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n async function uploadWithoutAuthentication() {\n const file = storage.bucket(bucketName).file(destFileName);\n\n // Returns an authenticated endpoint to which\n // you can make requests without credentials.\n const [location] = await file.createResumableUpload(); //auth required\n\n const options = {\n uri: location,\n resumable: true,\n validation: false,\n\n // Optional:\n // Set a generation-match precondition to avoid potential race conditions\n // and data corruptions. The request to upload is aborted if the object's\n // generation number does not match your precondition. For a destination\n // object that does not yet exist, set the ifGenerationMatch precondition to 0\n // If the destination object already exists in your bucket, set instead a\n // generation-match precondition using its generation number.\n preconditionOpts: {ifGenerationMatch: generationMatchPrecondition},\n };\n\n // Passes the location to file.save so you don't need to\n // authenticate this call\n await file.save(contents, options);\n\n console.log(`${destFileName} uploaded to ${bucketName}`);\n }\n\n uploadWithoutAuthentication().catch(console.error);\n // [END storage_upload_without_authentication]\n}", "manageBucketPointer(){\n if (fs.existsSync(this.file_bucket_path)) {\n let data=fs.readFileSync(this.file_bucket_path);\n this.bucket=JSON.parse(data);\n this.updateFilePointerBucket();\n }else{\n this.createFilePointerBucket();\n } \n }", "async function main() {\n const bucketName = process.env.BUCKET_NAME;\n const objectName = process.env.OBJECT_NAME;\n // Defines a credential access boundary that grants objectViewer access in\n // the specified bucket.\n const cab = {\n accessBoundary: {\n accessBoundaryRules: [\n {\n availableResource: `//storage.googleapis.com/projects/_/buckets/${bucketName}`,\n availablePermissions: ['inRole:roles/storage.objectViewer'],\n availabilityCondition: {\n expression:\n \"resource.name.startsWith('projects/_/buckets/\" +\n `${bucketName}/objects/${objectName}')`,\n },\n },\n ],\n },\n };\n\n const googleAuth = new GoogleAuth({\n scopes: 'https://www.googleapis.com/auth/cloud-platform',\n });\n const projectId = await googleAuth.getProjectId();\n // Obtain an authenticated client via ADC.\n const client = await googleAuth.getClient();\n // Use the client to generate a DownscopedClient.\n const cabClient = new DownscopedClient(client, cab);\n\n // OAuth 2.0 Client\n const authClient = new OAuth2Client();\n // Define a refreshHandler that will be used to refresh the downscoped token\n // when it expires.\n authClient.refreshHandler = async () => {\n const refreshedAccessToken = await cabClient.getAccessToken();\n return {\n access_token: refreshedAccessToken.token,\n expiry_date: refreshedAccessToken.expirationTime,\n };\n };\n\n const storageOptions = {\n projectId,\n authClient: new GoogleAuth({authClient}),\n };\n\n const storage = new Storage(storageOptions);\n const downloadFile = await storage\n .bucket(bucketName)\n .file(objectName)\n .download();\n console.log('Successfully retrieved file. Contents:');\n console.log(downloadFile.toString('utf8'));\n}", "async function imageUpload(filename,type, bucketName) {\n\n try{\n\n //create bucket if it isn't present.\n await bucketExists(bucketName);\n\n const bucket = storage.bucket(bucketName);\n \n const gcsname = type +'/'+Date.now() + filename.originalname;\n const file = bucket.file(gcsname);\n \n const stream = file.createWriteStream({\n metadata: {\n contentType: filename.mimetype,\n },\n resumable: false,\n });\n\n \n \n stream.on('error', err => {\n filename.cloudStorageError = err;\n console.log(err);\n });\n \n stream.on('finish', async () => {\n \n filename.cloudStorageObject = gcsname;\n await file.makePublic().then(() => {\n imageUrl = getPublicUrl(gcsname,bucketName);\n console.log(imageUrl);\n });\n \n\n });\n \n stream.end(filename.buffer);\n return getPublicUrl(gcsname,bucketName);\n\n }\n\n catch(error){\n console.log(error);\n \n }\n // [END process]\n\n}", "function main(\n bucketName = 'my-bucket',\n maxAgeSeconds = 3600,\n method = 'POST',\n origin = 'http://example.appspot.com',\n responseHeader = 'content-type'\n) {\n // [START storage_cors_configuration]\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The origin for this CORS config to allow requests from\n // const origin = 'http://example.appspot.com';\n\n // The response header to share across origins\n // const responseHeader = 'Content-Type';\n\n // The maximum amount of time the browser can make requests before it must\n // repeat preflighted requests\n // const maxAgeSeconds = 3600;\n\n // The name of the method\n // See the HttpMethod documentation for other HTTP methods available:\n // https://cloud.google.com/appengine/docs/standard/java/javadoc/com/google/appengine/api/urlfetch/HTTPMethod\n // const method = 'GET';\n\n async function configureBucketCors() {\n await storage.bucket(bucketName).setCorsConfiguration([\n {\n maxAgeSeconds,\n method: [method],\n origin: [origin],\n responseHeader: [responseHeader],\n },\n ]);\n\n console.log(`Bucket ${bucketName} was updated with a CORS config\n to allow ${method} requests from ${origin} sharing \n ${responseHeader} responses across origins`);\n }\n\n configureBucketCors().catch(console.error);\n // [END storage_cors_configuration]\n}", "function parseBucketName(url) {\n\n let bucket;\n let object;\n\n if (url.startsWith(\"gs://\")) {\n const i = url.indexOf('/', 5);\n if (i >= 0) {\n bucket = url.substring(5, i);\n const qIdx = url.indexOf('?');\n object = (qIdx < 0) ? url.substring(i + 1) : url.substring(i + 1, qIdx);\n }\n\n } else if (url.startsWith(\"https://storage.googleapis.com\") || url.startsWith(\"https://storage.cloud.google.com\")) {\n const bucketIdx = url.indexOf(\"/v1/b/\", 8)\n if (bucketIdx > 0) {\n const objIdx = url.indexOf(\"/o/\", bucketIdx);\n if (objIdx > 0) {\n const queryIdx = url.indexOf(\"?\", objIdx);\n bucket = url.substring(bucketIdx + 6, objIdx);\n object = queryIdx > 0 ? url.substring(objIdx + 3, queryIdx) : url.substring(objIdx + 3);\n }\n\n } else {\n const idx1 = url.indexOf(\"/\", 8);\n const idx2 = url.indexOf(\"/\", idx1+1);\n const idx3 = url.indexOf(\"?\", idx2);\n if (idx2 > 0) {\n bucket = url.substring(idx1+1, idx2);\n object = idx3 < 0 ? url.substring(idx2+1) : url.substring(idx2+1, idx3);\n }\n }\n\n } else if (url.startsWith(\"https://www.googleapis.com/storage/v1/b\")) {\n const bucketIdx = url.indexOf(\"/v1/b/\", 8);\n const objIdx = url.indexOf(\"/o/\", bucketIdx);\n if (objIdx > 0) {\n const queryIdx = url.indexOf(\"?\", objIdx);\n bucket = url.substring(bucketIdx + 6, objIdx);\n object = queryIdx > 0 ? url.substring(objIdx + 3, queryIdx) : url.substring(objIdx + 3);\n }\n }\n\n if (bucket && object) {\n return {\n bucket, object\n }\n } else {\n throw Error(`Unrecognized Google Storage URI: ${url}`)\n }\n\n}", "function uploadFileToGCS(localFileName) {\n let promise = new Promise((resolve, reject) => {\n const bucket = admin.storage().bucket();\n\n // const filename = 'Local file to upload, e.g. ./local/path/to/file.txt';\n // Uploads a local file to the bucket\n const fileName = path.join(__dirname, localFileName);\n const baseFileName = fileName.split(\"/\").pop();\n const gcsObjectName = `/testUploads/${uuidv4()}-${baseFileName}`;\n\n bucket.upload(fileName, {\n destination: gcsObjectName,\n }).then(() => {\n console.log(`${fileName} uploaded to ${bucket.name}${gcsObjectName}`);\n }).catch(err => {\n console.error(`ERROR: err ${err}`);\n });\n });\n\n return promise;\n}", "function upload(){\n const {Storage} = require('@google-cloud/storage');\n\n // Your Google Cloud Platform project ID\n const projectId = 'check-221407';\n\n // Creates a client\n const storage = new Storage({\n projectId: projectId,\n });\n\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n const bucketName = 'cal_ballots';\n const filename = 'hint10.JPG';\n\n // Uploads a local file to the bucket\n await storage.bucket(bucketName).upload(filename, {\n // Support for HTTP requests made with `Accept-Encoding: gzip`\n gzip: true,\n metadata: {\n // Enable long-lived HTTP caching headers\n // Use only if the contents of the file will never change\n // (If the contents will change, use cacheControl: 'no-cache')\n cacheControl: 'public, max-age=31536000',\n },\n });\n\n console.log(`${filename} uploaded to ${bucketName}.`);\n}", "function StorageObject() {}", "function StorageObject() {}", "function StorageObject() {}", "function StorageObject() {}", "function StorageObject() {}", "function sendUploadToGCS (req, folder) {\n return new Promise((resolve, reject) => {\n if (!req.file) reject()\n\n var uuid = folder\n if (!folder) uuid = generateUUID()\n let extension = req.file.originalname.substring(req.file.originalname.lastIndexOf('.'))\n const gcsname = uuid + '/' + req.file.originalname\n\n const file = bucket.file(gcsname)\n const stream = file.createWriteStream()\n\n stream.on('error', function (err) {\n req.file.cloudStorageError = err\n console.log(err)\n reject(err)\n })\n\n stream.on('finish', function () {\n req.file.cloudStorageObject = gcsname\n req.file.cloudStoragePublicUrl = getPublicUrl(gcsname)\n req.file.file_name = req.file.originalname\n req.file.folderId = uuid\n resolve(req)\n })\n\n stream.end(req.file.buffer)\n }) // return promise\n}", "async function create_upload_thumbnail(storage_key) {\n\n const newThumbName = uuidv4()\n\n // Get owner and docId from storage_key\n const owner = storage_key.split('/')[1]\n const docId = storage_key.split('/')[2].split('.')[0]\n\n // 3. Save to file pipeline\n var file = gcsBucket.file(`users/${owner}/thumbnails/${newThumbName}.jpeg`).createWriteStream({ contentType: 'image/jpeg' })\n .on('error', (err) => {\n console.warn(err)\n return\n })\n .on('finish', () => {\n // Write thumbnail to firestore\n admin.firestore().collection('users').doc(owner).collection('files').doc(docId).update({\n thumbnail_key: `users/${owner}/thumbnails/${newThumbName}.jpeg`\n }).then(() => {\n return console.log(\"Thumbnail uploaded successfully.\")\n }).catch((err) => console.error('Could not upload ....', owner, err))\n\n });\n\n // 2. Resize\n const pipeline = sharp()\n pipeline.resize(450).jpeg({\n quality: 50\n }).pipe(file);\n\n // 1. Stream file from Wasabi\n const stream = s3.getObject({\n Bucket: project_id,\n Key: storage_key\n }).createReadStream().on('error', error => {\n return console.log(error)\n });\n stream.pipe(pipeline);\n\n}", "async function gcsCopy(srcBucket, srcFile, destBucket, destFile) {\n // console.log('Copy from <gs://' + srcBucket + '/' + srcFile + '> to <gs://' + destBucket + '/' + destFile + '>');\n await storage.bucket(srcBucket).file(srcFile).copy(storage.bucket(destBucket).file(destFile))\n .catch(function (error) {\n console.error('!!!!!!!!!!!!! ERROR: Failed to copy a file: ' + destFile + ' with error: ' + error);\n });\n}", "function getGSUrls(bucket, filename) {\n return `https://storage.googleapis.com/${bucket}/${filename}`;\n}", "async function getFile() {\n\n const myFile = await fleekStorage.get({\n apiKey: 'my-key',\n apiSecret: 'my-secret', \n key: 'filename-on-fleek',\n getOptions: [\n 'data',\n 'bucket',\n 'key',\n 'hash',\n 'publicUrl'\n ],\n })\n\nconsole.log('myFile', myFile)\n\n}", "function upload(localFile, remoteFile){\n\n let uuid = UUID();\n \n return bucket.upload( localFile, {\n destination:remoteFile,\n uploadType: \"media\",\n metadata: {\n contentType: 'image/png',\n metadata: {\n firebaseStorageDownloadTokens: 'hello token'\n }\n }\n })\n .then((data) => {\n \n let file = data[0];\n \n return Promise.resolve(\"https://firebasestorage.googleapis.com/v0/b/\" + bucket.name + \"/o/\" + encodeURIComponent(file.name) + \"?alt=media&token=\" + 'hell token');\n });\n }", "function uploadStreamToGCS(attachmentUrl, fileName) {\n return new Promise((resolve, reject) => {\n\n const bucket = admin.storage().bucket();\n\n const imageUrl = attachmentUrl;\n\n // Configure axios to receive a response type of stream, and get a readableStream of the image from the specified URL\n axios({\n method: \"get\",\n url: imageUrl,\n responseType: \"stream\"\n }).then((response) => {\n let gcFile = bucket.file(fileName);\n // Pipe the axios response data to Google Cloud\n response.data.pipe(gcFile.createWriteStream({\n resumable: false,\n validation: false,\n contentType: \"auto\",\n gzip: true,\n public: true,\n metadata: {\n contentType: imageUrl.mimetype\n }\n })).on(\"error\", (err) => {\n console.error(`Error saving image ${err}`);\n }).on(\"finish\", () => {\n console.log(\"Image saved successfully\");\n gcFile.makePublic().then(() => {\n const publicURL = `https://storage.googleapis.com/${bucket.name}${fileName}`;\n return resolve(publicURL);\n }).catch(err => {\n return reject(err);\n });\n });\n }).catch(err => {\n console.log(`Image transfer error. ${err}`);\n return reject(err);\n });\n }); // Promise\n}", "async uploadArtifacts() {\n const objectId = this.getBucketId();\n const filesFolder = this.options.distributionFolder || 'client/dist/';\n const files = read(filesFolder);\n\n const objects = files.map((file) => {\n return {\n ObjectName: file.replace(filesFolder,''),\n LocalPath: file\n };\n });\n\n const bucket = this.templates.create.Resources[objectId].Properties;\n\n this.serverless.cli.log(`Uploading objects to OSS bucket ${bucket.BucketName}...`);\n await Promise.all(objects.map((object) => this.provider.uploadObject(object.ObjectName, object.LocalPath)));\n this.serverless.cli.log(`Uploaded objects to OSS bucket ${bucket.BucketName}`);\n }", "function StorageObject() { }", "async function gcsDelete(bucket, file) {\n // console.log('Deleting file: '+file);\n storage.bucket(bucket).file(file).delete()\n .catch(function (error) {\n console.error(\"!!!!!!!!!!!! Failed to delete a file: \" + error);\n });\n}", "function authenticateCurator() {\n //READMORE: http://googlecloudplatform.github.io/gcloud-node/#/docs/v0.37.0/storage/file?method=createWriteStream\n return gcloud.storage({\n keyFilename: './auth/curatorKey.json',\n projectId : 'artist-tekuma-4a697'\n });\n console.log(\"connected art storage\");\n }", "function DeleteBucket(filePath) {\n const bucket = functions.config().firebase.storageBucket\n const myBucket = gcs.bucket(bucket);\n const file = myBucket.file(filePath);\n console.log(`${myBucket},${filePath}, ${file}`)\n if (file.exists()){\n return file.delete();\n }\n else {\n return;\n }\n\n}", "uploadPartCopy(partConfig, cb) {\n const { bucketName, objectName, uploadID, partNumber, headers } = partConfig\n\n const method = 'PUT'\n let query = `uploadId=${uploadID}&partNumber=${partNumber}`\n const requestOptions = { method, bucketName, objectName: objectName, query, headers }\n return this.makeRequest(requestOptions, '', [200], '', true, (e, response) => {\n let partCopyResult = Buffer.from('')\n if (e) {\n return cb(e)\n }\n pipesetup(response, transformers.uploadPartTransformer())\n .on('data', (data) => {\n partCopyResult = data\n })\n .on('error', cb)\n .on('end', () => {\n let uploadPartCopyRes = {\n etag: sanitizeETag(partCopyResult.ETag),\n key: objectName,\n part: partNumber,\n }\n\n cb(null, uploadPartCopyRes)\n })\n })\n }", "function main(\n bucketName = 'my-bucket',\n firstFileName = 'file-one.txt',\n secondFileName = 'file-two.txt',\n destinationFileName = 'file-one-two.txt'\n) {\n // [START storage_compose_file]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The ID of the first GCS file to compose\n // const firstFileName = 'your-first-file-name';\n\n // The ID of the second GCS file to compose\n // const secondFileName = 'your-second-file-name';\n\n // The ID to give the new composite file\n // const destinationFileName = 'new-composite-file-name';\n\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n async function composeFile() {\n const bucket = storage.bucket(bucketName);\n const sources = [firstFileName, secondFileName];\n\n await bucket.combine(sources, destinationFileName);\n\n console.log(\n `New composite file ${destinationFileName} was created by combining ${firstFileName} and ${secondFileName}`\n );\n }\n\n composeFile().catch(console.error);\n // [END storage_compose_file]\n}", "static putFile (bucketName, objectKey, objectBody) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey,\n Body: objectBody\n };\n return new Promise((resolve, reject) => {\n s3.upload(params, (err, data) => err ? reject(err) : resolve(data.Location));\n });\n }", "function StorageObject() {\n}", "function multipartUpload(service, location, mappings, blob, metadata) {\n var urlPart = location.bucketOnlyServerUrl();\n var headers = {\n 'X-Goog-Upload-Protocol': 'multipart'\n };\n function genBoundary() {\n var str = '';\n for (var i = 0; i < 2; i++) {\n str = str + Math.random().toString().slice(2);\n }\n return str;\n }\n var boundary = genBoundary();\n headers['Content-Type'] = 'multipart/related; boundary=' + boundary;\n var metadata_ = metadataForUpload_(location, blob, metadata);\n var metadataString = toResourceString(metadata_, mappings);\n var preBlobPart = '--' +\n boundary +\n '\\r\\n' +\n 'Content-Type: application/json; charset=utf-8\\r\\n\\r\\n' +\n metadataString +\n '\\r\\n--' +\n boundary +\n '\\r\\n' +\n 'Content-Type: ' +\n metadata_['contentType'] +\n '\\r\\n\\r\\n';\n var postBlobPart = '\\r\\n--' + boundary + '--';\n var body = FbsBlob.getBlob(preBlobPart, blob, postBlobPart);\n if (body === null) {\n throw cannotSliceBlob();\n }\n var urlParams = { name: metadata_['fullPath'] };\n var url = makeUrl(urlPart);\n var method = 'POST';\n var timeout = service.maxUploadRetryTime;\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\n requestInfo.urlParams = urlParams;\n requestInfo.headers = headers;\n requestInfo.body = body.uploadData();\n requestInfo.errorHandler = sharedErrorHandler(location);\n return requestInfo;\n}", "function multipartUpload(service, location, mappings, blob, metadata) {\n var urlPart = location.bucketOnlyServerUrl();\n var headers = {\n 'X-Goog-Upload-Protocol': 'multipart'\n };\n function genBoundary() {\n var str = '';\n for (var i = 0; i < 2; i++) {\n str = str + Math.random().toString().slice(2);\n }\n return str;\n }\n var boundary = genBoundary();\n headers['Content-Type'] = 'multipart/related; boundary=' + boundary;\n var metadata_ = metadataForUpload_(location, blob, metadata);\n var metadataString = toResourceString(metadata_, mappings);\n var preBlobPart = '--' +\n boundary +\n '\\r\\n' +\n 'Content-Type: application/json; charset=utf-8\\r\\n\\r\\n' +\n metadataString +\n '\\r\\n--' +\n boundary +\n '\\r\\n' +\n 'Content-Type: ' +\n metadata_['contentType'] +\n '\\r\\n\\r\\n';\n var postBlobPart = '\\r\\n--' + boundary + '--';\n var body = FbsBlob.getBlob(preBlobPart, blob, postBlobPart);\n if (body === null) {\n throw cannotSliceBlob();\n }\n var urlParams = { name: metadata_['fullPath'] };\n var url = makeUrl(urlPart, service.host);\n var method = 'POST';\n var timeout = service.maxUploadRetryTime;\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\n requestInfo.urlParams = urlParams;\n requestInfo.headers = headers;\n requestInfo.body = body.uploadData();\n requestInfo.errorHandler = sharedErrorHandler(location);\n return requestInfo;\n}", "function multipartUpload(service, location, mappings, blob, metadata) {\n var urlPart = location.bucketOnlyServerUrl();\n var headers = {\n 'X-Goog-Upload-Protocol': 'multipart'\n };\n function genBoundary() {\n var str = '';\n for (var i = 0; i < 2; i++) {\n str = str + Math.random().toString().slice(2);\n }\n return str;\n }\n var boundary = genBoundary();\n headers['Content-Type'] = 'multipart/related; boundary=' + boundary;\n var metadata_ = metadataForUpload_(location, blob, metadata);\n var metadataString = toResourceString(metadata_, mappings);\n var preBlobPart = '--' +\n boundary +\n '\\r\\n' +\n 'Content-Type: application/json; charset=utf-8\\r\\n\\r\\n' +\n metadataString +\n '\\r\\n--' +\n boundary +\n '\\r\\n' +\n 'Content-Type: ' +\n metadata_['contentType'] +\n '\\r\\n\\r\\n';\n var postBlobPart = '\\r\\n--' + boundary + '--';\n var body = FbsBlob.getBlob(preBlobPart, blob, postBlobPart);\n if (body === null) {\n throw cannotSliceBlob();\n }\n var urlParams = { name: metadata_['fullPath'] };\n var url = makeUrl(urlPart, service.host);\n var method = 'POST';\n var timeout = service.maxUploadRetryTime;\n var requestInfo = new RequestInfo(url, method, metadataHandler(service, mappings), timeout);\n requestInfo.urlParams = urlParams;\n requestInfo.headers = headers;\n requestInfo.body = body.uploadData();\n requestInfo.errorHandler = sharedErrorHandler(location);\n return requestInfo;\n}", "resetBucket() {\n this.cacheBucket = '';\n }", "function main(bucketName = 'my-bucket') {\n // [START storage_get_uniform_bucket_level_access]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n async function getUniformBucketLevelAccess() {\n // Gets Bucket Metadata and checks if uniform bucket-level access is enabled.\n const [metadata] = await storage.bucket(bucketName).getMetadata();\n\n if (metadata.iamConfiguration) {\n const uniformBucketLevelAccess =\n metadata.iamConfiguration.uniformBucketLevelAccess;\n console.log(`Uniform bucket-level access is enabled for ${bucketName}.`);\n console.log(\n `Bucket will be locked on ${uniformBucketLevelAccess.lockedTime}.`\n );\n } else {\n console.log(\n `Uniform bucket-level access is not enabled for ${bucketName}.`\n );\n }\n }\n\n getUniformBucketLevelAccess().catch(console.error);\n\n // [END storage_get_uniform_bucket_level_access]\n}", "upload() {\n let [ssName, storageService] = getStorageService();\n\n if (this.state == local_file) {\n console.log('uploading file: ', this.originalFileName);\n let oldLocation = this._obj.location;\n return storageService.upload(oldLocation, this.originalFileName)\n .then(remoteFile => {\n this._obj.ss = ssName;\n this._obj.state = remote_file;\n this._obj.location = remoteFile.dbRepresentation.location;\n console.log(\"uploaded file.\");\n\n return deleteFile(oldLocation);\n })\n .catch(e => {\n console.error(e);\n console.log(\"error while uploading file.\");\n });\n } else if(this.state == remote_file) {\n return Promise.resolve();\n } else {\n return Promise.reject('There is no file to upload.');\n }\n }", "createFilePointerBucket(){\n var total=fs.fstatSync(this.fd).size;\n var iterLeft=this.iterLeft(total,this.indexing_buffer_size);\n var iter=iterLeft[0];\n var left=iterLeft[1];\n var position=0;\n this.filePointerBucketHelper(iter,left,position)\n var json = JSON.stringify(this.bucket);\n fs.writeFileSync(this.file_bucket_path, json, 'utf8');\n // console.log(l)\n }", "function main(\n bucketName = 'my-bucket',\n fileName = 'test.txt',\n oldKey = process.env.GOOGLE_CLOUD_KMS_KEY_US,\n newKey = process.env.GOOGLE_CLOUD_KMS_KEY_ASIA,\n generationMatchPrecondition = 0\n) {\n // [START storage_rotate_encryption_key]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The ID of your GCS bucket\n // const bucketName = 'your-unique-bucket-name';\n\n // The ID of your GCS file\n // const fileName = 'your-file-name';\n\n // The Base64 encoded AES-256 encryption key originally used to encrypt the\n // object. See the documentation on Customer-Supplied Encryption keys for\n // more info:\n // https://cloud.google.com/storage/docs/encryption/using-customer-supplied-keys\n // The Base64 encoded AES-256 encryption key originally used to encrypt the\n // const oldKey = 'TIbv/fjexq+VmtXzAlc63J4z5kFmWJ6NdAPQulQBT7g=';\n\n // The new encryption key to use\n // const newKey = '0mMWhFvQOdS4AmxRpo8SJxXn5MjFhbz7DkKBUdUIef8=';\n\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n\n async function rotateEncryptionKey() {\n const rotateEncryptionKeyOptions = {\n encryptionKey: Buffer.from(newKey, 'base64'),\n\n // Optional: set a generation-match precondition to avoid potential race\n // conditions and data corruptions. The request to copy is aborted if the\n // object's generation number does not match your precondition.\n preconditionOpts: {\n ifGenerationMatch: generationMatchPrecondition,\n },\n };\n await storage\n .bucket(bucketName)\n .file(fileName, {\n encryptionKey: Buffer.from(oldKey, 'base64'),\n })\n .rotateEncryptionKey({\n rotateEncryptionKeyOptions,\n });\n\n console.log('Encryption key rotated successfully');\n }\n\n rotateEncryptionKey().catch(console.error);\n // [END storage_rotate_encryption_key]\n}", "async storeInCloudStorage(file) {\n await uploadFile(BUCKET_NAME, file);\n }", "function onBucketCreated(response) {\n\n console.log('[Uploading to A360 started...] ' +jobStatus.jobId);\n\n fs.stat(serverFile, function (err, stats) {\n if (err) {\n console.log('Uploading to A360 failed...' + err);\n }\n var total = stats.size;\n var chunkSize = config.fileResumableChunk * 1024 * 1024;\n\n if( total > chunkSize)\n {\n console.log(' Resumable uploading for large file...' +jobStatus.jobId);\n\n lmv.resumableUpload(serverFile,\n config.defaultBucketKey,\n jobStatus.jobId,uploadProgressCallback).then(onResumableUploadCompleted, onError);\n }\n else\n {\n //single uploading\n console.log(' Single uploading for small file...' +jobStatus.jobId);\n lmv.upload(serverFile,\n config.defaultBucketKey,\n jobStatus.jobId).then(onSingleUploadCompleted, onError);\n }\n });\n }", "completeMultiUpload() {\n var self = this;\n var outputTag = [];\n /*\n here we are constructing the Etag data in the required format.\n */\n self.etag.forEach((data, index) => {\n const obj = {\n ETag: data,\n PartNumber: ++index\n };\n outputTag.push(obj);\n });\n\n var params = {\n Bucket: 'ankurself', // required\n Key: self.filename, // required\n UploadId: self.uploadId, // required\n MultipartUpload: {\n Parts: outputTag\n }\n };\n\n self.s3.completeMultipartUpload(params, function(err, data) {\n if (err) {\n console.log(err, err.stack);\n } // an error occurred\n else {\n self.saveVideoURL(data.Location);\n // initialize variable back to normal\n self.etag = [];\n self.recordedChunks = [];\n self.uploadId = '';\n self.booleanStop = false;\n // self.disableAllButton();\n // self.removeLoader();\n alert('we have successfully saved the questionaire..');\n }\n });\n }", "async init() {\n this.debug(`creating ${this.bucket}`);\n await createS3Bucket(this.s3, this.bucket, this.region, this.acl, this.lifespan);\n this.debug(`creating ${this.bucket}`);\n }", "constructor(url, pipeline) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n this.pipeline = pipeline;\n this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions());\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n this.credential = new AnonymousCredential();\n for (const factory of this.pipeline.factories) {\n if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) ||\n factory instanceof AnonymousCredential) {\n this.credential = factory;\n }\n else if (coreHttp.isTokenCredential(factory.credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n this.credential = factory.credential;\n }\n }\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext;\n storageClientContext.requestContentType = undefined;\n }", "constructor(url, pipeline) {\n // URL should be encoded and only once, protocol layer shouldn't encode URL again\n this.url = escapeURLPath(url);\n this.accountName = getAccountNameFromUrl(url);\n this.pipeline = pipeline;\n this.storageClientContext = new StorageClientContext(this.url, pipeline.toServiceClientOptions());\n this.isHttps = iEqual(getURLScheme(this.url) || \"\", \"https\");\n this.credential = new AnonymousCredential();\n for (const factory of this.pipeline.factories) {\n if ((coreHttp.isNode && factory instanceof StorageSharedKeyCredential) ||\n factory instanceof AnonymousCredential) {\n this.credential = factory;\n }\n else if (coreHttp.isTokenCredential(factory.credential)) {\n // Only works if the factory has been attached a \"credential\" property.\n // We do that in newPipeline() when using TokenCredential.\n this.credential = factory.credential;\n }\n }\n // Override protocol layer's default content-type\n const storageClientContext = this.storageClientContext;\n storageClientContext.requestContentType = undefined;\n }", "upload () {\n return this.loader.file.then(async file => {\n try {\n const format = file.name.split('.')[1]\n const filePath = `images/${new Date().getTime()}.${format}`\n const fileSnapshot = await firebase\n .storage()\n .ref(filePath)\n .put(file)\n const url = await fileSnapshot.ref.getDownloadURL()\n console.log('url: ', url)\n return { default: url }\n } catch (error) {\n console.error(error)\n }\n })\n }", "function storeImage(imageData,a,b){\n var max = 4;\n var name = a.toString().replace(/\\./g,'x')+\"and\"+ b.toString().replace(/\\./g,'y');\n console.log(\"in store image:\"+imageData)\n var storageRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage().ref(name+\"/\");\n // Create a root reference\n\n var imageName = Date.now()+\".image\";\n var uploadTask = storageRef.child(imageName).putString(imageData, 'data_url');\n uploadTask.on('state_changed', function(snapshot){\n // Observe state change events such as progress, pause, and resume\n // code snippet from firebase documentation adapted\n switch (snapshot.state) {\n case __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n}, function(error) {\n // Handle unsuccessful uploads\n}, function() {\n console.log(\"sucess!\")\n var hash = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__backend_js__[\"c\" /* getHash */])(a,b);\n var firebaseRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].database().ref(\"info\"); //top level <info>\n var infoRef = firebaseRef.child(hash);\n var src = infoRef.child(\"url\");\n src.set(uploadTask.snapshot.downloadURL);\n\n});\n}", "async function createSignedGsUrl(serviceAccountKey, {bucket, name}) {\n const storage = new Storage({ credentials: serviceAccountKey });\n const response = await storage.bucket(bucket).file(name).getSignedUrl({ action: 'read', expires: Date.now() + 36e5 });\n return response[0];\n}", "async function uploadFiles(pics) {\n let fileBuckets = [];\n let urls = [];\n //Upload the news pics\n for (const pic of pics) {\n\n console.log(pic);\n let img = pic.buffer;\n let filename = pic.originalname;\n let imageBuffer = new Uint8Array(img);\n let fileBucket = bucket.file(\"upload/news\" + filename);\n fileBuckets.push(fileBucket);\n\n await fileBucket.save(imageBuffer, {\n metadata: {\n contentType: pic.mimeType\n },\n });\n }\n\n for(let fileBucket of fileBuckets) {\n await fileBucket.getSignedUrl(options)\n .then(results => {\n const url = results[0];\n urls.push(url);\n });\n }\n return urls;\n}", "async function run() {\n let blob = new BlobStorage(config.storageAccount,config.storageKey);\n //blob.uploadFile('blobbyvolley', 'neuer-blob1',sourceFilePath);\n blob.createAppendBlob('logfiles','kalender');\n blob.createAppendBlob('logfiles','users');\n blob.createAppendBlob('logfiles','events');\n}", "function initializeApi() {\n gapi.client.load('storage', API_VERSION);\n}", "export() {\n return {\n bucketArn: new cdk.CfnOutput(this, 'BucketArn', { value: this.bucketArn }).makeImportValue().toString(),\n bucketName: new cdk.CfnOutput(this, 'BucketName', { value: this.bucketName }).makeImportValue().toString(),\n bucketDomainName: new cdk.CfnOutput(this, 'DomainName', { value: this.domainName }).makeImportValue().toString(),\n bucketWebsiteUrl: new cdk.CfnOutput(this, 'WebsiteURL', { value: this.bucketWebsiteUrl }).makeImportValue().toString()\n };\n }", "function del_Face(){\n\t\t\t\t// The name of the bucket to access, e.g. \"my-bucket\"\n\t\t\t\tvar bucketName = 'smartmirrortest'\n\n\t\t\t\t// The name of the file to delete, e.g. \"file.txt\"\n\t\t\t\t const filename = formatted+'face.jpg';\n\n\t\t\t\t// Instantiates a client\n\t\t\t\n\n\t\t\t\t// Deletes the file from the bucket\n\t\t\t\tgcs\n\t\t\t\t .bucket(bucketName)\n\t\t\t\t .file(filename)\n\t\t\t\t .delete()\n\t\t\t\t .then(() => {\n\t\t\t\t\tconsole.log(`gs://${bucketName}/${filename} deleted.`);\n\t\t\t\t })\n\t\t\t\t .catch((err) => {\n\t\t\t\t\tconsole.error('ERROR:', err);\n\t\t\t\t });\n\t\t\t}", "constructor(storageAPI) {\n this.api = storageAPI;\n }", "async uploadFile(file, filename, options) {\n const MB = Math.pow(2, 20);\n let cancelled = false;\n if (options.onCancelToken) {\n options.onCancelToken(() => {\n cancelled = true;\n });\n }\n this.isCanceled(cancelled);\n const uploadID = await this.createMultipartUpload(filename, options);\n const bytesPerChunk = options.chunkSize || 7 * MB;\n const fileSize = file.length || file.size;\n const chunkAmount = Math.floor(fileSize / bytesPerChunk) + 1;\n const partsPerTime = 3;\n if (chunkAmount > 1 && bytesPerChunk < 5 * MB) {\n throw new Error(\"Chunk sizes cannot be lower than 5mb if the upload will have multiple parts\");\n }\n let offsetStart = 0;\n let offsetEnd = bytesPerChunk;\n let partNumber = 1;\n let error = null;\n const parts = [];\n const promises = [];\n this.isCanceled(cancelled);\n while (offsetStart < fileSize) {\n const sliced = file.slice(offsetStart, offsetEnd);\n while (promises.length >= partsPerTime) {\n this.isCanceled(cancelled);\n if (error) {\n throw error;\n }\n await sleep_1.default(1000);\n }\n const promise = this._addToQueue(filename, uploadID, partNumber, sliced, options);\n promises.push(promise);\n promise.then((partData) => {\n if (promises.indexOf(promise) >= 0) {\n promises.splice(promises.indexOf(promise), 1);\n }\n parts.push(partData);\n if (options.onProgress) {\n const percentage = (parts.length * 100) / chunkAmount;\n const limitedPercentage = Math.min(percentage, 100).toFixed(2);\n const roundedPercentage = Number(limitedPercentage);\n options.onProgress(roundedPercentage);\n }\n });\n promise.catch((err) => {\n error = err;\n });\n this.isCanceled(cancelled);\n await sleep_1.default(500);\n offsetStart = offsetEnd;\n offsetEnd = offsetStart + bytesPerChunk;\n partNumber += 1;\n }\n while (promises.length > 0) {\n this.isCanceled(cancelled);\n if (error) {\n throw error;\n }\n await sleep_1.default(1000);\n }\n this.isCanceled(cancelled);\n for (let i = 0; i < 3; i += 1) {\n try {\n return this._completeMultipartUpload(filename, uploadID, parts, options);\n }\n catch (ex) {\n await sleep_1.default(1000);\n if (i === 2) {\n throw ex;\n }\n }\n }\n }", "function GitStorage () {}", "snippetsWorkspaceEncodedIdNodeIdFilesPathGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.SnippetsApi(); // String | // String | // String | // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.\n /*let path = \"path_example\";*/ /*let nodeId = \"nodeId_example\";*/ /*let encodedId = \"encodedId_example\";*/ /*let workspace = \"workspace_example\";*/ apiInstance.snippetsWorkspaceEncodedIdNodeIdFilesPathGet(\n incomingOptions.path,\n incomingOptions.nodeId,\n incomingOptions.encodedId,\n incomingOptions.workspace,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function upload(file_path, bucket, title, audio_id, data_type=\"fingerprint\", custom_fields=None, cb) {\n var current_data = new Date();\n var timestamp = current_data.getTime()/1000;\n\n var stringToSign = buildStringToSign('POST',\n defaultOptions.endpoint,\n defaultOptions.access_key,\n defaultOptions.signature_version,\n timestamp);\n console.log(stringToSign)\n\n var signature = sign(stringToSign, defaultOptions.access_secret);\n console.log(signature)\n\n var headers = {\n 'access-key': defaultOptions.access_key,\n 'signature-version': defaultOptions.signature_version,\n 'signature': signature,\n 'timestamp':timestamp\n };\n var formData = {\n 'audio_file': {\n 'value': fs.createReadStream(file_path),\n 'options': {\n 'filename': path.basename(file_path),\n 'contentType': 'fingerprint/lo'\n }\n },\n 'data_type':data_type,\n 'bucket_name':bucket,\n 'title':title,\n 'audio_id':audio_id,\n }\n if (custom_fields) {\n keys = []\n values = []\n for (var k in custom_fields) {\n keys.push(k)\n values.push(custom_fields[k])\n }\n formData['custom_key[]'] = keys\n formData['custom_value[]'] = values\n }\n\n request.post({\n url: \"https://\"+defaultOptions.host + defaultOptions.endpoint,\n method: 'POST',\n headers: headers,\n formData: formData\n }, cb);\n}", "function fillstorage() {\n const obj_1 = 'some_content';\n const obj_2 = {bar: 'baz'};\n\n// save to file\n const id = storage.put(obj_2);\n console.log(id)\n const everything = storage.all();\n console.log(everything)\n}", "supportsUploads() {\n return true;\n }", "function getGlobDataAPI(){\n\n}", "putObject(image, options) {\n const params = {\n Bucket: image.bucketName,\n Key: image.fileName,\n Body: image.data,\n Metadata: Object.assign({}, image.headers.Metadata, {\"cdn-processed\": \"true\"}),\n ContentType: image.headers.ContentType,\n CacheControl: (options.cacheControl !== undefined) ? options.cacheControl : image.headers.CacheControl,\n ACL: image.acl || \"private\"\n };\n\n console.log(\"Uploading to: \" + params.Key + \" (\" + params.Body.length + \" bytes)\");\n\n return this.client.putObject(params).promise();\n }", "function insertBucket() {\n resource = {\n 'name': BUCKET\n };\n\n var request = gapi.client.storage.buckets.insert({\n 'project': PROJECT,\n 'resource': resource\n });\n executeRequest(request, 'insertBucket');\n}", "async multipartInit() {\n if (this.cacheData.UploadId) {\n return;\n }\n const { Bucket, Region, Key } = this.getParams();\n const { ContentLength, ...multipartInitParams } = this.object;\n if (this.mode === 'NEW_UPLOAD_ID_ONLY') {\n const { UploadId } = await this.cosSdkInstance.multipartInitRetry(multipartInitParams);\n this.cacheData.UploadId = UploadId;\n } else {\n const { Upload = [] } = await this.cosSdkInstance.multipartListRetry({\n Bucket,\n Region,\n Prefix: Key,\n });\n const uploadIds = Upload.filter(item => item.Key === Key).map(item => item.UploadId);\n if (uploadIds.length) {\n this.cacheData.UploadId = uploadIds[0];\n } else {\n const { UploadId } = await this.cosSdkInstance.multipartInitRetry(multipartInitParams);\n this.cacheData.UploadId = UploadId;\n }\n }\n this.cacheData.Parts = [];\n }", "handleUpload () {\n var uploadTask = storage.ref(`images/${this.state.image.name}`).put(this.state.image);\n uploadTask.on(\n \"state_changed\",\n snapshot => {\n var progress = Math.round(\n (snapshot.bytesTransferred / snapshot.totalBytes) * 100\n );\n this.setState({\n progress:progress})\n },\n error => {\n console.log(error);\n },\n () => {\n storage\n .ref(\"images\")\n .child(this.state.image.name)\n .getDownloadURL()\n .then(url => {\n this.setState({\n url : url\n })\n });\n }\n );\n }", "static get uploadFields () { return {} }", "function getPublicUrl (filename,bucketName) {\n return `https://storage.googleapis.com/${bucketName}/${filename}`;\n}", "static storage_path() { return '.'; }", "function main(bucketName = 'my-bucket') {\n // [START storage_set_public_access_prevention_unspecified]\n /**\n * TODO(developer): Uncomment the following lines before running the sample.\n */\n // The name of your GCS bucket\n // const bucketName = 'Name of a bucket, e.g. my-bucket';\n // Imports the Google Cloud client library\n const {Storage} = require('@google-cloud/storage');\n\n // Creates a client\n const storage = new Storage();\n async function setPublicAccessPreventionUnspecified() {\n // Sets public access prevention to 'unspecified' for the bucket\n await storage.bucket(bucketName).setMetadata({\n iamConfiguration: {\n publicAccessPrevention: 'unspecified',\n },\n });\n\n console.log(`Public access prevention is 'unspecified' for ${bucketName}.`);\n }\n\n setPublicAccessPreventionUnspecified();\n // [END storage_set_public_access_prevention_unspecified]\n}", "async uploadImageToFirebase(imageData, imgTypeName, ID) {\n return new Promise(async (resolve) => {\n let date = moment(new Date()).format(\"YYYYMMDDHHmmss\");\n const storageRef = storage()\n .ref(imgTypeName + \"-\" + ID + \"-\" + date)\n .putFile(imageData);\n storageRef.on(\n `state_changed`,\n (snapshot) => {\n this.uploadValue =\n (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n },\n (error) => {\n console.log(error.message);\n },\n async () => {\n this.uploadValue = 100;\n storageRef.snapshot.ref.getDownloadURL().then((url) => {\n resolve(url);\n });\n }\n );\n });\n }", "function getSignedUrl(filename, filetype, foldername, operation) {\n const folderName = foldername;\n const params = {\n Bucket: 'gsg-image-uploads',\n Key: `${folderName}/` + filename,\n Expires: 604800\n };\n if(operation==='putObject'){\n params['ContentType'] = filetype;\n }\n return new Promise((resolve, reject) => {\n s3.getSignedUrl(operation, params, function(err, data) {\n if (err) {\n console.log(\"Error\",err);\n reject(err)\n } else {\n resolve(data)\n }\n });\n });\n}", "function insertObject(event) {\n try{\n var fileData = event.target.files[0];\n }\n catch(e) {\n //'Insert Object' selected from the API Commands select list\n //Display insert object button and then exit function\n filePicker.style.display = 'block';\n return;\n }\n const boundary = '-------314159265358979323846';\n const delimiter = \"\\r\\n--\" + boundary + \"\\r\\n\";\n const close_delim = \"\\r\\n--\" + boundary + \"--\";\n\n var reader = new FileReader();\n reader.readAsBinaryString(fileData);\n reader.onload = function(e) {\n var contentType = fileData.type || 'application/octet-stream';\n var metadata = {\n 'name': fileData.name,\n 'mimeType': contentType\n };\n\n var base64Data = btoa(reader.result);\n var multipartRequestBody =\n delimiter +\n 'Content-Type: application/json\\r\\n\\r\\n' +\n JSON.stringify(metadata) +\n delimiter +\n 'Content-Type: ' + contentType + '\\r\\n' +\n 'Content-Transfer-Encoding: base64\\r\\n' +\n '\\r\\n' +\n base64Data +\n close_delim;\n\n //Note: gapi.client.storage.objects.insert() can only insert\n //small objects (under 64k) so to support larger file sizes\n //we're using the generic HTTP request method gapi.client.request()\n var request = gapi.client.request({\n 'path': '/upload/storage/' + API_VERSION + '/b/' + BUCKET + '/o',\n 'method': 'POST',\n 'params': {'uploadType': 'multipart'},\n 'headers': {\n 'Content-Type': 'multipart/mixed; boundary=\"' + boundary + '\"'\n },\n 'body': multipartRequestBody});\n //Remove the current API result entry in the main-content div\n listChildren = document.getElementById('main-content').childNodes;\n if (listChildren.length > 1) {\n listChildren[1].parentNode.removeChild(listChildren[1]);\n }\n try{\n //Execute the insert object request\n executeRequest(request, 'insertObject');\n //Store the name of the inserted object\n object = fileData.name;\n }\n catch(e) {\n alert('An error has occurred: ' + e.message);\n }\n }\n}", "function createPublicFileURL(storageName) {\n return `http://storage.googleapis.com/${bucketName}/${encodeURIComponent(storageName)}`;\n}", "get CompressedHQ() {}", "function createBlob() {\n}", "function song(path){\n if ( path.substr(0,4)==\"http\" ){\n path = path.replace(\"https://tabs.ultimate-guitar.com/\",\"\");\n } \n var key = datastore.key([ DS_KIND, path ]);\n //console.log('key',key);\n return datastore.get(key)\n .then((entities)=>{\n\n var existingPath = _.get( entities,'0.path',false); \n\n /** CASE: A**/\n if (existingPath){ \n //we already have the html, we just need to update the metadata field so storage pubsub event fires\n console.log(\"we already have the html, we just need to update the metadata field so storage pubsub event fires\");\n return {\n success: true,\n statements: [ 'Got it' ]\n }\n }\n\n /** CASE: B **/\n //fetch the html from ultimate guitar\n var rc = {\n url:path,\n method: 'get',\n httpsAgent: S.agentHttps\n }\n \n var pathToTmp = \"/tmp/\"+path.replace(/\\//g,\"_\")+\".html\";\n console.log(\"fetching pre_html stored at \" + path);\n return S.Song.request(rc)\n .then((res)=>{\n var nn = $(\"pre.js-tab-content.js-copy-content.js-tab-controls-item\",res.data);\n //console.log(nn); console.log(nn.length);\n if(nn.length===0){\n throw new Error(\"Failed to fetch chord sheet\");\n }\n\n var pre_html = nn.eq(0).html();\n console.log('len of pre_html',pre_html.length);\n\n /*\n * got the html we want\n * 1. store it in storage bucket song-chords/path/to/chordsheet\n * 2. update datastore record to indicate we have the html\n */\n console.log(\"writing to \", pathToTmp);\n return write(pathToTmp,pre_html)\n })\n .then(( )=>{\n console.log(\"write to tmp ok\");\n var opts = { resumable: true, gzip: true, predefinedAcl:'publicRead', destination: path };\n return S.songBkt.upload(pathToTmp,opts);\n }) \n .then(( )=>{\n console.log(\"upload ok to \" + path);\n var r = {\n path: path\n }\n return datastore.get(key)\n })\n .then((entities)=>{\n console.log(\"got datastore entities\" , entities.length);\n entities[0].path = path;\n return datastore.update({ key: key, data: entities[0] })\n })\n .then((datastoreUpdateResult)=>{\n return {\n success: true,\n statements: [ 'Got It' ]\n }\n })\n .catch((err) =>{\n var statusCode = _.get(err,'response.status',-1);\n switch(statusCode){\n case -1:\n return {\n statements: [ \"Something went wrong parsing the chord sheet.\" ],\n success: false,\n err: err\n }\n case 404: \n return {\n statements: [ \"The chord is no longer available at Ultimate Guitar\" ],\n success: false,\n }\n default: \n return {\n statements: [ \"Something went wrong with fetching the chord from Ultimate Guitar.\" ],\n success: false,\n err: err.response.statusText\n }\n break;\n }\n })\n\n })\n .then((pkg)=>{\n if ( !pkg.success ) {\n console.log(\"pkg.success failed\", pkg);\n return pkg; //failed\n }\n\n\n //update meta so chromecast sender app Express erver get's gets notified (via storage pub/sub)\n //which will notify chromecast sender client (on chrome browser) via socket.io\n var pubnubPayload = {\n kind: \"chords\", pathToChords: path.replace(\"https://tabs.ultimate-guitar.com/\",\"\")\n }\n return publishToPubNubCastawayChannel(pubnubPayload)\n .then((r)=>{\n console.log('publishToPubNubResult',r);\n return pkg;\n })\n .catch((errB)=>{ \n console.log('errB');\n console.error(errB);\n throw errB; \n })\n })\n .catch((err)=>{\n return { //failed\n statements: [ \"Something went wrong with fetching the chord sheet.\" ],\n success: false,\n err: err.response.statusText\n }\n })\n}", "async findTempRegister() {\n try {\n this.client = await client.connect();\n console.log(\"Connected correctly to server\");\n const db = this.client.db(dbName);\n const col = this.client.db(dbName).collection('registers');\n const bucket = new mongodb.GridFSBucket(db, {\n bucketName: 'photos'\n });\n var docs;\n var docsId, doc, fileName = [];\n\n var numberDoc = await col.count({ isTemporary: true });\n var tempCollection = await col.find({ isTemporary: true }).toArray();\n docsId = await col.find({ isTemporary: true }).project({ _id: 0, image_id: 1 }).toArray();\n\n // //get name of the file based on \"id_image\" field in collection \"registers\" \n for (var i = 0; i < numberDoc; i++) {\n var docsSplitted = (JSON.stringify(docsId[i])).split('\"');\n var idSingleDoc = (docsSplitted[3]);\n var fileNamesObj = await bucket.find(ObjectId(idSingleDoc)).project({ _id: 1, filename: 1 }).toArray();\n var fileNamesSplitted = (JSON.stringify(fileNamesObj)).split('\"');\n fileName[i] = fileNamesSplitted[7];\n bucket.openDownloadStreamByName(fileName[i])\n .pipe(fs.createWriteStream(\"./public/images/photos/\" + fileName[i]))\n .on('error', function (error) {\n assert.ifError(error);\n }).on('end', function (img) {\n process.exit(0);\n });\n fileName = fileName;\n }\n return doc = {\n tempCollection: tempCollection,\n numberDoc: numberDoc,\n fileName: fileName\n }\n\n } catch (error) {\n console.log(\"Error with data: \", error);\n }\n }", "function refreshStorageListing() {\n ExportSave();\n var keys = getLocalStorageKeys();\n var blobPairs = [];\n for (var index = 0; index < keys.length; ++index) {\n blobPairs[index] = [keys[index], JSON.stringify(findValue(keys[index]))];\n }\n\n var file = base64(generateMultiBlob(blobPairs));\n ref.set(file)\n console.log(\"exported\")\n\n //\"data:application/octet-stream;base64,\" +\n //push save data to aws //////////////////////////////////////////////////////////////////////////////////////////////////\n //this.download = \"gameboy_advance_saves_\" + ((new Date()).getTime()) + \".export\";\n\n}", "async createFile(name, filePath, fileKeys) {\n let auth = this.auth;\n let res = {\"fileId\": \"\", \"keyId\": \"\", \"name\": name, keys: fileKeys};\n var drive = google.drive({ version: 'v3', auth });\n var fileMetadata = {\n 'name': name\n };\n var media = {\n mimeType: 'text/plain', \n body: fs.createReadStream(filePath+\".enc\")\n };\n var key_media = {\n mimeType: 'text/plain', \n body: fs.createReadStream(filePath+\".key\")\n }\n \n const fileRes = await drive.files.create({\n resource: fileMetadata,\n media: media,\n fields: 'id'\n });\n res.fileId = fileRes.data.id;\n fs.unlinkSync(filePath+\".enc\");\n \n const keyRes = await drive.files.create({\n resource: {\n 'name': fileMetadata[\"name\"] + \".key\"\n },\n media: key_media,\n fields: 'id'\n });\n res.keyId = keyRes.data.id;\n fs.unlinkSync(filePath+\".key\");\n this.db.collection('filesCollection').insertOne(res);\n var jsonUpload= {\n \"$class\": \"org.example.mynetwork.Document\",\n \"DocumentId\" : res.fileId.toString(),\n \"owner\": \"u1\",\n \"description\": \"test\",\n \"UsersWithAccess\": [\n \"u1\"\n ]\n };\n request.post(this.BLOCKCHAIN_URL+'/api/Document',{json: jsonUpload}, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(body)\n }\n });\n return res;\n }", "function uploadToFirebase(image, name){\n var storageRef = firebase.storage().ref('images/' + app.blgName + \"/\"+ name);\n storageRef.put(image).then(function(snapshot){\n storageRef.getDownloadURL().then(function(url) {\n var arg = {\n \"url\": url,\n \"filename\": name\n };\n firebaseUrls.push(arg);\n }).catch(function(error) {\n switch (error.code) {\n case 'storage/object-not-found':\n // File doesn't exist\n console.log(\"File doesn't exist\")\n return false;\n break;\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n console.log(\"User doesn't have permission to access the object\")\n return false;\n break;\n case 'storage/canceled':\n // User canceled the upload\n console.log(\"User canceled the upload\")\n return false;\n break;\n case 'storage/unknown':\n // Unknown error occurred, inspect the server response\n console.log(\"Unknown error occurred, inspect the server response\");\n return false;\n break;\n }\n });\n });\n}", "function destroyFromGCS(storageFilePath) {\n let promise = new Promise((resolve, reject) => {\n const bucket = admin.storage().bucket();\n const file = bucket.file(storageFilePath);\n\n // storage.bucket(bucketName).file(storageFilePath).delete();\n file.delete().then(() => {\n // Deleted\n resolve();\n }).catch(err => {\n reject(err);\n });\n });\n return promise;\n}", "snippetsWorkspaceEncodedIdFilesPathGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.SnippetApi(); // String | // String | // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`.\n /*let path = \"path_example\";*/ /*let encodedId = \"encodedId_example\";*/ /*let workspace = \"workspace_example\";*/ apiInstance.snippetsWorkspaceEncodedIdFilesPathGet(\n incomingOptions.path,\n incomingOptions.encodedId,\n incomingOptions.workspace,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "repositoriesWorkspaceRepoSlugRefsTagsGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.RefsApi(); // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. // String | This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`. // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.\n /*let workspace = \"workspace_example\";*/ /*let username = \"username_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ let opts = {\n // 'q': \"q_example\", // String | Query string to narrow down the response as per [filtering and sorting](../../../../../meta/filtering).\n // 'sort': \"sort_example\" // String | Field by which the results should be sorted as per [filtering and sorting](../../../../../meta/filtering). The `name` field is handled specially for tags in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].\n };\n\n if (incomingOptions.opts)\n Object.keys(incomingOptions.opts).forEach(\n (key) =>\n incomingOptions.opts[key] === undefined &&\n delete incomingOptions.opts[key]\n );\n else delete incomingOptions.opts;\n incomingOptions.opts = Object.assign(opts, incomingOptions.opts);\n\n apiInstance.repositoriesWorkspaceRepoSlugRefsTagsGet(\n incomingOptions.workspace,\n incomingOptions.username,\n incomingOptions.repoSlug,\n incomingOptions.opts,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "async function endpointsCreateOrUpdateAzureStorageSmbFileShare() {\n const subscriptionId =\n process.env[\"STORAGEMOVER_SUBSCRIPTION_ID\"] || \"60bcfc77-6589-4da2-b7fd-f9ec9322cf95\";\n const resourceGroupName = process.env[\"STORAGEMOVER_RESOURCE_GROUP\"] || \"examples-rg\";\n const storageMoverName = \"examples-storageMoverName\";\n const endpointName = \"examples-endpointName\";\n const endpoint = {\n properties: {\n description: \"Example Storage File Share Endpoint Description\",\n endpointType: \"AzureStorageSmbFileShare\",\n fileShareName: \"examples-fileshare\",\n storageAccountResourceId:\n \"/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new StorageMoverClient(credential, subscriptionId);\n const result = await client.endpoints.createOrUpdate(\n resourceGroupName,\n storageMoverName,\n endpointName,\n endpoint\n );\n console.log(result);\n}", "function uploadCSV() {\n\tvar csv_file_path = './test.csv.gz';\n\tgServerTime = admin.database.ServerValue.TIMESTAMP;\n\tconst fileMime = mime.lookup(csv_file_path);\n\tvar csv_file_name = path.basename(csv_file_path);\n\tvar uploadTo = path.join(SENSORSTORAGES_TABLE, sensorCustomerID, sensorZoneID, sensorID, csv_file_name);\n\tconsole.log(\"uploadto:\", uploadTo);\n\tvar metadata = {\n\t\tcontentType: 'text/plain',\n\t\tcontentEncoding: 'gzip',\n\t\tcacheControl: \"public, max-age=300\",\n\t\tcustomerId: sensorCustomerID\n\t};\n\t\n\tbucket.upload(csv_file_path,{\n\t\tdestination:uploadTo,\n\t\tpublic:true,\n\t\tmetadata: metadata\n\t}, function(err, file) {\n\t\tif(err)\n\t\t{\n\t\t\tconsole.log(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(createPublicFileURL(uploadTo));\n\t\tupdateSensorCsvPath(uploadTo, createPublicFileURL(uploadTo), file['metadata']['size']);\n\t});\n}", "repositoriesWorkspaceRepoSlugDownloadsFilenameDelete(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.DownloadsApi(); // String | // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.\n /*let filename = \"filename_example\";*/ /*let workspace = \"workspace_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ apiInstance.repositoriesWorkspaceRepoSlugDownloadsFilenameDelete(\n incomingOptions.filename,\n incomingOptions.workspace,\n incomingOptions.repoSlug,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "uploadFileURL() {\n return `${this.baseUrl}/renku/cache.files_upload?override_existing=true`;\n }", "getBucket() {\n const headers = {\n Date: this._buildDateHeader(),\n };\n\n const authHeader = this._buildAuthHeader('GET', '', {}, headers);\n const fetchOptions = {\n method: 'GET',\n headers: {\n Authorization: authHeader,\n },\n };\n\n return new Promise((resolve, reject) => {\n fetch(this.bucketBaseUrl, fetchOptions)\n .then(res => resolve(res))\n .catch(err => reject(err));\n });\n }", "static getFile (bucketName, objectKey) {\n const s3 = Storage._getS3Instance();\n const params = {\n Bucket: bucketName,\n Key: objectKey\n };\n return new Promise((resolve, reject) => {\n s3.getObject(params, (err, data) => {\n if (err) {\n reject(err);\n } else {\n resolve({\n content: data.Body, // buffer\n type: data.ContentType, // string\n encoding: data.ContentEncoding, // string\n size: data.ContentLength // integer\n });\n }\n });\n });\n }", "repositoriesWorkspaceRepoSlugDownloadsFilenameGet(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.DownloadsApi(); // String | // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.\n /*let filename = \"filename_example\";*/ /*let workspace = \"workspace_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ apiInstance.repositoriesWorkspaceRepoSlugDownloadsFilenameGet(\n incomingOptions.filename,\n incomingOptions.workspace,\n incomingOptions.repoSlug,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, data, response);\n }\n }\n );\n }", "async function endpointsCreateOrUpdateAzureStorageBlobContainer() {\n const subscriptionId =\n process.env[\"STORAGEMOVER_SUBSCRIPTION_ID\"] || \"60bcfc77-6589-4da2-b7fd-f9ec9322cf95\";\n const resourceGroupName = process.env[\"STORAGEMOVER_RESOURCE_GROUP\"] || \"examples-rg\";\n const storageMoverName = \"examples-storageMoverName\";\n const endpointName = \"examples-endpointName\";\n const endpoint = {\n properties: {\n description: \"Example Storage Blob Container Endpoint Description\",\n blobContainerName: \"examples-blobcontainer\",\n endpointType: \"AzureStorageBlobContainer\",\n storageAccountResourceId:\n \"/subscriptions/60bcfc77-6589-4da2-b7fd-f9ec9322cf95/resourceGroups/examples-rg/providers/Microsoft.Storage/storageAccounts/examplesa\",\n },\n };\n const credential = new DefaultAzureCredential();\n const client = new StorageMoverClient(credential, subscriptionId);\n const result = await client.endpoints.createOrUpdate(\n resourceGroupName,\n storageMoverName,\n endpointName,\n endpoint\n );\n console.log(result);\n}", "repositoriesWorkspaceRepoSlugRefsTagsNameDelete(incomingOptions, cb) {\n const Bitbucket = require('./dist');\n let defaultClient = Bitbucket.ApiClient.instance;\n // Configure API key authorization: api_key\n let api_key = defaultClient.authentications['api_key'];\n api_key.apiKey = incomingOptions.apiKey;\n // Uncomment the following line to set a prefix for the API key, e.g. \"Token\" (defaults to null)\n api_key.apiKeyPrefix = incomingOptions.apiKeyPrefix || 'Token';\n // Configure HTTP basic authorization: basic\n let basic = defaultClient.authentications['basic'];\n basic.username = 'YOUR USERNAME';\n basic.password = 'YOUR PASSWORD';\n // Configure OAuth2 access token for authorization: oauth2\n let oauth2 = defaultClient.authentications['oauth2'];\n oauth2.accessToken = incomingOptions.accessToken;\n\n let apiInstance = new Bitbucket.RefsApi(); // String | The name of the tag // String | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. // String | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.\n /*let name = \"name_example\";*/ /*let workspace = \"workspace_example\";*/ /*let repoSlug = \"repoSlug_example\";*/ apiInstance.repositoriesWorkspaceRepoSlugRefsTagsNameDelete(\n incomingOptions.name,\n incomingOptions.workspace,\n incomingOptions.repoSlug,\n (error, data, response) => {\n if (error) {\n cb(error, null, response);\n } else {\n cb(null, '', response);\n }\n }\n );\n }", "function destroyAllPostPhotosFromGCS(uid, postId) {\n // You do not have to use Promise constructor here, just return async function\n // return new Promise((resolve, reject) => {\n return (async (resolve, reject) => {\n const bucket = admin.storage().bucket();\n let folderRef = `/users/${uid}/posts/${postId}/`;\n // List all the files under the bucket\n let files = await bucket.getFiles({\n prefix: folderRef\n });\n // Delete each one\n let response;\n for (let i in files) {\n try {\n response = await files[i].delete();\n } catch(err) {\n reject(err);\n }\n }\n resolve(response);\n });\n}", "async function copyFile() {\n // Copies the file to the other bucket\n await storage\n .bucket(srcBucket)\n .file(file.name)\n .copy(storage.bucket(finalBucket).file(fileName));\n\n }", "getObjectContents(object) {\n let clusterUrl = object.get('cluster').get('proxyUrl');\n let bucketTypeName = object.get('bucketType').get('name');\n let bucketName = object.get('bucket').get('name');\n let objectName = object.get('name');\n let isCRDT = !!(object.get('bucket').get('isCRDT'));\n let url = (isCRDT) ? `${clusterUrl}/types/${bucketTypeName}/buckets/${bucketName}/datatypes/${objectName}` : `${clusterUrl}/types/${bucketTypeName}/buckets/${bucketName}/keys/${objectName}`;\n let xhrOptions = {\n url: url,\n type: 'GET',\n cache: false,\n headers: {'Accept': '*/*, multipart/mixed'},\n processData: !isCRDT\n };\n\n if (isCRDT) { xhrOptions.dataType = 'json'; }\n\n return new Ember.RSVP.Promise(function(resolve, reject) {\n let request = Ember.$.ajax(xhrOptions);\n\n request.done(function(data, textStatus, jqXHR) {\n let headerObj = parseHeader(jqXHR.getAllResponseHeaders());\n let type = (isCRDT) ? data.type : 'default';\n let content = (isCRDT) ? data.value : data;\n\n object.set('headers', headerObj);\n object.set('type', type);\n object.set('contents', content);\n object.set('url', url);\n\n resolve(object);\n });\n\n request.fail(function(data) {\n reject(data);\n });\n });\n }", "function _isBucketStorage(storageType) {\n\treturn !!storageTypes[storageType];\n}", "function gn() {\n if (!pe.Lt().ia) throw new c(h.UNIMPLEMENTED, \"Blobs are unavailable in Firestore in this environment.\");\n}", "putObject(bucketName, objectName, contentType, size, r, cb) {\n if (!validateBucketName(bucketName)) {\n throw new errors.InvalidateBucketNameException('Invalid bucket name: ' + bucketName)\n }\n\n if (objectName === null || objectName.trim() === '') {\n throw new errors.InvalidObjectNameException('Object name cannot be empty')\n }\n\n if (contentType === null || contentType.trim() === '') {\n contentType = 'application/octet-stream'\n }\n\n function calculatePartSize(size) {\n var minimumPartSize = 5 * 1024 * 1024, // 5MB\n maximumPartSize = 5 * 1025 * 1024 * 1024,\n // using 10000 may cause part size to become too small, and not fit the entire object in\n partSize = Math.floor(size / 9999)\n\n if (partSize > maximumPartSize) {\n return maximumPartSize\n }\n return Math.max(minimumPartSize, partSize)\n }\n\n var self = this\n if (size <= 5*1024*1024) {\n var concater = transformers.getConcater()\n pipesetup(r, concater)\n .on('error', e => cb(e))\n .on('data', chunk => self.doPutObject(bucketName, objectName, contentType, null, null, chunk, cb))\n return\n }\n async.waterfall([\n function(cb) {\n self.findUploadId(bucketName, objectName, cb)\n },\n function(uploadId, cb) {\n if (uploadId) {\n self.listAllParts(bucketName, objectName, uploadId, (e, etags) => {\n return cb(e, uploadId, etags)\n })\n return\n }\n self.initiateNewMultipartUpload(bucketName, objectName, contentType, (e, uploadId) => {\n return cb(e, uploadId, [])\n })\n },\n function(uploadId, etags, cb) {\n var partSize = calculatePartSize(size)\n var sizeVerifier = transformers.getSizeVerifierTransformer(size)\n var chunker = BlockStream2({size: partSize, zeroPadding: false})\n var chunkUploader = self.chunkUploader(bucketName, objectName, contentType, uploadId, etags)\n pipesetup(r, chunker, sizeVerifier, chunkUploader)\n .on('error', e => cb(e))\n .on('data', etags => cb(null, etags, uploadId))\n },\n function(etags, uploadId, cb) {\n self.completeMultipartUpload(bucketName, objectName, uploadId, etags, cb)\n }\n ], function(err, etag) {\n if (err) {\n return cb(err)\n }\n cb(null, etag)\n })\n }", "static get instanceIdentifier() {\n return \"BITBUCKET_\";\n }", "function getPublicUrl (filename) {\n return `https://storage.googleapis.com/${config.CLOUD_BUCKET}/${filename}`;\n}", "function onBucketCreated(response) {\n\n console.log('Uploading to A360 started...');\n\n fs.stat(serverFile, function (err, stats) {\n if (err) {\n console.log('Uploading to A360 failed...' + err);\n res.send('err',err);\n }\n var total = stats.size;\n var chunkSize = config.fileResumableChunk * 1024 * 1024;\n\n if( total > chunkSize)\n {\n console.log(' Resumable uploading for large file...');\n\n lmv.resumableUpload(serverFile,\n config.defaultBucketKey,\n filename,uploadProgressCallback).then(onResumableUploadCompleted, onError);\n }\n else\n {\n //single uploading\n console.log(' Single uploading for small file...');\n lmv.resumableUpload(serverFile,\n config.defaultBucketKey,\n filename).then(onSingleUploadCompleted, onError);\n }\n //guid for checking uploading status\n res.send({uploadguid:newGuid()});\n });\n }", "static get servicePath() {\n return 'bigquerydatatransfer.googleapis.com';\n }", "deleteObject(image) {\n const params = {\n Bucket: image.bucketName,\n Key: image.fileName\n };\n\n console.log(\"Delete original object: \" + params.Key);\n\n return this.client.deleteObject(params).promise();\n }" ]
[ "0.59337705", "0.59263813", "0.5902599", "0.57244325", "0.5717236", "0.57163745", "0.5605475", "0.5575883", "0.5423533", "0.5423533", "0.5423533", "0.5423533", "0.5423533", "0.539048", "0.53614956", "0.53597564", "0.53062487", "0.52984977", "0.52737", "0.5270933", "0.5263212", "0.52596796", "0.5212611", "0.5207417", "0.51719344", "0.51438946", "0.5132699", "0.5110032", "0.5098773", "0.50976235", "0.5089584", "0.5089584", "0.5069876", "0.50663084", "0.505381", "0.50451404", "0.50441235", "0.50263554", "0.5022597", "0.49959692", "0.49938163", "0.49887726", "0.49887726", "0.49675566", "0.49604562", "0.4955462", "0.49502486", "0.49299678", "0.49217415", "0.4909794", "0.49059862", "0.49038857", "0.49032915", "0.4899653", "0.48927152", "0.48729482", "0.48710406", "0.48709765", "0.48671928", "0.4863755", "0.48512706", "0.4845099", "0.48439983", "0.48420465", "0.48420063", "0.48351285", "0.48346248", "0.48309052", "0.48242843", "0.482299", "0.4820708", "0.48144487", "0.48074165", "0.4795657", "0.47866985", "0.4774038", "0.47721174", "0.47712502", "0.4769224", "0.47679693", "0.47614306", "0.47440457", "0.47440073", "0.4742734", "0.47423553", "0.4739889", "0.47372505", "0.47357237", "0.47294083", "0.472685", "0.47254372", "0.47186133", "0.4717623", "0.47173676", "0.47150913", "0.47053608", "0.4703922", "0.46983606", "0.469768", "0.46974424", "0.46972635" ]
0.0
-1
Main/Setup function, initialize stuff...
async function main() { image = await loadImage('./Apollo11HP-128539876.jpg'); imageData = await readImageData(image); new p5((p_) => { p = p_; p.setup = setup; }, elements.container); // Settings gui.add(settings, 'omega', 0, 1).step(0.01).onFinishChange(drawThrottled); gui.add(settings, 'phase', 0, 1).step(0.01).onFinishChange(drawThrottled); gui.add(settings, 'quantVal', 1, 30).step(0.1).onFinishChange(drawThrottled); gui.add(settings, 'saveImage'); gui.close(); if (ENABLE_STATS) { stats.showPanel(0); elements.stats.appendChild(stats.dom); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _setup () {\n }", "function setup() {}", "setup() {}", "setup() {}", "setup() {}", "function main() {\r\n initFlags();\r\n fixMarkup();\r\n changeLayout();\r\n initConfiguration();\r\n}", "initialise () {}", "function _main() {\n log('> lesslms init...', 'info');\n _buildTree();\n _setupMenu();\n}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function init() {}", "function main() {\n // Initialize some event listeners on the word info display choice.\n setup_word_info();\n\n // Initialize the first page of cues.\n previous_page();\n\n // Initialize the top scores leaderboard.\n load_leaderboard();\n\n // Initialize the Sammy.js app.\n app.run();\n}", "async setup() { }", "function initMain()\r\n{\r\n\t// Initialize a new instance\r\n\tinitInstance();\r\n\r\n\t// Initialize AJAX components\r\n\tinitAjaxComponents();\r\n\r\n\t// Initialize AJAX navigation\r\n\tinitAjaxNavigation();\r\n\r\n\t// Initialize addons\r\n\tinitAddons();\r\n}", "init()\r\n {\r\n var self = this;\r\n\r\n // set the template file for uri set method\r\n this.raumkernel.getSettings().uriMetaDataTemplateFile = \"node_modules/node-raumkernel/lib/setUriMetadata.template\";\r\n\r\n // set some other settings from the config/settings file\r\n // TODO: @@@\r\n //this.raumkernel.getSettings().\r\n\r\n // if there is no logger defined we do create a standard logger\r\n if(!this.parmLogger())\r\n this.createLogger(this.settings.loglevel, this.settings.logpath);\r\n\r\n this.logInfo(\"Welcome to raumserver v\" + PackageJSON.version +\" (raumkernel v\" + Raumkernel.PackageJSON.version + \")\");\r\n\r\n // log some information of the network interfaces for troubleshooting\r\n this.logNetworkInterfaces();\r\n\r\n // Do the init of the raumkernel. This will include starting for the raumfeld multiroom system and we\r\n // do hook up on some events so the raumserver knows the status of the multiroom system\r\n this.logVerbose(\"Setting up raumkernel\");\r\n this.raumkernel.parmLogger(this.parmLogger());\r\n // TODO: listen to events like hostOnline/hostOffline\r\n this.raumkernel.init();\r\n\r\n this.logVerbose(\"Starting HTTP server to receive requests\");\r\n this.startHTTPServer();\r\n\r\n this.logVerbose(\"Starting bonjour server for advertising\");\r\n // TODO: @@@\r\n }", "function setupMain() {\n setupMenu();\n setupTreeView();\n setupAnnotations();\n\n // Add initial pane\n pm.registerPane();\n pm.renderPane();\n}", "function setup(){\n\tinitVars(); \n\tinitCanvas(); \n\tinitObjects(); \n\tinitListeners(); \n\n}", "initialize(config) {}", "_setup() {\n this.wrapper = this._setupWrapper();\n this.canvas = this._setupCanvas();\n this.context = this._setupCanvasContext();\n this.stage = this._setupStage();\n this.bricks = this._setupBricks();\n this._setupPaddle();\n this._setupBall();\n this.collisionDetection = this._setupCollisionDetection();\n }", "init() {\n //todo: other init stuff here\n }", "function initialize() {}", "function main(opts){\n return initialize;\n}", "function setup() {\n\n\t\t\t\t\t}", "function setupDefault() {\n}", "function setup() {\n \n // create an HL app to start retrieving kinect datas\n // and automatically call the function update, onUserIn and onUserOut\n app = new HL.App();\n\n // set it up with our project's metadatas\n app.setup({\n projectName : 'Ball Bounce',\n author1 : 'Prenom Nom',\n author2 : 'Prenom Nom'\n });\n\n setupBall();\n setupObstacles();\n}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "init() { }", "init() { }", "init() { }", "init() { }", "init() { }", "setup(config) {\r\n setup(config);\r\n }", "_startUp()\n {\n // Check debug.\n if (RodanClientCore.config.DEBUG)\n {\n Radio.tuneIn('rodan');\n }\n\n this._initializeRadio();\n this._initializeControllers();\n this._initializeBehaviors();\n this._initializeDateTimeFormatter();\n this.addRegions({regionMaster: '#region-master'});\n this._initializeViews();\n require('./.plugins');\n }", "function Setup() {\n}", "function main() {\n\n\t//======================================\n\t//THE FOLLOWING SHOULD ALL BE SINGLETONS\n\t//======================================\n\n\t//A service to get data and set data from localStorage API\n\tlet todoService = new TodoService();\n\t//The todoApp Data model\n\tlet todoAppData = new TodoAppData(todoService.getLists());\n\t//A class that helps create DOM elements imperatively\n\tlet todoViewFactory = new TodoViewFactory();\n\t//Helps controll the view of the application\n\tlet todoViewSetter = new TodoViewSetter(todoViewFactory);\n\n\t//initializes the view\n\ttodoViewSetter\n\t\t.setListsMenu(todoAppData.lists)\n\t\t.setSelectedList(todoAppData.selectedList);\n\n\t//sets event listeners\n\tsetListeners(todoAppData, todoViewSetter, todoService);\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 }", "init () {}", "init () {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "init() {}", "function setup(){\n\tinitVars();\n\tinitCanvas();\n\tinitObjects();\n}", "function init() { }", "function init() { }", "function setup(args, ctx) {\n}", "function setup(){\n\tinitVars(); \n\tinitCanvas(); \n\tinitObjects(); \n\n}", "function init() {\n\t//TODO\n}", "function init() {\n\t\tuserAgentCheck();\n\t\ttestThis();\n\t}", "function _init() {\n }", "function _main() {\n window.tools = {} || window.tools;\n window.tools.log = _log;\n }", "setup() {\n this.setupMap();\n this.displayLabMarker();\n this.captureMouseCoordinates();\n }", "function _init() {\n }", "function _init() {\n }", "function _init() {\n }", "function init () {\n // Here below all inits you need\n }", "init () {\n // Load application configuration\n this.config = require('./config').init(this)\n\n // Axios Http client\n this.http = require('./http').init(this)\n\n // TigoPesa API client\n this.api = require('./api').init(this)\n\n // Init express app instance\n this.express = require('./express').init(this)\n\n // Init job queue\n this.jobs = require('./jobs').init(this)\n }", "_init() {\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }", "function init() {\n try {\n readConfigFile();\n } catch (err) {\n console.debug(`index.js: ${err}`);\n return;\n }\n\n try {\n // Use options to setup resources and start server\n setup();\n } catch (err) {\n logger.error(`index.js: ${err}`);\n logger.debug(`index.js: ${err.stack}`);\n }\n}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "function init(){}", "function main() {\n init();\n enable();\n}", "constructor(setup) {\n this.setup = setup;\n }", "function init() {\r\n reset();\r\n lastTime = Date.now();\r\n main();\r\n }", "init() {\n }", "init() {\n }", "init() {\n }", "setup() {\n this.setupLayout();\n this.setupNotifications();\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}", "init () {\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "initialize()\n {\n }", "function init(){\r\n\tcreateMap();\r\n\tcreateSnake();\r\n\tcreateFruit();\r\n}", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "function init() {\n reset();\n lastTime = Date.now();\n main();\n }", "async init () {}", "function mainFn () {\n logFn( prefixStr + 'Start' );\n xhiObj.npmObj.load( xhiObj.fqPkgFilename, onLoadFn );\n }" ]
[ "0.77655905", "0.7694501", "0.7633991", "0.7633991", "0.7633991", "0.74172056", "0.74151796", "0.7229239", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.71484035", "0.7136952", "0.70935816", "0.7083781", "0.7054819", "0.70132875", "0.6999001", "0.69941545", "0.69913954", "0.69825035", "0.69796157", "0.6975939", "0.6975914", "0.69527906", "0.6946969", "0.6944028", "0.6944028", "0.6944028", "0.6944028", "0.6944028", "0.6944028", "0.6926862", "0.6926862", "0.6926862", "0.6926862", "0.6926862", "0.6914131", "0.6907185", "0.6900312", "0.6888602", "0.6877513", "0.68734497", "0.68734497", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6852034", "0.6844266", "0.6830817", "0.6830817", "0.67849725", "0.676976", "0.6750301", "0.67384124", "0.67289346", "0.6725287", "0.6708327", "0.6704538", "0.6704538", "0.6704538", "0.6701522", "0.6698555", "0.6689504", "0.6686417", "0.6680231", "0.665812", "0.66405565", "0.66293246", "0.66221994", "0.6606604", "0.6606604", "0.6606604", "0.659775", "0.65885675", "0.6584745", "0.65820324", "0.65820324", "0.6568613", "0.6563323", "0.6562299", "0.6562299", "0.6562299", "0.6562299", "0.6560125", "0.6559479" ]
0.0
-1
Listen dragover event for drag&drop
function onDragOver(event) { // Prevent default behavior (Prevent file from being opened) event.preventDefault(); event.dataTransfer.dropEffect = 'copy'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dragOverHandler(ev) {\n // console.log('File(s) in drop zone');\n\n // Prevent default behavior (Prevent file from being opened)\n ev.preventDefault();\n}", "function dragOver(e){\n //we have to prevent the defaullt behavior or drop will not work \n e.preventDefault();\nconsole.log('over');\n\n}", "function dragover(event) {\n // Prevent default in order to allow/enable the drop event to fire.\n event.preventDefault();\n }", "function dragOver(event) {\n console.log('drag over');\n event.preventDefault();\n}", "function dragOverHandler(ev) {\n // console.log('File(s) in drop zone'); \n document.getElementById(\"dragdropcontainer\").style.backgroundColor = \"white\";\n // Prevent default behavior (Prevent file from being opened)\n ev.preventDefault();\n}", "function dragover(e) {\n e.stopPropagation();\n e.preventDefault();\n}", "function dragoverHandler(evt) {\n\tnobubbleHandler(evt);\n\tevt.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.\n}", "dragEnter(ev) {\n this.dragOver(ev);\n }", "function dragOverHandler(e) {\n e.stopPropagation();\n e.preventDefault();\n}", "function dragOverHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n event.dataTransfer.dropEffect = 'copy';\n}", "function _onDragOver(e) {\n\n\t\t\t\t//disable default event behavior\n\t\t\t\te.preventDefault();\n\n\t\t\t\t//change cursor icon\n\t\t\t\te.dataTransfer.dropEffect = 'move';\n\n\t\t\t\tconsole.log(\"dragging: \" + dragEl.tagName);\n\n\t\t\t\t//target that triggered the event (note: it isn't the one that is being dragged)\n\t\t\t\tvar target = e.target;\n\n\t\t\t\t//choosing if the destination target is suitable to change its position in the album list\n\t\t\t\t//with the dragged element\n\t\t\t\tif( target && target !== dragEl && target.getAttribute(\"sortable\") === \"true\" ){\n\n\t\t\t\t\tvar rect = target.getBoundingClientRect(); //target card rect (used to get its size on screen)\n\t\t\t\t\tvar next = (e.clientY - rect.top)/(rect.bottom - rect.top) > .5; //true if we are up the target that triggered the event\n\n\t\t\t\t\t//thanks to \"next\" we understand where to put in the albumList the dragged album\n\t\t\t\t\trootEl.insertBefore(dragEl, next && target.nextSibling || target);\n\n\t\t\t\t}\n\t\t\t}", "_onDragOver(evt) {\n if (!this.isDropTargetEnabled) return;\n this.classList.add('layer-file-drag-and-drop-hover');\n evt.preventDefault();\n return false;\n }", "function onDragOver(e) {\n // console.log(\"onDragOver\")\n // console.log(e);\n // Prevent Default actions\n e.preventDefault ? e.preventDefault() : void 0;\n e.stopPropagation ? e.stopPropagation() : void 0;\n\n // This get current elements parent id\n var targetParent = tbody.attr('drag-id') ? tbody.attr('drag-id') : void 0;\n\n\n // If user drag elemnt from its boundary then cursor will show block icon else it will show move icon [ i.e : this effect work perfectly in google chrome]\n // e.dataTransfer.dropEffect = sourceParent !== targetParent || typeof attr.ngRepeat === \"undefined\" ? 'none' : 'move';\n\n return false;\n }", "function dragOver(e) {\n e.preventDefault();\n}", "function dragOver(e) {\n e.preventDefault()\n }", "function rsltDragOverHandler (e) {\n let dt = e.dataTransfer;\n let target = e.target;\n if (isLinux) {\n\tcurRsltTarget = target;\n\tcurRsltDt = dt;\n }\n//console.log(\"Rslt drag over event: \"+e.type+\" target: \"+target+\" id: \"+target.id+\" class: \"+target.classList);\n // Handle drag scrolling inhibition\n handleRsltDragScroll(OverEvent, e);\n dt.dropEffect = \"none\"; // Signal drop not allowed\n}", "onDragOver(e){\n e.preventDefault();\n }", "function dragOver(e) {\n e.preventDefault();\n}", "function onDragOver(e) {\n\n // Prevent Default actions\n e.preventDefault ? e.preventDefault() : void 0;\n e.stopPropagation ? e.stopPropagation() : void 0;\n\n // This get current elements parent id\n var targetParent = tbody.attr('drag-id') ? tbody.attr('drag-id') : void 0;\n\n\n // If user drag elemnt from its boundary then cursor will show block icon else it will show move icon [ i.e : this effect work perfectly in google chrome]\n e.dataTransfer.dropEffect = sourceParent !== targetParent || typeof attr.ngRepeat === \"undefined\" ? 'none' : 'move';\n\n return false;\n }", "dragOver(event, obj){\n\t\tevent.preventDefault();\n\t\t// Maybe make some nice colors?\n\t}", "function onWidgetDragover(event) {\n if (canDropOnWidget(this)) {\n // Prevent default, allowing drop.\n event.preventDefault();\n }\n }", "function handleDragOver(evt) {\n\tevt.stopPropagation()\n\tevt.preventDefault()\n\tevt.dataTransfer.dropEffect = 'copy'\n}", "function dragOver(e){\n\te.preventDefault();\n}", "function onDragOver(ev)\n{\n ev.preventDefault();\n}", "drag(ev) {\n // console.log('drag')\n }", "onDragOver(event) {\r\n if (this.state.inDropMode)\r\n event.preventDefault(); // Allows for dropping\r\n }", "function handleDragOver(event) {\n event.stopPropagation();\n event.preventDefault();\n event.dataTransfer.dropEffect = 'copy'; // Explicitly show this is a copy.\n}", "function handleDragOver(e) {\r\n if (e.preventDefault) {\r\n e.preventDefault(); // Necessary. Allows us to drop.\r\n }\r\n e.dataTransfer.dropEffect = 'move'; // See the section on the DataTransfer object.\r\n return false;\r\n }", "function onDragOver (e) {\n e.preventDefault()\n }", "function handleDragOver(event) {\n event.stopPropagation();\n event.preventDefault();\n dropArea.addClass(\"hover\");\n }", "function dragover_handler(e) {\r\n dataFrom = e.dataTransfer.getData(\"text/plain\");\r\n dataTo = e.currentTarget.dataset.jsDroppable;\r\n\r\n if (dataFrom !== dataTo) {\r\n e.preventDefault();\r\n }\r\n}", "function dragover(e){\n e.stopPropagation();\n e.preventDefault();\n elem.addClass('dragenter');\n }", "function dragover(e){\n e.stopPropagation();\n e.preventDefault();\n elem.addClass('dragenter');\n }", "function onDragOver(evt) {\n evt.preventDefault();\n}", "function onDragOver(event) {\n event.preventDefault();\n}", "handleDragOver(evt) {\n \n console.log('DragOver event for [' + this.getTargetLabel() + ']');\n \n //Cancel the event\n this.cancel(evt);\n\n this.addDragOverStyle()\n \n }", "function addDragDropHandler(canvas) {\n canvas.addEventListener('dragover', onDragOver, false);\n canvas.addEventListener('drop', onDrop, false);\n}", "function handleDragOver(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n evt.dataTransfer.dropEffect = 'copy';\n }", "function onDragOver(event) {\n event.preventDefault();\n}", "onDragOver(evt) {\n\t\tevt.preventDefault();\n\t}", "function _onDragOver(evt) {\n evt.preventDefault();\n evt.dataTransfer.dropEffect = 'move';\n var target = evt.target;\n\n if( target && target !== dragEl && target.nodeName.toLowerCase() == targetname.toLowerCase() ){\n // Sorting\n\n var rect = target.getBoundingClientRect();\n var topnext = (evt.clientY - rect.top)/(rect.bottom - rect.top) > 0.5;\n var leftnext = (evt.clientX - rect.left)/(rect.right - rect.left) > 0.5;\n rootEl.insertBefore(dragEl, (topnext && target.nextSibling) || (leftnext && target.nextSibling) || target);\n }\n }", "onMouseDrag(e) {}", "handleDragOver(e) {\n if (this.state.dragging) {\n return\n }\n e.preventDefault()\n e.dataTransfer.dropEffect = 'move'\n this.props.onDragOver(this.props.todo)\n }", "static dragEvents(){\n //enter drag\n Quas.on(\"dragenter dragstart\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).addCls(\"dragenter\");\n });\n\n //exit drag\n Quas.on(\"dragend dragleave\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n });\n\n //prevent default on other drag events\n Quas.on(\"drag dragover\", \".drop\", function(e){\n e.preventDefault();\n });\n\n //dropping the file\n Quas.on(\"drop\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n upload(e.dataTransfer.files, function(data){\n //todo progress bar\n closeToolModals();\n Quas.getEl(\"#post-tool-cloud\").visible(true);\n loadModal(\"cloud\");\n });\n });\n }", "function dragOver(e) {\n if (_isDraggingFile) {\n e.preventDefault();\n }\n }", "function handleOverDrop(e) {\n e.preventDefault();\n if (e.type !== \"drop\") {\n return;\n }\n var draggedId = e.dataTransfer.getData(\"text\");\n var draggedEl = document.getElementById(draggedId);\n if (draggedEl.parentNode === this) {\n return;\n }\n// window.alert(draggedEl.textContent);\n// window.alert(e.target.id);\n if (e.target.id === draggedEl.textContent)\n {\n draggedEl.parentNode.removeChild(draggedEl);\n this.appendChild(draggedEl);\n counts++;\n if (counts === 4) {\n window.alert(\"You Win !\");\n clearTimeout(timeout);\n }\n } else {\n document.getElementById(\"info\").innerHTML = \"Not this one, Try again !\";\n }\n this.className = \"\";\n}", "handleDragOver(event) {\n event.preventDefault();\n }", "onDrop(event) {\r\n event.preventDefault(); // Allows for dropping\r\n const data = event.dataTransfer.getData(\"text\");\r\n if (data == locationAncestor_type_1.dragAndDropName && this.state.inDropMode) {\r\n this.module.onDrop();\r\n }\r\n }", "function globalDragOver(e) {\n if (_isDraggingFile) {\n e.preventDefault();\n if (_innerCounter > 0) {\n e.dataTransfer.dropEffect = \"copy\";\n } else {\n e.dataTransfer.dropEffect = \"none\";\n }\n }\n }", "function handleDragOver(evt){\n\tevt.stopPropagation();\n\tevt.preventDefault();\n\tevt.dataTransfer.dropEffect = 'copy'; \n\t//This basically makes the dropped file a copy of the original\n}", "function onOver(target, type, draggedNode, accept){\n\t//console.info(\"onOver ::: \", target, type, draggedNode);\n\t// add the dropIndicator style for the tab of tabContainer.\n\tswitch(type){\n\t\tcase \"dijit.layout.TabContainer\" :\n\t\t\tif (accept){\n\t\t\t\tdojo.addClass(target, \"dndOver\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdojo.addClass(target, \"dndOverNotAccepted\");\n\t\t\t}\n\t\tbreak;\n\t}\n}", "async dragOver(data = { items: [], dragOperationsMask: 1 }) {\n await this._scrollIntoViewIfNeeded();\n const target = await this.clickablePoint();\n await this._page.mouse.dragOver(target, data);\n }", "function handleDragOver(evt) {\n evt.preventDefault();\n evt.dataTransfer.effectAllowed = 'copy';\n evt.dataTransfer.dropEffect = 'copy';\n }", "function handleDragOver(event) {\n\t\tevent.preventDefault();\n\t}", "function showDrop(event) { uploadzone.className += \" dragover\"; }", "function onTrashcanDragover(event) {\n if (draggedWidget) {\n // Prevent default, allowing drop.\n event.preventDefault();\n }\n }", "function onDrop() {\n\t\tobject.style.display = \"none\";\n\n\t\tvar\n\t\telement = document.elementFromPoint(onDrag.x, onDrag.y),\n\t\tevent = hasListener ? document.createEvent(\"MouseEvent\") : document.createEventObject();\n\n\t\tevent.MsDataTransfer = new DataTransfer(arguments);\n\n\t\thasListener && event.initMouseEvent(\"drop\", true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);\n\n\t\thasListener ? element.dispatchEvent(event) : element.fireEvent(\"ondrop\", event);\n\n\t\tonDrop.active = false;\n\t}", "function drag_over(event) { \n event.preventDefault(); \n return false; \n }", "function handleDragOver()\n {\n var dragSession;\n var transferable;\n\n dragSession= getDragSession();\n\n // See notes in canPaste about flavors we can accept.\n\n if (dragSession.isDataFlavorSupported(\n PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER))\n {\n dragSession.canDrop= true;\n return true;\n }\n\n transferable=\n Components.classes[\"@mozilla.org/widget/transferable;1\"].\n createInstance(Components.interfaces.nsITransferable);\n transferable.addDataFlavor(PlacesUtils.TYPE_X_MOZ_PLACE);\n transferable.addDataFlavor(PlacesUtils.TYPE_X_MOZ_URL);\n transferable.addDataFlavor(PlacesUtils.TYPE_UNICODE);\n\n for (let i= 0; i < dragSession.numDropItems; i++)\n {\n dragSession.getData(transferable, i);\n if (canPasteHelper(transferable))\n {\n dragSession.canDrop= true;\n return true;\n }\n }\n\n dragSession.canDrop= false;\n return false;\n }", "function handleDragOverRacers(evt) {\n //dataTransfer object is accessible on every drag and drop event\n evt.dataTransfer.dropEffect = \"copy\";\n evt.stopPropagation();\n evt.preventDefault();\n racersList.className = \"highlighted\";\n return false;\n}", "function drag_over(event) {\n\tevent.preventDefault();\n\treturn false;\n}", "initDragAndDrop() {\n // treat body as drag and drop zone\n this.dndZone = document.getElementById('drag-and-drop');\n this.dndZone.addEventListener('dragover', this.onDragOver);\n this.dndZone.addEventListener(\"dragleave\", this.onDragLeave);\n this.dndZone.addEventListener('drop', this.onDragDrop);\n }", "function setupDragDropListener(obj){\n obj.addEventListener(\"dragover\", fileDragHover, false);\n obj.addEventListener(\"dragleave\", fileDragHover, false);\n obj.addEventListener(\"drop\", fileSelectHandler, false);\n obj.style.display = \"block\";\n }", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function onDocumentDragOver(evt) {\n evt.preventDefault();\n}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function bkmkDragOverHandler (e) {\n let target = e.target;\n let dt = e.dataTransfer;\n if (isLinux) {\n\tcurBkmkTarget = target;\n\tcurBkmkDt = dt;\n }\n//console.log(\"Drag over event: \"+e.type+\" target: \"+target+\" id: \"+target.id+\" class: \"+target.classList);\n // Handle drag scrolling inhibition\n handleBkmkDragScroll(OverEvent, e);\n if (((target.className == undefined) // When on Text, className and classList are undefined.\n\t || (target.className.length > 0)\n\t )\n\t && checkDragType(dt)\n ) {\n\t// Get the enclosing row\n\t// Note: when the mouse is over the lifts, an HTMLDivElement is returned\n\tlet row = getDragToRow(target);\n//console.log(\"Over row: \"+row+\" class: \"+row.classList+\" BN_id: \"+row.dataset.id);\n//console.log(\"Bkmkitem_x: \"+bkmkitem_x+\" class: \"+bkmkitem_x.classList);\n\tif (row == undefined) { // We are on the scrollbars for example\n\t highlightRemove(e);\n\t dt.dropEffect = \"none\"; // Signal drop not allowed\n\t}\n\telse {\n\t let is_ctrlKey = (isMacOS ? e.metaKey : e.ctrlKey);\n\t if ((!is_ctrlKey && (noDropZone != undefined) && noDropZone.isInZone(row.rowIndex))\n\t\t || (isProtected && !isTopItem) // Protection, can't drop on non top draggable elements = specials\n\t ) {\n\t\thighlightRemove(e);\n\t\tdt.dropEffect = \"none\"; // Signal drop not allowed\n\t }\n\t else {\n\t\te.preventDefault(); // Allow drop\n\t\thighlightInsert(e);\n\t\tif (isBkmkItemDragged) { // For internal drags, take Ctrl key into account to change visual feedback\n\t\t dt.dropEffect = (is_ctrlKey ? \"copy\" : \"move\");\n\t\t}\n\t }\n\t}\n }\n else {\n\thighlightRemove(e);\n\tdt.dropEffect = \"none\"; // Signal drop not allowed\n }\n}", "function onP2pSendDragoverHandler(event) {\n var overlay = $('.p2pSendDragDropOverlay');\n if (!overlay.is(':visible')) {\n compatibleDragEvent(event);\n var dt = event.dataTransfer;\n var length = dt.files.length || dt.items.length;\n // check if all selected items are files\n var notAllFiles = false;\n if (dt.items) {\n for (var i = 0; i < dt.items.length; i++) {\n if (notAllFiles = (dt.items[i].kind !== 'file')) {\n break;\n }\n }\n }\n if (notAllFiles) {\n $('.p2pSendDragDropOverlayText').text('Please select only files.');\n } else if (length > MAX_DATA_CONNECTIONS) {\n $('.p2pSendDragDropOverlayText').text('Too may files selected (max is ' + MAX_DATA_CONNECTIONS + ').');\n } else {\n $('.p2pSendDragDropOverlayText').text('Drop to send files to the participants');\n }\n $('.p2pSendDragDropOverlay').show();\n }\n if (dragOverlayHideTimer) {\n clearTimeout(dragOverlayHideTimer);\n dragOverlayHideTimer = null;\n }\n event.preventDefault();\n}", "function dragEnter(event) {\n if(!event.target.classList.contains(\"dropped\")) {\n event.target.classList.add(\"droppable-hover\");\n }\n}", "function onWidgetDragenter() {\n if (canDropOnWidget(this)) {\n // Add class to highlight the target.\n $('#ha-widget-' + viewmodel.getWidgetIdFromElementId(this.id)).addClass('drag-over');\n }\n }", "function dragDropVisual () {\n // Start the drag effect\n $('.drop-zone').on('dragover', function (e) {\n e.preventDefault()\n e.stopPropagation()\n $(this).addClass('dragover')\n })\n\n // Stop the effect when mouse out/release\n $('.drop-zone').on('dragleave dragend', function (e) {\n e.preventDefault()\n e.stopPropagation()\n $(this).removeClass('dragover')\n })\n\n // Stop when successfully dropped\n $('.drop-zone').on('drop', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $(this).removeClass('dragover')\n\n // we're interested in just first file\n var files = e.originalEvent.dataTransfer.files\n for (var i = 0; i < files.length; i++) {\n parseImport(files[i])\n }\n })\n}", "function drag(ev) {\n ev.dataTransfer.setData(\"text\", ev.target.id);\n ev.dataTransfer.setDragImage(ev.target, 25,25, 0);\n Array.from(document.getElementsByClassName(\"drop_target\")).forEach(o => {\n o.style.pointerEvents = \"auto\";\n });\n}", "function allowDrop(ev) {\n ev.preventDefault();\n $(\"#drag-cont\").addClass(\"drag-cont-over\");\n}", "function enableDropArea() {\n\tdropArea.addEventListener(\"drop\", dropHandler);\n\tdropArea.addEventListener(\"dragover\", dragOverHandler);\n\tdropArea.addEventListener(\"dragleave\", dragLeaveHandler);\n}", "onDragEnded(mousePosition) {\n }", "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "function dragLeave(e) {\n \n if (e.dataTransfer.items && e.dataTransfer.items.length > 0 && e.dataTransfer.items[0].kind === \"file\") {\n e.preventDefault();\n _innerCounter--;\n if (_innerCounter === 0) {\n $(this).removeClass(\"drop-over\");\n }\n }\n }", "function mouseDownEvent(eb){\r\n dragging = eb\r\n}", "function drag(event) {\n draggedItem = event.target;\n dragging = true;\n}", "function drag(e) {\n draggedItem = e.target;\n dragging = true;\n}", "function editOnDragOver(e){this._internalDrag=false;this.setMode('drag');e.preventDefault();}", "preventUnintendedDropEvents() {\n function preventDefault(e) { e.preventDefault(); }\n window.addEventListener(\"dragover\", preventDefault, false);\n window.addEventListener(\"drop\", preventDefault, false);\n }", "function dragEnter(e) {\n if (e.dataTransfer.items && e.dataTransfer.items.length > 0 && e.dataTransfer.items[0].kind === \"file\") {\n e.dataTransfer.dropEffect = \"copy\";\n _innerCounter++;\n if (_innerCounter === 1) {\n $(this).addClass(\"drop-over\");\n }\n }\n }", "function drag(e) {\n draggedItem = e.target\n dragging = true\n}", "function mouseOverEvent(e) {\n\tif (e.button == 0) {\n\t\tif (left_click_drag_flag) {\n\t\t\tcreateGrid(this, active_object);\n\t\t}\n\t}\n\tif (e.buttons == 2) {\n\t\tif (right_click_drag_flag) {\n\t\t\tdeleteGrid(this);\n\t\t}\n\t}\n }", "function drag (event) {\r\n console.log(\"drag FN start\");\r\n console.log(event);\r\n draggedPic = event.target; // TODO draggedPic\r\n event.dataTransfer.setData(\"text\", event.target.id);\r\n event.dataTransfer.effectAllowed = \"move\";\r\n}", "onStart ( e ) {\n\n e.target.classList.remove ( 'use-hover' );\n this.isDragging = true;\n\n e.vdg = this.getEventData ( e );\n this.$emit ( 'drag-start', e );\n\n }", "function handleDrop(event) {\n unhighlight(event);\n var dt = event.dataTransfer;\n var files = dt.files;\n handleFiles(files);\n }", "drag(event) {\n event.dataTransfer.setData(\"divId\", event.target.id);\n console.log(\"----drag----:\");\n }", "function createDragAndDropListener() {\n\n //Create Listeners for Columns\n var tempColumns = document.getElementsByClassName('evo_c-divtable-column');\n if (tempColumns != null) {\n for (var i = 0; i < tempColumns.length; i++) {\n tempColumns[i].addEventListener('dragstart', handleColumnDragStart, false);\n tempColumns[i].addEventListener('dragenter', handleColumnDragEnter, false)\n tempColumns[i].addEventListener('dragover', handleColumnDragOver, false);\n tempColumns[i].addEventListener('dragleave', handleColumnDragLeave, false);\n tempColumns[i].addEventListener('drop', handleColumnDrop, false);\n tempColumns[i].addEventListener('dragend', handleColumnDragEnd, false);\n }\n }\n //Create Listeners for Rows\n var tempRows = document.getElementsByClassName('evo_c-divtable-row_evo_c-divtable-header');\n if (tempRows != null) {\n for (var i = 0; i < tempRows.length; i++) {\n tempRows[i].addEventListener('dragstart', handleRowDragStart, false);\n tempRows[i].addEventListener('dragenter', handleRowDragEnter, false)\n tempRows[i].addEventListener('dragover', handleRowDragOver, false);\n tempRows[i].addEventListener('dragleave', handleRowDragLeave, false);\n tempRows[i].addEventListener('drop', handleRowDrop, false);\n tempRows[i].addEventListener('dragend', handleRowDragEnd, false);\n }\n }\n }", "onDrag(mousePosition) {\n }", "onDrop({ context, event }) {\n const me = this,\n { currentOverClient, dragData } = me;\n\n if (!context.valid) {\n return me.onInvalidDrop({ context, event });\n }\n\n let modified = false;\n\n me.updateDragContext(context, event);\n\n if (me.tip) {\n me.tip.hide();\n }\n\n if (context.valid && dragData.startDate && dragData.endDate) {\n dragData.finalize = (...params) => {\n me.finalize(...params);\n context.finalize(...params);\n };\n\n // Allow implementer to take control of the flow, by returning false from this listener,\n // to show a confirmation popup etc. This event is documented in EventDrag and TaskDrag\n currentOverClient.trigger(`before${currentOverClient.capitalizedEventName}DropFinalize`, {\n context: dragData,\n event\n });\n\n context.async = dragData.async;\n\n // Internal validation, making sure all dragged records fit inside the view\n if (!context.async && me.isValidDrop(dragData)) {\n modified = dragData.startDate - dragData.origStart !== 0 || dragData.newResource !== dragData.resourceRecord;\n }\n }\n\n if (!context.async) {\n me.finalize(dragData.valid && context.valid && modified);\n }\n }", "onDragOver(e) {\n\t\tif (this.props.children) {return;}\n\t\te.preventDefault();\n\t}", "function onMouseDown(event)\n{\n dragging = true;\n var pos = getRelative(event);\n mouseDragStartX = pos.x;\n mouseDragStartY = pos.y;\n}", "onDrop({\n context,\n event\n }) {\n var _me$tip;\n\n const me = this,\n {\n currentOverClient,\n dragData\n } = me;\n let modified = false;\n me.updateDragContext(context, event);\n (_me$tip = me.tip) === null || _me$tip === void 0 ? void 0 : _me$tip.hide();\n\n if (context.valid && dragData.startDate && dragData.endDate) {\n dragData.finalize = (...params) => {\n me.finalize(...params);\n context.finalize(...params);\n }; // Allow implementer to take control of the flow, by returning false from this listener,\n // to show a confirmation popup etc. This event is documented in EventDrag and TaskDrag\n\n currentOverClient.trigger(`before${currentOverClient.capitalizedEventName}DropFinalize`, {\n context: dragData,\n event\n });\n context.async = dragData.async; // Internal validation, making sure all dragged records fit inside the view\n\n if (!context.async && me.isValidDrop(dragData)) {\n modified = dragData.startDate - dragData.origStart !== 0 || dragData.newResource !== dragData.resourceRecord;\n }\n }\n\n if (!context.async) {\n me.finalize(dragData.valid && context.valid && modified);\n }\n }" ]
[ "0.769651", "0.76147044", "0.75004053", "0.7474787", "0.74141115", "0.7351664", "0.7288885", "0.728741", "0.7240025", "0.7213235", "0.7125893", "0.7100127", "0.70821434", "0.70630836", "0.70545024", "0.7022991", "0.7002271", "0.699019", "0.69885576", "0.6972374", "0.69563496", "0.6940695", "0.6932968", "0.6929654", "0.6911473", "0.68969965", "0.68879527", "0.6883808", "0.6850449", "0.68372744", "0.68358904", "0.6828245", "0.6828245", "0.6827669", "0.68141687", "0.6799768", "0.6776666", "0.6773689", "0.6767416", "0.67549485", "0.6728744", "0.6667604", "0.66601694", "0.6652104", "0.6644755", "0.6636891", "0.6634047", "0.66302603", "0.66280735", "0.65972275", "0.6589582", "0.65568864", "0.6554942", "0.6552281", "0.6535565", "0.64517456", "0.6451015", "0.64480984", "0.6440658", "0.64357007", "0.6424442", "0.64186454", "0.6410786", "0.64106464", "0.64106464", "0.64106464", "0.64106464", "0.64106464", "0.64106464", "0.64106464", "0.6392909", "0.63900965", "0.638999", "0.63768995", "0.6373505", "0.6361088", "0.6359745", "0.6340895", "0.63402706", "0.6329471", "0.63236254", "0.6297755", "0.6295143", "0.6277845", "0.6277513", "0.62742764", "0.6267338", "0.626578", "0.6245538", "0.62295705", "0.6223456", "0.6197477", "0.6191766", "0.6190825", "0.6188107", "0.6187702", "0.6186583", "0.61859727", "0.61650103", "0.61586714" ]
0.68473554
29
Listen drop event for drag&drop
async function onDrop(event) { // Prevent default behavior (Prevent file from being opened) event.preventDefault(); if (event.dataTransfer.files) { onFilesDroppedOrSelected(event.dataTransfer.files); } else { console.log(`Your browser does not support FileList`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static dragEvents(){\n //enter drag\n Quas.on(\"dragenter dragstart\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).addCls(\"dragenter\");\n });\n\n //exit drag\n Quas.on(\"dragend dragleave\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n });\n\n //prevent default on other drag events\n Quas.on(\"drag dragover\", \".drop\", function(e){\n e.preventDefault();\n });\n\n //dropping the file\n Quas.on(\"drop\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n upload(e.dataTransfer.files, function(data){\n //todo progress bar\n closeToolModals();\n Quas.getEl(\"#post-tool-cloud\").visible(true);\n loadModal(\"cloud\");\n });\n });\n }", "onDrop(event) {\r\n event.preventDefault(); // Allows for dropping\r\n const data = event.dataTransfer.getData(\"text\");\r\n if (data == locationAncestor_type_1.dragAndDropName && this.state.inDropMode) {\r\n this.module.onDrop();\r\n }\r\n }", "drag(ev) {\n // console.log('drag')\n }", "function handleDrop(event) {\n unhighlight(event);\n var dt = event.dataTransfer;\n var files = dt.files;\n handleFiles(files);\n }", "function drop(e) {\n if (_isDraggingFile) {\n e.preventDefault();\n\n _outerCounter = 0;\n _innerCounter = 0;\n _isDraggingFile = false;\n\n var files = [];\n\n if (e.dataTransfer.items) {\n for (var i = 0; i < e.dataTransfer.items.length; i++) {\n if (e.dataTransfer.items[i].kind === 'file') {\n files.push(e.dataTransfer.items[i].getAsFile());\n }\n }\n }\n\n if (files.length > 0) {\n $(this).removeClass(\"drop-over\");\n $(\"html\").removeClass(\"dragging\");\n wvy.fileupload.uploadBlobs(files, $(jQuery.data($(this)[0], \"target\")));\n }\n }\n }", "setDropListener() {\n this.holder.addEventListener(\"drop\", (event) => {\n const { target } = event;\n if (this.holder.contains(target)) {\n const dropTarget = this.getDropTarget(target);\n if (dropTarget) {\n this.endBlock = this.getTargetPosition(dropTarget);\n this.moveBlocks();\n }\n }\n\n var evt = document.createEvent(\"MouseEvents\");\n evt.initEvent(\"mouseup\", true, true);\n document.dispatchEvent(evt);\n });\n }", "function handleDrop() {\n stopScroll();\n // drop draggable in to place smoothly\n $dragging.animate({'top': positions[$dragging.data('draggable-index')]}, 'fast', reset);\n $dragging.trigger('drop.dragdroplist');\n }", "function onDrop(event) {\n alert(\"Now Dropping!!\");\n // cancel event\n if (event.stopPropagation) {\n event.stopPropagation();\n }\n if (event.preventDefault) {\n event.preventDefault();\n }\n if (event.dataTransfer.files) {\n var files = event.dataTransfer.files;\n readFile(files);\n }\n }", "function drop(ev){\r\n ev.preventDefault(ev);\r\n}", "function addDragDropHandler(canvas) {\n canvas.addEventListener('dragover', onDragOver, false);\n canvas.addEventListener('drop', onDrop, false);\n}", "function onDrop() {\n\t\tobject.style.display = \"none\";\n\n\t\tvar\n\t\telement = document.elementFromPoint(onDrag.x, onDrag.y),\n\t\tevent = hasListener ? document.createEvent(\"MouseEvent\") : document.createEventObject();\n\n\t\tevent.MsDataTransfer = new DataTransfer(arguments);\n\n\t\thasListener && event.initMouseEvent(\"drop\", true, true, document.defaultView, 1, 0, 0, 0, 0, false, false, false, false, 0, null);\n\n\t\thasListener ? element.dispatchEvent(event) : element.fireEvent(\"ondrop\", event);\n\n\t\tonDrop.active = false;\n\t}", "function _handleDrop(e){\n\n var files = e.originalEvent.dataTransfer.files,\n docPath =currentDoc.file._parentPath,\n relativeFilename;\n\n if(files && files.length){\n e.stopPropagation();\n e.preventDefault();\n\n brackets.app.getDroppedFiles(function(err, paths){\n if(!err){\n relativeFilename = abspath2rel( docPath, paths[0] );\n doInsert({text:relativeFilename});\n hideDialog();\n }\n });\n }\n }", "function drop (event) {\r\n console.log(\"drop\");\r\n event.stopPropagation();\r\n event.stopImmediatePropagation();\r\n event.preventDefault();\r\n\r\n // Check if box id matches pic id and allow drop and then\r\n // Remove dragged pic from top space and data and add to correct box\r\n if (this.classList.contains(\"DnD__dropZone-dropHere\")\r\n && this.id === draggedPic.id) {\r\n this.classList.remove(\"DnD__dropZone-active\");\r\n var picID = event.dataTransfer.getData(\"text\");\r\n event.target.appendChild(document.getElementById(picID));\r\n\r\n // Show next pic to drag again\r\n rolePics.shift();\r\n showPic();\r\n } else {\r\n this.classList.remove(\"DnD__dropZone-active\");\r\n }\r\n }", "function dragOverHandler(ev) {\n // console.log('File(s) in drop zone');\n\n // Prevent default behavior (Prevent file from being opened)\n ev.preventDefault();\n}", "initDragAndDrop() {\n // treat body as drag and drop zone\n this.dndZone = document.getElementById('drag-and-drop');\n this.dndZone.addEventListener('dragover', this.onDragOver);\n this.dndZone.addEventListener(\"dragleave\", this.onDragLeave);\n this.dndZone.addEventListener('drop', this.onDragDrop);\n }", "function drop(e) {\n e.stopPropagation();\n e.preventDefault();\n displayFile(e.dataTransfer.files);\n}", "function allowDrop(event) {\n //console.log(\"lo puedo_dejar_aqui\")\n event.preventDefault();\n}", "_drop() {\n if (!this.element || !this.$()) { return; }\n\n let element = this.get('handle') ? this.$(this.get('handle')) : this.$();\n this._preventClick(element);\n\n this.set('isDragging', false);\n this.set('isDropping', true);\n\n this._tellGroup('update');\n\n this._waitForTransition()\n .then(run.bind(this, '_complete'));\n }", "function allowDrop(ev){\nev.preventDefault();}", "function drop(e){\n e.preventDefault();\n // Remove Background Color/Padding\n listColumns.forEach((column)=>{\n column.classList.remove('over');\n\n });\n // Add Item to Column\n const parent =listColumns[currentColumn];\n parent.appendChild(draggedItem);\n // Dragging complete\n dragging=false;\n rebuildArrays();\n}", "function drop(e) {\n e.preventDefault();\n // Remove Background Color/Padding\n listColumns.forEach((col) => {\n col.classList.remove(\"over\");\n });\n // Add Item to Column\n const parent = listColumns[currentColumn];\n parent.appendChild(draggedItem);\n dragging = false;\n rebuildArrays();\n}", "function drop(e) {\r\n e.preventDefault();\r\n const parent = listColumns[currentColumn];\r\n // Remove Background Color/Padding\r\n listColumns.forEach((column) => {\r\n column.classList.remove('over');\r\n });\r\n // Add item to Column\r\n parent.appendChild(draggedItem);\r\n // Dragging complete\r\n dragging = false;\r\n rebuildArrays();\r\n}", "function drop(e) {\n e.preventDefault()\n const parent = listColumns[currentColumn]\n // Remove Background Color Padding\n listColumns.forEach((column) => {\n column.classList.remove('over')\n })\n // Add Item To Column\n parent.appendChild(draggedItem)\n // Dragging complete\n dragging = false\n rebuildArrays()\n}", "function do_drop(e, attachedElement) {\r\n log(\"do drop: \" + e.clientX + \", \" + e.clientY);\r\n letGo(attachedElement);\r\n}", "function setupDragDropListener(obj){\n obj.addEventListener(\"dragover\", fileDragHover, false);\n obj.addEventListener(\"dragleave\", fileDragHover, false);\n obj.addEventListener(\"drop\", fileSelectHandler, false);\n obj.style.display = \"block\";\n }", "function drop(ev) {\n ev.preventDefault();\n var data = ev.dataTransfer.getData(\"text\");\n if (ev.target.tagName == \"CANVAS\") {\n moveAndDrawImageToCanvas(document.getElementById(data), ev.target)\n } else {\n ev.target.appendChild(document.getElementById(data));\n }\n}", "function dragDropVisual () {\n // Start the drag effect\n $('.drop-zone').on('dragover', function (e) {\n e.preventDefault()\n e.stopPropagation()\n $(this).addClass('dragover')\n })\n\n // Stop the effect when mouse out/release\n $('.drop-zone').on('dragleave dragend', function (e) {\n e.preventDefault()\n e.stopPropagation()\n $(this).removeClass('dragover')\n })\n\n // Stop when successfully dropped\n $('.drop-zone').on('drop', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $(this).removeClass('dragover')\n\n // we're interested in just first file\n var files = e.originalEvent.dataTransfer.files\n for (var i = 0; i < files.length; i++) {\n parseImport(files[i])\n }\n })\n}", "function DST_release(e) {\n\tvar ev = e || window.event;\n\tvar Drop = Drag.Drop;\n\tDrop.target = ev.target || ev.srcElement;\n\tDrop.to = Drop.target ? Drop.target.parentNode : null;\n\n\t//unhook:\n\tdocument.onmouseup = null;\n\t//unstyle:\n\tDrag.object.className = \n\tDrag.object.className.replace(Drag.channel.regexps.drag, \"\");\n\tfor (var i = 0; i < Drag.channel.containers.length; i++) {\n\t\tDrag.channel.containers[i].className =\n\t\tDrag.channel.containers[i].className.replace(Drag.channel.regexps.drop, \"\");\n\t}\n\n\t//drop?\n\tif (!Drop.target) return false;\n\tif (Drop.target == Drag.object) return true;\n\n\tvar drop_tree = 0; // are sub-level drops allowed in general?\n\tvar drop_into = 0; // is *current* drop a sub-level drop?\n\tif (Drag.channel.classes.ruler != '') {\n\t\tdrop_tree = 1;\n\t\tdrop_into = 1;\n\t \tif (Drop.target.className.search(Drag.channel.classes.ruler) != -1) drop_into = 0;\n\t}\n\n\tvar drop_handler; //HACK -- call a specified function instead of doing anything\n\tdrop_handler = Drop.target.getAttribute('data-drop-handler');\n\tif (drop_handler) {\n\t\tvar fn = window[drop_handler];\n\t\tif (typeof fn === 'function') {\n\t\t\tfn(Drop.target, Drag.object);\n\t\t\treturn true;\n\t\t}\n\t\talert(\"undefined function \" + drop_handler + \", can't handle drop\");\n\t\treturn false;\n\t}\n\n\tvar Drop_channel;\n\twhile ((Drop_channel = DST.find_channel(Drop.to)) == null) {\n\t\tDrop.target = Drop.to;\n\t\tDrop.to = Drop.target.parentNode;\n\t\tif (!Drop.to) return false;\n\t}\n\n\tif (Drag.channel != Drop_channel) return false;\n\tif (Drop.target == Drag.object) return true;\n\n\tvar Drop_object = null;\n\n\t//dropping to trash\n\tif (Drag.channel.classes.trash && Drop.target.className.search(\n\t\tDrag.channel.classes.trash) != -1) {\n\t\t//do not delete singletons\n\t\tif (Drag.object.className.search(Drag.channel.regexps.factory_or_singleton) != -1)\n\t\t\tdrop_into = 0;\n\n\t\t//do not delete unless dropping INTO trash \n\t\tif (drop_tree == 0 || drop_into == 1) {\n\t\t\t//delete\n\t\t\tDrag.parent.removeChild(Drag.object);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t//handle the factory ideom\n\tif (Drag.channel.classes.factory) {\n\t\t//dropping TO factory\n\t\tif (Drop.target.className.search(Drag.channel.classes.factory) != -1) {\n\t\t\tif ((drop_tree == 0 || drop_into == 1) \n\t\t\t\t&& Drag.channel.same_factory(Drop.target, Drag.object)) {\n\t\t\t\t//delete\n\t\t\t\tDrag.parent.removeChild(Drag.object);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t//never insert anything INTO a factory\n\t\t\tdrop_into = 0;\n\t\t}\n\n\t\t//dropping A factory\n\t\tif (Drag.object.className.search(Drag.channel.classes.factory) != -1) {\n\t\t\t//copy\n\t\t\tvar new_node = Drag.object.cloneNode(true);\n\t\t\tnew_node.className = \n\t\t\tnew_node.className.replace(\n\t\t\t\tDrag.channel.classes.factory,\n\t\t\t\tDrag.channel.classes.product );\n\t\n\t\t\tDrop_object = new_node;\n\t\t}\n\t}\n\n\tif (drop_into)\n\t{\n\t\t//if a node is trying to append itself to it's own child, the whole thing is illegal\n\t\tif (isChildOf(Drop.target, Drag.object)) return false;\n\n\t\tvar found = -1;\n\t\tfor (var i = 0; i < Drop.target.childNodes.length; i++) {\n\t\t\tif (DST.find_channel(Drop.target.childNodes[i]) != null) {\n\t\t\t\tfound = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (found == -1) {\n\t\t\t// Cut\t\n\t\t\tif (!Drop_object) Drop_object = Drag.parent.removeChild(Drag.object)\n\t\t\t//create new list\n\t\t\tvar new_list = Drop.to.cloneNode(false);\n\t\t\tnew_list.appendChild ( Drop_object );\n\t\t\tDrag.channel.reg_container(new_list, true);\n\n\t\t\tDrop.to = Drop.target;\n\t\t\tDrop.target = null;\n\t\t\tDrop_object = new_list;\n\n\t\t} else {\n\t\t\t//append to existing list\n\t\t\tDrop.to = Drop.target.childNodes[found];\n\t\t\tDrop.target = null;\n\t\t\tif (!Drop_object) Drop_object = Drag.parent.removeChild(Drag.object);\n\t\t}\n\n\t}\n\n\tif (Drag.parent == Drop.to) {\n\t\tif (Drag.channel.classes.swap && Drop.to.className.search(\n\t\t\tDrag.channel.classes.swap) != -1) {\n\t\t\t//swap\n\t\t\tif (Drag.object.nextSibling == Drop.target)\n\t\t\t\tswapNode(Drop.target, Drag.object);\n\t\t\telse\n\t\t\t\tswapNode(Drag.object, Drop.target);\n\t\t\treturn;\n\t\t}\n\t}\n\n\t// Cut\t\n\tif (!Drop_object) Drop_object = Drag.parent.removeChild(Drag.object)\n\n\t// Paste\n\tif (!Drop.target) \n\t\tDrop.to.appendChild(Drop_object);\n\telse\n\t\tDrop.to.insertBefore(Drop_object, Drop.target);\n\treturn true;\n}", "function onDrop(acceptedFiles, rejectedFiles) {\n // do stuff with files...\n}", "function onWidgetDrop(event) {\n // Move the widget to the target widget.\n viewmodel.moveWidget(draggedWidget, viewmodel.getWidgetFromElementId(this.id));\n event.preventDefault();\n }", "function allowDrop(ev) {\n ev.preventDefault();\n console.log(\"allowDrop\");\n}", "onFileDropped($event) {\n this.prepareFilesList($event);\n }", "function dragDropped(arg) {\n\t\tif (Y.Lang.isArray(arg.value)) {\n\t\t\targ = arg.value;\n\t\t}\n\n\t\tfor (var i = 0; i < arg.length; i++) {\n\t\t\tif (arg[i].mimeType[0] == \"application/x-folder\") { continue; }// skip folders\n\t\t\tfilesToUpload.push(arg[i]);\n\t\t} \n\n\t\t// now let's disable that pesky drop target.\n\t\tlog(START, \"Now processing \" + filesToUpload.length + \" files...\");\n\t\tenableDropTarget(false);\n\t\tstartNextUploadTest();\n\t}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function drag(e) {\n draggedItem = e.target;\n dragging = true;\n}", "onDrop({ context, event }) {\n const me = this,\n { currentOverClient, dragData } = me;\n\n if (!context.valid) {\n return me.onInvalidDrop({ context, event });\n }\n\n let modified = false;\n\n me.updateDragContext(context, event);\n\n if (me.tip) {\n me.tip.hide();\n }\n\n if (context.valid && dragData.startDate && dragData.endDate) {\n dragData.finalize = (...params) => {\n me.finalize(...params);\n context.finalize(...params);\n };\n\n // Allow implementer to take control of the flow, by returning false from this listener,\n // to show a confirmation popup etc. This event is documented in EventDrag and TaskDrag\n currentOverClient.trigger(`before${currentOverClient.capitalizedEventName}DropFinalize`, {\n context: dragData,\n event\n });\n\n context.async = dragData.async;\n\n // Internal validation, making sure all dragged records fit inside the view\n if (!context.async && me.isValidDrop(dragData)) {\n modified = dragData.startDate - dragData.origStart !== 0 || dragData.newResource !== dragData.resourceRecord;\n }\n }\n\n if (!context.async) {\n me.finalize(dragData.valid && context.valid && modified);\n }\n }", "function drop(ev) {\n ev.preventDefault();\n var dato = ev.dataTransfer.getData(\"Text\");\n ev.target.appendChild(document.getElementById(dato));\n document.getElementById(dato);\n ev.target.style.background = \"rgb(229, 229, 255)\";\n validarCampos(ev)\n}", "function drag(e) {\r\n draggedItem = e.target;\r\n dragging = true;\r\n}", "function dropHandler(ev) {\n ev.preventDefault();\n for (const file of ev.dataTransfer.files) {\n addFile(gallery, file);\n overlay.classList.remove(\"draggedover\");\n counter = 0;\n }\n}", "handleDrop(e) {\n e.stopPropagation();\n e.preventDefault();\n\n if (this.isDragInProgress) {\n handleDrop(getBaseComponent(this), this.dragMonitor);\n\n this.isOver = false;\n }\n\n return false;\n }", "function onDrop(source, target) {\n //emits event after piece is dropped\n var room = formEl[1].value\n socket.emit('Dropped', { source, target, room })\n}", "function drag(e) {\n draggedItem = e.target\n dragging = true\n}", "onDrop (files) {\n const fileArray = [];\n for (let idx = 0; idx < files.length; idx++) {\n fileArray.push(files[idx]);\n }\n this.props.onDrop(fileArray);\n }", "function drop(event) {\n event.preventDefault();\n\n // Remove background color / padding\n columnElArray.forEach(columnEl => {\n columnEl.classList.remove('over');\n });\n\n // Add item to column\n const parentEl = currentColumnEl;\n parentEl.append(draggedItem);\n dragging = false;\n\n updateArrays();\n updateDOM();\n}", "function allowDrop(ev){\n\tev.preventDefault();\n}", "function CdkDragDrop() {}", "function CdkDragDrop() {}", "function allowDrop(ev) {\r\n\tev.preventDefault();\r\n}", "function drag(event) {\n draggedItem = event.target;\n dragging = true;\n}", "function createDragAndDropListener() {\n\n //Create Listeners for Columns\n var tempColumns = document.getElementsByClassName('evo_c-divtable-column');\n if (tempColumns != null) {\n for (var i = 0; i < tempColumns.length; i++) {\n tempColumns[i].addEventListener('dragstart', handleColumnDragStart, false);\n tempColumns[i].addEventListener('dragenter', handleColumnDragEnter, false)\n tempColumns[i].addEventListener('dragover', handleColumnDragOver, false);\n tempColumns[i].addEventListener('dragleave', handleColumnDragLeave, false);\n tempColumns[i].addEventListener('drop', handleColumnDrop, false);\n tempColumns[i].addEventListener('dragend', handleColumnDragEnd, false);\n }\n }\n //Create Listeners for Rows\n var tempRows = document.getElementsByClassName('evo_c-divtable-row_evo_c-divtable-header');\n if (tempRows != null) {\n for (var i = 0; i < tempRows.length; i++) {\n tempRows[i].addEventListener('dragstart', handleRowDragStart, false);\n tempRows[i].addEventListener('dragenter', handleRowDragEnter, false)\n tempRows[i].addEventListener('dragover', handleRowDragOver, false);\n tempRows[i].addEventListener('dragleave', handleRowDragLeave, false);\n tempRows[i].addEventListener('drop', handleRowDrop, false);\n tempRows[i].addEventListener('dragend', handleRowDragEnd, false);\n }\n }\n }", "onDrop(evt) {\n\t\tevt.preventDefault();\n\t}", "function allowDrop(ev) {\n\tev.preventDefault();\n\tconsole.log(ev.target);\n}", "function dragOverHandler(ev) {\n // console.log('File(s) in drop zone'); \n document.getElementById(\"dragdropcontainer\").style.backgroundColor = \"white\";\n // Prevent default behavior (Prevent file from being opened)\n ev.preventDefault();\n}", "function addDragDropHandlers(element) {\n element.addEventListener('dragstart', handleDragStart, false);\n element.addEventListener('dragenter', handleDragEnter, false)\n element.addEventListener('dragover', handleDragOver, false);\n element.addEventListener('dragleave', handleDragLeave, false);\n element.addEventListener('drop', handleDrop, false);\n element.addEventListener('dragend', handleDragEnd, false);\n }", "onMouseDrag(e) {}", "drag(event) {\n event.dataTransfer.setData(\"divId\", event.target.id);\n console.log(\"----drag----:\");\n }", "function drop(e) {\n e.preventDefault();\n}", "_setEvents() {\n\n if (this.fileInputLinkEle) {\n //Show file reference dialog when clicking the \"Select File\" link\n this.fileInputLinkEle.addEventListener('click', evt => {\n this.fileInputEle.click();\n evt.preventDefault();\n });\n }\n\n if (this.fileInputEle) {\n //Add a file when a file is selected on the file reference dialog\n this.fileInputEle.addEventListener('change', evt => {\n\n const selectedFiles = evt.target.files;\n\n //Add dropped file(s).\n this.doDrop(selectedFiles);\n });\n }\n\n\n this.fileDropAreaEle.addEventListener('dragenter', evt => {\n\n evt.preventDefault();\n\n // If there is a child element in the file drop area\n // Count enter/leave to ignore \"dragenter\"/\"dragleave\" event in child element\n this.enterLeaveNum++;\n\n const draggingObjectTypes = evt.dataTransfer.types;\n\n\n // If dragging objects contains \"file\" type object,\n // then set a flag to indicate that it can be dropped\n let draggingObjectContainsFile = false;\n\n for (const draggingObjectType of draggingObjectTypes) {\n if (draggingObjectType === 'Files') {\n draggingObjectContainsFile = true;\n break;\n }\n }\n\n if (!draggingObjectContainsFile) {\n this.nonFileObjectDragging = true;\n } else {\n this.nonFileObjectDragging = false;\n }\n\n\n if (this.nonFileObjectDragging) {\n this.fileDropAreaEle.style.cursor = 'not-allowed';\n this.fileDropAreaEle.classList.add(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n return;\n } else {\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.add(this.DRAG_OVER_CLS_NAME);\n return;\n }\n\n });\n\n this.fileDropAreaEle.addEventListener('dragover', evt => {\n\n if (this.nonFileObjectDragging) {\n //Return here to show 'forbidden' icon.\n return;\n }\n evt.preventDefault();\n });\n\n this.fileDropAreaEle.addEventListener('dragleave', evt => {\n\n this.enterLeaveNum--;\n\n if (this.enterLeaveNum === 0) {\n //When it comes out of the parent element (dragleave)\n\n if (this.nonFileObjectDragging) {\n this.nonFileObjectDragging = false;\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n } else {\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_CLS_NAME);\n }\n\n }\n\n });\n\n this.fileDropAreaEle.addEventListener('drop', evt => {\n\n evt.stopPropagation();\n evt.preventDefault();\n\n this.enterLeaveNum = 0;\n\n if (this.nonFileObjectDragging) {\n this.nonFileObjectDragging = false;\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n return;//Skip adding dropped file.\n\n } else {\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_CLS_NAME);\n }\n\n const selectedFiles = evt.dataTransfer.files;\n\n //Add dropped file(s).\n this.doDrop(selectedFiles);\n\n });\n\n }", "prepareDropTarget() {\n this.dropTargetView.addEventListener('dragover', (e) => {\n e.stopPropagation();\n e.preventDefault();\n });\n this.dropTargetView.addEventListener('dragenter', (e) => {\n e.stopPropagation();\n e.preventDefault();\n });\n this.dropTargetView.addEventListener('drop', (e) => {\n e.stopPropagation();\n e.preventDefault();\n\n const fileInfo = e.dataTransfer.files[0];\n\n const reader = new FileReader();\n reader.onload = (re) => this.loadFile(fileInfo.name, re.target.result);\n reader.readAsText(fileInfo);\n });\n }", "function enableDropArea() {\n\tdropArea.addEventListener(\"drop\", dropHandler);\n\tdropArea.addEventListener(\"dragover\", dragOverHandler);\n\tdropArea.addEventListener(\"dragleave\", dragLeaveHandler);\n}", "function allowDrop(ev,idchanger) {\n\t\n ev.preventDefault();\n \n \n}", "function listenDropFiles() {\n\n\t// Set the drag & drop div ID\n\tvar dropFilesDiv = document.getElementById(\"ajaxContentWindow\");\n\tvar dropFilesCheckDiv = document.getElementById(\"dropFilesCheckDiv\");\n\t\n\tvar xmlhttp = new XMLHttpRequest();\n\t\n\t// Check if upload is supported\n\tif (xmlhttp.upload) {\n\n\t\t// Add listener to file drop div\n\t\tdropFilesDiv.addEventListener(\"dragover\", stopBrowserActions, false);\n\t\tdropFilesDiv.addEventListener(\"dragleave\", stopBrowserActions, false);\n\t\tdropFilesDiv.addEventListener(\"drop\", captureDropFiles, false);\n\t\t\n\t\t// D&D supported message\n\t\t//dropFilesCheckDiv.innerHTML = lang_support_drop;\n\t\t//dropFilesCheckDiv.className = 'dropFilesCheckPassColor';\n\t\t\n\t} else {\n\t\n\t\t// D&D unsupported message\n\t\t//dropFilesCheckDiv.innerHTML = lang_no_support_drop;\n\t\t//dropFilesCheckDiv.className = 'dropFilesCheckFailColor';\n\t}\n}", "function allowDrop (ev) {\n ev.preventDefault ();\n}", "function allowDrop(ev) {\r\n\tev.preventDefault();\r\n }", "function allowDrop(ev)\n{\n\tev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function dropAble(mimeTypes, onDrop) {\n return function ($node) {\n $node.on('dragenter', function () {\n var e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\n //var xy = mouse($node.node());\n if (hasDnDType(e, mimeTypes)) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', true);\n //sounds good\n return false;\n }\n //not a valid mime type\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\n }).on('dragover', function () {\n var e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\n if (hasDnDType(e, mimeTypes)) {\n e.preventDefault();\n updateDropEffect(e);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', true);\n return false;\n }\n }).on('dragleave', function () {\n //\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\n }).on('drop', function (d) {\n var e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\n e.preventDefault();\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\n //var xy = mouse($node.node());\n if (hasDnDType(e, mimeTypes)) {\n var data_1 = {};\n //selects the data contained in the data transfer\n mimeTypes.forEach(function (mime) {\n var value = e.dataTransfer.getData(mime);\n if (value !== '') {\n data_1[mime] = value;\n }\n });\n return onDrop(data_1, d, copyDnD(e));\n }\n });\n };\n}", "dragEnd(e){\n console.log('--| [drag end]');\n }", "function allowDrop(ev) {\n\tev.preventDefault();\n}", "function allowDrop(ev) {\n\tev.preventDefault();\n}", "onDrop(evt) {\n evt.preventDefault();\n const { onComplete, multiple, output, onError } = this.props;\n const files = Array.from(evt.dataTransfer.files).filter((file) => {\n if (output && outputs[output])\n return file.type === outputs[output].mimeType;\n return true;\n });\n if (files.length)\n Promise.all(files.map(file => this.readFile(file)))\n .then(results => this.output(results))\n .catch(err => onError(err));\n else\n onComplete(multiple ? [] : null);\n }", "function drop(ev) {\n ev.preventDefault();\n var datos=ev.dataTransfer.getData(\"text\");\n ev.target.appendChild(document.getElementById( datos));\n var destino = ev.target.id\n console.log(\"destino: \"+destino);\n console.log(\"objeto: \"+datos);\n edit_Kanban(destino, datos)\n ev.stopPropagation();\n}", "onDrop(e) {\n e.preventDefault();\n\n // Loop through array of files and upload each file\n if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length > 0) {\n // eslint-disable-next-line no-plusplus,no-cond-assign\n for (let i = 0, f; f = e.dataTransfer.files[i]; i++) {\n document.querySelector('.media-dragoutline').classList.remove('active');\n this.upload(f);\n }\n }\n document.querySelector('.media-dragoutline').classList.remove('active');\n }", "function allowDrop(ev) {\r\n ev.preventDefault();\r\n}", "function allowDrop(ev) {// credit to https://www.w3schools.com/HTML/html5_draganddrop.asp\n ev.preventDefault();\n}", "function handleDrop(e) {\n e.stopPropagation();\n\n var status = \"\" \n\n //user may move backlog items to inprogress\n if (backlogColumn.contains(dragSrcEl) && inProgressColumn.contains(this)) {\n inProgressColumn.appendChild(dragSrcEl);\n status = 'inProgress';\n updateTaskStatus(dragSrcEl, status)\n }\n //user may move inProgress items to Complete\n else if (inProgressColumn.contains(dragSrcEl) && completeColumn.contains(this)) {\n completeColumn.appendChild(dragSrcEl);\n status = 'complete';\n updateTaskStatus(dragSrcEl, status)\n }\n //user may move items backwards from inProgress to Backlog\n else if (inProgressColumn.contains(dragSrcEl) && backlogColumn.contains(this)) {\n backlogColumn.appendChild(dragSrcEl);\n status = 'backlog';\n updateTaskStatus(dragSrcEl, status)\n }\n //user may move items backwards from complete to inProgress\n else if (completeColumn.contains(dragSrcEl) && inProgressColumn.contains(this)) {\n inProgressColumn.appendChild(dragSrcEl);\n status = 'inProgress';\n updateTaskStatus(dragSrcEl, status)\n }\n //user may not move tasks by more than one column at a time\n else if (\n (completeColumn.contains(dragSrcEl) && backlogColumn.contains(this)) ||\n (backlogColumn.contains(dragSrcEl) && completeColumn.contains(this))\n ) {\n alert(\"You may only move tasks by one column at a time\");\n\n //remove any colored borders after alert\n inProgressColumn.classList.remove(\"goRight\");\n inProgressColumn.classList.remove(\"goLeft\");\n }\n\n return false;\n}", "drop_file(e) {\r\n let droppedFiles = e.dataTransfer.files;\r\n if(!droppedFiles) return;\r\n this.$parent.upload_image(droppedFiles[0]);\r\n }", "function dropFile(event)\n\t{\n\t\t// stop the browser doing\n\t\t// it's normal thing of going\n\t\t// to the item\n\t\tevent.stopPropagation();\n\t\tevent.preventDefault();\n\t\t\n\t\t// query what was dropped\n\t\tvar files = event.dataTransfer.files;\n\t\t\n\t\t// if we have something\n\t\tif(files.length) {\n\t\t\thandleFile(files[0]);\n\t\t}\n\t\t\n\t\treturn false;\n\t}", "function drop(event) {\n clearSpaces();\n var checkerId = event.dataTransfer.getData(\"Text\");\n var destRow = Math.floor((event.pageY - 7 - document.getElementById(checkerId).parentElement.offsetTop) / 50);\n var destCol = Math.floor((event.pageX - 7 - document.getElementById(checkerId).parentElement.offsetLeft) / 50);\n\n if (isLegalMove(destRow, destCol, checkerId, currentColor)) {\n event.preventDefault();\n if (Math.abs(destRow - srcRow) == 1) {\n makeSimpleMove(destRow, destCol, checkerId);\n }\n else if (Math.abs(destRow - srcRow) == 2) {\n makeJumpMove(destRow, destCol, checkerId, currentColor);\n }\n if (((destRow == 7) || (destRow == 0)) && (!isAKing(checkerId))) {\n kingAPiece(destRow, destCol, checkerId);\n }\n var winner = checkForWinner();\n var previousBoard = document.getElementById(\"boardInput\").value;\n document.getElementById(\"boardInput\").value = getBoard();\n if (findIfChecked()) {\n getComputersMove();\n }\n }\n\n clickedCheckerId = null;\n}", "function presb_allowDrop(ev) {\n\tev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "function allowDrop(ev) {\n ev.preventDefault();\n}", "handleDragEnd({ destination, source, draggableId, type }) {}", "function drag(e) {\r\n //draggedItem = e.target; No need for a global variable here\r\n e.dataTransfer.setData(\"text\", e.target.id); // set data in drag and drop event to dragged element's id\r\n dragging = true;\r\n}", "function handleDropEvent( event, ui ) {\n var draggable = ui.draggable;\n\n // The following coordinates is where the user dropped relative to the\n // top-left of the graph\n var x = event.pageX - this.offsetLeft;\n var y = event.pageY - this.offsetTop;\n\n // Find next available id\n var id = 1;\n while (true) {\n var element = cy.getElementById(id.toString());\n if (element.length === 0)\n break;\n id += 1;\n }\n\n // Add the node with the id just found to the graph in the location dropped\n // into by the mouse.\n var newNode = ur.do('add', {\n group: 'nodes',\n data: {\n id: id.toString(),\n parameters: {\n action: id.toString(),\n app: \"None\",\n device: \"None\",\n errors: [\n {\n name: \"None\",\n nextStep: \"None\",\n flags: []\n }\n ],\n input: {}, \n name: id.toString(),\n next: [\n {\n name: \"None\",\n nextStep: \"None\",\n flags: []\n }\n ],\n }\n },\n position: { x: x, y: y }\n });\n\n newNode.on('click', onClick);\n }" ]
[ "0.764663", "0.75064576", "0.73780066", "0.73323184", "0.72952396", "0.7266148", "0.7223049", "0.7125478", "0.7116659", "0.70849293", "0.7083214", "0.70670176", "0.70559156", "0.70256853", "0.7014486", "0.7008006", "0.69967324", "0.6996727", "0.69838995", "0.6945833", "0.6939593", "0.69259304", "0.69082034", "0.6907505", "0.6900775", "0.6899658", "0.6898961", "0.689131", "0.68627256", "0.6834812", "0.68250996", "0.68197674", "0.68165517", "0.68118834", "0.6809774", "0.6808343", "0.68007344", "0.68002707", "0.679639", "0.679035", "0.67825747", "0.6781127", "0.6779981", "0.67766774", "0.677559", "0.676953", "0.676953", "0.67655045", "0.6759119", "0.6751838", "0.67470413", "0.6740684", "0.6739505", "0.6736376", "0.67334163", "0.6724097", "0.6716543", "0.67048186", "0.66982615", "0.66867703", "0.6681398", "0.66793805", "0.667738", "0.6674815", "0.6671136", "0.6670814", "0.6670814", "0.6670814", "0.6670814", "0.6670814", "0.6670814", "0.6670814", "0.6670814", "0.6666438", "0.6661639", "0.66470605", "0.66470605", "0.66395336", "0.6634389", "0.66315615", "0.6625694", "0.6625589", "0.6621642", "0.6615087", "0.6614534", "0.6609548", "0.6606207", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.66037875", "0.6602055", "0.65968865", "0.6595224" ]
0.7139374
7
Main method for drag & drop or fileinput selection.
async function onFilesDroppedOrSelected(fileList) { const images = []; // Use DataTransferItemList interface to access the file(s) for (let i = 0; i < fileList.length; i++) { // If dropped items aren't files, reject them const file = fileList[i]; if (file.type.split('/')[0] == 'image') { images.push({ name: file.name, file, }); } } if (images.length == 0) { console.log('No image found'); return; } const url = URL.createObjectURL(images[0].file); image = await loadImage(url); imageData = await readImageData(image); p.remove(); IMAGE_SIZE = [imageData.width, imageData.height]; min_omega = (Math.PI * 2) / (0.05 * IMAGE_SIZE[0]); max_omega = (Math.PI * 2) / (300.0 * IMAGE_SIZE[0]); lpf1 = new LowpassFilter(rate, lowpass1_cutoff * rate); lpf2 = new LowpassFilter(rate, lowpass2_cutoff * rate); lpf3 = new LowpassFilter(rate, lowpass3_cutoff * rate); new p5((p_) => { p = p_; p.setup = function () { const renderer = p.createCanvas(imageData.width, imageData.height); p.pixelDensity(1); resizer.canvas = renderer.canvas; resizer.dimension = [imageData.width, imageData.height]; resizer.calculateDimensions(); resizer.addStyles(); resizer.canvas.style.width = `${resizer.styleWidth}px`; resizer.canvas.style.height = `${resizer.styleHeight}px`; const pContext = p.drawingContext; pContext.putImageData(imageData, 0, 0); draw(); }; }, elements.container); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CdkDragDrop() {}", "function CdkDragDrop() {}", "function mouseDragged(){\r\n inputForMDragging(mouseX, mouseY);\r\n\r\n\r\n}", "function InitDragDrop() {\n document.onmousedown = OnMouseDown;\n document.onmouseup = OnMouseUp;\n}", "function SelectionUtil() {\n}", "function dragAction() {\n $(\".content-list\").selectable({\n selected: function(event, ui) {\n docListTools();\n },\n unselecting: function(event, ui) {\n docListTools();\n }\n });\n\n $(\".content-list\").find(\".folder\").draggable({\n revert: 'false',\n helper: function(event) {\n var $group = $(\"<div>\", {\n class: \"content-list\"\n });\n if ($(\".folder.ui-selected\").length) {\n var theClone = $(\".folder.ui-selected\").clone();\n theClone = $group.html(theClone);\n } else {\n theClone = $group.html($(this).clone());\n }\n return theClone;\n }\n });\n $(\".content-list\").find(\".data-folder\").droppable({\n tolerance: 'pointer',\n drop: function(event, ui) {\n var dragId = ui.draggable.attr(\"data-id\");\n var dragType = ui.draggable.attr(\"data-type\");\n var dropId = $(this).attr(\"data-id\");\n // relocate(dragId, dragType, dropId);\n if ($(\".folder.ui-selected\").length) {\n $(\".folder.ui-selected\").remove();\n } else {\n ui.draggable.remove();\n }\n\n $(this).removeClass(\"over-now\");\n },\n over: function(event, ui) {\n $(this).addClass(\"over-now\");\n },\n out: function(event, ui) {\n $(this).removeClass(\"over-now\");\n }\n });\n}", "static dragEvents(){\n //enter drag\n Quas.on(\"dragenter dragstart\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).addCls(\"dragenter\");\n });\n\n //exit drag\n Quas.on(\"dragend dragleave\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n });\n\n //prevent default on other drag events\n Quas.on(\"drag dragover\", \".drop\", function(e){\n e.preventDefault();\n });\n\n //dropping the file\n Quas.on(\"drop\", \".drop\", function(e){\n e.preventDefault();\n new Element(this).delCls('dragenter');\n upload(e.dataTransfer.files, function(data){\n //todo progress bar\n closeToolModals();\n Quas.getEl(\"#post-tool-cloud\").visible(true);\n loadModal(\"cloud\");\n });\n });\n }", "_setEvents() {\n\n if (this.fileInputLinkEle) {\n //Show file reference dialog when clicking the \"Select File\" link\n this.fileInputLinkEle.addEventListener('click', evt => {\n this.fileInputEle.click();\n evt.preventDefault();\n });\n }\n\n if (this.fileInputEle) {\n //Add a file when a file is selected on the file reference dialog\n this.fileInputEle.addEventListener('change', evt => {\n\n const selectedFiles = evt.target.files;\n\n //Add dropped file(s).\n this.doDrop(selectedFiles);\n });\n }\n\n\n this.fileDropAreaEle.addEventListener('dragenter', evt => {\n\n evt.preventDefault();\n\n // If there is a child element in the file drop area\n // Count enter/leave to ignore \"dragenter\"/\"dragleave\" event in child element\n this.enterLeaveNum++;\n\n const draggingObjectTypes = evt.dataTransfer.types;\n\n\n // If dragging objects contains \"file\" type object,\n // then set a flag to indicate that it can be dropped\n let draggingObjectContainsFile = false;\n\n for (const draggingObjectType of draggingObjectTypes) {\n if (draggingObjectType === 'Files') {\n draggingObjectContainsFile = true;\n break;\n }\n }\n\n if (!draggingObjectContainsFile) {\n this.nonFileObjectDragging = true;\n } else {\n this.nonFileObjectDragging = false;\n }\n\n\n if (this.nonFileObjectDragging) {\n this.fileDropAreaEle.style.cursor = 'not-allowed';\n this.fileDropAreaEle.classList.add(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n return;\n } else {\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.add(this.DRAG_OVER_CLS_NAME);\n return;\n }\n\n });\n\n this.fileDropAreaEle.addEventListener('dragover', evt => {\n\n if (this.nonFileObjectDragging) {\n //Return here to show 'forbidden' icon.\n return;\n }\n evt.preventDefault();\n });\n\n this.fileDropAreaEle.addEventListener('dragleave', evt => {\n\n this.enterLeaveNum--;\n\n if (this.enterLeaveNum === 0) {\n //When it comes out of the parent element (dragleave)\n\n if (this.nonFileObjectDragging) {\n this.nonFileObjectDragging = false;\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n } else {\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_CLS_NAME);\n }\n\n }\n\n });\n\n this.fileDropAreaEle.addEventListener('drop', evt => {\n\n evt.stopPropagation();\n evt.preventDefault();\n\n this.enterLeaveNum = 0;\n\n if (this.nonFileObjectDragging) {\n this.nonFileObjectDragging = false;\n this.fileDropAreaEle.style.cursor = 'default';\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_NOT_ALLOWED_CLS_NAME);\n return;//Skip adding dropped file.\n\n } else {\n this.fileDropAreaEle.classList.remove(this.DRAG_OVER_CLS_NAME);\n }\n\n const selectedFiles = evt.dataTransfer.files;\n\n //Add dropped file(s).\n this.doDrop(selectedFiles);\n\n });\n\n }", "inputDropHandler(event) {\n event.preventDefault();\n event.stopPropagation();\n event.currentTarget.classList.remove('input-dragging');\n // Don't take any action on disabled elements\n if (event.currentTarget.disabled) {\n return;\n }\n const { name } = event.currentTarget; // the arg's key and type\n // TODO: could add more filters based on argType (e.g. only show .csv)\n const fileList = event.dataTransfer.files;\n const { triggerScrollEvent, updateArgValues, t } = this.props;\n if (fileList.length !== 1) {\n alert(t('Only drop one file at a time.')); // eslint-disable-line no-alert\n } else if (fileList.length === 1) {\n updateArgValues(name, fileList[0].path);\n } else {\n throw new Error('Error handling input file drop');\n }\n event.currentTarget.focus();\n triggerScrollEvent();\n }", "function beginDrag(ev){\n\tcurrentChoice = ev.target.id;\n\tconsole.log(\"Current choice is:\" + currentChoice);\n\tdrag(ev);\n}", "_dragHandler() {\n if (!this._settings.draggable) return;\n\n if (!this._settings.selectableContent) {\n this._startDrag();\n } else {\n setTimeout(() => this._startDrag(), this._settings.timeToSelect);\n }\n }", "function handleDrop(event) {\n unhighlight(event);\n var dt = event.dataTransfer;\n var files = dt.files;\n handleFiles(files);\n }", "function file_drag_start(){\n\n\tdrag_flag();\n\n}", "drag(ev) {\n // console.log('drag')\n }", "selectionTool(e) {\n //find the cropper\n let cropper = this.state.cropper;\n //trigger the crop/selection tool\n cropper.setDragMode(\"crop\");\n //reset active buttons\n this.clearActiveButtons();\n this.setActiveButton(\"selectionTool\");\n }", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function UISelection(){\n\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 handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n // Get the FileList object that contains the list of files that were dropped\n var files = evt.dataTransfer.files;\n\n // this UI is only built for a single file so just dump the first one\n dumpFile(files[0]);\n }", "startDrag(x, y) {}", "function selectDDDragstart (e) {\n selectMenuItem ( 'drag-drop-menu', 'dragstart');\n e.preventDefault();\n}", "function init() {\n var dropZone = document.getElementById('drop_zone');\n dropZone.addEventListener('dragover', handleDragOver, false);\n dropZone.addEventListener('drop', handleFileSelect, false);\n document.querySelector('#files').addEventListener('change', handleFileSelectButton, false);\n selDiv = document.querySelector(\"#selectedFiles\"); \n }", "function drag(form) {\n var input = document.querySelector(\"input\");\n var priority = document.getElementById(\"priorityBtn\");\n var option = document.getElementsByClassName(\"dropdown-item\");\n\n var pos1 = 0, \n pos2 = 0, \n pos3 = 0, \n pos4 = 0;\n\n //allow user to input task, priority and description without getting stuck in drag mode\n if(input)\n input.onmousedown = prevent;\n else if(priority)\n priority.onmousedown = prevent;\n else if(option)\n option.onmousedown = prevent;\n\n //otherwise, you can drag from anywhere on the form\n form.onmousedown = dragMouseDown; \n\n function prevent(event){\n event.preventDefault();\n }\n\n function dragMouseDown(event) {\n event = event || window.event;\n\n // get the mouse cursor position at startup\n pos3 = event.clientX;\n pos4 = event.clientY;\n document.onmouseup = closeDragElement;\n\n // call function whenever the cursor moves\n document.onmousemove = elementDrag; \n }\n\n function elementDrag(event) {\n event = event || window.event;\n event.preventDefault();\n\n // calculate the new cursor position\n pos1 = pos3 - event.clientX;\n pos2 = pos4 - event.clientY;\n pos3 = event.clientX;\n pos4 = event.clientY;\n\n // set the element's new position\n form.style.top = (form.offsetTop - pos2) + \"px\";\n form.style.left = (form.offsetLeft - pos1) + \"px\"; \n }\n\n function closeDragElement() {\n //stop moving when mouse button is released\n document.onmouseup = null;\n document.onmousemove = null;\n }\n}", "function drop(e) {\n e.stopPropagation();\n e.preventDefault();\n displayFile(e.dataTransfer.files);\n}", "function SelectionChange() { }", "function SelectionChange() { }", "function myDown(e){\n getMouse(e);\n \n\n //we are over a selection box\n if (expectResize !== -1) {\n isResizeDrag = true;\n return;\n }\n \n clear(gctx);\n // var l = boxes2.length;\n var l = boxes2Images.length;\n for (var i = l-1; i >= 0; i--) {\n // draw shape onto ghost context\n // boxes2[i].draw(gctx, 'black');\n boxes2Images[i].drawImage(gctx,'');\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 = boxes2[i];\n mySel = boxes2Images[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 \n invalidate();\n clear(gctx);\n return;\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}", "browse_button (){\r\n this.$refs.inputDrag.click();\r\n }", "function on_doc_down(event){\n \t//Toggle Cursor Menu Dropdown\n \tif (!event.target.matches('#dropBtn') && !event.target.classList.contains('menuBtn')) {\n \t closeMenu();\n \t}\n\n \t//Confirm name change of sidebar element if clicking outside of textbox\n \tif (editingList && event.target.type != 'text'){\n \t\tvar li = editingList.parentElement.parentElement;\n \t\tli.attached.name = editingList.value;\n \t\tli.innerHTML = editingList.value;\n \t\teditingList = false;\n \t\treturn false;\n \t}\n\n \t//Reset all object opacities\n \tfor (var i=0; i<scene.objects.length; i++){\n \t\tif (scene.objects[i] != SELECTED){\n \t\t\tscene.objects[i].material.opacity = 1;\n \t\t}\n \t}\n\n \t//Select a cube if name in sidebar is clicked, otherwise unselect all\n \tif (event.target != renderer.domElement){\n \t\tif (event.target.localName == \"li\"){\n \t\t\tif(SELECTED){\n \t\t\t\tunselect();\n \t\t\t}\n \t\t\t// console.log(\"select!\");\n \t\t\tselectObj(event.srcElement.attached);\n \t\t}\n \t}\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 drop(ev) {\n ev.preventDefault();\n var data = ev.dataTransfer.getData(\"text\");\n if (ev.target.tagName == \"CANVAS\") {\n moveAndDrawImageToCanvas(document.getElementById(data), ev.target)\n } else {\n ev.target.appendChild(document.getElementById(data));\n }\n}", "function main() {\n if (!isCorrectEnv('version:16', 'selection')) return;\n\n var paths = getPaths(selection);\n if (!paths.length) return;\n\n addIntersectPoints();\n\n if (selection.length !== paths.length) {\n selection = null;\n app.redraw();\n alert('The paths problem\\n'\n + 'Due to the Illustrator error, resulting paths get split.\\n'\n + 'Please try to change or move the paths slightly before run script.', 'Script Error');\n app.undo();\n return;\n }\n \n for (var i = selection.length - 1; i >= 0; i--) {\n var item = selection[i],\n arr = get(selection);\n arr.splice(i, 1);\n var otherPts = getPoints(arr);\n rmvPoints(item, otherPts);\n }\n}", "function Main(curDoc, sel, amountofselectedobjects, clipobject){\n if (amountofselectedobjects){\n if(curDoc.activeLayer.locked || !curDoc.activeLayer.visible){\n alert(\"Please select objects on an unlocked and visible layer,\\nthen run this script again.\");\n }else{\n\n //IF Compound object, alter appearance SOURCE\n //if (clipobject.typename === \"CompoundPathItem\") {\n // clipobject = sel[amountofselectedobjects -1].pathItems[0];\n //}\n //app.executeMenuCommand('deselectall');\n //clipobject = sel[0].pathItems[0];\n //clipobject.selected = true;\n app.executeMenuCommand('ungroup');\n app.executeMenuCommand('copy');\n app.executeMenuCommand('Live Pathfinder Crop');\n app.executeMenuCommand('expandStyle');\n app.executeMenuCommand('ungroup');\n app.executeMenuCommand('pasteBack');\n app.executeMenuCommand('releaseMask');\n sel = curDoc.selection;\n amountofselectedobjects = sel.length;\n app.executeMenuCommand('deselectall');\n for (i = 1; i < amountofselectedobjects ; i++) {\n killobject = sel[i];\n killobject.remove();\n }\n }\n }\n}", "static Setup () {\n BrowserUI.instance = new BrowserUI()\n BrowserUI.instance.createWorkbench()\n document.getElementById('tabDefault').click()\n REDIPS.drag.init()\n REDIPS.drag.dropMode = 'single' // one item per cell\n REDIPS.drag.trash.question = null // don't confirm deletion\n }", "function dragDropVisual () {\n // Start the drag effect\n $('.drop-zone').on('dragover', function (e) {\n e.preventDefault()\n e.stopPropagation()\n $(this).addClass('dragover')\n })\n\n // Stop the effect when mouse out/release\n $('.drop-zone').on('dragleave dragend', function (e) {\n e.preventDefault()\n e.stopPropagation()\n $(this).removeClass('dragover')\n })\n\n // Stop when successfully dropped\n $('.drop-zone').on('drop', function (e) {\n e.stopPropagation()\n e.preventDefault()\n $(this).removeClass('dragover')\n\n // we're interested in just first file\n var files = e.originalEvent.dataTransfer.files\n for (var i = 0; i < files.length; i++) {\n parseImport(files[i])\n }\n })\n}", "function main() {\n\t\tvar selectedItem = ProjectManager.getSelectedItem(),\n\t\t\timageInfo = getImageInfo(selectedItem._path);\n\n\t\t// Check file via its extension\n\t\tif (!fileTypeRegex.test(imageInfo.name)) {\n\t\t\tDialogs.showModalDialog(EXTENSION_ID, 'Information', 'Please open an image or icon to pick colors from.');\n\t\t\treturn closeImage();\n\t\t}\n\n\t\tif (filePath !== imageInfo.path) {\n\t\t\topenImage(imageInfo);\n\t\t} else {\n\t\t\tcloseImage();\n\t\t}\n\t}", "function srcClick(o) {\n\tswitch (o.innerText) {\n\t\tcase \"Rename\":\n\t\t\tlet input = prompt(\"Enter a new filename\", \"myprog.mtb\");\n\t\t\tif (input === null) {\n\t\t\t\tinput = \"\";\n\t\t\t} else {\n\t\t\t\tinput = input.trim().substr(0,10);\n\t\t\t}\n\n\t\t\tif (input != \"\") {\n\t\t\t\tif (ItemSelection.classList.contains(\"device\")) {\n\t\t\t\t\tinput = ItemSelection.id.slice(-1) + \"- \" + input;\n\t\t\t\t}\n\t\t\t\tItemSelection.innerText = input;\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"Delete\":\n\t\t\tconst name = ItemSelection.innerText\n\t\t\tconst idx = getNodeIndex(SourceNode, ItemSelection);\n\t\t\tlet sel = getNodeIndex(SourceNode, SelectedNode);\n\t\t\tif (SourceFiles.length == 1) break;\n\t\t\tif (confirm(\"Are you sure you want to delete \" + name + \"?\")) {\n\t\t\t\tconst isLast = idx == SourceFiles.length -1;\n\t\t\t\tconst newIdx = (isLast) ? idx - 1 : idx + 1;\n\t\t\t\tif (idx == sel) {\n\t\t\t\t\tswitchFiles(SelectedNode, SourceNode.children[newIdx]);\n\t\t\t\t\tSourceFiles = deleteFile(SourceNode, SourceFiles, idx);\n\t\t\t\t\tif (isLast) sel--;\n\t\t\t\t} else if (idx < sel) {\n\t\t\t\t\tSourceFiles = deleteFile(SourceNode, SourceFiles, idx)\n\t\t\t\t\tsel--;\n\t\t\t\t} else {\n\t\t\t\t\tSourceFiles = deleteFile(SourceNode, SourceFiles, idx);\n\t\t\t\t}\n\t\t\t\t\tSelectedNode = SourceNode.children[sel];\n\t\t\t\t\tSelectedNode.classList.add(\"selected\");\n\t\t\t\t\teditor.setSession(SourceFiles[sel]);\n\t\t\t\t\t\n\t\t\t}\n\t\t\tbreak;\n\t\tcase \"Upload\":\n\t\t\tdocument.getElementById(\"fileread\").click();\n\t\t\tbreak;\n\t\tcase \"Open\":\n const modal = document.getElementById(\"myModal\");\n const fileModal = document.getElementById(\"file-content\");\n const infoModal = document.getElementById(\"info-content\");\n const fsList = document.getElementById(\"fs-list\");\n const[index, isSource] = findNode(ItemSelection);\n theList = (isSource) ? SourceFSFiles : DataFSFiles;\n fileModal.style.display = \"block\";\n infoModal.style.display = \"none\";\n modal.style.display = \"flex\";\n fsList.innerHTML = \"<ul>\\n\";\n for (item of theList) {\n fsList.innerHTML += \"<li class='fs-item' onclick='loadFile(this)'>\"+item+\"</li>\\n\";\n } \n fsList.innerHTML += \"</ul>\";\n break;\n default:\n break;\n }\n}", "function DragDropConfig() {}", "function DragDropConfig() {}", "function dragEditBox(e) {\n console.log(typeof e);\n console.log(\"I'm draggin!\");\n e.preventDefault();\n e.dataTransfer.setData(\"text\", e.target);\n}", "function DragNDrop() {\n this.__init__();\n}", "function myDown(e){\n\t\tgetMouse(e);\n\t\t\n\t\t//we are over a selection box\n\t\tif (expectResize !== -1) {\n\t\tisResizeDrag = true;\n\t\treturn;\n\t\t}\n\t\t\n\t\tclear(gctx);\n\t\tvar l = boxes2.length;\n\t\tfor (var i = l-1; i >= 0; i--) {\n\t\t// draw shape onto ghost context\n\t\tboxes2[i].draw(gctx, 'black');\n\t\t\n\t\t// get image data at the mouse x,y pixel\n\t\tvar imageData = gctx.getImageData(mx, my, 1, 1);\n\t\tvar index = (mx + my * imageData.width) * 4;\n\t\t\n\t\t// if the mouse pixel exists, select and break\n\t\tif (imageData.data[3] > 0) {\n\t\t\tmySel = boxes2[i];\n\t\t\toffsetx = mx - mySel.x;\n\t\t\toffsety = my - mySel.y;\n\t\t\tmySel.x = mx - offsetx;\n\t\t\tmySel.y = my - offsety;\n\t\t\tisDrag = true;\n\t\t\t\n\t\t\tinvalidate();\n\t\t\tclear(gctx);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t}\n\t\t// havent returned means we have selected nothing\n\t\tmySel = null;\n\t\t// clear the ghost canvas for next time\n\t\tclear(gctx);\n\t\t// invalidate because we might need the selection border to disappear\n\t\tinvalidate();\n\t}", "onMouseDrag(e) {}", "function dragDrop(args) {\n\n // merges args passed in with defaults\n var options = $.extend(true, {\n id: undefined,\n dragstart: defaultFunc,\n drag: defaultFunc,\n dragenter: defaultFunc,\n dragleave: defaultFunc,\n dragover: defaultFunc,\n drop: defaultFunc,\n dragend: defaultFunc\n }, args);\n\n\n if (window.File && window.FileList && window.FileReader && !$.browser.msie && !$.browser.safari) {\n\n // Dropzone element\n var dropzone = $(options.id);\n\n dropzone.on('dragstart', options.dragstart);\n\n dropzone.on('drag', options.drag);\n\n dropzone.on('dragenter', options.dragenter);\n\n dropzone.on('dragleave', options.dragleave);\n\n dropzone.on('dragover', options.dragover);\n\n dropzone.on('drop', options.drop);\n\n dropzone.on('dragend', options.dragend);\n\n // Stops stuff heppening when file dropped in document\n $(document).on('drop dragover', defaultFunc);\n\n }\n}", "function programListDragHandler(event) {\n dragging = event.target;\n event.dataTransfer.setData('text/html', dragging);\n}", "function dropHandler(e) {\n\t\n\t//preventDefault behaviour\n \te.preventDefault();\n\t\n\t//remove the border\n\tdropArea.style.borderColor = bgColor;\n\t\n\t//grab the first file from the list\n\tfile = e.dataTransfer.files[0];\n\n\t//lets find out what the fileType is\n\tfileType = getFileType();\n\t\n\tif (fileType == \"NONE\") {\n\t\talert(\"File type not supported\");\n\t\treturn;\n\t}\n\t\n\t//create a new instance of FileReader\n\tvar reader = new FileReader();\n\n\t//our callback\n\treader.onload = function(loadEvent) {\n\n\t\t//lets find out the fileURL\n\t\tfileURL = loadEvent.target.result;\n\n\t\t//initPreview (now that we know what the file, fileType and fileURL are)\n\t\tinitPreview();\n\t\t\n\t}\n\n\t//now attempt to the read the file\n\treader.readAsDataURL(file);\n\t\n\t//hideIntroElem\n\thideIntroElem();\n\t//showOptionsElem\n\tshowOptionsElem();\n \t\n}", "function start(event, Dt, Op) {\n\n // Mark the handle as 'active' so it can be styled.\n if (Dt.handles.length === 1) {\n Dt.handles[0].data('grab').addClass(clsList[4]);\n }\n\n // A drag should never propagate up to the 'tap' event.\n event.stopPropagation();\n\n // Attach the move event.\n attach(actions.move, doc, move, {\n start: event\n\t\t\t\t, base: Dt.base\n\t\t\t\t, target: Dt.target\n\t\t\t\t, handles: Dt.handles\n\t\t\t\t, positions: [Dt.handles[0].data('pct')\n\t\t\t\t\t , Dt.handles[Dt.handles.length - 1].data('pct')]\n\t\t\t\t, point: Op['orientation'] ? 'pointY' : 'pointX'\n\t\t\t\t, size: Op['orientation'] ? Dt.base.height() : Dt.base.width()\n });\n\n // Unbind all movement when the drag ends.\n attach(actions.end, doc, end, {\n target: Dt.target\n\t\t\t\t, handles: Dt.handles\n });\n\n // Text selection isn't an issue on touch devices,\n // so adding additional callbacks isn't required.\n if (event.cursor) {\n\n // Prevent the 'I' cursor and extend the range-drag cursor.\n body.css('cursor', $(event.target).css('cursor'));\n\n // Mark the target with a dragging state.\n if (Dt.handles.length > 1) {\n Dt.target.addClass(clsList[20]);\n }\n\n // Prevent text selection when dragging the handles.\n body.on('selectstart' + namespace, function () {\n return false;\n });\n }\n }", "function FileSelectHandler(e) {\n\n // cancel browser events and remove hover style\n FileDragHover(e);\n\n // gets a FileList object containing dropped files\n var files = e.originalEvent.dataTransfer.files;\n //alert(files.item(0).name.toString());\n \n UploadFile(files.item(0));\n }", "function handleMouseDown(evt)\n{\n mylog('Started handleMouseDown with target nodeName '+evt.target.nodeName);\n // With svgweb, mousedown on text elements causes also mousedown on\n // the \"svg\" node on the back, so this check nullifies the second\n // function call\n if (evt.target.nodeName == 'svg')\n return;\n // This is necessary with firefox native renderer, otherwise the\n // \"mousedown\" event would cause the attempt of dragging svg\n // elements\n evt.preventDefault();\n\n var p = mouseCoordsSvg(evt);\n\n if(g['shape'].active)\n // When the current tool corresponds to a shape, mouse events are\n // forwarded to the shape\n g['shape'].mousedown(p.x, p.y);\n else{\n // Other tools not binded with shapes, but that act on a\n // clicked shape. First ignore the operation if the target is\n // 'canvas', then retrieve the shape parent group and execute\n // the action\n var target = evt.target;\n if (target.id == 'canvas'){\n mylog('Ignoring attempt to act on the canvas');\n if (g['tool']=='delete')\n // Activate the \"dragging delete\"\n g['active_tool'] = true;\n }\n else{\n // To search the group and then to come back to the childs\n // can look weird, but this is useful because changing the\n // renderer, the element which raises the event (for\n // example in a text structure) may change\n var group = find_group(target.parentNode);\n switch(g['tool']){\n case 'select':\n var shape = group.childNodes[0];\n // Select is useful only for the links, which have\n // 'text' as top node. They can distinguished by plain\n // text elements because they have a first <tspan>\n // element with visibility=\"hidden\"\n if (shape.nodeName == 'text' &&\n shape.childNodes[0].getAttribute('visibility')=='hidden'){\n var url = shape.childNodes[1].data;\n // Urls without the http look nicer, but it has to\n // be added, otherwise they will be taken as\n // relative links\n if (!/http/.test(url))\n url = 'http://'+url;\n window.open(url);\n }\n break;\n case 'edit':\n var shape = group.childNodes[0];\n // Paths can't be edited\n if (shape.nodeName == 'path')\n mylog('Ignoring attempt to edit a path');\n else{\n // Distinguish a 'link' shape\n if (shape.nodeName == 'text' &&\n shape.childNodes[0].getAttribute('visibility')=='hidden')\n var shape_name = 'link';\n else\n var shape_name = shape.nodeName;\n show_additional_panel(shape_name);\n // Copy the old object\n g['shape'] = g['shape_generator'].generate_shape(shape_name);\n g['shape'].copy_shape(shape);\n g['shape'].mousedown(p.x, p.y);\n // Delete the old object: sender_add is called\n // with the asynchronous flag set to true, so the\n // delete update will be sent together with the\n // new shape update.\n var group_id = group.getAttribute('id');\n sender_add('delete', [], group_id, true);\n g['pages'].remove(group);\n }\n break;\n case 'delete':\n delete_object(group);\n g['active_tool'] = true;\n break;\n case 'move':\n g['moving_object'] = group;\n var transMatrix = g['moving_object'].getCTM();\n // g['p'] will be read on mouse up, and to correctly\n // compute the new transformation we must consider the\n // original position of the object, not the one seen\n // by the user and the pointer\n p.x = p.x - Number(transMatrix.e);\n p.y = p.y - Number(transMatrix.f);\n g['active_tool'] = true;\n break;\n }\n }\n }\n // Store the initial mouse position for the other event handlers\n g['p'] = p;\n}", "function dragStart() {\n\t\tconsole.log('started draggin');\n\t}", "onDrag(mousePosition) {\n }", "drag(x, y) {\n this.doDrag(x, y);\n }", "function dragPhoto(){\n\t\t\tdocument.querySelector(currentOptions.input_file_wrap).click();\n\t\t}", "function setGeneralDragAndDrop(){\n\n\twindow.ondragover = function () { this.className = 'hover'; return false; };\n \twindow.ondragend = function () { this.className = ''; return false; };\n\n\twindow.ondrop = function (e) {\n\t\n\t\tuploadFile(e);\n\t\treturn true;\n\t};\n}", "function doFileSelect(fileObj) {\n\n\t\t\tif (!(typeof fileObj.attr === 'string' || typeof fileObj.date === 'string' || typeof fileObj.dir === 'string' || typeof fileObj.ext === 'string' || typeof fileObj.fullpath === 'string' || typeof fileObj.mime === 'string' || typeof fileObj.height === 'string' || typeof fileObj.height === 'number' || typeof fileObj.name !== 'string' || typeof fileObj.size !== 'number' || typeof fileObj.type !== 'string' || typeof fileObj.width === 'string' || typeof fileObj.width === 'number')) {\n\n\t\t\t\t// debug the file selection settings (if debug is turned on and console is available)\n\t\t\t\tif (sys.debug) {\n\t\t\t\t\tconsole.log(fileObj);\n\t\t\t\t}\n\n\t\t\t\tdisplayDialog({\n\t\t\t\t\ttype: 'throw',\n\t\t\t\t\tstate: 'show',\n\t\t\t\t\tlabel: 'Oops! There was a problem',\n\t\t\t\t\tcontent: 'There was a problem reading file selection information.'\n\t\t\t\t});\n\n\t\t\t} else if (typeof tinyMCE !== 'undefined' && typeof tinyMCEPopup !== 'undefined') {\n\t\t\t\tvar win = tinyMCEPopup.getWindowArg('window'),\n\t\t\t\t\trelPath = fileObj.dir + fileObj.name;\n\n\t\t\t\t// insert information into the tinyMCE window\n\t\t\t\twin.document.getElementById(tinyMCEPopup.getWindowArg('input')).value = relPath;\n\n\t\t\t\t// for image browsers: update image dimensions\n\t\t\t\tif (win.ImageDialog) {\n\t\t\t\t\tif (win.ImageDialog.getImageData) {\n\t\t\t\t\t\twin.ImageDialog.getImageData();\n\t\t\t\t\t}\n\t\t\t\t\tif (win.ImageDialog.showPreviewImage) {\n\t\t\t\t\t\twin.ImageDialog.showPreviewImage(relPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// close popup window\n\t\t\t\ttinyMCEPopup.close();\n\n\t\t\t} else {\n\n\t\t\t\t// We are a standalone mode. What to do, is up to you...\n\t\t\t\tif (opts.callBack !== null) {\n\n\t\t\t\t\t// user passed a callback function\n\t\t\t\t\topts.callBack(fileObj);\n\n\t\t\t\t} else {\n\n\t\t\t\t\t// just do a simple throw\n\t\t\t\t\tdisplayDialog({\n\t\t\t\t\t\ttype: 'throw',\n\t\t\t\t\t\tstate: 'show',\n\t\t\t\t\t\tlabel: 'Standalone Mode Message',\n\t\t\t\t\t\tcontent: 'You selected' + (fileObj.dir + fileObj.name) + '<br />' + fileObj.fullpath\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t}\n\t\t}", "function selectFile(evt) {\n\t\tvar last_file = {};\n\t\tif (context_element && (context_element.type == 2)) {\n\t\t\tlast_file = context_element;\n\t\t}\n\t\tcontext_element = getElProp(evt);\n\t\tif (context_element.type == 1) {\n\t\t\t// If select directory then open the directory\n\t\t\t// if index >= 0 then select subfolde, if index < 0 - then select up folder\n\t\t\tif (context_element.index >= 0) {\n\t\t\t\tgetDirContent(cur_path + context_element.name + '/');\n\t\t\t} else {\n\t\t\t\tvar\n\t\t\t\t\tpath = '',\n\t\t\t\t\ti\n\t\t\t\t;\n\t\t\t\tfor (i = dir_content.path.length + context_element.index; i >= 0; i--) {\n\t\t\t\t\tpath = dir_content.path[i] + '/' + path;\n\t\t\t\t}\n\t\t\t\tgetDirContent('/' + path);\n\t\t\t}\n\t\t} else if (context_element.type == 2) {\n\t\t\t// Іf select the file then highlight and execute the external functions with the file properties\n\t\t\thighlightFileItem(context_element.index);\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_select || on_dblselect) {\n\t\t\t\tvar file = dir_content.files[context_element.index];\n\t\t\t\t// Generate additional field\n\t\t\t\tfile.path = cur_path + file.name;\n\t\t\t\tfile.wwwPath = getURIEncPath(HTMLDecode(upload_path + cur_path + file.name));\n\t\t\t\t// If thumbnail exist, set the www path to him\n\t\t\t\tif (file.thumb && file.thumb !== '') {\n\t\t\t\t\tfile.wwwThumbPath = getURIEncPath(HTMLDecode(upload_path + file.thumb));\n\t\t\t\t}\n\t\t\t\tif (on_select) {\n\t\t\t\t\ton_select(file);\n\t\t\t\t}\n\t\t\t\t// If double click on file then chose them by on_dblselect() function\n\t\t\t\tif ( on_dblselect &&(last_file.index == context_element.index) && ((context_element.time - last_file.time) < dbclick_delay) ) {\n\t\t\t\t\ton_dblselect(file);\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// No selections\n\t\t\t// Clean the highlight\n\t\t\thighlightFileItem();\n\t\t\t// Hide the tooltips\n\t\t\thideTooltips();\n\t\t\t// If set the external function - then execute it\n\t\t\tif (on_deselect) {\n\t\t\t\ton_deselect();\n\t\t\t}\n\t\t}\n\t}", "addEventListeners() {\n\n this.dropZone.ondragover = (e) => {\n\n e.preventDefault();\n e.target.classList.add(\"highlight\");\n };\n \n this.dropZone.ondragleave = (e) => {\n \n e.preventDefault();\n e.target.classList.remove(\"highlight\");\n };\n \n this.dropZone.ondrop = (e) => {\n \n e.preventDefault();\n e.target.classList.remove(\"highlight\");\n this.addFiles(e);\n };\n \n this.fileInput.onchange = (e) => {\n \n e.preventDefault();\t\n this.addFiles(e);\n };\n }", "function drag(){\n console.log(\"Being dragged around\");\n}", "function myDown(e){\n\t getMouse(e);\n\t toggleMenuOff();\n\n\t var isRightMB;\n\t e = e || window.event;\n\n\t if(\"which\" in e){\n\t \tisRightMB = e.which == 3;\n\t } else if(\"button\" in e){\n\t \tisRightMB = e.button == 2;\n\t }\n\t \n\t //we are over a selection box\n\t if (expectResize !== -1) {\n\t isResizeDrag = true;\n\t return;\n\t }\n\n\t var element = e.target;\n\t var canvasObject = canvases[element.getAttribute(\"parent\")]; //allCanvases[parseInt(element.getAttribute(\"canvpos\"))];\n\n\t checkGhostCanvas(canvasObject);\n\t \n\t clearGhost(canvasObject);\n\t var l = canvasObject.boxes2.length;\n\t for (var i = l-1; i >= 0; i--) {\n\t // draw shape onto ghost context\n\t canvasObject.boxes2[i].draw(gctx, 'black');\n\t \n\t // get image data at the mouse x,y pixel\n\t var imageData = gctx.getImageData(mx, my, 1, 1);\n\t \n\t // if the mouse pixel exists, select and break\n\t if (imageData.data[3] > 0) {\n\t mySel = canvasObject.boxes2[i];\n\n\t if(isRightMB){\n\t \ttoggleAnnotatorWrapperOff();\n\t \ttoggleMenuOn();\n\t \tpositionMenu(menu);\n\t \tactiveCanvasIndex = i;\n\t \tactiveCanvasObject = canvasObject;\n\t \treturn;\n\t } else{\n\t \ttoggleAnnotatorWrapperOff();\n\t \ttoggleMenuOff();\n\t }\n\n\t offsetx = mx - mySel.x;\n\t offsety = my - mySel.y;\n\t mySel.x = mx - offsetx;\n\t mySel.y = my - offsety;\n\t isDrag = true;\n\t \n\t invalidate(canvasObject);\n\t clearGhost(canvasObject);\n\t return;\n\t }\n\t \n\t }\n\n\t \n\t toggleAnnotatorWrapperOff();\n\t toggleMenuOff();\n\t // havent returned means we have selected nothing\n\t mySel = null;\n\t // clear the ghost canvas for next time\n\t clearGhost(canvasObject);\n\t // invalidate because we might need the selection border to disappear\n\t invalidate(canvasObject);\n\t}", "function dropAble(mimeTypes, onDrop) {\n return function ($node) {\n $node.on('dragenter', function () {\n var e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\n //var xy = mouse($node.node());\n if (hasDnDType(e, mimeTypes)) {\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', true);\n //sounds good\n return false;\n }\n //not a valid mime type\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\n }).on('dragover', function () {\n var e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\n if (hasDnDType(e, mimeTypes)) {\n e.preventDefault();\n updateDropEffect(e);\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', true);\n return false;\n }\n }).on('dragleave', function () {\n //\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\n }).on('drop', function (d) {\n var e = __WEBPACK_IMPORTED_MODULE_0_d3__[\"event\"];\n e.preventDefault();\n __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_d3__[\"select\"])(this).classed('drag_over', false);\n //var xy = mouse($node.node());\n if (hasDnDType(e, mimeTypes)) {\n var data_1 = {};\n //selects the data contained in the data transfer\n mimeTypes.forEach(function (mime) {\n var value = e.dataTransfer.getData(mime);\n if (value !== '') {\n data_1[mime] = value;\n }\n });\n return onDrop(data_1, d, copyDnD(e));\n }\n });\n };\n}", "function DragHelperTemplate() {}", "function DragHelperTemplate() {}", "function editOnDragStart(){this._internalDrag=true;this.setMode('drag');}", "mouseUp(e){\n this._super(...arguments);\n\n\n if(e.path === undefined || e.path[0].tagName !== \"MULTI-SELECTION\"){\n return;\n }\n\n if(e.button == 0){\n e.stopPropagation();\n e.preventDefault();\n\n this.set('moveStart', false);\n }\n\n\n\n document.removeEventListener('mousemove', this.get('mouseMoveListener'));\n document.removeEventListener('mouseup', this.get('mouseUpListener'));\n\n\n }", "async function onDrop(event) {\n // Prevent default behavior (Prevent file from being opened)\n event.preventDefault();\n\n if (event.dataTransfer.files) {\n onFilesDroppedOrSelected(event.dataTransfer.files);\n } else {\n console.log(`Your browser does not support FileList`);\n }\n}", "drop(ev) {\n\t\tev.preventDefault();\n\t\tvar data = ev.dataTransfer.getData(\"text\");\n\t\tif(data.includes(\"func\"))\n\t\t{\n\t\t\tcopyID = \"drag\" + counter;\n\t\t\tcounter++;\n\t\t\tvar offLeft = document.getElementById(\"context\").offsetLeft;\n\t\t\tvar offTop = document.getElementById(\"context\").offsetTop;\n\t\t\tvar x = ev.clientX - offLeft; // Get the horizontal coordinate of mouse\n\t\t\tvar y = ev.clientY - offTop; // Get the vertical coordinate of mouse\n\t\t\t\n\t\t\t// console.log(\"Left =\" + offLeft + \", Top =\" + offTop );\n\t\t\t// console.log(\"X =\" + x + \", Y =\" + y );\n\t\t\tvar elem;\n\t\t\tswitch (data) {\n\t\t\t\tcase \"funcBody\":\n\t\t\t\t\telem = document.getElementById(\"funcBody\");\n\t\t\t\t\t// console.log(elem.offsetWidth + \" \" + elem.offsetHeight);\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\t// console.log(x + \" \" + y);\n\t\t\t\t\t// x -= elem.offsetWidth/2;\n\t\t\t\t\t// y -= elem.offsetHeight/2;\n\t\t\t\t\tthis.appendData(funcBody, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcRec\":\n\t\t\t\t\telem = document.getElementById(\"funcRec\");\n\t\t\t\t\t// console.log(elem.offsetWidth + \" \" + elem.offsetHeight);\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\t// console.log(x + \" \" + y);\n\t\t\t\t\tthis.appendData(funcRec, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcOp\":\n\t\t\t\t\telem = document.getElementById(\"funcOp\");\n\t\t\t\t\t// console.log(elem.offsetWidth + \" \" + elem.offsetHeight);\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\t// console.log(x + \" \" + y);\n\t\t\t\t\tthis.appendData(funcOp, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcExp\":\n\t\t\t\t\telem = document.getElementById(\"funcExp\");\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\tthis.appendData(funcExp, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tcase \"funcNExp\":\n\t\t\t\t\telem = document.getElementById(\"funcNExp\");\n\t\t\t\t\tx = Math.round((x-elem.offsetWidth/2) / 10) * 10;\n\t\t\t\t\ty = Math.round((y-elem.offsetHeight/2) / 10) * 10;\n\t\t\t\t\tthis.appendData(funcNExp, copyID, x, y);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tconsole.log(\"Invalid drop\");\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "onDrop(evt) {\n evt.preventDefault();\n const { onComplete, multiple, output, onError } = this.props;\n const files = Array.from(evt.dataTransfer.files).filter((file) => {\n if (output && outputs[output])\n return file.type === outputs[output].mimeType;\n return true;\n });\n if (files.length)\n Promise.all(files.map(file => this.readFile(file)))\n .then(results => this.output(results))\n .catch(err => onError(err));\n else\n onComplete(multiple ? [] : null);\n }", "function Dragging_DetectActionStart(event)\n{\n\t//interactions blocked?\n\tif (__SIMULATOR.UserInteractionBlocked())\n\t{\n\t\t//block the event (will forward to designer, if possible)\n\t\tBrowser_BlockEvent(event);\n\t}\n\telse\n\t{\n\t\t//not during gestures\n\t\tif (!__GESTURES.IsBusy())\n\t\t{\n\t\t\t//get the source element\n\t\t\tvar srcElement = Browser_GetEventSourceElement(event);\n\t\t\t//get the html\n\t\t\tvar theHTML = Get_HTMLObject(srcElement);\n\t\t\t//valid?\n\t\t\tif (theHTML)\n\t\t\t{\n\t\t\t\t//the object we will drag\n\t\t\t\tvar intObject = null;\n\t\t\t\tvar data = null;\n\t\t\t\t//switch according to class\n\t\t\t\tswitch (theHTML.InterpreterObject.DataObject.Class)\n\t\t\t\t{\n\t\t\t\t\tcase __NEMESIS_CLASS_LINK:\n\t\t\t\t\tcase __NEMESIS_CLASS_LABEL:\n\t\t\t\t\tcase __NEMESIS_CLASS_UNKNOWN:\n\t\t\t\t\t\t//attempt to replace the object\n\t\t\t\t\t\tvar replacementObject = Label_ProcessEventForwarding(theHTML.InterpreterObject, __NEMESIS_EVENT_DRAGDROP);\n\t\t\t\t\t\t//found a link\n\t\t\t\t\t\tif (replacementObject)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//we use this\n\t\t\t\t\t\t\tintObject = replacementObject;\n\t\t\t\t\t\t\t//drag it directly\n\t\t\t\t\t\t\ttheHTML = intObject.HTML;\n\t\t\t\t\t\t\t//get data\n\t\t\t\t\t\t\tdata = intObject.GetData();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __NEMESIS_CLASS_TREE_VIEW:\n\t\t\t\t\t\t//memorise the interpreter object\n\t\t\t\t\t\tintObject = theHTML.InterpreterObject;\n\t\t\t\t\t\t//ask for the html data\n\t\t\t\t\t\tvar treeViewDragData = Treeview_DraggingOverTree(srcElement);\n\t\t\t\t\t\t//valid?\n\t\t\t\t\t\tif (treeViewDragData)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//set it\n\t\t\t\t\t\t\ttheHTML = treeViewDragData.Branch;\n\t\t\t\t\t\t\tdata = treeViewDragData.Exception;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//ignore this\n\t\t\t\t\t\t\tintObject = null;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t//got element to drag?\n\t\t\t\tif (intObject)\n\t\t\t\t{\n\t\t\t\t\t//begin drag operation\n\t\t\t\t\tDragging_Start(event);\n\t\t\t\t\t//store clone our drag element\n\t\t\t\t\t__DRAG_DATA.DraggingClone = theHTML.cloneNode(true);\n\t\t\t\t\t//indicate that we currently arent visible\n\t\t\t\t\t__DRAG_DATA.IsShowing = false;\n\t\t\t\t\t//get its rect\n\t\t\t\t\tvar rect = Position_GetDisplayRect(theHTML);\n\t\t\t\t\t//set special properties\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.width = rect.width + \"px\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.height = rect.height + \"px\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone_InitialPosition = { x: rect.left / __SIMULATOR.Scale + __SIMULATOR.Interpreter.DisplayPanel.scrollLeft, y: rect.top / __SIMULATOR.Scale + __SIMULATOR.Interpreter.DisplayPanel.scrollTop };\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.border = __DRAGGING_CLONE_BORDER;\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.position = \"absolute\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.zIndex = __ZINDEX_POPUP;\n\t\t\t\t\tBrowser_SetOpacity(__DRAG_DATA.DraggingClone, 50);\n\t\t\t\t\t//update its position\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.left = __DRAG_DATA.DraggingClone_InitialPosition.x + \"px\";\n\t\t\t\t\t__DRAG_DATA.DraggingClone.style.top = __DRAG_DATA.DraggingClone_InitialPosition.y + \"px\";\n\t\t\t\t\t//setup drag action\n\t\t\t\t\t__DRAG_DATA.DragActionSource = { InterpreterObject: intObject, Data: data };\n\t\t\t\t\t//setup start time\n\t\t\t\t\t__DRAG_DATA.StartTime = new Date().getTime();\n\t\t\t\t\t//set up listeners\n\t\t\t\t\t__DRAG_DATA.OnMove = Dragging_DetectActionMove;\n\t\t\t\t\t__DRAG_DATA.OnEnd = Dragging_DetectActionEnd;\n\t\t\t\t\t__DRAG_DATA.OnWheel = Dragging_DetectActionWheel;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}", "function allowDrop(ev){\nev.preventDefault();}", "function dragMouseStart(e) {\n console.log('dragMouseStart');\n // allow effect data transfer on the start of mouse move\n e.dataTransfer.effectAllowed = 'move'\n // drop effect on start of mouse move\n e.dataTransfer.dropEffect = 'move';\n\n e = e || window.event;\n // get the mouse cursor position at startup:\n pos3 = e.clientX;\n pos4 = e.clientY;\n console.log(pos3 + \" \" + pos4);\n // get the element from the mouse position\n var node = document.elementFromPoint(pos3, pos4);\n // get the parent node of the elemnt \n node = node.parentNode;\n console.log(node);\n // create a selection to hold the cards to be moved\n selection = getSelection(node);\n selectednode = node;\n document.dragend = dragMouseEnd;\n \n }", "function initFileSelection() {\n // If there is an entry, set the pointer to the first entry.\n if (filelist.children.length > 0) { // If there is at least one entry…\n pointer = 0; // … set the pointer to the first item.\n }\n\n // Populate slots.\n initSlots();\n\n // Set the event listener.\n addEventListener('keydown', keyListener, false);\n}", "function _corexitOnMouseDown(event) {\r\n\t// Update the options. Need to do it here, because in mouse up it's too late\r\n\t//chrome.extension.sendRequest({command : \"getOptions\"}, getOptions);\r\n\t// Mark if the source click is inside a text box\r\n\tif (!event.target.nodeName)\r\n\t\tgClickInTextBox = false;\r\n\telse\r\n\t\tgClickInTextBox = (event.target.nodeName == \"INPUT\" || event.target.nodeName == \"TEXTAREA\");\r\n}", "constructor (...args) {\n super(...args)\n\n this.editorText = new EditorText(this)\n this.terminal = new Terminal(this)\n this.title = $('<h1></h1>').text('file')\n\n this.dragRemove = dragDrop('body', (files) => {\n if (this.ide.currentPage !== this) return false\n if (!files || files.length < 1) return false\n\n const file = files[0]\n const code = new TextDecoder('utf-8').decode(file)\n\n this.editorText.setCode(code)\n })\n\n this.file = {\n filepath: null,\n filename: null,\n content: null\n }\n }", "_selectStartHandler(event) {\n const that = this;\n\n if (that._thumbDragged) {\n event.preventDefault();\n }\n }", "function run() {\n app.selection = null;\n btnsState = [bezierBtn.value, flushBtn.value, cornerBtn.value, brokenBtn.value, flatBtn.value];\n processPoints(btnsState, selPaths, tolValue.text * 1);\n sPoints.text = 'Selected Points: ' + getSelectedPoints(selPaths);\n }", "function cutSelectionTool() {\n\t// Saving the coordinates\n\tcopiedEndX = endX;\n\tcopiedEndY = endY;\n\n\tcopiedStartX = startX;\n\tcopiedStartY = startY;\n\n\t// Getting the selected pixels\n\t// If I'm already moving a selection\n\tif (imageDataToMove !== undefined) {\n\t\t// I just save that selection in the clipboard\n\t\tclipboardData = imageDataToMove;\n\t\t// And clear the underlying space\n\t\tTMPLayer.context.clearRect(0, 0, TMPLayer.canvas.width, TMPLayer.canvas.height);\n\t\t// The image has been cleared, so I don't have anything to move anymore\n\t\timageDataToMove = undefined;\n\t}\n\telse {\n\t\t// Otherwise, I copy the current selection into the clipboard\n\t\tcopySelection();\n\t\t// And clear the selection\n\t\tcurrentLayer.context.clearRect(startX - 0.5, startY - 0.5, endX - startX + 1, endY - startY + 1);\n\t}\n}", "function drag(e){\ndraggedItem=e.target;\ndragging=true;\n}", "function dragtaskStart(ev) {\n ev.dataTransfer.setData(\"text/plain\", ev.target.id);\n}", "mouseDownF(e){\n if(this.toolss){\n this.locationX;\n this.locationY;\n this.mouseLocationStart(e);\n if(!this.loc){\n this.locationX = this.xStart;\n this.locationY = this.yStart;\n this.loc = true;\n }\n if(this.toolss == \"f\" ||this.toolss == \"text\"){\n this.textWrite();\n this.keyClick(e);\n this.isDrawing = false; \n this.isMoving = true;\n this.toolss = \"newText\";\n }\n else{\n if(this.isMovingDraw){\n this.isMovingDraw = true;\n this.isDrawing = false;\n this.isMoving = true;\n }\n else if(this.toolss == \"select\"){\n this.isDrawing = true; \n this.isMoving = false;\n }\n else if(this.toolss == \"paste\" || this.toolss == \"rotate-right-90-deg\" || this.toolss == \"rotate-left-90-deg\" || this.toolss == \"rotate-180-deg\" || this.toolss == \"rotate-flip-hor\" || this.toolss == \"rotate-flip-ver\"){\n this.isDrawing = false; \n this.isMoving = true;\n }\n else if(this.toolss == \"file-open\"){\n this.createTempCanvas();\n this.tempctx.drawImage(this.imageUpload,0,0);\n this.isDrawing = false; \n this.isMoving = true;\n }\n else if(this.toolss == \"file-save\"){\n this.link.setAttribute('download', 'MintyPaper.png');\n this.link.setAttribute('href', this.myCanvasHolder.toDataURL(\"image/png\").replace(\"image/png\", \"image/octet-stream\"));\n\n Canvas2Image.saveAsPNG(canvas);\n this.isDrawing = false; \n this.isMoving = true;\n }\n \n else {\n this.isDrawing = true; \n this.isMoving = false;\n this.createTempCanvas(e); \n } \n } \n }\n }", "function drag(e) {\r\n //draggedItem = e.target; No need for a global variable here\r\n e.dataTransfer.setData(\"text\", e.target.id); // set data in drag and drop event to dragged element's id\r\n dragging = true;\r\n}", "function D_D (main_el,par,pos_x,pos_y,def_el,fdfex) {\n//main_el is a trigger, elemet that start drag&drop\n//par is for collision, so element can't go out of parent\n//with pos_x and pos_y you can set position for element\n//with def_el you can move another element\n//*fdfex is a function definition expression. And a function definition expression it is a function is passed as an argument to another function\n\nlet el = main_el;\nel.setAttribute('onselectstart',\"return false\");\n\nel.addEventListener('mousedown',mdD_D);\n\nif (def_el !== undefined && def_el != 0 && def_el != \"\"){\n\tel = def_el;\n}\n\nif (pos_x !== undefined && !isNaN(pos_x)) {\n\tel.style.left = Number(pos_x)+\"px\";\n}\nif (pos_y !== undefined && !isNaN(pos_x)) {\n\tel.style.top = Number(pos_y)+\"px\";\n}\n\nfunction mdD_D (e) {\n\twindow.addEventListener('mousemove',mvD_D);\n\twindow.addEventListener('mouseup',muD_D);\n\n\tlet elCrd = {\n\t\tx:el.offsetLeft,\n\t\ty:el.offsetTop,\n\t\tw:el.offsetWidth,\n\t\th:el.offsetHeight\n\t}\n\n\tlet mouse = {\n\t\tx:e.x,\n\t\ty:e.y\n\t}\n\n\tif (e.target != this & e.target.tagName != \"svg\" & e.target.tagName != \"line\") {\n\t\twindow.removeEventListener('mousemove',mvD_D);\n\n\t}else {\n\t\tel.style.boxShadow = \"0 0 5px 2px #b3e0f9\";\n\t}\n\n\tfunction mvD_D (e) {\n\nif (!isResizing){\n\nmouse.x = e.x - mouse.x;\nmouse.y = e.y - mouse.y;\n\nif (par) {\n//this if is for collision with parent\nlet speed = internalColision (el,mouse.x,mouse.y,par);\n//and this for change coords of element\nelCrd.x += speed.x;\nelCrd.y += speed.y;\n\n}else {\n\telCrd.x += mouse.x;\n\telCrd.y += mouse.y;\n}\n\n\t\telCrd.X = getCoords(el).left;\n\t\telCrd.Y = getCoords(el).top;\n\n//here I set another position of element with css\n\t\tif (fdfex !== undefined && fdfex !== \"\" && fdfex !== 0) {\n\t\t\tlet status = 1;\n\t\t\tif (typeof fdfex == \"function\") {\n\t\t\t\tfdfex(e,status);\n\t\t\t}\n\t\t\tif (typeof fdfex == \"object\") {\n\t\t\t\tlet move = fdfex.f(e,fdfex.arg,status,elCrd.X,elCrd.Y);\n\t\t\t}\n\t\t}\n\n\t\tel.style.left = elCrd.x + \"px\";\n\t\tel.style.top = elCrd.y + \"px\";\n\t\tmouse.x = e.x;\n\t\tmouse.y = e.y;\n}\n\n\t}\n\nfunction muD_D (e) {\n\twindow.removeEventListener('mousemove',mvD_D);\n\twindow.removeEventListener('mouseup',muD_D);\n\n//here I set another position of element with css\n\n\tif (fdfex !== undefined && fdfex !== \"\" && fdfex !== 0) {\n\t\tlet status = 0;\n\t\tif (typeof fdfex == \"function\") {\n\t\t\tfdfex(e,status);\n\t\t}\n\t\tif (typeof fdfex == \"object\") {\n\t\t\tlet change = fdfex.f(e,fdfex.arg,status,e.x,e.y);\n\t\t}\n\t}\n\n\tel.style.boxShadow = \"none\";\n\tisDraging = false;\n\t}\n}\n\nel.ondragstart = function() {\n return false;\n};\n\n}", "function drag(ev) \n{\n ev.dataTransfer.setData(\"text\", ev.target.id);\n //$('#'+ev.target.id).draggable( {cursor: 'move'} );\n}", "function filesSelected(event) {\n processImport(event.target.files, 0);\n}", "function dragAndDrop(){\n var controls = new THREE.DragControls( dancers, cameraPerspective, renderer.domElement );\n\n controls.addEventListener( 'dragstart', dragStartCallback );\n controls.addEventListener( 'drag', dragCallback);\n controls.addEventListener( 'dragend', dragendCallback );\n\n function dragStartCallback(event) {\n if($(\"#changeName\").prop(\"checked\") == true){\n var name = 0;\n var nameStatus = \"\";\n while(name == 0){\n var newN = prompt(\"New name\", nameStatus);\n name = 1;\n if(newN == \"\") {\n name = 0;\n nameStatus = \"Name can't be blank\"\n }\n }\n if(newN == null){\n $(\"#changeName\").click();\n return;\n }\n changeName(event.object, newN);\n $(\"#changeName\").click();\n return;\n }else{\n startColor = event.object.material.color.getHex();\n event.object.material.color.setHex(0xf5163f);\n console.log(\"DRAG START\");\n }\n }\n function dragCallback(event){\n if($(\"#changeName\").prop(\"checked\") == true){\n alert(\"Change your name first\")\n }else{\n event.object.position.y = 0;\n console.log(\"DRAG\");\n }\n }\n function dragendCallback(event) {\n if($(\"#changeName\").prop(\"checked\") == true){\n alert(\"Change your name first\")\n }else{\n event.object.material.color.setHex(startColor);\n var pos = event.object.position;\n updateAllPositions()\n console.log(\"DRAG END\");\n }\n }\n}", "function handleFileSelect(evt) {\r\n evt.stopPropagation();\r\n evt.preventDefault();\r\n\r\n // Get the FileList object that contains the list of files that were dropped\r\n const files = evt.dataTransfer.files;\r\n\r\n // this UI is only built for a single file so just dump the first one\r\n file = files[0];\r\n const imageId = cornerstoneWADOImageLoader.wadouri.fileManager.add(file);\r\n loadAndViewImage(imageId);\r\n}", "function handleFileSelect(evt) {\n evt.stopPropagation();\n evt.preventDefault();\n\n var files = evt.dataTransfer.files; // FileList object.\n\n // files is a FileList of File objects. List some properties.\n var output;\n for (var i = 0, f; f = files[i]; i++) {\n output=f.name;\n }\n document.getElementById('textarea').value = output;\n }", "initDragAndDrop() {\n // treat body as drag and drop zone\n this.dndZone = document.getElementById('drag-and-drop');\n this.dndZone.addEventListener('dragover', this.onDragOver);\n this.dndZone.addEventListener(\"dragleave\", this.onDragLeave);\n this.dndZone.addEventListener('drop', this.onDragDrop);\n }", "function setupDragDropListener(obj){\n obj.addEventListener(\"dragover\", fileDragHover, false);\n obj.addEventListener(\"dragleave\", fileDragHover, false);\n obj.addEventListener(\"drop\", fileSelectHandler, false);\n obj.style.display = \"block\";\n }", "function win_drag_start(ftWin){draggingShape = true;}", "function fileInputChange(e) {\n /*jshint validthis:true, unused:vars*/\n handleFiles(this.files);\n document.getElementById(\"dropzoneContainer\").classList.remove(\"dragover\");\n document.getElementById(\"dropzoneContainer\").classList.add(\"filled\");\n document.getElementById(\"file-bar\").classList.remove(\"hidden\");\n document.getElementById(\"run-button\").classList.remove(\"hidden\");\n }", "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "function SelectionManager() {\n\tvar t = this;\n\t\n\t\n\t// exports\n\tt.select = select;\n\tt.unselect = unselect;\n\tt.reportSelection = reportSelection;\n\tt.daySelectionMousedown = daySelectionMousedown;\n\t\n\t\n\t// imports\n\tvar opt = t.opt;\n\tvar trigger = t.trigger;\n\tvar defaultSelectionEnd = t.defaultSelectionEnd;\n\tvar renderSelection = t.renderSelection;\n\tvar clearSelection = t.clearSelection;\n\t\n\t\n\t// locals\n\tvar selected = false;\n\n\n\n\t// unselectAuto\n\tif (opt('selectable') && opt('unselectAuto')) {\n\t\t$(document).mousedown(function(ev) {\n\t\t\tvar ignore = opt('unselectCancel');\n\t\t\tif (ignore) {\n\t\t\t\tif ($(ev.target).parents(ignore).length) { // could be optimized to stop after first match\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tunselect(ev);\n\t\t});\n\t}\n\t\n\n\tfunction select(startDate, endDate, allDay) {\n\t\tunselect();\n\t\tif (!endDate) {\n\t\t\tendDate = defaultSelectionEnd(startDate, allDay);\n\t\t}\n\t\trenderSelection(startDate, endDate, allDay);\n\t\treportSelection(startDate, endDate, allDay);\n\t}\n\t\n\t\n\tfunction unselect(ev) {\n\t\tif (selected) {\n\t\t\tselected = false;\n\t\t\tclearSelection();\n\t\t\ttrigger('unselect', null, ev);\n\t\t}\n\t}\n\t\n\t\n\tfunction reportSelection(startDate, endDate, allDay, ev) {\n\t\tselected = true;\n\t\ttrigger('select', null, startDate, endDate, allDay, ev);\n\t}\n\t\n\t\n\tfunction daySelectionMousedown(ev) { // not really a generic manager method, oh well\n\t\tvar cellToDate = t.cellToDate;\n\t\tvar getIsCellAllDay = t.getIsCellAllDay;\n\t\tvar hoverListener = t.getHoverListener();\n\t\tvar reportDayClick = t.reportDayClick; // this is hacky and sort of weird\n\t\tif (ev.which == 1 && opt('selectable')) { // which==1 means left mouse button\n\t\t\tunselect(ev);\n\t\t\tvar _mousedownElement = this;\n\t\t\tvar dates;\n\t\t\thoverListener.start(function(cell, origCell) { // TODO: maybe put cellToDate/getIsCellAllDay info in cell\n\t\t\t\tclearSelection();\n\t\t\t\tif (cell && getIsCellAllDay(cell)) {\n\t\t\t\t\tdates = [ cellToDate(origCell), cellToDate(cell) ].sort(dateCompare);\n\t\t\t\t\trenderSelection(dates[0], dates[1], true);\n\t\t\t\t}else{\n\t\t\t\t\tdates = null;\n\t\t\t\t}\n\t\t\t}, ev);\n\t\t\t$(document).one('mouseup', function(ev) {\n\t\t\t\thoverListener.stop();\n\t\t\t\tif (dates) {\n\t\t\t\t\tif (+dates[0] == +dates[1]) {\n\t\t\t\t\t\treportDayClick(dates[0], true, ev);\n\t\t\t\t\t}\n\t\t\t\t\treportSelection(dates[0], dates[1], true, ev);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\n\n}", "function _drag_init(elem) {\n\t\t\t\tselected = elem;\n\t\t\t\tx_elem = x_pos - selected.offsetLeft;\n\t\t\t}", "onMouseDown(e) {}", "function DragPreviewTemplate() {}", "function DragPreviewTemplate() {}", "function dragStart(event) {\n //console.log(event)\n event.dataTransfer.setData(\"choice\", event.target.id);\n event.dataTransfer.setData(\"letter\", event.target.innerHTML);\n}" ]
[ "0.64888227", "0.64888227", "0.6236188", "0.6157477", "0.6138555", "0.61237496", "0.6038748", "0.60213727", "0.6013821", "0.5990888", "0.5983206", "0.5976383", "0.5976149", "0.5962859", "0.5946961", "0.5946084", "0.5946084", "0.5946084", "0.5946084", "0.59139776", "0.5886861", "0.5886572", "0.58858114", "0.5883255", "0.5880249", "0.58656013", "0.5808585", "0.57992303", "0.57992303", "0.5785254", "0.5782658", "0.5714029", "0.5698865", "0.567462", "0.566991", "0.566139", "0.5646151", "0.56448793", "0.56160694", "0.560866", "0.55923295", "0.55923295", "0.55711585", "0.5562359", "0.55568254", "0.55551594", "0.55492735", "0.5543818", "0.5532973", "0.5528527", "0.552801", "0.5515808", "0.55087656", "0.54997987", "0.54986984", "0.5492994", "0.54788166", "0.5476636", "0.5470585", "0.5465896", "0.5459499", "0.5458235", "0.5457304", "0.5456341", "0.5456341", "0.5441181", "0.5440984", "0.54367054", "0.5431761", "0.5425098", "0.5422034", "0.5421425", "0.54068494", "0.54062814", "0.5399663", "0.5398743", "0.53929883", "0.53924507", "0.5389171", "0.5387083", "0.5384022", "0.5364164", "0.53639334", "0.5363677", "0.5359677", "0.53561", "0.53503054", "0.53500015", "0.5343766", "0.533979", "0.5336817", "0.53233105", "0.5319567", "0.53173107", "0.53173107", "0.53173107", "0.5314699", "0.531423", "0.53104985", "0.53104985", "0.5308373" ]
0.0
-1
Bookmark has a search method but it searches all bookmarks, and we want sometimes to search only in a specific folder
function searchBookmarks(bookmarks, title, url) { let id = 0; console.debug(`Looking for bookmark: ${title} | ${url}`); recursiveSearch(bookmarks, title, url); // Save the new id, only if the id isn't set already (which means we've already found the id) function recursiveSearch(bookmarks, title, url) { bookmarks.forEach(function (bm) { //console.debug(`bookmark: ${bm.title} (${bm.id})`); if (!id && bm.title == title) { console.debug(`Found bookmark by title: ${title} (id: ${bm.id})`); id = bm.id; } else if (!id && url && bm.url && bm.url == url) { console.debug(`Found bookmark by url: ${url} (id: ${bm.id})`); id = bm.id; } if (!id && bm.children) { recursiveSearch(bm.children, title, url); } }); } return id.toString(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search( query ) {\n return new Promise( function( resolve, reject ) {\n chrome.bookmarks.search( query, function( results ) {\n var matchingItem = $.map( results, function( el, i ) {\n var item; // On ne renvoie que les bookmarks et non les folder qui n'ont pas d'url\n if ( el.url && el.url.length !== 0 ) {\n item = {\n id: el.id,\n url: el.url,\n title: el.title\n };\n }\n return item;\n } );\n\n resolve( matchingItem );\n } );\n } );\n}", "function recursiveSearch(bookmarks, title, url) {\n bookmarks.forEach(function (bm) {\n //console.debug(`bookmark: ${bm.title} (${bm.id})`);\n if (!id && bm.title == title) {\n console.debug(`Found bookmark by title: ${title} (id: ${bm.id})`);\n id = bm.id;\n } else if (!id && url && bm.url && bm.url == url) {\n console.debug(`Found bookmark by url: ${url} (id: ${bm.id})`);\n id = bm.id;\n }\n\n if (!id && bm.children) {\n recursiveSearch(bm.children, title, url);\n }\n });\n }", "function BN_search (BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result, is_recur = true) {\r\n if (BN_match(BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch)) {\r\n\ta_result.push(BN);\r\n }\r\n if (is_recur && (BN.type == \"folder\")) {\r\n\tlet children = BN.children;\r\n\tif (children != undefined) {\r\n\t let url;\r\n\t let i;\r\n\t let len = children.length;\r\n\t for (let j=0 ; j<len ; j++) {\r\n\t\ti = children[j];\r\n\t\tif ((i.type != \"separator\")\r\n\t\t\t&& (((url = i.url) == undefined) || !url.startsWith(\"place:\")) // Ignore special bookmarks\r\n\t\t ) {\r\n\t\t BN_search(i, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result, is_recur)\r\n\t\t}\r\n\t }\r\n\t}\r\n }\r\n}", "function walkFolderFind()\n\t\t{\n\t\t\t// set up the callback function\n\t\t\t\tfunction callback(element, index, level, indent)\n\t\t\t\t{\n\t\t\t\t\ttrace(indent + '/' + element.name);\n\t\t\t\t\tif(element instanceof File && element.contents.indexOf(search) > -1)\n\t\t\t\t\t{\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t// promt the user and search\n\t\t\t\tvar search = prompt('Enter some text to find', 'Find a file by searching folders and comparing contents')\n\t\t\t\tvar result = Utils.walkFolder('{user}', callback);\n\n\t\t\t// do something with the result\n\t\t\t\tresult ? trace(result) : trace('Nothing was found');\n\n\t\t}", "function scanBNTree (BN, faviconWorker, doStats = true) {\r\n let type = BN.type;\r\n if (type == \"folder\") {\r\n\tlet bnId = BN.id;\r\n\tif (bnId != Root) { // Do not count Root (not visible)\r\n\t let url = BN.url;\r\n\t if (url == undefined) { // Do not count folders with url (\"place:\" special folders),\r\n\t\t\t\t\t\t\t // they are to be counted as bookmarks\r\n\t\tif (doStats)\r\n\t\t countFolders++;\r\n\t\tif (BN.title == BSP2TrashName) {\r\n\t\t bsp2TrashFldrBNId = bnId;\r\n\t\t bsp2TrashFldrBN = BN;\r\n\t\t}\r\n\t }\r\n\t else if (url.startsWith(\"place:\")) { // Remember pointers at special folders ..\r\n//BN.type = \"bookmark\";\r\n\t\tif (doStats)\r\n\t\t countBookmarks++;\r\n\t\tif (url.includes(RecentBkmkSort)) {\r\n\t\t recentBkmkBNId = bnId;\r\n\t\t recentBkmkBN = BN;\r\n\t\t}\r\n\t\telse if (url.includes(MostVisitedSort)) {\r\n\t\t mostVisitedBNId = bnId;\r\n\t\t mostVisitedBN = BN;\r\n\t\t}\r\n\t\telse if (url.includes(RecentTagSort)) {\r\n\t\t recentTagBNId = bnId;\r\n\t\t recentTagBN = BN;\r\n\t\t}\r\n\t }\r\n\t}\r\n\tlet children = BN.children;\r\n \tif (children != undefined) {\r\n\t let len = children.length;\r\n\t for (let i=0 ; i<len ;i++) {\r\n \t\tscanBNTree(children[i], faviconWorker, doStats);\r\n \t }\r\n\t}\r\n }\r\n else if (type == \"separator\") {\r\n\tif (doStats)\r\n\t countSeparators++;\r\n }\r\n else { // Presumably a bookmark\r\n\tlet bnId = BN.id;\r\n\tif (type == \"bookmark\") {\r\n\t if (bnId.startsWith(\"place:\")) { // Do not count special bookmarks under special place: folders\r\n\t\t\t\t\t\t\t\t\t // tagged with \"place:\" before their id when inserted\r\n\t\tif (!bnId.startsWith(\"place:mostVisited_\")) { \r\n\t\t // If one of recently bookmarked, try to avoid any un-needed fetches\r\n\t\t // by getting the uri directly from the original bookmark\r\n\t\t let origBnId = bnId.substring(6); // Remove \"place:\"\r\n\t\t let origBN = curBNList[origBnId];\r\n\t\t if (origBN != undefined) {\r\n\t\t\tBN.faviconUri = origBN.faviconUri;\r\n\t\t }\r\n\t\t}\r\n\t } else {\r\n\t\tif (doStats)\r\n\t\t countBookmarks++;\r\n\t }\r\n\t}\r\n\telse {\r\n\t trace(\"Odd bookmark type: \"+type);\r\n\t if (doStats)\r\n\t\tcountOddities++;\r\n\t}\r\n\tlet url = BN.url;\r\n\tif ((url == undefined) || url.startsWith(\"file:\")) { // Change nothing\r\n\t}\r\n\telse if (url.startsWith(\"about:\")) { // Change nothing also, except if protect is set unduly\r\n\t BN.protect = bnId.startsWith(\"place:\"); \r\n\t}\r\n\telse if (migration_spfldr && url.startsWith(\"place:\")) { // Change nothing also, but transform (and remember pointers) ..\r\n\t // These are now special folders, still counted as bookmarks\r\n\t BN.type = \"folder\";\r\n\t BN.fetchedUri = true; // Tell to use special favicon instead of standard folder favicon\r\n\t if (url.includes(MostVisitedSort)) {\r\n\t\tmostVisitedBNId = bnId;\r\n\t\tmostVisitedBN = BN;\r\n\t }\r\n\t else if (url.includes(RecentTagSort)) {\r\n\t\trecentTagBNId = bnId;\r\n\t\trecentTagBN = BN;\r\n\t }\r\n\t else if (url.includes(RecentBkmkSort)) {\r\n\t\trecentBkmkBNId = bnId;\r\n\t\trecentBkmkBN = BN;\r\n\t }\r\n\t}\r\n\telse if (options.disableFavicons) {\r\n\t BN.faviconUri = undefined;\r\n\t BN.fetchedUri = false;\r\n\t}\r\n\telse {\r\n\t let triggerFetch;\r\n\t let uri = BN.faviconUri;\r\n\t if ((uri == undefined) || (uri == \"/icons/waiting.gif\")) {\r\n\t\tBN.faviconUri = \"/icons/nofavicontmp.png\";\r\n\t\tBN.fetchedUri = false;\r\n\t\ttriggerFetch = true;\r\n\t\tif (doStats) {\r\n\t\t countFetchFav++;\r\n//console.log(\"countFetchFav 2: \"+countFetchFav+\" bnId: \"+bnId);\r\n\t\t}\r\n\t }\r\n\t else if (uri == \"/icons/nofavicontmp.png\") {\r\n\t\tBN.fetchedUri = false;\r\n\t\ttriggerFetch = true;\r\n\t\tif (doStats) {\r\n\t\t countFetchFav++;\r\n//console.log(\"countFetchFav 3: \"+countFetchFav+\" bnId: \"+bnId);\r\n\t\t}\r\n\t }\r\n\t else if ((url.toLowerCase().endsWith(\".pdf\")) && (uri == \"/icons/nofavicon.png\")) {\r\n\t\ttriggerFetch = false;\r\n\t\tBN.faviconUri = \"/icons/pdffavicon.png\";\r\n\t\tif (countNoFavicon > 0)\r\n\t\t countNoFavicon--;\r\n\t }\r\n\t else {\r\n\t\ttriggerFetch = false;\r\n\t\tif (uri == \"/icons/nofavicon.png\")\r\n\t\t countNoFavicon++;\r\n\t }\r\n\r\n\t if (triggerFetch && !options.pauseFavicons) { // Trigger favicon fetch, except if paused\r\n\t\t// This is a bookmark, so here no need for cloneBN(), there is no tree below\r\n//\t\tfaviconWorker.postMessage([\"get\", BN.id, BN.url, options.enableCookies]);\r\n\t\tfaviconWorker({data: [\"get\", bnId, url, options.enableCookies]});\r\n\t }\r\n\t}\r\n }\r\n}", "function getBookmarks(array, folder = '') {\n var result = [];\n array.forEach(a => {\n if (a.children && a.children.length > 0) {\n result = result.concat(getBookmarks(a.children, a.title));\n } else {\n // add folder name as prefix if user-defined folder\n if (!ignoredFolders.has(folder)) {\n a.title = `${folder}/${a.title}`;\n }\n result.push(a);\n }\n });\n return result;\n}", "function doubleSearch () {}", "function GoToBookmark(pdfDoc, bmNameToFind)\r\n{\r\n\t// split a possible hierarchy bookmark name such A:B:C into tokens\r\n\tvar tokens = bmNameToFind.split(':');\r\n\t\r\n\t// use app thermometer\r\n\tvar therm = app.thermometer\r\n\ttherm.duration = 10*tokens.length;\r\n\ttherm.begin();\r\n\ttherm.text = \"Search bookmarks ... \\(Cancel key: Esc on Win, command-period on Mac.\\)\";\r\n\ttherm.value = 2;\r\n\r\n\t// search\r\n\tvar nLevel = 0;\r\n\tvar bmFound;\r\n\tvar bmMatch;\r\n\r\n\t// go through each token to find match\r\n\tfor(var i=0;i<tokens.length;i++) {\r\n\r\n\t\t// the first token can be in any level of bookmarks\r\n\t\tif(i==0) {\r\n\t\t\t// remove any star tokens in front\r\n\t\t\twhile (tokens[i]==\"*\") {\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tbmFound = FindBookmarkByName(pdfDoc.bookmarkRoot, tokens[i]);\r\n\t\t}\r\n\t\t// the star token can be in any level under the previous one\r\n\t\telse if (tokens[i]==\"*\" && i+1<tokens.length) { \r\n\t\t\tbmFound = FindBookmarkByName(bmMatch, tokens[++i]);\r\n\t\t}\r\n\t\t// the token other than star must in the level next to the previous token\r\n\t\telse { \r\n\t\t\tbmFound = null;\r\n\t\t\tif(bmMatch.children != null) \r\n\t\t\tfor(var j=0;j<bmMatch.children.length;j++) {\r\n\t\t\t\tif(bmMatch.children[j].name.toLowerCase() == tokens[i].toLowerCase()) {\r\n\t\t\t\t\tbmFound = bmMatch.children[j];\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t// substitution if found\r\n\t\tif(bmFound != null )\r\n\t\t\tbmMatch = bmFound;\r\n\t\t// not found, end the process, return null.\r\n\t\telse {\r\n\t\t\ttherm.text = \" \";\r\n\t\t\ttherm.end();\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\t// set current value of thermometer\r\n\t\ttherm.value = 10*(i+1);\r\n\t}\r\n\r\n\ttherm.text = \" \";\r\n\ttherm.end();\r\n\r\n\t// if found, execute its action.\r\n\tbmFound.execute();\r\n\r\n\t// return the bookmark\r\n\treturn bmFound; \r\n}", "function scanFavBNTree (BN, faviconWorker, setFavicon) {\r\n if (!options.disableFavicons && !options.pauseFavicons) {\r\n\tlet type = BN.type;\r\n\tif (type == \"folder\") {\r\n\t let children = BN.children;\r\n \t if (children != undefined) {\r\n\t\tlet len = children.length;\r\n\t\tfor (let i=0 ; i<len ;i++) {\r\n \t\t scanFavBNTree(children[i], faviconWorker, setFavicon);\r\n \t\t}\r\n\t }\r\n\t}\r\n\telse if (type == \"bookmark\") {\r\n\t let bnId = BN.id;\r\n\t let url = BN.url;\r\n\t if ((url != undefined) && !url.startsWith(\"file:\") && !url.startsWith(\"about:\") && !url.startsWith(\"place:\")) {\r\n\t\tlet uri = BN.faviconUri;\r\n\t\tif (uri == \"/icons/nofavicon.png\") {\r\n\t\t if (url.toLowerCase().endsWith(\".pdf\")) {\r\n\t\t\tsetFavicon(bnId, \"/icons/pdffavicon.png\");\r\n\t\t }\r\n\t\t else {\r\n\t\t\tsetFavicon(bnId, \"/icons/nofavicontmp.png\");\r\n\t\t\tcountFetchFav++;\r\n\t\t\tfaviconWorker({data: [\"get\", bnId, url, options.enableCookies]});\r\n\t\t }\r\n\t\t}\r\n\t }\r\n\t}\r\n }\r\n}", "getBookmarkTree() {\r\n chrome.bookmarks.getTree( (results) => {\r\n if ( !results[0] || !results[0].children ) {\r\n this.setState({ noBookmarks: true });\r\n } else {\r\n this.buildTree(results[0].children);\r\n }\r\n });\r\n }", "function Search(root)\n{\n var input = $(\"searchfield\");\n var check = $(\"searchcomments\");\n \n var search = \"search.aspx?q=\" + encodeURIComponent(input.value);\n if (check != null && check.checked)\n search += \"&comment=true\";\n \n top.location.href = root + search;\n \n return false;\n}", "function triggerReprezentationByBookmarks(folders_list, blacklist){\n if(localStorage[\"hostname\"] == \"\"){\n for (key in folders_list){\n displayfolder(key);\n }\n }else{\n var folder = localStorage[\"hostname\"];\n for(var i = 0; i < folders_list[folder].length; i++){\n if(!isBlackListed(blacklist,folders_list[folder][i])){\n httpGetAsync(folders_list[folder][i]);\n }\n }\n localStorage[\"hostname\"] = \"\";\n }\n}", "function search(current){\n\n}", "function search() {\n\t\n}", "function getLinksFromBookmarks(folders, key, data){\n if(data.hasOwnProperty(\"children\")) {\n for (var i = 0; i < data.children.length; i++) {\n getLinksFromBookmarks(folders, data.title, data.children[i]);\n }\n }else{\n if(data.url != null) {\n if (folders[key] != null)\n folders[key].push(data.url);\n else{\n folders[key] = [];\n folders[key].push(data.url);\n }\n }\n }\n}", "function list_bookmark() {\n $.get('bookmark/list?_='+ new Date().getTime(), function(q) {\n var form = document.searchForm;\n form.q.value = q;\n form.from.value = 0;\n form.page.value = \"1\";\n $(\"input[name^='filter']\").remove();\n form.submit();\n })\n}", "function initiateSearch(str) {\n //if (str.slice(-1) == ' ') {\n //the following line may cause errors once the backend is fixxed\n //you can comment out the .then() part to make any errors stop\n CallSearch(str).then(updateBookmarkTable);\n //}\n }", "function mailSearchMail(allFolders){\n setBusy();\n var folder \n var searchString = document.getElementById('searchValue').value;\n folder = document.getElementById('folderId').options[document.getElementById('folderId').selectedIndex].value;\n //alert(searchString);\n var url;\n if(allFolders == true){\n url = \"./ajaxLoadMailByFolderAndSearch.pl?folderId=allFolders&searchString=\" + searchString;\n }else{\n url = \"./ajaxLoadMailByFolderAndSearch.pl?folderId=\" + folder + \"&searchString=\" + searchString;\n }\n getMailsByFolderAndSearch(url, \"mailFormId\");\n}", "function GetBookmarkName(doc)\r\n{\r\n\tvar str = util.printf(\"Enter a Bookmark to find in document %s. \\nUse A:B:C:D or A:*:D for hierarchy.\", doc.documentFileName);\r\n resp = app.response({\r\n cTitle: \"Find Bookmark\",\r\n cQuestion: str\r\n });\r\n if ( resp != null ) {\r\n\t\tif(GoToBookmark(doc, resp)==null)\r\n\t\t\tapp.alert(\"The bookmark is not found.\");\r\n\t}\r\n}", "function getFolderMarks(e) {\n\t\t\t// console.log('test', e, e.target);\n\t\t\tif (e.target.id == '') {console.log('its a link');return;}\n\n\t\t    if (e.target !== e.currentTarget) {\n\t\t        var folderId = e.target.id;\n\t\t\t\t// console.log(folderId, $('#'+folderId).height());\n\n\t\t\t\t//IF/ELSE to check if folder is open or not\n\t\t\t\tif($('#'+folderId).height() > 50){\n\t\t\t\t\t// console.log($('#'+folderId).height(), 'MORE THAN 50');\n\t\t\t\t\tvar props = {'height': '58px'};\n\t\t\t\t\t$('#'+folderId).animate(props,1000,'easeOutQuint', removeUrls(folderId));\n\t\t\t\t} else {\n\t\t\t\t\t// console.log($('#'+folderId).height(), 'LESS THAN 50');\n\t\t\t\t\tchrome.bookmarks.getChildren(String(folderId.substr(4)), function(marks){\n\t\t\t\t\t\t// console.log(marks);\n\t\t\t\t\t\t//FOR ADDING FULL LIST ITEM INSTEAD\n\t\t\t\t\t\t// $('#'+e.target.id).append('<ul id=\"cool\"></ul>');\n\t\t\t\t\t\tmarks.forEach(function(mark){\n\t\t\t\t\t\t\t//ADDS FULL LIST ITEM\n\t\t\t\t\t\t\t// $('#cool').append('<br><li class=\"linkItemFolder\"><a href=\"'+mark.url+'\">'+mark.url.substr(0,50)+'</a></li>');\n\t\t\t\t\t\t\t//Appends an link element for each bookmark in the selected folder\n\t\t\t\t\t\t\t//doesn't display folders inside folders\n\t\t\t\t\t\t\tif(mark.url){\n\t\t\t\t\t\t\t\t$('#'+e.target.id).append('<br><a href=\"'+mark.url+'\">'+mark.url.substr(0,50)+'</a>');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\tvar height = (marks.length * 20)+58+'px';\n\n\t\t\t\t\t\tvar props = {'height': height};\n\t\t\t\t\t\t// console.log($('#'+folderId));\n\t\t\t\t\t\t$('#'+folderId).animate(props,1000,'easeOutQuint');\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t    }\n\t\t    e.stopPropagation();\n\t\t}", "function SearchWrapper () {}", "function updateSearch () {\n // Triggered by timeout (or Enter key), so now clear the id\n inputTimeout = null;\n\n // Get search string\n let value = SearchTextInput.value;\n\n // Do not trigger any search if the input box is empty\n // Can happen in rare cases where we would hit the cancel button, and updateSearch() is dispatched\n // before the event dispatch to manageSearchTextHandler() and so before it could clear the timeout.\n if (value.length > 0) { // Launch search only if there is something to search for\n\t// Activate search mode and Cancel search button if not already\n\tif (sboxState != SBoxExecuted) {\n\t enableCancelSearch();\n\t}\n\t// Update search history list\n\tupdateSearchList(value);\n\n\t// Discard previous results table if there is one\n\tif (resultsTable != null) {\n\t SearchResult.removeChild(resultsTable);\n\t resultsTable = null;\n\t curResultRowList = {};\n//\t resultsFragment = null;\n\n\t // If a row cell was highlighted, do not highlight it anymore\n//\t clearCellHighlight(rcursor, rlastSelOp, rselection.selectIds);\n\t cancelCursorSelection(rcursor, rselection);\n\t}\n\n\t// Display waiting for results icon\n\tWaitingSearch.hidden = false;\n\n\t// Look for bookmarks matching the search text in their contents (title, url .. etc ..)\n\tlet searching;\n\tif (!options.noffapisearch\n\t\t&& (options.searchField == \"both\") && (options.searchScope == \"all\") && (options.searchMatch == \"words\")) {\n//console.log(\"Using FF Search API\");\n\t // It seems that parameters can make the search API fail and return 0 results sometimes, so strip them out,\n\t // there will be too much result maybe, but at least some results !\n\t let simpleUrl;\n\t let paramsPos = value.indexOf(\"?\");\n\t if (paramsPos >= 0) {\n\t\tsimpleUrl = value.slice(0, paramsPos);\n\t }\n\t else {\n\t\tsimpleUrl = value;\n\t }\n\t searching = browser.bookmarks.search(decodeURI(simpleUrl));\n\t}\n\telse {\n//console.log(\"Using BSP2 internal search algorithm\");\n\t searching = new Promise ( // Do it asynchronously as that can take time ...\n\t\t(resolve) => {\n\t\t let a_matchStr;\n\t\t let matchRegExp;\n\t\t let isRegExp, isTitleSearch, isUrlSearch;\n\t\t let a_BN;\n\n\t\t if (options.searchField == \"both\") {\n\t\t\tisTitleSearch = isUrlSearch = true;\n\t\t }\n\t\t else if (options.searchField == \"title\") {\n\t\t\tisTitleSearch = true;\n\t\t\tisUrlSearch = false;\n\t\t }\n\t\t else {\n\t\t\tisTitleSearch = false; \n\t\t\tisUrlSearch = true;\n\t\t }\n\n\t\t if (options.searchMatch == \"words\") { // Build array of words to match\n\t\t\tisRegExp = false;\n\t\t\ta_matchStr = strLowerNormalize(value).split(\" \"); // Ignore case and diacritics\n\t\t }\n\t\t else {\n\t\t\tisRegExp = true;\n\t\t\ttry {\n\t\t\t matchRegExp = new RegExp (strNormalize(value), \"i\"); // Ignore case and diacritics\n\t\t\t}\n\t\t\tcatch (e) { // If malformed regexp, do not continue, match nothing\n\t\t\t a_BN = [];\n\t\t\t}\n\t\t }\n\n\t\t if (a_BN == undefined) { // No error detected, execute search\n\t\t\tif (options.searchScope == \"all\") { // Use the List form\n\t\t\t a_BN = searchCurBNList(a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch);\n\t\t\t}\n\t\t\telse { // Use the recursive form\n\t\t\t let BN;\n\t\t\t if (cursor.cell == null) { // Start from Root\n\t\t\t\tBN = rootBN;\n\t\t\t }\n\t\t\t else { // Retrieve BN of cell in cursor\n\t\t\t\tBN = curBNList[cursor.bnId];\n\t\t\t\t// Protection\n\t\t\t\tif (BN == undefined) {\n\t\t\t\t BN = rootBN;\n\t\t\t\t}\n\t\t\t }\n\t\t\t a_BN = searchBNRecur(BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch,\n\t\t\t\t\t\t\t\t (options.searchScope == \"subfolder\") // Go down to subfolders, or only current folder ?\n\t\t\t\t\t\t\t\t );\n\t\t\t}\n\t\t }\n\n\t\t resolve(a_BN);\n\t\t}\n\t );\n\t}\n\tsearching.then(\n\t function (a_BTN) { // An array of BookmarkTreeNode or of BookmarkNode (a poor man's kind of \"polymorphism\" in Javascript ..)\n\t\t// Create the search results table only if a search is still active.\n\t\t// Can happen when browser.bookmarks.search() is very long, like higher than InputKeyDelay,\n\t\t// and we have cleared the input box / cancelled the search in between.\n\t\tif (SearchTextInput.value.length > 0) { // Display results only if there is something to search for\n\t\t displayResults(a_BTN);\n\t\t}\n\t }\n\t);\n }\n}", "function wpsn_loadBookmarks(callback,url,title) {\n\tchrome.bookmarks.getTree(function(curentBookmarkTreeNodes) {\n\t\tlet otherBookmarks = curentBookmarkTreeNodes[0].children[1];\n\t\tfor (let i = 0; i < otherBookmarks.children.length; i++) {\n\t\t\tlet temp_bkmrk = otherBookmarks.children[i];\n\t\t\tif (temp_bkmrk.title === wpsn_title) {\n\t\t\t\twpsn_bookmarks = temp_bkmrk;\n\t\t\t\tif (callback) { callback(url,title); }\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tchrome.bookmarks.create({'parentId': otherBookmarks.id, 'title': wpsn_title},\n\t\t\tfunction(newFolder) {\n\t\t\t\tlog('added folder: ' + newFolder.title);\n\t\t\t\twpsn_bookmarks = newFolder;\n\t\t\t\tif (callback) { callback(url,title); }\n\t\t\t}\n\t\t);\n\t});\n}", "function search() {\r\n let searchTerm = id(\"search-term\").value.trim();\r\n if (searchTerm !== \"\") {\r\n id(\"home\").disabled = false;\r\n loadBooks(\"&search=\" + searchTerm);\r\n }\r\n }", "updateSearch(aTab) {\n let tab = aTab || this.tabmail.currentTabInfo;\n // bail if things don't really exist yet\n if (!tab.folderDisplay || !tab.folderDisplay.view.search) {\n return;\n }\n\n let filterer = tab._ext.quickFilter;\n filterer.displayedFolder = tab.folderDisplay.displayedFolder;\n\n let [terms, listeners] = filterer.createSearchTerms(\n tab.folderDisplay.view.search.session\n );\n\n for (let [listener, filterDef] of listeners) {\n // it registers itself with the search session.\n new QuickFilterSearchListener(\n tab.folderDisplay,\n filterer,\n filterDef,\n listener,\n QuickFilterBarMuxer\n );\n }\n tab.folderDisplay.view.search.userTerms = terms;\n // Uncomment to know what the search state is when we (try and) update it.\n // dump(tab.folderDisplay.view.search.prettyString());\n }", "function fnPluginTaskSearch_resetSearchURL() {\n\t// Reinitialize the treeview to search only on the selected folder\n\n\t$restrict_folder = marknotes.search.restrict_folder;\n\n\tif ($restrict_folder !== \".\") {\n\t\t$restrict_folder = window.btoa(\n\t\t\tencodeURIComponent(JSON.stringify(marknotes.search.restrict_folder))\n\t\t);\n\t}\n\n\t$(\"#TOC\").jstree(true).settings.search.ajax.data = {\n\t\trestrict_folder: $restrict_folder,\n\t\tdisable_cache: marknotes.search.disable_cache ? 1 : 0,\n\t\tdisable_plugins: marknotes.search.disable_plugins ? 1 : 0\n\t};\n\n\treturn true;\n}", "function search(searchString, index) {\n var notebookFileName = getNotebookFileName(currentTabEntryId); \n var xmlDoc = $.parseXML($('#txtCache-' + notebookFileName).text());\n var $entry = $(xmlDoc).find('title,content').filter(function() {\n return $(this).text().indexOf(searchString) >= 0;\n }).closest('entry');\n var id = '';\n var total = 0;\n if (typeof $entry[index] != 'undefined') {\n id = $entry[index].getAttribute(\"id\");\n total = $entry.length;\n }\n return {\"entryId\": id, \"total\": total}; \n }", "function bookmarkWhere() {\n var string = JSON.stringify(where);\n localStorage.setItem('whereBookmark', string);\n}", "function initialSearch(keywords, home) {\n\t\n\tvar keywords = keywords;\n\tvar home = home;\n\t\n\t//var home = 'New+Brunswick%2C+NJ';\n\t//var keywords = 'node';\n\tvar searchLocation = \"&l=\"+home;\n\tvar searchKeyword = \"&q=\"+keywords;\n\tvar limit = \"&limit=\";\n\tvar resultsnum = 10;\n\tvar pageNumber = 1;\n\tvar first = true;\n\n searchCall(keywords, home);\n\tbuildResults(searchKeyword,searchLocation,limit,resultsnum,pageNumber,first,home);\n}", "function searchBNRecur (BN, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, is_recur = true) {\r\n let a_result = [];\r\n\r\n if (BN.type != \"folder\") { // Parent must be a folder ..\r\n\tBN = curBNList[BN.parentId];\r\n }\r\n let url;\r\n if (((url = BN.url) == undefined) || !url.startsWith(\"place:\")) { // Ignore special bookmarks\r\n\tlet children = BN.children;\r\n\tif (children != undefined) {\r\n\t let i;\r\n\t let len = children.length;\r\n\t for (let j=0 ; j<len ;j++) {\r\n\t\ti = children[j];\r\n\t\tif ((i.type != \"separator\")\r\n\t\t\t&& (((url = i.url) == undefined) || !url.startsWith(\"place:\")) // Ignore special bookmarks\r\n\t\t ) {\r\n\t\t BN_search (i, a_matchStr, matchRegExp, isRegExp, isTitleSearch, isUrlSearch, a_result, is_recur);\r\n\t\t}\r\n\t }\r\n\t}\r\n }\r\n\r\n return(a_result);\r\n}", "function fnReadBookmark()\r\n{\r\n\t//alert(\"Reading Bookmark : \" + Bookmark_location);\r\n\treturn Bookmark_location;\r\n}", "navigateFolder(folderId,folderName=\"\",modifyToast=-1)\n {\n chrome.bookmarks.getChildren(folderId,(data)=>{\n if (modifyToast<0)\n {\n this.props.controlHandler.current.addToast(folderId,folderName);\n }\n\n else\n {\n this.props.controlHandler.current.modifyToast(modifyToast);\n }\n\n this.controlMarks.current.setDisabled();\n this.setState({data});\n });\n }", "function search()\n{\n\tvar query = ($(\"#search\")[0]).value;\n\tcreateCookie('search', query, 1); /// Save the search query\n\tgoTo('index'); /// Go to index (search) page\n}", "function search() {\n return shell().Search;\n}", "function mainSearchFn() {\n // Check a search term has been entered\n if (searchText.value) {\n //Track how long the search takes: search start\n var d = new Date();\n var searchStartTime = d.getTime();\n\n //Search with index\n //Load searchIndex and searchSettings from localStorage.\n searchTerm = searchText.value;\n searchIndex = JSON.parse(localStorage.getItem(\"searchIndex\"));\n searchSettings = JSON.parse(localStorage.getItem(\"searchSettings\"));\n\n //kick off the search\n if (searchSettings[0] === \"fuzzy\") {\n console.log(\"Doing a fuzzy search...\");\n\n //First normalize the searchterm: no accents, no caps\n var searchTermLowerCaseNoAccents = searchTerm\n .toLowerCase()\n .normalize(\"NFD\")\n //replace accents with normal/unaccented characaters\n .replace(/[\\u0300-\\u036f]/g, \"\");\n for (const verse of searchIndex) {\n var verseLowerCaseNoAccents = verse.verseText\n .toLowerCase()\n .normalize(\"NFD\")\n .replace(/[\\u0300-\\u036f]/g, \"\");\n\n //Now search:\n //First check if the folder we're looking at exists in searchSettings\n if (searchSettings.includes(verse.folder) === true) {\n //if there is the search term, then give the result boolean result; string.includes returns true or false.\n var searchSuccess = verseLowerCaseNoAccents.includes(\n searchTermLowerCaseNoAccents\n );\n if (searchSuccess === true) {\n addSearchResult(verse);\n }\n }\n }\n } else if (searchSettings[0] === \"strict\") {\n //do strict search\n console.log(\"Doing a strict search...\");\n\n for (const verse of searchIndex) {\n //First check if the folder we're looking at exists in searchSettings\n if (searchSettings.includes(verse.folder) === true) {\n var searchSuccess = verse.verseText.match(searchTerm);\n //if there is no search term found, the result is null - if the search term is found, it's not null.\n //If success, then give the result.\n if (!(searchSuccess === null)) {\n addSearchResult(verse);\n }\n }\n }\n }\n }\n\n //If there are no results by now, give the user feedback to that effect\n document.getElementById(\"no-items\").innerHTML = \"\";\n if (!resultsList.hasChildNodes()) {\n console.log(\"Search item not found in index\");\n document.getElementById(\n \"no-items\"\n ).innerHTML = `<img src=\"no-results.png\">`;\n }\n\n //Log out time elapsed on the search\n var d = new Date();\n var searchEndTime = d.getTime();\n var totalTimeElapsed = searchEndTime - searchStartTime;\n console.log(\"Search complete in \" + totalTimeElapsed + \" milliseconds\");\n}", "search(url) {\n // we set the pointer node to the root.\n let currentNode = this.root;\n\n// we iterate through each character of the URL\n for (let char of url) {\n\n// if the current node does not point to the next character in the URL,\n//we know that URL does not exist in our visited set,\n //so we automatically return false,\n if (!currentNode.children.has(char)){\n return false\n } else {\n\n // otherwise we repeat the process, by changing our pointer\n //\"current node\" to the next node (it's child) and\n //continuing to check each node in the trie and each character in the URL\n currentNode = currentNode.children.get(char)\n }\n }\n\n // Once we iteriate through the URL to see if each node exists in the\n //tree, we check to see if it's a valid URL by returning whether the\n //last node is the \"end of the URL,\" if it's not the end of the URL,\n //then false is returned rather than true.\n return currentNode.end\n }", "function searchCall(keywords, home){\n\t\n\tvar search = {\n\t\tkeyWord: keywords,\n\t\thome: home,\n\t}\n\tsavedSearch.push(search);\n}", "function searchIt() {\r\n if (MovieListLoaded && SeriesListLoaded) {\r\n var searchFor = window.location.href.split('?q=');\r\n var searchQuery = searchFor[1];\r\n\r\n if (searchQuery !== null && searchFor.length > 1) {\r\n document.getElementById('searchText').value = decodeURI(\r\n searchQuery);\r\n getMovies(searchQuery);\r\n }\r\n }\r\n}", "function searchForQuery(query) {\r\n toggleMainContainer(false);\r\n togglePreloader(true);\r\n showLoadMoreButtons();\r\n clearLists();\r\n search(query, false, 1);\r\n search(query, true, 1); \r\n setCurrentQuery(query);\r\n }", "function search(q, d, nopush, all) {\n keywords = q\n current_retention = d // we use this later in the pagebuilder\n current_query = q // ditto\n var arr = xlist.split('@', 2)\n var listname = arr[0]\n var olist = listname\n var domain = arr[1]\n \n // are we checking *@foo.tld ?\n if (document.getElementById('checkall')) {\n all = document.getElementById('checkall').checked\n }\n // If checking multiple lists, the globa_deep will tell the pagebuilder to also\n // include the mailing list name in each result\n global_deep = false\n if (all == true) {\n listname = \"*\"\n global_deep = true\n }\n \n // we just made a new search, clear the selected month in the calendar to the left if that makes sense\n clearCalendarHover()\n \n // As usual, push new history state\n if (!nopush) {\n window.history.pushState({}, \"\", \"list.html?\" + listname + \"@\" + domain + \":\" + d + \":\" + encodeURIComponent(q));\n }\n \n // get the data from backend, push to page builder func\n GetAsync(\"/api/stats.lua?list=\" + listname + \"&domain=\" + domain + \"&q=\" + encodeURIComponent(q) + \"&d=\" + d, null, buildPage)\n \n // for the list title, prepare the date range\n // TODO: improve this much like we have with trends.html\n var arr = datePickerDouble(d)\n var howlong = datePickerValue(d)\n // howlong may begin with a month which should not be lower-cased.\n // or it may be 'Less than 1 month ago'\n // Avoid checking by starting a new sentence\n document.getElementById('listtitle').innerHTML = listname + \"@\" + domain + \" (Quick Search. \" + howlong + \") <a class='btn btn-warning' href='javascript:void(0);' onclick='getListInfo(xlist)'>Clear filters</a>\"\n xlist = olist + \"@\" + domain\n return false;\n}", "function BN_includes (BN, sBN) {\r\n let found = Object.is(BN, sBN);\r\n if (!found && (BN.type == \"folder\")) {\r\n\tlet children = BN.children;\r\n\tlet len;\r\n\tif ((children != undefined) && ((len = children.length) > 0)) {\r\n\t for (let i=0 ; i<len ; i++) {\r\n\t\tif (BN_includes(children[i], sBN)) {\r\n\t\t found = true;\r\n\t\t break;\r\n\t\t}\r\n\t }\r\n\t}\r\n }\r\n return (found);\r\n}", "function GetAllData(t_name) {\n\n jQuery.get(ajaxurl + \"?action=my_action&param=hello\", function (data) {\n\n var response = [data],\n currentPath = '',\n breadcrumbsUrls = [];\n var folders = [],\n files = [];\n // This event listener monitors changes on the URL. We use it to\n // capture back/forward navigation in the browser.\n\n jQuery(window).on('hashchange', function () {\n\n goto(window.location.hash);\n // We are triggering the event. This will execute \n // this function on page load, so that we show the correct folder:\n\n }).trigger('hashchange');\n // Hiding and showing the search box\n\n filemanager.find('.search').click(function () {\n\n var search = jQuery(this);\n search.find('span').hide();\n search.find('input[type=search]').show().focus();\n });\n // Listening for keyboard input on the search field.\n // We are using the \"input\" event which detects cut and paste\n // in addition to keyboard input.\n\n filemanager.find('input').on('input', function (e) {\n\n folders = [];\n files = [];\n var value = this.value.trim();\n if (value.length) {\n\n filemanager.addClass('searching');\n // Update the hash on every key stroke\n window.location.hash = 'search=' + value.trim();\n }\n\n else {\n\n filemanager.removeClass('searching');\n window.location.hash = encodeURIComponent(currentPath);\n }\n\n }).on('keyup', function (e) {\n // Clicking 'ESC' button triggers focusout and cancels the search\n var search = jQuery(this);\n if (e.keyCode == 27) {\n\n search.trigger('focusout');\n }\n\n }).focusout(function (e) {\n\n // Cancel the search\n\n var search = jQuery(this);\n if (!search.val().trim().length) {\n\n window.location.hash = encodeURIComponent(currentPath);\n search.hide();\n search.parent().find('span').show();\n }\n\n });\n /* fileList.on('click', '.del_folder', function (e) {\n e.preventDefault();\n var id = jQuery(this).attr('id');\n if(t_name == '0') {\n var a = confirm(\"Are You Sure You want Delete this Folder!\");\n \n if(a === true)\n {\n jQuery('#preloader_status').show();\n jQuery('#preloader').show();\n jQuery.ajax({\n url: ajaxurl+\"?action=del_folder&id=\"+id,\n type: 'GET',\n \n contentType: false,\n processData: false,\n success: function (returndata) {\n //alert(returndata);\n \n GetAllData(1);\n jQuery('#preloader_status').hide();\n jQuery('#preloader').hide();\n \n }\n });\n //window.location.href = url;\n }\n }\n c = true;\n \n });\n\n \n fileList.on('click', '.del_file', function (e) {\n e.preventDefault();\n var url = jQuery(this).attr('href');\n var id = jQuery(this).attr('id');\n if(t_name == '0') {\n var a = confirm(\"Are You Sure You want Delete this file!\");\n \n if(a === true)\n {\n jQuery('#preloader_status').show();\n jQuery('#preloader').show();\n jQuery.ajax({\n url: ajaxurl+\"?action=del_file&id=\"+id,\n type: 'GET',\n \n contentType: false,\n processData: false,\n success: function (returndata) {\n //alert(returndata);\n GetAllData(1);\n jQuery('#preloader_status').hide();\n jQuery('#preloader').hide();\n \n }\n });\n //window.location.href = url;\n }\n }\n c = true;\n });\n\n fileList.on('click', '.edit_fILE', function (e) {\n e.preventDefault();\n var id = jQuery(this).attr('id');\n jQuery(\"#file_id\").val(id);\n jQuery(\"#editFile\").show();\n c = true;\n });\n\n\n fileList.on('click', '.edit_folder', function (e) {\n e.preventDefault();\n\n var id = jQuery(this).attr('id');\n var name = jQuery(this).attr('title');\n \n jQuery(\"#folder_id\").val(id);\n jQuery(\"#editfolderName\").val(name);\n jQuery(\"#folderEdit\").show();\n c = true;\n });\n*/\n\n\n\n fileList.on('click', 'div#folder_id_view', function (e) {\n \n if(c==false) {\n e.preventDefault();\n var nextDir = jQuery(this).find('a.folders').attr('href');\n \n var folder_id = jQuery(this).find('a.folders').attr('id');\n //console.log(\"id == \",folder_id);\n jQuery(\"#folder_iddd\").val(folder_id);\n jQuery(\"#folder_parent_id\").val(folder_id);\n if (filemanager.hasClass('searching')) {\n\n // Building the breadcrumbs\n\n breadcrumbsUrls = generateBreadcrumbs(nextDir);\n filemanager.removeClass('searching');\n filemanager.find('input[type=search]').val('').hide();\n filemanager.find('span').show();\n }\n else {\n breadcrumbsUrls.push(nextDir);\n }\n\n window.location.hash = encodeURIComponent(nextDir);\n currentPath = nextDir;\n }\n \n });\n // Clicking on breadcrumbs\n\n breadcrumbs.on('click', 'a', function (e) {\n e.preventDefault();\n var index = breadcrumbs.find('a').index(jQuery(this)),\n nextDir = breadcrumbsUrls[index];\n // console.log(\"nextDir==\",nextDir);\n var path = nextDir.split('/');\n demo = response;\n for (var i = 0; i < path.length; i++) {\n for (var j = 0; j < demo.length; j++) {\n\n if (demo[j].name === path[i]) {\n //console.log(\"currentPath\", currentPath);\n // var aa = currentPath.split(\"/\");\n\n var currn_fol = path[path.length - 1];\n if (currn_fol == demo[j].name) {\n console.log(\"currentfolder_id == \", demo[j].name + \"==\" + demo[j].id);\n jQuery(\"#folder_iddd\").val(demo[j].id);\n jQuery(\"#folder_parent_id\").val(demo[j].id);\n }\n\n\n demo = demo[j].items;\n break;\n }\n }\n }\n\n\n breadcrumbsUrls.length = Number(index);\n window.location.hash = encodeURIComponent(nextDir);\n });\n // Navigates to the given hash (path)\n\n function goto(hash) {\n\n hash = decodeURIComponent(hash).slice(1).split('=');\n \n if (hash.length) {\n var rendered = '';\n // if hash has search in it\n\n if (hash[0] === 'search') {\n\n filemanager.addClass('searching');\n rendered = searchData(response, hash[1].toLowerCase());\n if (rendered.length) {\n currentPath = hash[0];\n render(rendered);\n }\n else {\n render(rendered);\n }\n\n }\n\n // if hash is some path\n\n else if (hash[0].trim().length) {\n currentPath = hash[0];\n var p = hash[0].trim();\n path = p.split('/');\n demo = response;\n console.log(\"refresh path\"+path);\n for (var i = 0; i < path.length; i++) {\n for (var j = 0; j < demo.length; j++) {\n\n if (demo[j].name === path[i]) {\n console.log(\"currentPath refresh\", currentPath);\n var aa = currentPath.split(\"/\");\n var currn_fol = aa[aa.length - 1];\n if (currn_fol == demo[j].name) {\n jQuery(\"#folder_iddd\").val(demo[j].id);\n jQuery(\"#folder_parent_id\").val(demo[j].id);\n }\n //console.log(\"currentfolder_id == \",demo[j].name+\"==\"+demo[j].id);\n flag = 1;\n demo = demo[j].items;\n break;\n }\n }\n }\n rendered = searchByPath(hash[0]);\n if (rendered.length) {\n\n currentPath = hash[0];\n breadcrumbsUrls = generateBreadcrumbs(hash[0]);\n render(rendered);\n }\n else {\n currentPath = hash[0];\n breadcrumbsUrls = generateBreadcrumbs(hash[0]);\n render(rendered);\n }\n\n }\n\n // if there is no hash\n\n else {\n\n currentPath = data.path;\n breadcrumbsUrls.push(data.path);\n render(searchByPath(data.path));\n }\n }\n }\n\n // Splits a file path and turns it into clickable breadcrumbs\n\n function generateBreadcrumbs(nextDir) {\n var path = nextDir.split('/').slice(0);\n for (var i = 1; i < path.length; i++) {\n path[i] = path[i - 1] + '/' + path[i];\n }\n return path;\n }\n\n\n // Locates a file by path\n\n function searchByPath(dir) {\n\n var path = dir.split('/'),\n demo = response,\n flag = 0;\n console.log(\"patssssh===\", path);\n for (var i = 0; i < path.length; i++) {\n for (var j = 0; j < demo.length; j++) {\n\n if (demo[j].name === path[i]) {\n console.log(\"currentPath\", currentPath);\n var aa = currentPath.split(\"/\");\n var currn_fol = aa[aa.length - 1];\n if (currn_fol == demo[j].name) {\n jQuery(\"#folder_iddd\").val(demo[j].id);\n jQuery(\"#folder_parent_id\").val(demo[j].id);\n }\n //console.log(\"currentfolder_id == \",demo[j].name+\"==\"+demo[j].id);\n flag = 1;\n demo = demo[j].items;\n break;\n }\n }\n }\n\n demo = flag ? demo : [];\n return demo;\n }\n\n\n // Recursively search through the file tree\n\n function searchData(data, searchTerms) {\n\n data.forEach(function (d) {\n if (d.type === 'folder') {\n\n searchData(d.items, searchTerms);\n if (d.name.toLowerCase().match(searchTerms)) {\n folders.push(d);\n }\n }\n else if (d.type === 'file') {\n if (d.name.toLowerCase().match(searchTerms)) {\n files.push(d);\n }\n }\n });\n return {folders: folders, files: files};\n }\n\n\n // Render the HTML for the file manager\n\n function render(data) {\n var scannedFolders = [],\n scannedFiles = [];\n if (Array.isArray(data)) {\n\n data.forEach(function (d) {\n\n if (d.type === 'folder') {\n scannedFolders.push(d);\n }\n else if (d.type === 'file') {\n scannedFiles.push(d);\n }\n\n });\n }\n else if (typeof data === 'object') {\n\n scannedFolders = data.folders;\n scannedFiles = data.files;\n }\n\n\n // Empty the old result and make the new one\n\n fileList.empty().hide();\n if (!scannedFolders.length && !scannedFiles.length) {\n filemanager.find('.nothingfound').show();\n }\n else {\n filemanager.find('.nothingfound').hide();\n }\n\n if (scannedFolders.length) {\n\n scannedFolders.forEach(function (f) {\n\n var itemsLength = f.items.length,\n name = escapeHTML(f.name),\n icon = '<span class=\"icon folder\"></span>';\n if (itemsLength) {\n icon = '<span class=\"icon folder full\"></span>';\n }\n\n if (itemsLength == 1) {\n itemsLength += ' item';\n }\n else if (itemsLength > 1) {\n itemsLength += ' items';\n }\n else {\n itemsLength = 'Empty';\n }\n var delUrl =ajaxurl+\"?action=del&id=\"+f.id;\n var editUrl =ajaxurl+\"?action=edit&id=\"+f.id;\n var folder = jQuery('<li class=\"folders\" id = \"fil_'+f.id+'\"><div id=\"folder_id_view\"><a id=\"' + f.id + '\" href=\"' + f.path + '\" title=\"' + f.path + '\" class=\"folders\">' + icon + '<span class=\"name\">' + name + '</span> <span class=\"details\">' + itemsLength + '</span></a> </div><div class=\"deleteedit\"><a id=\"'+f.id+'\" class=\"del_folder\">Delete</a> <a onClick=\"editFolder(\\''+f.id+'\\',\\''+f.name+'\\')\" id=\"'+f.id+'\" title=\"' + f.name + '\" class=\"edit_folder\" >Edit</a></div></li>');\n folder.appendTo(fileList);\n });\n }\n\n if (scannedFiles.length) {\n\n scannedFiles.forEach(function (f) {\n\n var fileSize = bytesToSize(f.size),\n name = escapeHTML(f.name),\n fileType = name.split('.'),\n icon = '<span class=\"icon file\"></span>';\n fileType = fileType[fileType.length - 1];\n icon = '<span class=\"icon file f-' + fileType + '\">.' + fileType + '</span>';\n \n var file = jQuery('<li class=\"files\" id = \"fil_'+f.id+'\"><a href=\"' + f.path + '\" title=\"' + f.path + '\" class=\"files\">' + icon + '<span class=\"name\">' + name + '</span> </a><div class=\"deleteedit\"><a id=\"'+f.id+'\" class=\"del_file\">Delete</a> <a id=\"'+f.id+'\" onClick=\"editFile(\\''+f.id+'\\')\" class=\"edit_fILE\" >Edit</a></div></li>');\n file.appendTo(fileList);\n });\n }\n\n\n // Generate the breadcrumbs\n\n var url = '';\n if (filemanager.hasClass('searching')) {\n\n url = '<span>Search results: </span>';\n fileList.removeClass('animated');\n }\n else {\n\n fileList.addClass('animated');\n //console.log(\"breadcrumbs \",breadcrumbsUrls);\n breadcrumbsUrls.forEach(function (u, i) {\n\n var name = u.split('/');\n if (i !== breadcrumbsUrls.length - 1) {\n url += '<a href=\"' + u + '\"><span class=\"folderName\">' + name[name.length - 1] + '</span></a> <span class=\"arrow-broad\">→</span> ';\n }\n else {\n url += '<span class=\"folderName\">' + name[name.length - 1] + '</span>';\n }\n\n });\n }\n\n breadcrumbs.text('').append(url);\n // Show the generated elements\n\n fileList.animate({'display': 'inline-block'});\n }\n\n\n // This function escapes special html characters in names\n\n function escapeHTML(text) {\n return text.replace(/\\&/g, '&amp;').replace(/\\</g, '&lt;').replace(/\\>/g, '&gt;');\n }\n\n // Convert file sizes from bytes to human readable units\n function bytesToSize(bytes) {\n var sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];\n if (bytes == 0)\n return '0 Bytes';\n var i = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));\n return Math.round(bytes / Math.pow(1024, i), 2) + ' ' + sizes[i];\n }\n\n });\n}", "function Search() {\r\n\tGlobal.dom.forEach(function(item) {\r\n\t\titem.className = item.className.replace(\"search-result\", \"\");\r\n\t});\r\n\tvar keyword_value = Global.keyword.value;\r\n\tif (keyword_value == \"\") return;\r\n\tGlobal.dom.forEach(function(item, index) {\r\n\t\tvar dom_content = item.innerText;\r\n\t\tconsole.log(dom_content);\r\n\t\tif (dom_content.indexOf(keyword_value) != -1) {\r\n\t\t\titem.className += \" search-result\";\r\n\t\t\tconsole.log(\"in\");\r\n\t\t}\r\n\t});\r\n}", "function traverse(bookmarkItems) {\n console.log(\"START\",bookmarkItems);\n for (node of bookmarkItems) {\n console.log(\"current node: \", node);\n if (node.title == \"saved pages\") {\n console.log(\"existing folder node: \", node);\n return (node);\n }\n else if (node.children) {\n\n //wraping result in a promise\n var recursivePromiseBranch = Promise.resolve().then(\n function () {\n console.log(\"traversing to next child\")\n return (traverse(node.children));\n }\n );\n return (recursivePromiseBranch);\n }\n }\n }", "find(search, folderId, sort, page, pageSize) {\n const params = new Array();\n if (search != null) {\n params.push(`search=${search}`);\n }\n if (folderId != null) {\n params.push(`folderId=${folderId}`);\n }\n if (sort != null) {\n params.push(`sort=${sort}`);\n }\n if (page != null) {\n params.push(`page=${page}`);\n }\n if (pageSize != null) {\n params.push(`pageSize=${pageSize}`);\n }\n return this.rest.get(`${this.baseUrl}`, ...params);\n }", "find(search, folderId, sort, page, pageSize) {\n const params = new Array();\n if (search != null) {\n params.push(`search=${search}`);\n }\n if (folderId != null) {\n params.push(`folderId=${folderId}`);\n }\n if (sort != null) {\n params.push(`sort=${sort}`);\n }\n if (page != null) {\n params.push(`page=${page}`);\n }\n if (pageSize != null) {\n params.push(`pageSize=${pageSize}`);\n }\n return this.rest.get(`${this.baseUrl}`, ...params);\n }", "function searchPages() {\n var searchUrl = baseURL + 'search';\n var searchArguments = {\n 'q' : document.getElementById('idSearchKeyword').value,\n 'type' : 'page',\n 'access_token' : access_token\n };\n \n http(searchUrl).get(searchArguments)\n .then(onSearchPageResult)\n .catch(logError);\n \n return false;\n}", "function name_select_folder(){\n\n\tif(setup_ajax()!=false){\n\n\t\tsearch_string = document.getElementById('searcharea').value;\n\n\t\tif(search_string==\"\"){\n\t\t\tdocument.getElementById('area2').innerHTML=\"<p>\" + NAMES_APPEAR + \"</p>\";\n\t\t}\n\n\t\tif(is_ok_user(search_string)){\n\t\t\t$.ajax({\n\t\t\t\ttype: \"POST\",\n\t\t\t\turl: \"website_code/php/folderproperties/name_select_folder.php\",\n\t\t\t\tdata: {\n\t\t\t\t\tsearch_string : search_string,\n\t\t\t\t\tfolder_id: window.name\n\t\t\t\t},\n\t\t\t})\n\t\t\t.done(function(response){\n\t\t\t\t$('#area2').html(response);\n\t\t\t});\n\t\t}else{\n\t\t\t$('#area2').html(\"<p>\" + SEARCH_FAIL + \"</p>\");\n\t\t}\n\n\t}\n\n}", "function searchByAlleleKeys() {\t\t\t\t\n\t\t\tconsole.log(\"searchByAlleleKeys: \" + document.location.search);\n\t\t\n\t\t\tpageScope.loadingStart();\n\t\t\t\n\t\t\tvar searchKeys = document.location.search.split(\"?searchKeys=\");\n\t\t\tvar params = {};\n\t\t\tparams.alleleKey = searchKeys[1];\n\n\t\t\tAlleleFearSearchAPI.search(params, function(data) {\n\t\t\t\tvm.results = data;\n\t\t\t\tvm.selectedIndex = 0;\n\t\t\t\tif (vm.results.length > 0) {\n\t\t\t\t\tloadObject();\n\t\t\t\t}\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t}, function(err) {\n\t\t\t\tpageScope.handleError(vm, \"API ERROR: MPAnnotSearchByKeysAPI.search\");\n\t\t\t\tpageScope.loadingEnd();\n\t\t\t\tsetFocus();\n\t\t\t});\n\t\t}", "function append_search_result_to_list(files) {\n var cur = window.current_drive_order || 0;\n var $list = $('#list');\n // Is it the last page of data?\n var is_lastpage_loaded = null === $list.data('nextPageToken');\n // var is_firstpage = '0' == $list.data('curPageIndex');\n\n html = \"\";\n\n for (i in files) {\n var item = files[i];\n var p = '/' + cur + ':/' + item.name + '/';\n if (item['size'] == undefined) {\n item['size'] = \"\";\n }\n\n item['modifiedTime'] = utc2beijing(item['modifiedTime']);\n item['size'] = formatFileSize(item['size']);\n if (item['mimeType'] == 'application/vnd.google-apps.folder') {\n html += `<a onclick=\"onSearchResultItemClick(this)\" id=\"${item['id']}\" class=\"list-group-item btn-outline-secondary\"><svg width=\"1.5em\" height=\"1.5em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><linearGradient id=\"WQEfvoQAcpQgQgyjQQ4Hqa\" x1=\"24\" x2=\"24\" y1=\"6.708\" y2=\"14.977\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#eba600\"></stop><stop offset=\"1\" stop-color=\"#c28200\"></stop></linearGradient><path fill=\"url(#WQEfvoQAcpQgQgyjQQ4Hqa)\" d=\"M24.414,10.414l-2.536-2.536C21.316,7.316,20.553,7,19.757,7L5,7C3.895,7,3,7.895,3,9l0,30\tc0,1.105,0.895,2,2,2l38,0c1.105,0,2-0.895,2-2V13c0-1.105-0.895-2-2-2l-17.172,0C25.298,11,24.789,10.789,24.414,10.414z\"></path><linearGradient id=\"WQEfvoQAcpQgQgyjQQ4Hqb\" x1=\"24\" x2=\"24\" y1=\"10.854\" y2=\"40.983\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#ffd869\"></stop><stop offset=\"1\" stop-color=\"#fec52b\"></stop></linearGradient><path fill=\"url(#WQEfvoQAcpQgQgyjQQ4Hqb)\" d=\"M21.586,14.414l3.268-3.268C24.947,11.053,25.074,11,25.207,11H43c1.105,0,2,0.895,2,2v26\tc0,1.105-0.895,2-2,2H5c-1.105,0-2-0.895-2-2V15.5C3,15.224,3.224,15,3.5,15h16.672C20.702,15,21.211,14.789,21.586,14.414z\"></path></svg> ${item.name}<span class=\"badge\"> ${item['size']}</span><span class=\"badge\">${item['modifiedTime']}</span></a>`;\n } else {\n var p = '/' + cur + ':/' + item.name;\n var c = \"file\";\n var ext = item.name.split('.').pop().toLowerCase();\n if (\"|html|php|css|go|java|js|json|txt|sh|md|mp4|webm|avi|bmp|jpg|jpeg|png|gif|m4a|mp3|flac|wav|ogg|mpg|mpeg|mkv|rm|rmvb|mov|wmv|asf|ts|flv|\".indexOf(`|${ext}|`) >= 0) {\n p += \"?a=view\";\n c += \" view\";\n }\n html += `<a onclick=\"onSearchResultItemClick(this)\" id=\"${item['id']}\" gd-type=\"${item.mimeType}\" class=\"list-group-item btn-outline-secondary\"><svg width=\"1.5em\" height=\"1.5em\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 48 48\"><path fill=\"#50e6ff\" d=\"M39,16v25c0,1.105-0.895,2-2,2H11c-1.105,0-2-0.895-2-2V7c0-1.105,0.895-2,2-2h17L39,16z\"></path><linearGradient id=\"F8F33TU9HxDNWNbQYRyY3a\" x1=\"28.529\" x2=\"33.6\" y1=\"15.472\" y2=\"10.4\" gradientUnits=\"userSpaceOnUse\"><stop offset=\"0\" stop-color=\"#3079d6\"></stop><stop offset=\"1\" stop-color=\"#297cd2\"></stop></linearGradient><path fill=\"url(#F8F33TU9HxDNWNbQYRyY3a)\" d=\"M28,5v9c0,1.105,0.895,2,2,2h9L28,5z\"></path></svg> ${item.name}<span class=\"badge\"> ${item['size']}</span><span class=\"badge\">${item['modifiedTime']}</span></a>`;\n }\n }\n\n // When it is page 1, remove the horizontal loading bar\n $list.html(($list.data('curPageIndex') == '0' ? '' : $list.html()) + html);\n // When it is the last page, count and display the total number of items\n if (is_lastpage_loaded) {\n $('#count').removeClass('mdui-hidden').find('.number').text($list.find('li.mdui-list-item').length);\n }\n}", "function ssearch_do_search() {\n\tvar search_string = d$(\"string_to_search\").value;\n\tif ( !search_string.length )\n\t\treturn;\n\twoas.do_search(search_string);\n}", "function runSearch(e) {\n if (e.target.value === \"\") {\n // On empty string, remove all search results\n // Otherwise this may show all results as everything is a \"match\"\n applySearchResults([]);\n } else {\n const tokens = e.target.value.split(\" \");\n const moddedTokens = tokens.map(function (token) {\n // \"*\" + token + \"*\"\n return token;\n })\n const searchTerm = moddedTokens.join(\" \");\n const searchResults = idx.search(searchTerm);\n const mapResults = searchResults.map(function (result) {\n const resultUrl = docMap.get(result.ref);\n return { name: result.ref, url: resultUrl };\n })\n\n applySearchResults(mapResults);\n }\n\n}", "function fetchBookmarks() {\n\t// Get bookmarks from localStorage (code duplicated from the else pathway in the saveBookmark function)\n\tconst bookmarks = JSON.parse(localStorage.getItem(\"bookmarks\"));\n\n\t// Get output id\n\tconst bookmarkResults = document.getElementById(\"bookmarkResults\");\n\n\t// Build the result outputs\n\tbookmarkResults.innerHTML = \"<li></li>\";\n\n\t//--- Now we're going to loop through all of the bookmarks in localStorage and output them into the unordered li as list items\n\t///--- The for() loop iterates over each bookmark in the array of bookmarks as stored in local storage\n\tfor (var i = 0; i < bookmarks.length; i++) {\n\t\t//--- This creates a variable storing the name and URL for each bookmark\n\t\tconst name = bookmarks[i].name;\n\t\tconst url = bookmarks[i].url;\n\n\t\tbookmarkResults.innerHTML +=\n\t\t\t\"<li>\" +\n\t\t\tname +\n\t\t\t' <a class=\"savedLink\" target=\"_blank\" href=\"' +\n\t\t\turl +\n\t\t\t'\">' +\n\t\t\turl +\n\t\t\t\"</a>\" +\n\t\t\t' <button class=\"deleteSavedBookmark\" onclick=\"deleteBookmark(\\'' +\n\t\t\turl +\n\t\t\t\"')\\\">Remove</button> \";\n\t\t(\"</li>\");\n\t}\n}", "function browse(callback){\n\tthe_session.browse(\"RootFolder\", function(err,browse_result){\n\t\tif(!err) {\n\t\t\tbrowse_result[0].references.forEach(function(item) {\n\t\t\t\t\tconsole.log(\"my browseName: \"+item.browseName.name.toString()+\", node ID: \"+ item.nodeId.value.toString()+\", namespace: \"+ item.browseName.namespaceIndex.toString()); \n\t\t\t\t\t// NodeCrawler Versuch\n\t\t\t\t\tif(item.browseName.name.toString() == \"MeineWohnung\"){\n\t\t\t\t\t\tcrawl(item.nodeId);\t\t\n\t\t\t\t\t}\n\t\t\t}); // -- // -- forEach\n\t\t} else {\n\t\t\tconsole.log(\"Error: \", err);\n\t\t}\n\t\tcallback(err);\n\t\t});\n}", "set bookmarks(value) { this._bookmarks = value; }", "function appendResult (BN) {\n//trace(\"Displaying <<\"+BN.id+\">><<\"+BN.title+\">><<\"+BN.type+\">><<\"+BN.url+\">>\");\n let type = BN.type;\n if (((options.searchFilter == \"fldr\") && (type == \"bookmark\"))\n\t || ((options.searchFilter == \"bkmk\") && (type == \"folder\"))\n\t ) { // Filter out the result, but continue with next ones\n\treturn;\n }\n\n // Append new bookmark row inside the search results table\n let row = resultsTable.insertRow();\n row.draggable = true; // Adding this, but with no handler, avoids that the anchor inside\n \t\t\t\t\t\t// can be dragged .. not sure of exactly why, but this is what I observe !\n let BN_id = row.dataset.id = BN.id; // Keep unique id of bookmark in the data-id attribute\n row.dataset.rslt = \"true\"; // Mark that this is a result row for easy identification\n curResultRowList[BN_id] = row;\n // Set cut status of the row (dim it), if corresponding to a cut row\n if ((isClipboardOpCut == true) && (bkmkClipboardIds[BN_id] != undefined)) {\n\trow.classList.add(\"cut\");\n }\n\n // Add bookmark items in row\n let cell = row.insertCell();\n cell.classList.add(\"brow\");\n cell.draggable = false;\n cell.tabIndex = 0;\n\n // Append proper contents to the cell:\n // - a <div> of class \"rbkmkitem_f\" or \"rbkmkitem_b\",\n // for respectively folder or bookmark, containing:\n // - a <div> (class \"rtwistiexx\") if a folder\n // - an <div>, or <img> if special folder, (class \"favicon\")\n // - and a <span> with text (class \"favtext\")\n // - for folder results, additionally, a <span> with path to the folder (class \"rfavpath\") \n if (type == \"folder\") {\t\t\t\t// Folder\n\t// Mark that row as folder\n\trow.dataset.type = \"folder\";\n\n\t// Create elements\n\tlet div2;\n\tlet span;\n\tlet pathspan;\n\tif (BN.fetchedUri) { // Special bookmark folder with special favicon\n\t div2 = RSFolderTempl.cloneNode(true);\n\t let img = div2.firstElementChild.nextElementSibling;\n\t img.src = BN.faviconUri;\n\t span = img.nextElementSibling;\n\t}\n\telse {\n\t div2 = RFolderTempl.cloneNode(true);\n\t span = div2.firstElementChild.nextElementSibling.nextElementSibling;\n\t}\n\tif (BN.inBSP2Trash) { // Set to italics\n\t span.style.fontStyle = \"italic\";\n\t}\n\tlet title = BN.title;\n\tspan.textContent = title;\n//\tspan.draggable = false;\n\n\tpathspan = span.nextElementSibling;\n\tlet p = pathspan.textContent = BN_path(BN.parentId);\n//\tpathspan.draggable = false;\n\n\tif (options.showPath) {\n\t div2.title = p;\n\t}\n\telse {\n\t div2.title = title;\n\t}\n\tcell.appendChild(div2);\n }\n else {\t\t\t\t\t\t\t\t// \"bookmark\"\n\t// Mark that row as bookmark\n\trow.dataset.type = \"bookmark\";\n\n\t// Create elements\n\tlet url = BN.url;\n\tif (url == undefined) {\n\t url = \"<undefined!>\";\n\t}\n\tlet title = BN.title;\n\tlet anchor;\n\tlet span;\n\t// Retrieve current uri or set to nofavicon.png by default\n\tlet uri = BN.faviconUri;\n\tif ((uri == undefined) || (uri == \"/icons/nofavicon.png\")) { // Clone with nofavicon image background\n\t anchor = RNFBookmarkTempl.cloneNode(true);\n\t span = anchor.firstElementChild.nextElementSibling;\n\t}\n\telse { // Clone normal one, and fill image\n\t anchor = RBookmarkTempl.cloneNode(true);\n\t let img = anchor.firstElementChild;\n\t img.src = uri;\n\t span = img.nextElementSibling;\n\t}\n\tif (BN.inBSP2Trash) { // Set to italics\n\t span.style.fontStyle = \"italic\";\n\t}\n\tif (!url.startsWith(\"place:\")) {\n\t anchor.href = url;\n\t}\n\tif (options.showPath) {\n\t anchor.title = BN_path(BN.parentId);\n\t if (title == \"\") {\n\t\ttitle = suggestDisplayTitle(url);\n\t }\n\t span.textContent = title;\n\t}\n\telse {\n\t if (title == \"\") {\n\t\tanchor.title = url;\n\t\tspan.textContent = suggestDisplayTitle(url);\n\t }\n\t else {\n\t\tanchor.title = title+\"\\n\"+url;\n\t\tspan.textContent = title;\n\t }\n\t}\n//\tanchor.draggable = false;\n\tanchor.style.marginLeft = \"16px\";\n\n\tcell.appendChild(anchor);\n }\n}", "function doSearch(query, searchPageDoc) {\n var url = \"http://movietrailers.apple.com/trailers/home/scripts/quickfind.php?q=\" + query.replace(\" \", \"+\");\n var req = new XMLHttpRequest();\n \n req.onreadystatechange = function() {\n if (req.readyState == 4) {\n resultsJSON = JSON.parse(req.responseText);\n showResults(resultsJSON, searchPageDoc);\n }\n }\n req.open(\"GET\", url, true);\n req.send();\n}", "function addBookmark() {\n let bmsvc = Cc[\"@mozilla.org/browser/nav-bookmarks-service;1\"]\n .getService(Ci.nsINavBookmarksService);\n let ios = Cc[\"@mozilla.org/network/io-service;1\"]\n .getService(Ci.nsIIOService);\n let bid = bmsvc.insertBookmark(bmsvc.unfiledBookmarksFolder, \n ios.newURI(self.data.url(\"dashboard.html?s=%s\"), null, null),\n bmsvc.DEFAULT_INDEX,\n \"RecallMonkey Search\"\n );\n bmsvc.setKeywordForBookmark(bid, \"r\");\n ss.storage.bookmarkId = bid;\n}", "function loadBookmark(bookmark) {\n\t//stop();\n\tlocalStorage.setItem(\"bookmark\", $(bookmark).text());\n\twindow.location.href = $(bookmark).attr(\"href\");\n}", "selectBookmark(name) {\n this.navigateBookmark(name);\n }", "function highlightWord(){\n var keyword = document.getElementById(\"keyword\").value;\n var display = document.getElementById('fileContent');\n var newContent = \"\";\n \n //find all the occurences\n let spans = document.querySelectorAll(\"mark\");\n\n for (var i=0; i< spans.length; i++){\n spans[i].outerHTML = spans[i].innerHTML;\n }\n\n var re = new RegExp(keyword, \"gi\");\n var replaceText = \"<mark od ='markMe'>$&</mark>\";\n var currentBook = display.innerHTML;\n \n newContent = currentBook.replace(re, replaceText);\n\n display.innerHTML = newContent;\n var count = document.querySelectorAll(\"mark\");\n document.getElementById(\"searchstat\").innerHTML = \"found \" + count.length + \" occurences\";\n\n if (count > 0){\n var element = document.getElementById(\"markMe\");\n element.scrollIntoView;\n }\n}", "function search( root, search ) {\n search = search.toLowerCase();\n app.set('possibilities', []);\n if (search) {\n return search_recurse(root, search, []);\n }\n}", "function SearchFolderDisplayWidget(aMessageDisplay) {\n FolderDisplayWidget.call(this, /* no tab info */ null, aMessageDisplay);\n}", "function TestSearch(\n aFolder,\n aValue,\n aAttrib,\n aOp,\n aHitCount,\n onDone,\n aCustomId,\n aArbitraryHeader,\n aHdrProperty\n) {\n var searchListener = {\n onSearchHit(dbHdr, folder) {\n hitCount++;\n },\n onSearchDone(status) {\n print(\"Finished search does \" + aHitCount + \" equal \" + hitCount + \"?\");\n searchSession = null;\n Assert.equal(aHitCount, hitCount);\n if (onDone) {\n onDone();\n }\n },\n onNewSearch() {\n hitCount = 0;\n },\n };\n\n // define and initiate the search session\n\n var hitCount;\n var searchSession = Cc[\n \"@mozilla.org/messenger/searchSession;1\"\n ].createInstance(Ci.nsIMsgSearchSession);\n searchSession.addScopeTerm(Ci.nsMsgSearchScope.offlineMail, aFolder);\n var searchTerm = searchSession.createTerm();\n searchTerm.attrib = aAttrib;\n\n var value = searchTerm.value;\n // This is tricky - value.attrib must be set before actual values\n value.attrib = aAttrib;\n if (aAttrib == Ci.nsMsgSearchAttrib.JunkPercent) {\n value.junkPercent = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.Priority) {\n value.priority = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.Date) {\n value.date = aValue;\n } else if (\n aAttrib == Ci.nsMsgSearchAttrib.MsgStatus ||\n aAttrib == Ci.nsMsgSearchAttrib.FolderFlag ||\n aAttrib == Ci.nsMsgSearchAttrib.Uint32HdrProperty\n ) {\n value.status = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.MessageKey) {\n value.msgKey = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.Size) {\n value.size = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.AgeInDays) {\n value.age = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.Label) {\n value.label = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.JunkStatus) {\n value.junkStatus = aValue;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.HasAttachmentStatus) {\n value.status = Ci.nsMsgMessageFlags.Attachment;\n } else {\n value.str = aValue;\n }\n searchTerm.value = value;\n searchTerm.op = aOp;\n searchTerm.booleanAnd = false;\n if (aAttrib == Ci.nsMsgSearchAttrib.Custom) {\n searchTerm.customId = aCustomId;\n } else if (aAttrib == Ci.nsMsgSearchAttrib.OtherHeader) {\n searchTerm.arbitraryHeader = aArbitraryHeader;\n } else if (\n aAttrib == Ci.nsMsgSearchAttrib.HdrProperty ||\n aAttrib == Ci.nsMsgSearchAttrib.Uint32HdrProperty\n ) {\n searchTerm.hdrProperty = aHdrProperty;\n }\n\n searchSession.appendTerm(searchTerm);\n searchSession.registerListener(searchListener);\n searchSession.search(null);\n}", "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "onSearching(aFolderDisplay, aIsSearching) {\n // we only care if we just started searching and we are active\n if (!aIsSearching || !aFolderDisplay.active) {\n return;\n }\n\n // - Update match status.\n this.reflectFiltererResults(this.activeFilterer, aFolderDisplay);\n }", "function runSearch() {\n ps.search()\n .then(function(rsp) {\n if(rsp.stat === \"fail\") {\n ps.showError(rsp);\n }\n else if (rsp.stat === \"ok\") {\n ps.paging = rsp.photos;\n ps.parseSearchResults();\n }\n });\n }", "function find() {}", "function searchBook() {\n setSearchTerm(searchValue.current.value)\n }", "function getBookmarks(rootList) {\r\n\t// ルートオブジェクトの取得\r\n\tlet root_defaultBookmark = rootList[0];\r\n\t// ルートオブジェクトから最上位のデフォルトのブックマークフォルダの配列の取得\r\n\tlet defaultBookmarkList = root_defaultBookmark['children'];\r\n\t// 「ブックマークバー」の取得 0:ブックマークバー 1:その他ブックマーク 2:モバイルブックマーク\r\n\tlet bookmarkBarNode = defaultBookmarkList[0];\r\n\treturn bookmarkBarNode;\r\n}", "function getSearchQuery() {\n\t// Parse search pattern from URL\n\tvar query = location.search.substr(1).replace(/%20/g, ' ');\n\n\tif (query) {\n\t\tsearch(query); // Check for matches\n\n\t\tif (focusFirstOccurence())\n\t\t\tdocument.getElementById('searchBar').value = query;\n\t\telse\n\t\t\tresetTabIndex();\n\t}\n}", "function search()\r\n {\r\n var to_find = frm.txt.value\r\n var links = this.document.all.tags(\"A\")\r\n var got=0\r\n //Go thru evey image in the file.\r\n for (i=0; i<links.length; i++)\r\n {\r\n var name = getName(links(i).toString())\r\n var loc = links(i).toString().replace(/%20/g,\" \")\r\n var position=name.toUpperCase().search(to_find.toUpperCase())\r\n //If the text is found\r\n if(position>=0)\r\n {\r\n got++\r\n if(frm.open.checked) location.href=loc\r\n else if(confirm(\"Got \"+to_find+\" at \"+loc+\". Open the found file?\")) location.href=loc \r\n }\r\n }\r\n //Display message if no hits are found.\r\n if(!got)\r\n {\r\n alert(to_find+\" can't be found.\")\r\n }\r\n\r\n return false\r\n }", "function searchTerm(){\n \n }", "function searchByPage()\n{\n\tvar type = $(\"#pagetype\").val() ;\n\tif(type=='' || type==null)\n\t{\n\t\ttype = undefined;\n\t}\n\t\n\n\t\n\tvar searchArt = $(\"#SearchPage\").val();\n\tif(searchArt=='' || searchArt==null)\n\t{\n\t\tsearchArt = undefined;\n\t}\n\tpageList(searchArt,0,0,'asc',type);\n}", "function pwdBookmark(aItemId) {\n var arr = [];\n for (var id = aItemId; id; id = BookmarksService.getFolderIdForItem(id)) {\n arr.push(id);\n }\n return arr;\n }", "function doSearch() {\n\n //This full path is used for redirect users to seek search pages\n var NavToPath = \"DateRange=\";\n if (selectedValue(\"DateRange\"))\n NavToPath = NavToPath + selectedValue(\"DateRange\");\n else\n NavToPath = NavToPath + '31';\n\n if (selectedValue(\"catparentlocation\")) {\n var location = selectedValue(\"catparentlocation\").split('|');\n for (var i = 0; i < location.length; i++) {\n switch (location[i + 1]) {\n case '1': NavToPath = NavToPath + \"&catlocation=\" + location[i];\n break;\n case '13': NavToPath = NavToPath + \"&catstate=\" + location[i];\n break;\n case '12': NavToPath = NavToPath + \"&catnation=\" + location[i];\n break;\n }\n }\n }\n if (selectedValue(\"catchildlocation\") && selectedValue(\"catchildlocation\") != 0 && selectedValue(\"catchildlocation\") != 'Any Area') {\n if (selectedValue(\"catchildlocation\").indexOf(\"|\") > -1) {\n var areaSplit = selectedValue(\"catchildlocation\").split('|');\n for (var k = 0; k < areaSplit.length; k++) {\n switch (areaSplit[k + 1]) {\n case '1': NavToPath = NavToPath + \"&catlocation=\" + areaSplit[k];\n break;\n case '11': NavToPath = NavToPath + \"&catarea=\" + areaSplit[k];\n break;\n }\n }\n }\n else\n NavToPath = NavToPath + \"&catarea=\" + selectedValue(\"catchildlocation\");\n }\n if (selectedValue(\"catindustry\") && selectedValue(\"catindustry\") != 0)\n NavToPath = NavToPath + \"&catindustry=\" + selectedValue(\"catindustry\");\n if (selectedValue(\"catoccupation\") && selectedValue(\"catoccupation\") != 0 && selectedValue(\"catoccupation\") != 'Any Sub-Classification')\n NavToPath = NavToPath + \"&catoccupation=\" + selectedValue(\"catoccupation\");\n if (selectedValue(\"Keywords\"))\n NavToPath = NavToPath + \"&Keywords=\" + selectedValue(\"Keywords\");\n if (selectedValue(\"catworktype\") && selectedValue(\"catworktype\") != 0)\n NavToPath = NavToPath + \"&catworktype=\" + selectedValue(\"catworktype\");\n var navToLocation = mainSeekSiteAddress + \"/jobsearch/index.ascx?\" + NavToPath;\n\n //Adds advertiser id if it's selected from a drop down\n if (selectedValue(\"AdvertiserID\") && selectedValue(\"AdvertiserID\") != 0)\n navToLocation = navToLocation + \"&AdvertiserID=\" + selectedValue(\"AdvertiserID\");\n else\n navToLocation = navToLocation + '&' + Settings[\"Advertiser\"];\n\n if (typeof target == 'object') {\n if (document.getElementById(\"JSresults\")) {\n document.getElementById(\"JSresults\").src = navToLocation;\n }\n else {\n target.location.href = navToLocation;\n }\n }\n else {\n if (target == 'blank')\n window.open(navToLocation, 'Job_Search_Results');\n else if (target == '/alliances/gough-recruitment/index.htm')\n window.open(mainSeekSiteAddress + target + '?' + NavToPath, 'Job_Search_Results');\n else if (target == 'http://www.scotfordfennessy.com.au/search_jobs.php')\n window.location.href = target + '?' + NavToPath;\n }\n}", "function search(e) {\n let searchResult = []\n for (i = 0; i < list.length; i++) {\n if (list[i].firstElementChild.firstElementChild.nextElementSibling.innerText.toUpperCase().split(\" \").join(\"\").indexOf(search_box.value.toUpperCase()) > -1) {\n searchResult.push(list[i])\n }\n }\n\n if (searchResult.length < 1) {\n\n showPages(searchResult, 0)\n if (containerPage[0].lastElementChild.tagName == \"DIV\") {\n containerPage[0].lastElementChild.remove()\n }\n\n let notFound = document.createElement(\"h2\")\n notFound.innerText = \"Sorry student not found\"\n if (containerPage[0].lastElementChild.tagName != \"H2\") {\n containerPage[0].appendChild(notFound)\n }\n } else {\n createPaginationLinks(searchResult)\n }\n\n}", "function searchText() {\r\n var search_term = $(\"#txtSearchText\").val();\r\n if( search_term != '' && search_term != null )\r\n getDocViewer('documentViewer').searchText( search_term );\r\n}", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function performSearch(button)\n{\n $(\"#results\").empty();\n settings = getSearchSettings();\n resultsList = [];\n for ([key, value] of filesToDisplays)\n {\n if (doesFileMatch(key, settings))\n {\n resultsList.push(key);\n }\n }\n compareFunc = getCompareFunc();\n filterFunc = getFilterFunc();\n if (compareFunc !== null) {\n resultsList = resultsList.filter(filterFunc);\n resultsList.sort(compareFunc);\n }\n fragment = document.createDocumentFragment();\n for (result of resultsList)\n {\n fragment.appendChild(filesToDisplays.get(result));\n }\n document.getElementById(\"results\").appendChild(fragment);\n}", "function loadBookmarks(data) {\n for (var b in data.results) {\n var bookmark = data.results[b];\n var bookmarkTitle = bookmark.title;\n var bookmarkUrl = bookmark.url;\n var bookmarkId = bookmark.objectId;\n\n var $bookmark = createBookmark(bookmarkTitle, bookmarkUrl, bookmarkId);\n\n $('#bookmarks-holder').append($bookmark);\n }\n }", "function searchBook(title) {\n const bookData = getListOfBook();\n const searchResult = [];\n for (let data of bookData) {\n if (data.title.includes(title)) {\n searchResult.unshift(data);\n }\n }\n renderBookList(true, searchResult);\n}", "read({ bookmark }, res) {\n res.json(bookmark);\n }", "search(val) {\n let found = this.root.search(val);\n return found;\n }", "search(e) {\n //NOTE You dont need to change this method\n e.preventDefault();\n _showLoading()\n try {\n SongService.getMusicByQuery(e.target.query.value);\n } catch (error) {\n console.error(error);\n }\n }", "searchByRef(queryStr) {\n\n return this.refSearcher.search(queryStr)\n .then((results) => {\n if (results.length > 0) {\n this.results.push(...results);\n this.isLoadingResults = false;\n this.onUpdateSearchStatus();\n return results;\n } else {\n // If the ref search turns up no results, perform a content search\n this.isLoadingResults = true;\n this.onUpdateSearchStatus();\n return this.searchByContent(queryStr);\n }\n })\n .catch((error) => {\n this.error = error;\n this.onUpdateSearchStatus();\n });\n\n }", "function searchData(data, searchTerms) {\n\n data.forEach(function (d) {\n if (d.type === 'folder') {\n\n searchData(d.items, searchTerms);\n if (d.name.toLowerCase().match(searchTerms)) {\n folders.push(d);\n }\n }\n else if (d.type === 'file') {\n if (d.name.toLowerCase().match(searchTerms)) {\n files.push(d);\n }\n }\n });\n return {folders: folders, files: files};\n }", "function addBookmark(title, url) {\n\tvar hash = buildBookmarkHash(title, url);\n\n\tif (hash !== undefined) {\n\t\thash.parentId = $('#folder_list :selected').val();\n\n\t\tchrome.bookmarks.create(hash, function(result) {\n\t\t\taddSpeedDialEntry(result);\n\t\t});\n\t} else {\n\t\talert('A bookmark requires a title and a URL');\n\t}\n}", "searchMovies(){\r\n document.documentElement.scrollTop = 0\r\n this.page = 1\r\n this.films = []\r\n this.searchedTitle = this.searchTitle\r\n 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 }", "function search(searchTerm, limit) {\n searchTerm = searchTerm.trim();\n requestStarted = new Date();\n\n $location.path(\"/search/\" + $scope.searchText);\n\n if ($scope.result && $scope.result.searchText === searchTerm)\n return;\n\n wiki.searchFor(searchTerm, limit, function (data) {\n $scope.result = {\n searchText: searchTerm,\n list: data,\n time: new Date() - requestStarted\n };\n\n $scope.$apply();\n });\n }", "function search(searchContent) {\r\n smoothTopScroll();\r\n if (searchContent.length==0) {\r\n callCategories();\r\n return;\r\n }\r\n document.getElementById(\"pagetitle\").innerHTML = \"Search\";\r\n var results = {};\r\n Object.keys(itemvarsetidenum).forEach(function(num) {\r\n Object.keys(itemvarsetidenum[num]).forEach(function(key) {\r\n if (key.toLowerCase().includes(searchContent.toLowerCase())) {\r\n results[key]=itemvarsetidenum[num][key];\r\n }\r\n });\r\n });\r\n\r\n hideAllBoxes();\r\n activeSet = 1;\r\n generateBox(\"Back\", null, 0, 1, \"<div class='subtext'>Click to return to categories</div>\");\r\n Object.keys(results).forEach(function(key) {\r\n if (Object.keys(results).indexOf(key) + 2 > 20) {return};\r\n generateBox(key, results, 0, Object.keys(results).indexOf(key) + 2,\r\n \"<div class='subtext shortcut'>\" + results[key] + \"</div>\")\r\n });\r\n}", "function openAllFolderMarks(id){\n\n\t\t\tchrome.bookmarks.getChildren(String(id), function(marks){\n\t\t\t\t// console.log(marks);\n\t\t\t\tmarks.forEach(function(mark){\n\t\t\t\t\tconsole.log(mark.url);\n\t\t\t\t\tchrome.tabs.create({url: mark.url});\n\t\t\t\t});\n\t\t\t});\n\t\t}", "searchByContent(queryStr) {\n\n // Perform content search if no reference results turned up\n return this.contentSearcher.search(queryStr)\n .then((results) => {\n // The user may type faster than page fetches can finish, so ensure that\n // only the results from the last fetch (i.e. for the latest query\n // string) are displayed\n if (queryStr === this.queryStr) {\n this.results.push(...results);\n this.isLoadingResults = false;\n this.onUpdateSearchStatus();\n return results;\n }\n })\n .catch((error) => {\n this.error = error;\n this.onUpdateSearchStatus();\n });\n\n }", "function dumpBookmarks(query) {\n var bookmarkTreeNodes = chrome.bookmarks.getTree(function (bookmarkTreeNodes) {\n $('#bookmarks').append(dumpTreeNodes(bookmarkTreeNodes, query));\n });\n }", "function searchData(data, searchTerms) {\n\n\t\t\tObject.keys(data).forEach( function(d) {\n\t\t\t\tif(data[d].type === 'folder') {\n\n\t\t\t\t\tsearchData(data[d].items,searchTerms);\n\n\t\t\t\t\tif(data[d].name.toLowerCase().match(searchTerms)) {\n\t\t\t\t\t\tfolders.push(data[d]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if(data[d].type === 'file') {\n\t\t\t\t\tif(data[d].name.toLowerCase().match(searchTerms)) {\n\t\t\t\t\t\tfiles.push(data[d]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {folders: folders, files: files};\n\t\t}", "function PathSearchResultCollector() {\n\n}", "function searchAll(q, dspan, from, subject, where) {\n keywords = q\n current_retention = dspan\n current_query = q\n global_deep = true\n var wherel = \"*\"\n var whered = \"*\"\n if (where && where == 'xlist') {\n var a = xlist.split(/@/)\n wherel = a[0]\n whered = a[1]\n }\n var url = \"/api/stats.lua?list=\"+wherel+\"&domain=\"+whered+\"&q=\" + encodeURIComponent(q) + \"&d=\" + encodeURIComponent(dspan)\n if (from) {\n url += \"&header_from=\" + \"\\\"\"+ encodeURIComponent(from) + \"\\\"\"\n current_query += \" FROM:\" + \"\\\"\"+ encodeURIComponent(from) + \"\\\"\"\n }\n if (subject) {\n url += \"&header_subject=\\\"\" + encodeURIComponent(subject) + \"\\\"\"\n current_query += \" SUBJECT:\\\"\" + encodeURIComponent(subject) + \"\\\"\"\n }\n GetAsync(url, {\n deep: true\n }, buildPage)\n var arr = datePickerDouble(dspan)\n var howlong = arr[3]\n if (howlong == null || isNaN(howlong)) {\n howlong = \"custom date range\"\n } else {\n if (howlong >= 365) {\n howlong = parseInt(howlong/365) + \" year\"\n } else if (howlong >= 30) {\n howlong = \"last \" + parseInt(howlong/30) + \" month\" + (howlong>59 ? \"s\" : \"\")\n } else {\n howlong = howlong + \" day\"\n }\n }\n document.getElementById('listtitle').innerHTML = \"Deep Search, \" + howlong + \" view <a class='btn btn-warning' href='javascript:void(0);' onclick='getListInfo(xlist)'>Clear filters</a>\"\n clearCalendarHover()\n return false;\n}", "search(searchString, excludeFromList, callback) {\n // Cancel on going existing request if new search is fired\n this.cancelOnNew && this.cancelExistingRequests();\n\n let dataList = null;\n // If search string is none and data is saved in storage get it from there\n if (this.storageKey && (!this.searchLocal && !searchString)) {\n dataList = ttlLocalStorage.getItem(this.storageKey, this.globalData);\n }\n\n // If data is available then pass the data from here\n if (dataList) {\n filterResultForSearchedString(\n searchString,\n this.searchableFields,\n JSON.parse(dataList),\n excludeFromList,\n callback,\n );\n return;\n }\n this.__searchOnNetwork(searchString, excludeFromList, callback);\n }", "onSearch() {\n try {\n const searchText = this.getSearchHash();\n if (searchText === this.priorSearchText)\n return;\n this.engine.search(searchText);\n this.priorSearchText = searchText;\n }\n catch (ex) {\n this.publish(\"error\", ex.message);\n }\n }", "function loadBookmarks(bm)\n {\n let lb = $(\"#listOfBookmarks\");\n\n\n //debug(bm);\n\n // bm and slider clear\n lb.empty();\n sliderBookMarks.empty();\n\n bm.sort((a, b) => {\n if (+a.pos > +b.pos)\n return 1;\n if (+a.pos < +b.pos)\n return -1;\n\n return 0;\n });\n\n for(let k in bm)\n {\n if (bm.hasOwnProperty(k))\n {\n let tmp = $(`<div data-id=\"${bm[k]._id}\">\n <div class=\"bookmark-pos hide\">${bm[k].pos}</div>\n <div class=\"bookmark-title contenteditable\">${bm[k].title}</div>\n <div class=\"bookmark-text contenteditable\">${bm[k].text}</div>\n <a class=\"icon btn-bookmark-goto\">${bm[k].pos}</a>\n <a class=\"icon btn-bookmark-edit online\">E</a>\n <a class=\"icon btn-bookmark-save online\">S</a>\n <a class=\"icon btn-bookmark-delete online\">D</a>\n </div>`).addClass(\"bookmark\").data(\"pos\", bm[k].pos);\n\n lb.append(tmp);\n\n let el = $(\"<div></div>\")\n .addClass(\"mark-user\")\n .css(\"top\", bm[k].pos / maxPos * sliderHeight)\n .data(\"pos\", bm[k].pos)\n .click(function() {\n thus.jmp($(this).data(\"pos\"));\n\t thus.selectEl($(this).data(\"pos\"), \"jump\");\n });\n\n sliderBookMarks.append(el);\n }\n\n }\n\n thus.__int__bookmark.reset();\n }" ]
[ "0.7174473", "0.7144372", "0.67589307", "0.63361156", "0.60026115", "0.6002369", "0.58503383", "0.5850192", "0.58499193", "0.58217025", "0.58047426", "0.5787057", "0.5689169", "0.5679823", "0.5670408", "0.56509095", "0.56009245", "0.55604416", "0.5556581", "0.55502653", "0.554727", "0.5526294", "0.5526125", "0.552311", "0.54871297", "0.54856753", "0.5481078", "0.5447825", "0.5420467", "0.5412864", "0.5403897", "0.5376364", "0.53452283", "0.531078", "0.5310721", "0.5301589", "0.52853316", "0.52781546", "0.5270685", "0.52703553", "0.52642775", "0.5256156", "0.52211106", "0.5215648", "0.52042866", "0.52042866", "0.5200415", "0.5198746", "0.5168977", "0.51637036", "0.51624924", "0.5162414", "0.51491815", "0.5144193", "0.5133153", "0.5125831", "0.51158917", "0.51140183", "0.5105103", "0.5104731", "0.5099099", "0.5094902", "0.50944424", "0.5074556", "0.5063825", "0.50574625", "0.50563776", "0.50544155", "0.5053321", "0.5046008", "0.50437444", "0.50430244", "0.5042441", "0.5041114", "0.50346166", "0.5031158", "0.5028562", "0.50224376", "0.5014802", "0.5012284", "0.5012082", "0.5009764", "0.50056887", "0.50030357", "0.5001081", "0.4996353", "0.4994846", "0.49919584", "0.49916637", "0.49862164", "0.49857906", "0.4985449", "0.49853343", "0.4984735", "0.49825436", "0.49821955", "0.4977684", "0.49730572", "0.49653992", "0.49578762" ]
0.6147131
4
Save the new id, only if the id isn't set already (which means we've already found the id)
function recursiveSearch(bookmarks, title, url) { bookmarks.forEach(function (bm) { //console.debug(`bookmark: ${bm.title} (${bm.id})`); if (!id && bm.title == title) { console.debug(`Found bookmark by title: ${title} (id: ${bm.id})`); id = bm.id; } else if (!id && url && bm.url && bm.url == url) { console.debug(`Found bookmark by url: ${url} (id: ${bm.id})`); id = bm.id; } if (!id && bm.children) { recursiveSearch(bm.children, title, url); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setID(id = false) {\n if (id) {\n // user input ID\n this.id = id + 1;\n return id;\n } else {\n // system generated ID\n const currentID = this.id;\n this.id++;\n return currentID;\n }\n }", "set id(newId) {\n this._id = newId;\n }", "function setid(v){\n id = v;\n}", "function getId () {\n return ++lastId\n }", "function updateId(inputId){\n id=inputId;\n}", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "function createId() {\n var id = $localStorage.booksId;\n $localStorage.booksId = $localStorage.booksId + 1;\n return id;\n }", "function getId(){\n let newId = ids.next();\n ids.claim(newId)\n return newId\n}", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "function getId() {\n return ++lastId;\n }", "set _id(value) {\n this.__id = value;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "set id(val) {\n if (this._id) {\n throw new Error(`Can't change id!`);\n }\n this._id = val;\n }", "_getAndIncrementId() {\n return this._id++;\n }", "function getId() {\n\t return ++lastId;\n\t }", "function getId() {\n\t return ++lastId;\n\t }", "function getId() {\n\t return ++lastId;\n\t }", "createId () {\n\t\tthis.attributes.id = this.useId || this.collection.createId();\n\t}", "function resetLastId() {\n\t\t lastId = 0;\n\t\t}", "updateId(id) {\n this._id = id;\n }", "function createId() {\n var id = $localStorage.authorId;\n $localStorage.authorId = $localStorage.authorId + 1;\n return id;\n }", "set id(id) {\n idMap.set(this, id);\n }", "set id(val) {\n WBORecord.prototype.__lookupSetter__(\"id\").call(this, val);\n return this.cleartext.id = val;\n }", "function save(data) {\n if (data.id) {\n return update(data.id, data).then(function (result) {\n return data;\n });\n } else {\n return create(data).then(function (result) {\n data.id = result.id;\n return data;\n });\n }\n }", "persistNextVineyardId() {\n this.getWriteStore('data').put(this.next_vineyard_id, 'next_vineyard_id');\n }", "set Id(value)\n {\n this.id = value;\n }", "getId() {\n uniqueId++\n return uniqueId;\n }", "getID() {\n this.id = userID;\n userID++;\n }", "function getNewID(){\n var newid=graph.getModel().createId();\n if(newid==99) newid=graph.getModel().createId();\n return newid;\n }", "function resetId(){\n\n\t\tID = 0;\n\n\t}", "set id (value) {\n this._id = value; // will be set to new value once invoked below with drone.id = 'B456';\n }", "onRecordIdChange({\n record,\n oldValue,\n value\n }) {\n super.onRecordIdChange({\n record,\n oldValue,\n value\n });\n\n if (record.isFieldModified('id')) {\n this.isChangingId = true;\n record.updateAssignmentResourceIds();\n this.isChangingId = false;\n }\n }", "function set(model) {\n var hash = model.toJSON(),\n idAttribute = model.idAttribute;\n\n if (!Y.Lang.isValue(hash[idAttribute])) {\n hash[idAttribute] = generateId();\n }\n\n data[hash[idAttribute]] = hash;\n save();\n\n return hash;\n }", "function save (id) {\n console.log('save - id', id);\n // find record\n image.update({_id: id}, {temporary: 0}, function (err, i) {\n if(err) { console.log (err); }\n console.log(i);\n });\n}", "assignTransactionID() {\r\n this._lastAssignedID += 1; // We start the IDs from 1\r\n return this._lastAssignedID;\r\n }", "saveVariable(variableId) {\n if (!this.savedReferences.includes(variableId)) {\n this.savedReferences.push(variableId);\n }\n }", "getNewId(){\r\n this._id = this._id || this.data && this.data.length || 0;\r\n this._id++;\r\n\r\n return this._id;\r\n }", "newID() {\n\t\tlet lastId = 0;\n\t\tthis.data.forEach(item => lastId = item.id > lastId ? item.id : lastId);\n\t\treturn lastId + 1;\n\t}", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "get id(){\n let id = this.data.id;\n if (id === undefined){\n id = this._id = (this._id || ++idCounter);\n }\n return id;\n }", "setId(id){\n this.id=id;\n }", "function assignId(req, res, next) {\n req.id = uuid.v4();\n next();\n}", "function increase_id_count() {\n id_count++;\n}", "upID(id)\r\n {\r\n try \r\n {\r\n return id.split('-')[0] + '-' + (parseInt(id.split('-')[1]) + 1);\r\n } \r\n catch (error) \r\n {\r\n //Return a custom ID\r\n return this.newCustomID()\r\n }\r\n }", "function nextId() {\r\n return currentId++;\r\n}", "function grabNextId() {\n\n\treturn nextId++;\n\n }", "function checkId(id){\n\n if ((seenID[id]) || (id===\"\")){\n return \"This ID is invalid\"; \n }\n\n seenID[id] = true;\n return true; \n}", "set id(id) {\n this._id = id;\n }", "function idUpdate(){\n dynamID.currID = dynamID.currID + 1;\n return (dynamID.currID - 1);\n}", "function getId(ele){\t// store the id value\r\n id_value = ele.id; \r\n}", "function getUniqueId() {\n _id++;\n return _id;\n}", "set id(id){\n const ID_REGEX = /^[1-9]+[0-9]*/\n if(ID_REGEX.test(id)){\n this._id = id\n return;\n }\n else\n throw \"Invalid employeeId\"\n }", "function updateID(array) {\n if (array.length != 0) {\n for (let i = 0; i < array.length; i++) {\n array[i].id = i;\n }\n }\n}", "getId(old) {\n // return existing old identifier\n const existing = old && this._existing.get(old);\n if (existing) {\n return existing;\n }\n\n // get next identifier\n const identifier = this.prefix + this.counter;\n this.counter++;\n\n // save mapping\n if (old) {\n this._existing.set(old, identifier);\n }\n return identifier;\n }", "SAVE_QUIZ_BY_ID (state, quiz) {\n state.quizById = quiz;\n }", "function incrementId(){\n //increment the counter\n incrementProgress.child('counter').transaction(function(currentValue){\n return (currentValue || 0) + 1\n }, function(err, committed, ss){\n if(err){\n setError(err);\n }\n \n else if(committed){\n //if update succeeds, then create a record\n addRecord(ss.val());\n }\n });\n }", "getId(old) {\n // return existing old identifier\n const existing = old && this._existing.get(old);\n if(existing) {\n return existing;\n }\n\n // get next identifier\n const identifier = this.prefix + this.counter;\n this.counter++;\n\n // save mapping\n if(old) {\n this._existing.set(old, identifier);\n }\n\n return identifier;\n }", "function id() {\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = \"a\" + newId;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "getId(old) {\n // return existing old identifier\n if (old && old in this.existing) {\n return this.existing[old];\n } // get next identifier\n\n\n const identifier = this.prefix + this.counter;\n this.counter += 1; // save mapping\n\n if (old) {\n this.existing[old] = identifier;\n }\n\n return identifier;\n }", "async save() {\n return new Promise((resolve, reject)=>{\n try {\n const id = generateID();\n // save to disk\n return resolve(id);\n } catch (e) {\n reject(e);\n }\n });\n }", "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "function id() {\r\n var newId = ('0000' + (Math.random() * Math.pow(36, 4) << 0).toString(36)).slice(-4);\r\n // append a 'a' because neo gets mad\r\n newId = \"a\" + newId;\r\n // ensure not already used\r\n if (!cache[newId]) {\r\n cache[newId] = true;\r\n return newId;\r\n }\r\n return id();\r\n}", "function saveObjectID(object_id) {\n localStorage.setItem('object_id', object_id)\n console.log(object_id)\n }", "function initializeID() {\n var lastID = localStorage.getItem( 'lastID' );\n if ( lastID == null ) {\n location.reload(true);\n localStorage.setItem( 'lastID',0 );\n }\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n // append a 'a' because neo gets mad\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "function getNewId(){\n return healthInfos[healthInfos.length -1].id + 1;\n}", "save() {\n var db = new DB();\n //Check if model exists\n if (!this.attributes['id']) {\n return new Promise((fulfill, reject) => {\n db.insert(this.table, this.attributes).then(result => {\n this.setAttribute('id', result.insertId)\n fulfill(this)\n })\n })\n }\n\n return new Promise((fulfill, reject) => {\n db.update(this.table, `id = ${this.id}`, this.attributes).then(result => {\n fulfill(this)\n })\n })\n\n }", "static updatePokemonId(saveData, oldID, newID) {\n Update.rotatePokemonIDs(saveData, [newID, oldID], false);\n }", "function getNewId() {\n\t\treturn (_idGen++).toString();\n\t}", "get id() {\n if (!this._id) {\n this._id = Util.GUID();\n }\n return this._id;\n }", "set resourceId(value) {\n const {\n resource\n } = this; // When assigning a new id to a resource, it will update the resourceId of the assignment. But the assignments\n // resource is still the same so we need to announce here\n\n if ((resource === null || resource === void 0 ? void 0 : resource.isModel) && resource.id === value) {\n this.set('resourceId', value);\n } else {\n this.resource = value;\n }\n }", "function setId(id) {\n\t\tthis.id = id;\n\t}", "function id() {\n let newId = ('0000' + ((Math.random() * Math.pow(36, 4)) << 0).toString(36)).slice(-4);\n newId = `a${newId}`;\n // ensure not already used\n if (!cache[newId]) {\n cache[newId] = true;\n return newId;\n }\n return id();\n}", "save(productId) {\n console.log(\"save started\");\n\n const db = getDB();\n\n //if the product exists, update product.catch((err) => {})\n if(productId){\n\n db.collection('products').updateOne(new mongoDbObjectId(productId), {$set : this});\n\n }else{\n\n //if the product doesnt already exist, a new product will be added.\n db.collection('products').insertOne(this)\n .then((value) => {\n console.log('save result', value);\n })\n .catch((err) => {\n console.log('save err', err)\n });\n }\n\n }", "get id() {\n console.log('in id getter');\n return this._id + 'TEMPORARY';\n }", "async _getIdAndIncrement() {\n const instance = this._instance;\n const id = await instance.get('zombie_id_serial').value();\n\n // increment\n await instance.update('zombie_id_serial', n => n + 1).write();\n\n return id;\n }", "function newId() {\n var maxId = Math.max(...ids);\n if (maxId !== -Infinity && !isNaN(parseInt(maxId))) {\n return parseInt(maxId) + 1;\n }\n return 0;\n }", "function updateIdStr( value ) {\n var strArray = value.split( '-' ),\n id = strArray[ strArray.length - 1 ],\n newId = parseInt( id ) + 1\n\n // console.log( strArray );\n // console.log( id );\n // console.log( newId );\n\n strArray[ strArray.length - 1 ] = newId;\n // console.log( strArray );\n return strArray.toString().replace( ',', '-' );\n\n}", "get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }", "get lastId () {\n // allocating ids is pretty costly because of the amount of ids created, so we try to reuse whenever possible\n return this.length === 1 ? this.id : createID(this.id.client, this.id.clock + this.length - 1)\n }", "function clickID() {\n const newBook = {\n id: props.id,\n title: props.title, \n authors: props.authors, \n desc: props.desc,\n pic: props.pic, \n link: props.link\n }\n console.log(newBook);\n API.save(newBook);\n }", "function clearNextId(){\n NextId = undefined;\n}", "function newID() {\n for (var i = 0; i < notesArray.length; i++) {\n notesArray[i].id = i;\n }\n}", "function recordPath2Id(uri, id) {\r\n if (kernel.path2id[uri]) {\r\n kernel.path2id[uri].push(id)\r\n } else {\r\n kernel.path2id[uri] = [id]\r\n }\r\n}", "function generateId() {\n\tif ($('#dm_item_auto_id').val() == \"\") {\n\t\tvar auto_id = createId();\n\t\t$('#dm_item_auto_id').val(auto_id);\n\t}\n}", "function add_and_save(id) {\n retrieve_item();\n // console.log(qty);\n qty[id]++;\n //console.log(qty);\n save_item();\n}", "function makeId() {\n //create an id from praxis number, username and suffix\n //complete version\n vm.setId = praxis+''+vm.name+''+vm.ownId;\n console.log('Setting own id from '+vm.setId+' to '+vm.ownId);\n //send complete peer id to all clients\n socket.emit('update:pid', vm.setId);\n }", "function resetIdCounter() {\n idCounter = 0\n}", "getId(old) {\n // return existing old identifier\n if(old && old in this.existing) {\n return this.existing[old];\n }\n\n // get next identifier\n const identifier = this.prefix + this.counter;\n this.counter += 1;\n\n // save mapping\n if(old) {\n this.existing[old] = identifier;\n }\n\n return identifier;\n }", "newCustomID()\r\n {\r\n var newID = \"customid_\" + this.id_counter;\r\n this.id_counter++;\r\n return newID;\r\n }", "static getNextId() {\r\n this.id++;\r\n return this.id;\r\n }", "function newID(){\n id = Math.floor(Math.random()*90+10).toString() + Math.floor(Math.random()*90+10).toString() + Math.floor(Math.random()*90+10).toString()\n console.log(\"ID: \" + id)\n}", "static newId() {\n return admin\n .firestore()\n .collection(`ids`)\n .doc().id;\n }", "function saveSelectedWorkout(){\n $.ajax({\n method: \"POST\",\n url: \"/api/workout\",\n data: selectedWorkout\n }).then(function(resp){\n console.log(resp);\n if( resp && resp._id ){\n selectedWorkout._id = resp._id;\n }\n });\n }" ]
[ "0.6788976", "0.6630375", "0.66057104", "0.6602518", "0.65621465", "0.652492", "0.6514293", "0.64927334", "0.6440393", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.6436303", "0.640295", "0.63926566", "0.63926566", "0.63828045", "0.63131213", "0.63131213", "0.63131213", "0.63070625", "0.6305378", "0.6304424", "0.6243954", "0.6235325", "0.61978555", "0.6161884", "0.61542696", "0.61509705", "0.6136305", "0.61181164", "0.6114125", "0.610733", "0.6097705", "0.602992", "0.6029324", "0.60134965", "0.60043746", "0.6002971", "0.5995725", "0.5989669", "0.59853023", "0.5980282", "0.59652597", "0.59303284", "0.5918871", "0.5915959", "0.58967656", "0.5893092", "0.586417", "0.58527905", "0.58407956", "0.5834187", "0.5805672", "0.5805505", "0.57993525", "0.578373", "0.5776997", "0.57588696", "0.5755825", "0.5746166", "0.5744316", "0.56904876", "0.5689615", "0.5689615", "0.568901", "0.5687635", "0.5665146", "0.5665146", "0.56576276", "0.5651518", "0.5650149", "0.5640185", "0.5639404", "0.56375456", "0.5637176", "0.5630855", "0.5621728", "0.5618455", "0.56098735", "0.5603461", "0.55970854", "0.5595601", "0.5595601", "0.5594314", "0.5584761", "0.55534136", "0.55523723", "0.55465925", "0.5534947", "0.5533762", "0.55328274", "0.55321664", "0.5530074", "0.5521268", "0.5513961", "0.5513601", "0.55118257" ]
0.0
-1
Don't use the tab passes in the listener cb, the groupid is 1 for tabs with pdf
async function onClickSave(info, _tab) { let [tab] = await chrome.tabs.query({ active: true, currentWindow: true }); // Return if not part of group if (tab.groupId < 0) { return; } // Get the group id the current tab is in let tabGroup = await chrome.tabGroups.get(tab.groupId); // Make sure the Saved Groups folder exists let savedGroupsFolderId = await createOrGetSavedGroupsFolder(); let groupBookmarkFolderName = formatTabGroupName(tabGroup); console.debug(`Saving tab group ${groupBookmarkFolderName} (${tab.groupId})`); // Create a folder let groupBookmarkId = await createOrGetbookmarkFolder(savedGroupsFolderId, groupBookmarkFolderName) // And and all tabs within the group await saveGroupTabs(tab.groupId, groupBookmarkId); updateFullCtxMenu(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onTab(cb) {\n\tvar innerPage = $('.inner-page');\n\tinnerPage.keydown(function(e){\n\t\tif (e.keyCode == 9) {\n\t\t\te.preventDefault();\n\t\t\tcb();\n\t\t}\n\t}) ;\n}", "function delegate_to(tab_id)\n {\n menu_tab_id = tab_id;\n browser.browserAction.setPopup({ popup: \"\" });\n browser.browserAction.onClicked.addListener(focus_menu_tab);\n }", "function onTabChange(i) {\n\t\tsetCurrentTab(i)\n\t}", "async function tabGroupHandler(group) {\n// console.log('tgu',tabgroupnames)\n if(group.title !== \"\"){\n if(tabgroupnames[group.id] === undefined) {\n tabgroupnames[group.id] = group.title\n }\n else if(tabgroupnames[group.id] !== group.title) {\n console.log(group)\n tabgroupnames[group.id] = group.title\n\n // update group color\n await chrome.tabGroups.update(group.id,{color: getColor(group.title)})\n\n let tabs = await chrome.tabs.query({}) // groupId: group.id doesn't work\n\n console.log(tabs)\n\n if(tabs.length > 0){\n\n let folderId = -1\n\n for (var i = 0; i < tabs.length; i++) \n {\n let tab = tabs[i]\n if(tab.groupId == group.id){\n let bm = await chrome.bookmarks.search({url: tab.url})\n console.log(bm)\n if(bm.length > 1 || bm.length == 0) continue;\n\n let parentId = bm[0].parentId\n\n if(folderId == -1) folderId = parentId\n\n if(folderId != parentId ) {\n folderId = -2\n break\n } \n }\n }\n\n console.log(folderId)\n\n if(folderId > 0 ) {\n //let folder = await chrome.bookmarks.get(folderId)\n\n await chrome.bookmarks.update(folderId,{title: group.title})\n\n }\n\n\n }\n }\n }\n}", "onNewTab(){\n console.log(\"onNewTab\");\n\n Session.set('selectedPractitioner', false);\n Session.set('practitionerDetailState', false);\n }", "function CustomTabsScoped(tabGroupArr) {\n\t\tvar _iterator = _createForOfIteratorHelper(tabGroupArr),\n\t\t\t\t_step;\n\n\t\ttry {\n\t\t\tfor (_iterator.s(); !(_step = _iterator.n()).done;) {\n\t\t\t\tvar tabGroupItem = _step.value;\n\t\t\t\tvar scopeNode = void 0;\n\t\t\t\tvar selector = void 0;\n\n\t\t\t\tif (typeof tabGroupItem === 'string') {\n\t\t\t\t\tscopeNode = [document];\n\t\t\t\t\tselector = tabGroupItem;\n\t\t\t\t} else {\n\t\t\t\t\tscopeNode = document.querySelectorAll(tabGroupItem.scopeElementSelect);\n\t\t\t\t\tselector = tabGroupItem.tabGroup;\n\t\t\t\t\tif (!scopeNode) return;\n\t\t\t\t}\n\n\t\t\t\tvar _iterator2 = _createForOfIteratorHelper(scopeNode),\n\t\t\t\t\t\t_step2;\n\n\t\t\t\ttry {\n\t\t\t\t\tvar _loop = function _loop() {\n\t\t\t\t\t\tvar node = _step2.value;\n\t\t\t\t\t\tvar tabPills = node.querySelectorAll('[data-tab-pill=\"' + selector + '\"]');\n\t\t\t\t\t\tvar tabContent = node.querySelectorAll('[data-tab-content=\"' + selector + '\"]');\n\n\t\t\t\t\t\tif (tabPills != [] && tabContent != []) {\n\t\t\t\t\t\t\tvar _iterator3 = _createForOfIteratorHelper(tabPills),\n\t\t\t\t\t\t\t\t\t_step3;\n\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\tfor (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n\t\t\t\t\t\t\t\t\tvar tab = _step3.value;\n\t\t\t\t\t\t\t\t\ttab.addEventListener('click', function () {\n\t\t\t\t\t\t\t\t\t\tvar thisTab;\n\n\t\t\t\t\t\t\t\t\t\tvar _iterator4 = _createForOfIteratorHelper(tabPills),\n\t\t\t\t\t\t\t\t\t\t\t\t_step4;\n\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tfor (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar _tab = _step4.value;\n\n\t\t\t\t\t\t\t\t\t\t\t\t_tab.classList.remove('active');\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t_iterator4.e(err);\n\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t_iterator4.f();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tvar _iterator5 = _createForOfIteratorHelper(tabContent),\n\t\t\t\t\t\t\t\t\t\t\t\t_step5;\n\n\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\tfor (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar contItem = _step5.value;\n\t\t\t\t\t\t\t\t\t\t\t\tcontItem.classList.remove('active');\n\n\t\t\t\t\t\t\t\t\t\t\t\tif (contItem.getAttribute('data-tab-for') === this.getAttribute('data-tab-for')) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tthisTab = contItem;\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}\n\t\t\t\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t\t\t\t_iterator5.e(err);\n\t\t\t\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t\t\t\t_iterator5.f();\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tthis.classList.add('active');\n\t\t\t\t\t\t\t\t\t\tthisTab.classList.add('active');\n\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} catch (err) {\n\t\t\t\t\t\t\t\t_iterator3.e(err);\n\t\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\t\t_iterator3.f();\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\tfor (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n\t\t\t\t\t\t_loop();\n\t\t\t\t\t}\n\t\t\t\t} catch (err) {\n\t\t\t\t\t_iterator2.e(err);\n\t\t\t\t} finally {\n\t\t\t\t\t_iterator2.f();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (err) {\n\t\t\t_iterator.e(err);\n\t\t} finally {\n\t\t\t_iterator.f();\n\t\t}\n\t}", "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 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 removeTabEvent(tabpanel, tab) { \r\n if(enabledTabsMap[tab.getId()] == true) {\r\n //send end conversation system message'\r\n conn.request({\r\n url: CONTACT_LIST_JSON_URL,\r\n method: 'POST',\r\n params: { method: \"endConversation\", userId:tab.title},\r\n success: function(responseObject) {\r\n //enabledTabsMap[tab.getId()] = false;\r\n },\r\n failure: function() {\r\n\t Ext.Msg.alert(getLocalizationValue('application.javascript.messagingWindow.alert.errorTitle'), getLocalizationValue('application.javascript.messagingWindow.alert.errorMsg'));\r\n return false;\r\n }\r\n });\r\n } \r\n endConversation(tab.title);\r\n \r\n removeIndex = tabsMap.length; \r\n for(var i=0; i<tabsMap.length; i++) {\r\n if(tabsMap[i].title == tab.title) {\r\n removeIndex = i; \r\n }\r\n }\r\n tabsMap.splice(removeIndex, 1);\r\n}", "function showTab(tabName, tableGroup, tableName){\n\n // store the index of tablegroup that was selected\n switch (tableGroup) {\n case \"owner2grpRestriction\":\n tabsFrame.selectedTableGroup = 2;\n break;\n case \"ownergrpRestriction\":\n tabsFrame.selectedTableGroup = 1;\n break;\n case \"datagrpRestriction\":\n tabsFrame.selectedTableGroup = 0;\n break;\n //\t\tdefault: tabsFrame.selectedTableGroup = 0;\n }\n \n // navigate to desired tab, applying appropriate restriction based on table name selected. \n switch (tabName) {\n case \"page4b\":\n // If the target frame is page4b (Select Fields), then restrict the records\n // according to the table name \n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4b');\n break\n case \"page4c\":\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4c', restriction);\n break\n case \"page4d\":\n var restriction = new Ab.view.Restriction(); \n var inValues = []; \t\t\t\t\t\n // restriction = \"afm_flds.table_name IN (\";\n \n var parameters = {\n tableName: 'afm_flds',\n fieldNames: toJSON(['afm_flds.table_name', 'afm_flds.field_name', 'afm_flds.ref_table']),\n restriction: '{\"afm_flds.table_name\":' + tableName + '}',\n recordLimit: 0\n };\n var result = Workflow.runRuleAndReturnResult('AbCommonResources-getDataRecords', parameters);\n \n if (result.code == 'executed') { \n for (var i = 0; i < result.data.records.length; i++) {\n var record = result.data.records[i];\n if (record['afm_flds.ref_table'] != '') {\n inValues.push( record['afm_flds.ref_table']);\n }\n }\n }\n //restriction += \"' ')\";\n restriction.addClause(\"afm_flds.table_name\", inValues, \"IN\");\n \n var listOfRestrictedFields = tabsFrame.listOfRestrictionFields;\n if(listOfRestrictedFields){\n \trestriction = addFieldsToRestriction(restriction, listOfRestrictedFields);\n \t}\n myTabsFrame.refTable = tableName;\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4d', restriction);\n break\n case \"page4e\":\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4e', restriction);\n break\n case \"page4f\":\n myTabsFrame.selectTab('page4f');\n var restriction = new Ab.view.Restriction();\n restriction.addClause(\"afm_flds.table_name\", tableName, \"=\");\n tabsFrame.restriction = restriction;\n myTabsFrame.selectTab('page4f', restriction);\n break\n }\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 groupTabsContextOnClick(pageUrl, tab) {\n var regex = window.prompt('Enter URL regex to group (Use * for wildcard)', pageUrl);\n if (regex) groupTabs(regex);\n}", "function handlePdfSelectClick(e) {\n e.preventDefault();\n ipcRenderer.send(\"dialog:pdf:open\");\n}", "function hideDocumentTabCaptureEls() {\n if (topTabCaptureEl) {\n topTabCaptureEl.style.display = 'none';\n bottomTabCaptureEl.style.display = 'none';\n }\n }", "function changeTab(e) {\n setTab(e.target.id);\n}", "resetTab(name) {\n const canvas = this.#tabs[name].canvas;\n while (canvas.firstChild)\n canvas.firstChild.remove();\n }", "loadOneTab() { }", "onNewTab(){\n console.log(\"onNewTab\");\n\n Session.set('selectedPatient', false);\n Session.set('patientDetailState', false);\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 CustomTabsScoped(tabGroupArr) {\n\t\tfor (let tabGroupItem of tabGroupArr) {\n\t\t\tlet scopeNode;\n\t\t\tlet selector;\n\t\t\tif (typeof tabGroupItem === 'string'){\n\t\t\t\tscopeNode = [document];\n\t\t\t\tselector = tabGroupItem;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tscopeNode = document.querySelectorAll(tabGroupItem.scopeElementSelect);\n\t\t\t\tselector = tabGroupItem.tabGroup;\n\t\t\t\tif (!scopeNode) return\n\t\t\t}\n\t\t\tfor (let node of scopeNode){\n\t\t\t\tlet tabPills = node.querySelectorAll('[data-tab-pill=\"' + selector + '\"]');\n\t\t\t\tlet tabContent = node.querySelectorAll('[data-tab-content=\"' + selector + '\"]');\n\t\t\t\tif (tabPills != [] && tabContent != []) {\n\t\t\t\t\tfor (let tab of tabPills) {\n\t\t\t\t\t\ttab.addEventListener('click', function () {\n\t\t\t\t\t\t\tlet thisTab;\n\t\t\t\t\t\t\tfor (let tab of tabPills) {\n\t\t\t\t\t\t\t\ttab.classList.remove('active');\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tfor (let contItem of tabContent) {\n\t\t\t\t\t\t\t\tcontItem.classList.remove('active');\n\t\t\t\t\t\t\t\tif (contItem.getAttribute('data-tab-for') === this.getAttribute('data-tab-for')) {\n\t\t\t\t\t\t\t\t\tthisTab = contItem;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tthis.classList.add('active');\n\t\t\t\t\t\t\tthisTab.classList.add('active');\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "async function groupTabsAlwaysOnClick(info, tab) {\n const alwaysGroup = info.checked;\n await saveObjectInLocalStorage(\"alwaysGroup\", alwaysGroup);\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 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 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 saveStandardsAndContinue(){\n tabsFrame.restriction = null;\t\n myTabsFrame.selectTab('page4a')\n}", "function tabChangeEvent(tabpanel, tab) { \r\n\ttab.doLayout();\r\n\ttab.syncSize();\r\n\t// WS-1805: find the add contacts tab and hide the result list\r\n\tvar tabTitle = getLocalizationValue('application.javascript.contactList.searchTabTitle');\r\n\tvar searchTab = findTab(tabTitle);\r\n\tif (searchTab != null) {\r\n\t\tsearchTab.getComponent(0).collapse();\r\n\t}\r\n\t\r\n}", "function jscoverage_selectTab(tab) {\n\t$(tab).tab('show');\n}", "function startFillRepProgress(yearDoc, yearParam, reporType) {\n tab1.enabled = false;\n tab2.enabled = false;\n tab3.enabled = false;\n tab4.enabled = false;\n tab5.enabled = false;\n console.log('##1153 yearDoc = ' + yearDoc + ', yearParam = ' + yearParam + ', reporType = ' + reporType);\n fillRepProgress(yearDoc, yearParam, reporType);\n}", "function closeTab(tab) {\n var found = false;\n if (groupList.length > 0) {\n for(var i = 0; i < groupList[0].myTabs.length; i++){\n if(tab.url === groupList[0].myTabs[i].url){\n found = true;\n break;\n }\n }\n if(found === false){\n groupList[0].add(tab.id);\n }\n }\n// allTabs.splice(tab.id, 1);\n chrome.tabs.remove(tab.id);\n}", "_handleClick(tab, tabHeader, index) {\n if (!tab.disabled) {\n this.selectedIndex = tabHeader.focusIndex = index;\n }\n }", "function selectTab(group, index)\n{\n let tabContents = group.getElementsByClassName('tabs-content');\n for (let i = 0, count = tabContents.length; i < count; i++)\n {\n let content = tabContents[i];\n if (i == index)\n {\n content.classList.remove('hidden');\n }\n else\n {\n content.classList.add('hidden');\n }\n }\n let titles = group.getElementsByClassName('tabs-title');\n for (let i = 0, count = titles.length; i < count; i++)\n {\n let content = titles[i];\n if (i == index)\n {\n content.classList.add('selected');\n }\n else\n {\n content.classList.remove('selected');\n }\n if (!content.classList.contains('inited'))\n {\n let pos = i;\n content.onclick = () =>\n {\n selectAllTabs(pos, true);\n };\n content.classList.add('inited');\n }\n }\n}", "_tabsFocusHandler(event) {\n const that = this;\n\n if (event.type === 'focus') {\n that.bringToFront();\n that.setAttribute('focus', '');\n }\n else {\n that.removeAttribute('focus');\n }\n }", "function onTab(e) {\n var isShiftPressed = e.shiftKey;\n var activeElement = document.activeElement;\n var focusableElements = getFocusables(getSlideOrSection($(SECTION_ACTIVE_SEL)[0]));\n\n function preventAndFocusFirst(e) {\n preventDefault(e);\n return focusableElements[0] ? focusableElements[0].focus() : null;\n } //outside any section or slide? Let's not hijack the tab!\n\n\n if (isFocusOutside(e)) {\n return;\n } //is there an element with focus?\n\n\n if (activeElement) {\n if (closest(activeElement, SECTION_ACTIVE_SEL + ',' + SECTION_ACTIVE_SEL + ' ' + SLIDE_ACTIVE_SEL) == null) {\n activeElement = preventAndFocusFirst(e);\n }\n } //no element if focused? Let's focus the first one of the section/slide\n else {\n preventAndFocusFirst(e);\n } //when reached the first or last focusable element of the section/slide\n //we prevent the tab action to keep it in the last focusable element\n\n\n if (!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] || isShiftPressed && activeElement == focusableElements[0]) {\n preventDefault(e);\n }\n }", "_makeTabsFromPfTab () {\n let ul = this.querySelector('ul');\n let pfTabs = this.querySelectorAll('pf-tab');\n [].forEach.call(pfTabs, function (pfTab, idx) {\n let tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n } else {\n pfTab.style.display = 'none';\n }\n }.bind(this));\n }", "function onTab(e){\r\n var isShiftPressed = e.shiftKey;\r\n var activeElement = document.activeElement;\r\n var focusableElements = getFocusables(getSlideOrSection($(SECTION_ACTIVE_SEL)[0]));\r\n\r\n function preventAndFocusFirst(e){\r\n preventDefault(e);\r\n return focusableElements[0] ? focusableElements[0].focus() : null;\r\n }\r\n\r\n //outside any section or slide? Let's not hijack the tab!\r\n if(isFocusOutside(e)){\r\n return;\r\n }\r\n\r\n //is there an element with focus?\r\n if(activeElement){\r\n if(closest(activeElement, SECTION_ACTIVE_SEL + ',' + SECTION_ACTIVE_SEL + ' ' + SLIDE_ACTIVE_SEL) == null){\r\n activeElement = preventAndFocusFirst(e);\r\n }\r\n }\r\n\r\n //no element if focused? Let's focus the first one of the section/slide\r\n else{\r\n preventAndFocusFirst(e);\r\n }\r\n\r\n //when reached the first or last focusable element of the section/slide\r\n //we prevent the tab action to keep it in the last focusable element\r\n if(!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] ||\r\n isShiftPressed && activeElement == focusableElements[0]\r\n ){\r\n preventDefault(e);\r\n }\r\n }", "function switchGroup(groupID) {\n var destGroups = groups[groupID];\n var tabs = groups[activeGroup].tabs;\n //Creates tabs and selects the first tab\n var p = destGroups.tabs.length\n for (var k = 0; k < p; k++) {\n if (k === 0) chrome.tabs.create({url:destGroups.tabs[k].url,selected:true});\n else chrome.tabs.create({url:destGroups.tabs[k].url,selected:false});\n }\n var q = tabs.length\n for (var j = 0; j < q; j++){\n\t chrome.tabs.remove(tabs[j].id);\n }\n activeGroup = groupID;\n storeGroups();\n destGroups.active = true;\n}", "_insertNearAGroup(details) {\n const that = this,\n tab = details.tab,\n tabLabelContainer = details.tabLabelContainer;\n let index = details.index;\n\n index = Math.max(0, Math.min(index, that._tabs.length));\n\n const previous = that._tabs[index - 1],\n next = that._tabs[index],\n groupOfNext = next ? next.group : undefined;\n\n if (previous && previous.group !== null && next && groupOfNext !== null) {\n // insert into group\n next.tabLabelContainer.parentElement.insertBefore(tabLabelContainer, next.tabLabelContainer);\n next.parentElement.insertBefore(tab, next);\n\n tab.group = groupOfNext;\n }\n else {\n if (next) {\n if (groupOfNext !== null) {\n that.$.tabStrip.insertBefore(tabLabelContainer, that._groupLabels[that._groups.indexOf(groupOfNext)]);\n that.$.tabContentSection.insertBefore(tab, that.$.tabContentSection.querySelector('jqx-tab-items-group[label=\"' + groupOfNext + '\"]'));\n }\n else {\n that.$.tabStrip.insertBefore(tabLabelContainer, next.tabLabelContainer);\n that.$.tabContentSection.insertBefore(tab, next);\n }\n }\n else {\n that.$.tabStrip.insertBefore(tabLabelContainer, that._addNewTab || null);\n that.$.tabContentSection.appendChild(tab);\n }\n }\n\n that._tabLabelContainers.splice(index, 0, tabLabelContainer);\n that.$.dropDownButtonDropDown.insertBefore(details.dropDownLabelContainer, that.$.dropDownButtonDropDown.children[index] || null);\n that._tabs.splice(index, 0, tab);\n\n that._updateIndexes(index);\n }", "function setTable(currentIndex, tablegroup, primaryKeys){\n var numberOfTblgrps = Number(tabsFrame.tablegroupsRestriction);\n var currentTab = \"page3-\" + currentIndex;\n var PKpair = String(toJSON(primaryKeys));\n var objRegExp = /{\".*\": \"(.*)\"}/i;\n table = PKpair.replace(objRegExp, \"$1\");\n var view = tabsFrame.newView;\n var tIndex = currentIndex - 1;\n \n // Create a tablegroup object to hold tablegroup properties (for now, this is the table_name and which tablegroup)\n var tableGroup = createTgrpObject(table);\n // if we don't have enough tablegroups for the pattern, add the table_name\n if (view.tableGroups.length < numberOfTblgrps) {\n view.tableGroups.push(tableGroup);\n }\n else {\n // otherwise, replace the table_name for this current tablegroup\n view.tableGroups[(numberOfTblgrps - tgrp_position)] = tableGroup;\n }\n\n\tvar pattern = tabsFrame.patternRestriction;\t\n\tvar bHasDrawing = false;\n\t\n\t// for drawing \n\tif (pattern.match(/paginated-highlight/gi)){\n\t\tbHasDrawing = true;\n\t\ttgrp_position = 1;\n\t}\t\n\n\t// if this is a drawing report, set the owner and owner2 table groups to have the same table\n\tif (bHasDrawing == true){\n\t\n\t\tif (view.hasOwnProperty('tableGroups')){\n\t\t\tif (view.tableGroups.length == 3){\n\t\t\t\tview.tableGroups[0] = createTgrpObject(table);\n\t\t\t\tview.tableGroups[1] = createTgrpObject(table);\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (view.tableGroups.length !=3){\n\t\t\tview.tableGroups.push(createTgrpObject(table));\t\t\t//\towner \n\t\t\tview.tableGroups.push(createTgrpObject(table));\t\t\t// \towner2\n\t\t}\t\n\t\t\t\t\t\n\t\ttabsFrame.ownergrpRestriction = table;\n\t\ttabsFrame.owner2grpRestriction = table;\n\t\t\n\t\t/*\n\t\t// if thematic drawings, default summarize to true\n\t\tif ((pattern == 'ab-viewdef-paginated-highlight-thematic') && (!valueExistsNotEmpty(tabsFrame.fileToConvert))){\n\t\t\t// view.tableGroups[0].paginatedPanelProperties.summarizeBySortOrder = 'summarizeBySortOrder';\t\n\t\t\tview.tableGroups[2].paginatedPanelProperties.summarizeBySortOrder = 'summarizeBySortOrder';\t\n\t\t}\n\t\t*/\n\t}\n\t\t \n // Store this information in the tab frame\n tabsFrame.newView = view;\n \n \t// clear the mini-console index before we leave\n \tvar tgrpPanel = 'tgrp' + tgrp_position + 'Panel';\t\n\tvar grid = Ab.view.View.getControl('', tgrpPanel);\n\t// grid.indexValue = '';\n\tgrid.setIndexLevel(0);\n\t// grid.indexEntries = null;\n\t// grid.indexRow = null;\n\t\t \n if ((currentIndex) == 1) {\n // Go to \"Set Characteristics\"\n tabsFrame.datagrpRestriction = table;\n var toTab = \"page4\";\n tabsFrame.restriction = \"\";\n tabsFrame.selectTab(toTab);\n }\n else {\n \n // Otherwise, go to the next \"Select Data\" tab with restriction to related tables \t\t\t \n if (currentIndex == 2) {\n tabsFrame.ownergrpRestriction = table;\n }\n else {\n tabsFrame.owner2grpRestriction = table;\n }\n \n var toTab = String(\"page3-\" + (currentIndex - 1));\n dataTabsFrame.selectTab(toTab);\n }\n tabsFrame.disableFileSelect = true;\n}", "function openTab(evt, tab) {\n var i, x, tablinks;\n\tx = document.getElementsByClassName(\"beamTabs\");\n\tfor (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" w3-indigo\", \"\");\n }\n evt.currentTarget.className += \" w3-indigo\";\n\tdocument.getElementById(tab).style.display = \"block\";\n\tupdateDiagramGeometry();\n}", "function onTab(e){\n var isShiftPressed = e.shiftKey;\n var activeElement = document.activeElement;\n var focusableElements = getFocusables(getSlideOrSection($(SECTION_ACTIVE_SEL)[0]));\n\n function preventAndFocusFirst(e){\n preventDefault(e);\n return focusableElements[0] ? focusableElements[0].focus() : null;\n }\n\n //outside any section or slide? Let's not hijack the tab!\n if(isFocusOutside(e)){\n return;\n }\n\n //is there an element with focus?\n if(activeElement){\n if(closest(activeElement, SECTION_ACTIVE_SEL + ',' + SECTION_ACTIVE_SEL + ' ' + SLIDE_ACTIVE_SEL) == null){\n activeElement = preventAndFocusFirst(e);\n }\n }\n\n //no element if focused? Let's focus the first one of the section/slide\n else{\n preventAndFocusFirst(e);\n }\n\n //when reached the first or last focusable element of the section/slide\n //we prevent the tab action to keep it in the last focusable element\n if(!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] ||\n isShiftPressed && activeElement == focusableElements[0]\n ){\n preventDefault(e);\n }\n }", "function onTab(e){\n var isShiftPressed = e.shiftKey;\n var activeElement = document.activeElement;\n var focusableElements = getFocusables(getSlideOrSection($(SECTION_ACTIVE_SEL)[0]));\n\n function preventAndFocusFirst(e){\n preventDefault(e);\n return focusableElements[0] ? focusableElements[0].focus() : null;\n }\n\n //outside any section or slide? Let's not hijack the tab!\n if(isFocusOutside(e)){\n return;\n }\n\n //is there an element with focus?\n if(activeElement){\n if(closest(activeElement, SECTION_ACTIVE_SEL + ',' + SECTION_ACTIVE_SEL + ' ' + SLIDE_ACTIVE_SEL) == null){\n activeElement = preventAndFocusFirst(e);\n }\n }\n\n //no element if focused? Let's focus the first one of the section/slide\n else{\n preventAndFocusFirst(e);\n }\n\n //when reached the first or last focusable element of the section/slide\n //we prevent the tab action to keep it in the last focusable element\n if(!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] ||\n isShiftPressed && activeElement == focusableElements[0]\n ){\n preventDefault(e);\n }\n }", "function onTab(e){\n var isShiftPressed = e.shiftKey;\n var activeElement = document.activeElement;\n var focusableElements = getFocusables(getSlideOrSection($(SECTION_ACTIVE_SEL)[0]));\n\n function preventAndFocusFirst(e){\n preventDefault(e);\n return focusableElements[0] ? focusableElements[0].focus() : null;\n }\n\n //outside any section or slide? Let's not hijack the tab!\n if(isFocusOutside(e)){\n return;\n }\n\n //is there an element with focus?\n if(activeElement){\n if(closest(activeElement, SECTION_ACTIVE_SEL + ',' + SECTION_ACTIVE_SEL + ' ' + SLIDE_ACTIVE_SEL) == null){\n activeElement = preventAndFocusFirst(e);\n }\n }\n\n //no element if focused? Let's focus the first one of the section/slide\n else{\n preventAndFocusFirst(e);\n }\n\n //when reached the first or last focusable element of the section/slide\n //we prevent the tab action to keep it in the last focusable element\n if(!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] ||\n isShiftPressed && activeElement == focusableElements[0]\n ){\n preventDefault(e);\n }\n }", "function fillPdfWindow( evt ) {\n // skip this if no window is waiting on a PDF for this activity\n if ( !evt.owner || !evt.owner._id || !evt.mediaId || !self.pdfWindows[ evt.owner._id ] ) { return; }\n\n var\n mediaUrl = '/media/' + evt.mediaId + '_original.APPLICATION_PDF.pdf',\n privateUrl = Y.doccirrus.infras.getPrivateURL( mediaUrl );\n\n self.pdfWindows[ evt.owner._id ].location = privateUrl;\n self.pdfWindows[ evt.owner._id ] = null;\n delete self.pdfWindows[ evt.owner._id ];\n }", "function changeTab(e){\n let targetTab = e.target.id;\n loadTab(targetTab);\n}", "_makeTabsFromPfTab() {\n const ul = this.querySelector('ul');\n if (this.children && this.children.length) {\n const pfTabs = [].slice\n .call(this.children)\n .filter(node => node.nodeName === 'PF-TAB');\n [].forEach.call(pfTabs, (pfTab, idx) => {\n const tab = this._makeTab(pfTab);\n ul.appendChild(tab);\n this.tabMap.set(tab, pfTab);\n this.panelMap.set(pfTab, tab);\n\n if (idx === 0) {\n this._makeActive(tab);\n }\n else {\n pfTab.style.display = 'none';\n }\n });\n }\n }", "function external_tab_on_click(scale_title, resource_type){\n var click_tab = document.getElementsByClassName(scale_title + '_' + resource_type)[0];\n click_tab.onclick = function(){\n deactivate_previous_tab(scale_title);\n click_tab.parentElement.className = 'tabberactive';\n $(resource_type).show();\n };\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 handleFirstTab(e) {\n if (e.keyCode === 9) {\n \n document.body.classList.add('user-is-tabbing');\n \n window.removeEventListener('keydown', handleFirstTab);\n window.addEventListener('mousedown', handleMouseDownOnce);\n\n }\n\n }", "clickEventListener (event) {\n var tab = event.target;\n this.activateTab(tab, false);\n }", "function set_destinataires_pdf()\n{\n RMPApplication.debug (\"begin set_destinataires_pdf\");\n var my_pattern = {};\n var options = {};\n col_destinataires_pdf_tpi.listCallback(my_pattern, options, set_destinataires_pdf_ok, set_destinataires_pdf_ko);\n RMPApplication.debug (\"end set_destinataires_pdf\");\n}", "function registerBackgroundTabDetection() {\n if (global && global.document) {\n global.document.addEventListener('visibilitychange', function () {\n var activeTransaction = utils_2.getActiveTransaction();\n if (global.document.hidden && activeTransaction) {\n utils_1.logger.log(\"[Tracing] Transaction: \" + spanstatus_1.SpanStatus.Cancelled + \" -> since tab moved to the background, op: \" + activeTransaction.op);\n // We should not set status if it is already set, this prevent important statuses like\n // error or data loss from being overwritten on transaction.\n if (!activeTransaction.status) {\n activeTransaction.setStatus(spanstatus_1.SpanStatus.Cancelled);\n }\n activeTransaction.setTag('visibilitychange', 'document.hidden');\n activeTransaction.setTag(constants_1.FINISH_REASON_TAG, constants_1.IDLE_TRANSACTION_FINISH_REASONS[2]);\n activeTransaction.finish();\n }\n });\n }\n else {\n utils_1.logger.warn('[Tracing] Could not set up background tab detection due to lack of global document');\n }\n}", "_insertNoGrouping(tabDetails) {\n const that = this,\n index = Math.max(0, Math.min(tabDetails.index, that._tabs.length)),\n tab = tabDetails.tab,\n tabLabelContainer = tabDetails.tabLabelContainer;\n\n that.$.tabStrip.insertBefore(tabLabelContainer, that._tabLabelContainers[index] || that._addNewTab || null);\n that.$.tabContentSection.insertBefore(tab, that._tabs[index] || null);\n that._tabLabelContainers.splice(index, 0, tabLabelContainer);\n that.$.dropDownButtonDropDown.insertBefore(tabDetails.dropDownLabelContainer, that.$.dropDownButtonDropDown.children[index] || null);\n that._tabs.splice(index, 0, tab);\n\n that._updateIndexes(index);\n }", "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 captureTab(callback) {\n\tchrome.tabs.getSelected(function(tab) {\n\t\tif (tab.url.match(/^http[s]?:\\/\\//)) {\n\t\t\tactiveWindowId = tab.windowId;\n\t\t\tactiveTabId = tab.id;\n\n\t\t\tinitVars(tab.windowId, tab.id);\n\n\t\t\tcaptureVisibleTab(callback);\n\t\t\tcaptureInnerText();\n\t\t}\n\t});\n}", "function messaging(text_mod, pdf, generateOnce, newTab, tabs) {\n\t\t\t\t\t//starting the program\n\t\t\t\t\tif (message.text == \"startListen\") {\n\t\t\t\t\t\tif (playing == true){ //if playing\n\t\t\t\t\t\t\tport.postMessage({text:\"playing\"});\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\telse if (playing == false){ //if paused\n\t\t\t\t\t\t\tport.postMessage({text:\"paused\"});\n\t\t\t\t\t\t} \n\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t//now the pdf is being played\n\t\t\t\t\t\t\tif (pdf == true) {\n\t\t\t\t\t\t\t\tinitPDF = true;\n\t\t\t\t\t\t \tconsole.log('pdf is true')\n\t\t\t\t\t \t\t\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinitPDF = false;\n\t\t\t\t\t\t\t\tcreateChild(text_mod, port);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t \n\t\t\t\t\t\t}\n\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\t//what happens when the audio is played\n\t\t\t\t\telse if(message.text == \"play\") {\n\t\t\t\t\t\tplaying = true;\n\t\t\t\t\t child.play();\n\t\t\t\t\t $(\"#controls\").css(\"display\", \"block\");\n\t\t\t\t\t document.getElementById(\"controls\").appendChild(child);\n\t\t\t\t\t}\n\n\t\t\t\t\t//what happens when the audio is paused\n\t\t\t\t\telse if(message.text == \"pause\"){\n\t\t\t\t\t\tplaying = false;\n\t\t\t\t\t child.pause();\n\t\t\t\t\t}\n\n\t\t\t\t\t//what happens when the audio is stopped\n\t\t\t\t\telse if(message.text == \"stop\"){\n\t\t\t\t\t\tconsole.log('stopped')\n\t\t\t\t\t\tstopped = true;\n\t\t\t\t\t\tplaying = undefined;\n\t\t\t\t\t\tchild.currentTime = 0;\n\t\t\t\t\t\tchild.pause();\n\t\t\t\t\t\tchild.load();\n\t\t\t\t\t\tended = true;\n\t\t\t\t\t \tport.postMessage({ended:ended});\n\t\t\t\t\t \t//refreshes the page when stopped so a new connection is made\n\t\t\t\t\t \tvar code = 'window.location.reload();';\n \t\t\t\t\t\tchrome.tabs.executeScript(tabs[0].id, {code: code});\n\t\t\t\t\t} \n\n\t\t\t\t\t//whenever it's initiated\n\t\t\t\t\telse if (message.text == \"main\"){\n\t\t\t\t\t\tif (initPDF == true) {\n\n\t\t\t\t\t\t\tport.postMessage({pdf:true});\n\t\t\t\t\t\t\tPDFJS.disableWorker = true; //using pdf.js: PDFJS is in the pdf.js code /scripts/pdf.js\n\n\t\t\t\t\t\t\t//getting the pdf document by url\n\t\t\t\t\t\t\tPDFJS.getDocument(url).then(function getPdf(pdf) {\n\n\t\t\t\t\t\t\t\t//generating the text from the pdf\n\t\t\t\t\t\t\t\t//using the callback I made before the wrapper to generate the pdf\n\t\t\t\t\t\t\t\tgeneratePDFText(pdf, function(){\n\t\t\t\t\t\t\t console.log(pdfText);\n\t\t\t\t\t\t\t text_mod = pdfText;\n\t\t\t\t\t\t\t\t createChild(text_mod, port); //running the audio\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t //event variables\n\t\t\t\t\t\t\t\t initPDF = false;\n\t\t\t\t\t\t\t \tplaying = true;\n\t\t\t\t\t\t\t \tgenerateOnce = true\n\n\t\t\t\t\t\t\t\t\tport.postMessage({pdf:\"finished\"}) //sending the message to the content_script that it's finsihed loading\n\t\t\t\t\t\t\t\t\tconsole.log('-----pdf finished-----')\n\t\t\t\t\t\t\t\t\treturn true;\n\t\t\t\t\t\t\t });\n\n\t\t\t\t\t\t });\n\t\t\t\t\t\t} else if (playing == true) {\n\t\t\t\t\t\t\t//replays audio when pdf is initiated\n\t\t\t\t\t\t\tchild.play();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\t\n\n\t\t\t\t}", "_tabStripHandler(target, event) {\n const that = this,\n eventType = event.type;\n\n if (eventType === 'down' && that._tabToResize !== undefined) {\n that._resizing = true;\n that._tabsHeaderSectionCoordinate = that.$.tabsHeaderSection.getBoundingClientRect()[that._orientationSettings.edge];\n return;\n }\n\n if (eventType === 'down' && JQX.Utilities.Core.isMobile) {\n that._dragStartDetails = {\n startX: event.pageX,\n startY: event.pageY,\n pageX: event.pageX,\n pageY: event.pageY,\n startTime: Date.now(),\n originalTime: Date.now(),\n target: event.originalEvent.target\n };\n }\n\n const scrollButton = target.closest('jqx-repeat-button');\n\n if (eventType === 'up' && scrollButton) {\n that.focus();\n\n if (that.resize) {\n that._getTabCoordinates();\n }\n return;\n }\n\n if (target.classList.contains('jqx-tab-close-button')) {\n // close button\n if (eventType === 'up') {\n if (target === that._downTarget) {\n const indexToClose = target.parentElement.parentElement.tab.index,\n closingEvent = that.$.fireEvent('closing', { 'index': indexToClose });\n\n if (!closingEvent.defaultPrevented) {\n that.remove(indexToClose);\n\n that.$.fireEvent('close', { 'index': indexToClose });\n }\n return;\n }\n }\n else if (eventType === 'down') {\n that._downTarget = target;\n return;\n }\n else if (!that._reordering && !that._swiping) {\n if (eventType === 'mouseover') {\n target.setAttribute('hover', '');\n }\n else if (eventType === 'mouseout') {\n target.removeAttribute('hover');\n }\n }\n }\n\n const closestLabelContainer = target.closest('.jqx-tab-label-container');\n\n if (closestLabelContainer !== null) {\n that._labelContainerHandler(closestLabelContainer, event, eventType);\n return;\n }\n\n const closestGroupContainer = target.closest('.jqx-tab-group-container');\n\n if (closestGroupContainer !== null) {\n that._groupContainerHandler(closestGroupContainer, eventType);\n }\n }", "function start(tab)\n{\n\t\n}", "function handleFirstTab(e) {\n if (e.keyCode === 9) {\n document.body.classList.add('tab-used');\n window.removeEventListener('keydown', handleFirstTab);\n }\n}", "function removeTab(tab)\n{\n // TODO\n}", "function lemurlog_OnTabRemoved_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 lemurlog_DoWriteLogFile(lemurlog_LOG_FILE, \"RmTab\\t\" + time + \"\\t\" + id + \"\\n\");\n}", "function onTab(e){\r\n var isShiftPressed = e.shiftKey;\r\n var activeElement = document.activeElement;\r\n var activeSection = $(SECTION_ACTIVE_SEL)[0];\r\n var activeSlide = $(SLIDE_ACTIVE_SEL, activeSection)[0];\r\n var focusableWrapper = activeSlide ? activeSlide : activeSection;\r\n var focusableElements = $(focusableElementsString + ':not([tabindex=\"-1\"])', focusableWrapper);\r\n\r\n function preventAndFocusFirst(e){\r\n preventDefault(e);\r\n return focusableElements[0].focus();\r\n }\r\n\r\n //is there an element with focus?\r\n if(activeElement){\r\n if(closest(activeElement, SECTION_ACTIVE_SEL + ',' + SLIDE_ACTIVE_SEL) == null){\r\n activeElement = preventAndFocusFirst(e);\r\n }\r\n }\r\n\r\n //no element if focused? Let's focus the first one of the section/slide\r\n else{\r\n preventAndFocusFirst(e);\r\n }\r\n\r\n //when reached the first or last focusable element of the section/slide\r\n //we prevent the tab action to keep it in the last focusable element\r\n if(!isShiftPressed && activeElement == focusableElements[focusableElements.length - 1] ||\r\n isShiftPressed && activeElement == focusableElements[0]\r\n ){\r\n preventDefault(e);\r\n }\r\n }", "function onClickHandler(info, tab) {\n\tchrome.tabs.sendMessage(tab.id, 'remove-selected-loading-mask');\n}", "addEnabledTab(tabId) {\n this.transAddEnabledTab(tabId);\n }", "async function tab(tab) {\n setLoading(true);\n setActiveTab(tab);\n setSecondTab(\"results\");\n setActiveTest(\"\");\n setPatientSelected(null);\n if (tab == \"new\") {\n setPatient(null);\n var result = await client.postApi(`${endpoints.user.getPatients}`, null, true);\n if (result.statusCode === 200) {\n setPatient(result.response);\n setLoading(false);\n } else {\n setLoading(false);\n }\n } else {\n setLoading(false);\n }\n }", "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 main () {\n\tgetTabs({audible: true, muted: false}, processAudibleTabs, muteGivenTabs, unmuteAllTabs);\n}", "function do_tabpanel(group,idnode)\r\n{\r\n\r\n\t\tvar c = new class_compat();\r\n\t\tc.showgroupelement(group,idnode);\r\n\t\t\r\n\r\n}", "_tab(event){\n event.preventDefault(); // always?\n\n // get list of all children elements:\n const o = Array.from(this.querySelectorAll('*'));\n\n // get list of focusable items\n const focusableItems = o.filter((e)=>UIDialog._isVisibleElement(e));\n\n // get currently focused item\n const focusedItem = document.activeElement;\n\n // get the number of focusable items\n const numberOfFocusableItems = focusableItems.length;\n\n if (numberOfFocusableItems === 0) return;\n\n // get the index of the currently focused item\n const focusedItemIndex = focusedItem ? focusableItems.indexOf(focusedItem) : -1;\n\n if (event.shiftKey) {\n // back tab\n // if focused on first item and user preses back-tab, go to the last focusable item\n if (focusedItemIndex === 0) {\n focusableItems[numberOfFocusableItems - 1].focus();\n //event.preventDefault();\n }\n } else {\n // forward tab\n // if focused on the last item and user preses tab, go to the first focusable item\n if (focusedItemIndex === numberOfFocusableItems - 1) {\n focusableItems[0].focus();\n //event.preventDefault();\n }\n }\n }", "_indexChangeHandler(event) {\n const that = this,\n oldIndex = event.detail.oldIndex,\n validNewIndex = Math.max(0, Math.min(event.detail.newIndex, that._tabs.length - 1));\n\n if (oldIndex !== validNewIndex) {\n if (that._groups.length === 0) {\n that._reorderTabs(oldIndex, validNewIndex);\n }\n else {\n const tabItem = event.detail.tabItem;\n\n tabItem._setIndex(oldIndex);\n that.remove(oldIndex);\n that.insert(validNewIndex, { node: tabItem });\n\n if (that.selectedIndex === oldIndex) {\n that._select(validNewIndex, false);\n }\n }\n\n that._reorderedIndex = undefined;\n }\n }", "function user_form_afterSelect(){\n\n\tvar pattern = tabsFrame.patternRestriction;\t\n var tgrpPanel = 'tgrp' + tgrp_position + 'Panel'; // determine panel name based on the tab name\n var grid = Ab.view.View.getControl('', tgrpPanel);\n var view = tabsFrame.newView; // get the view object\n var numOfTgrps = view.tableGroups.length; // get the number of tablegroups in the view object\n var table_name = \"\"; // variable to store the current table name\n var parentTable = \"\"; // variable to store the parent/owner table name (relevant to the curent table)\n var restriction = \"\"; // variable to store restriction for the next tab\n var numberOfTblgrps = Number(tabsFrame.tablegroupsRestriction); // number of tablegroups based on the selected pattern\n\t \n\t// if the number of tablegroup in the pattern matches the number of tablegroups in the view obj, enable corresponding tabs\n if (numOfTgrps == numberOfTblgrps) {\n for (j = 1; j < 4; j++) {\n dataTabsFrame.setTabEnabled(\"page3-\" + j, true);\n }\n }\n \n \tvar action = grid.actions.get('goNext' + tgrp_position);\n\taction.enable(false);\n\t\t\t\n // for \"data\" tablegroup\n if (tgrp_position == 1) {\n table_name = tabsFrame.datagrpRestriction;\n parentTable = tabsFrame.ownergrpRestriction;\n if ((numberOfTblgrps > 1) && !(pattern.match(/highlight/gi))) {\n $('goBack1').style.display = \"\";\n }\n else {\n $('goBack1').style.display = \"none\";\n }\n }\n \n // for \"owner\" tablegroup\n if (tgrp_position == 2) {\n table_name = tabsFrame.ownergrpRestriction;\n parentTable = tabsFrame.owner2grpRestriction;\n if (numberOfTblgrps > 2) {\n $('goBack2').style.display = \"\";\n }\n else {\n $('goBack2').style.display = \"none\";\n }\n }\n \n // for \"owner2\" tablegroup\n if (tgrp_position == 3) {\n table_name = tabsFrame.owner2grpRestriction;\n }\n \n // if a table was previously selected, restrict the grid show only that table record and hide the \"Select\" button\n if ((table_name != \"\") && (table_name != undefined)) {\n\t\taction.enable(true); \n\t\t \n // apply restriction to grid\n restriction = \"afm_tbls.table_name = '\" + table_name + \"'\";\n grid.refresh(restriction);\n \n\t\thideButtons(grid);\n\t\t\t\n } else if (parentTable != \"\") {\n\t\t\taction.enable(false); \n\t\t\t \n // otherwise, if a parent table exists, restrict grid to show all possible tables that can have the parent table as an owner table\n restriction = \"afm_tbls.table_name = '\" + parentTable + \"' OR EXISTS (SELECT 1 FROM afm_flds WHERE afm_tbls.table_name = afm_flds.table_name AND afm_flds.ref_table='\" + parentTable + \"'\";\n var listOfRestrictedTables = tabsFrame.listOfRestrictionTables;\n restriction += (valueExistsNotEmpty(listOfRestrictedTables) && listOfRestrictedTables != ';') ? \" AND table_name IN (\" + addStringSeparators(listOfRestrictedTables) + \")\" : \"\";\n restriction += \")\";\n grid.refresh(restriction);\n }\n \n // show the miniconsole filter uncollapsed\n if (grid) {\n\t\tgrid.indexLevel = 0;\n grid.isCollapsed = false;\n grid.showIndexAndFilter();\n }\n \n}", "function removeTab(evt){ //accept either the span event object or the panel\n var $span = $(evt.target);\n var panelRef = $span.parent().children(\"a\").attr(\"href\");\n var panelId = panelRef.substr(1);\n destroyChartMap(panelId);\n $(panelRef).remove();\n $span.parent().remove();\n delete panelGraphs[panelId];\n $graphTabs.tabs('refresh'); //tell JQUI to sync up\n if($graphTabs.find(\"li\").length == 0){\n editingPanelId = null; //dissociate the chart from the this edit session\n $(\"#btnEditGraphTop\").attr(\"disabled\",\"disabled\");\n $(\"button.add-to-graph\").attr(\"disabled\",\"disabled\");\n lastTabAnchorClicked.click();\n } else {\n $('#graph-tabs a:last').click();\n }\n $(\"#graph_title\").attr('value','');\n}", "function updatedListener(tabId, changeInfo, tab) {\n thePageClock.filteredUpdate();\n}", "function TabSheet_NotifyDestruction()\n{\n\t//valid parent?\n\tif (this.InterpreterObject && this.InterpreterObject.Parent)\n\t{\n\t\t//check parent\n\t\tswitch (this.InterpreterObject.Parent.DataObject.Class)\n\t\t{\n\t\t\tcase __NEMESIS_CLASS_TAB_CONTROL:\n\t\t\t\t//make sure to remove ourselves\n\t\t\t\tthis.InterpreterObject.Parent.HTML.RemoveTabSheet(this);\n\t\t\t\tbreak;\n\t\t}\n\t}\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 onTab(e) {\n var isShiftPressed = e.shiftKey;\n var activeElement = $(':focus');\n var activeSection = $(SECTION_ACTIVE_SEL);\n var activeSlide = activeSection.find(SLIDE_ACTIVE_SEL);\n var focusableWrapper = activeSlide.length ? activeSlide : activeSection;\n var focusableElements = focusableWrapper.find(focusableElementsString);\n\n function preventAndFocusFirst(e) {\n e.preventDefault();\n return focusableElements.first().focus();\n }\n\n //is there an element with focus?\n if (activeElement.length) {\n if (!activeElement.closest(SECTION_ACTIVE_SEL, SLIDE_ACTIVE_SEL).length) {\n activeElement = preventAndFocusFirst(e);\n }\n }\n\n //no element if focused? Let's focus the first one of the section/slide\n else {\n preventAndFocusFirst(e);\n }\n\n //when reached the first or last focusable element of the section/slide\n //we prevent the tab action to keep it in the last focusable element\n if (!isShiftPressed && activeElement.is(focusableElements.last()) ||\n isShiftPressed && activeElement.is(focusableElements.first())\n ) {\n e.preventDefault();\n }\n }", "function firstTab() {\n\n // Deselect current tab and correspondent tabpanel.\n deselectTab(currentEnabledTabs[currentTabIndex]);\n deselectTabpanel(document.getElementById(currentEnabledTabs[currentTabIndex].getAttribute('aria-controls')));\n\n // Select first tab and correspondent tabpanel.\n selectTab(currentEnabledTabs[0]);\n selectTabpanel(document.getElementById(currentEnabledTabs[0].getAttribute('aria-controls')));\n\n }// End: firstTab().", "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 }", "_loadSingleTabLoader() {\n \n for ( let item of this._mainTabElement ) {\n let singleTabLoader = new SingleTabLoader();\n singleTabLoader.init( item );\n }\n\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 onTab(e){\r\n var isShiftPressed = e.shiftKey;\r\n var activeElement = $(':focus');\r\n var activeSection = $(SECTION_ACTIVE_SEL);\r\n var activeSlide = activeSection.find(SLIDE_ACTIVE_SEL);\r\n var focusableWrapper = activeSlide.length ? activeSlide : activeSection;\r\n var focusableElements = focusableWrapper.find(focusableElementsString);\r\n\r\n function preventAndFocusFirst(e){\r\n e.preventDefault();\r\n return focusableElements.first().focus();\r\n }\r\n\r\n //is there an element with focus?\r\n if(activeElement.length){\r\n if(!activeElement.closest(SECTION_ACTIVE_SEL, SLIDE_ACTIVE_SEL).length){\r\n activeElement = preventAndFocusFirst(e);\r\n }\r\n }\r\n\r\n //no element if focused? Let's focus the first one of the section/slide\r\n else{\r\n preventAndFocusFirst(e);\r\n }\r\n\r\n //when reached the first or last focusable element of the section/slide\r\n //we prevent the tab action to keep it in the last focusable element\r\n if(!isShiftPressed && activeElement.is(focusableElements.last()) ||\r\n isShiftPressed && activeElement.is(focusableElements.first())\r\n ){\r\n e.preventDefault();\r\n }\r\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}", "_insertIntoNewGroup(details) {\n const that = this,\n tab = details.tab,\n tabLabelContainer = details.tabLabelContainer,\n group = details.group,\n groupContainers = that._addGroupContainer(group),\n groupLabel = groupContainers.label,\n groupDropDown = groupContainers.dropDown;\n\n groupDropDown.appendChild(tabLabelContainer);\n\n that._groups.push(group);\n\n let index = Math.max(0, Math.min(details.index, that.$.tabStrip.childElementCount)),\n tabStripIndex = index;\n\n if (that._addNewTab && tabStripIndex === that.$.tabStrip.childElementCount) {\n tabStripIndex--;\n }\n\n that.$.tabStrip.insertBefore(groupLabel, that.$.tabStrip.children[tabStripIndex] || null);\n\n that._groupLabels.push(groupLabel);\n\n const newJqxTabItemsGroup = document.createElement('jqx-tab-items-group');\n\n newJqxTabItemsGroup.appendChild(tab);\n that.$.tabContentSection.insertBefore(newJqxTabItemsGroup, that.$.tabContentSection.children[index]);\n newJqxTabItemsGroup.label = group;\n\n const previousSibling = newJqxTabItemsGroup.previousElementSibling;\n let overallIndex = 0;\n\n if (previousSibling) {\n if (previousSibling instanceof JQX.TabItem) {\n overallIndex = previousSibling.index + 1;\n }\n else if (previousSibling) {\n overallIndex = previousSibling.lastElementChild.index + 1;\n }\n }\n\n that._tabLabelContainers.splice(overallIndex, 0, tabLabelContainer);\n that.$.dropDownButtonDropDown.insertBefore(details.dropDownLabelContainer, that.$.dropDownButtonDropDown.children[overallIndex] || null);\n that._tabs.splice(overallIndex, 0, tab);\n\n index = overallIndex;\n\n tab.group = group;\n\n that._updateIndexes(index);\n }", "function on_tab_removed(id) { delete host_tab_ids[id]; }", "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 handleDeleteEvent(){\n\tvar tabIds = getSelectedTabs();\n\t\t\t//remove tab checkboxes from front end\n\t \t\t//removeTabs(tabIds);\n\t \t\t//remove actual tabs \n\t \t\tgDelBtn = $('#'+gDelBtnId).button('loading')\n\n\t \t\tchrome.runtime.getBackgroundPage(function(eventPage) {\n\t \t\t\teventPage.deleteTabs(tabIds);\n\t \t\t});\n\t\t\t// showTabListing();\n}", "function mkdfOnWindowLoad() {\n\n }", "function tabActivate( prmCanvasLoc, prmtabHdrLoc, prmtabCntLoc ) \n{\n var i, nChildCount;\n var strChildId;\n var oChild;\n\n //--- get the number of children in canvas\n nChildCount = prmCanvasLoc.children.length;\n \n //--- loop thru the child objects to manage CONTENT-TABS\n for( i = 0; i < nChildCount; i++ ) \n {\n //--- retrive child object and id\n oChild = prmCanvasLoc.children(i);\n strChildId = oChild.id;\n \n //--- process only if object is content tab\n if( strChildId.substr(0,6) == \"tabCnt\" ) \n { \n if( oChild.id==prmtabCntLoc.id )\n {\n oChild.style.visibility= 'inherit';\n oChild.style.zIndex= 2;\n }\n else \n oChild.style.visibility= 'hidden';\n }\n }\n \n //--- loop thru the child objects to manage HEADER-TABS\n for( i = 0; i < nChildCount; i++ ) \n {\n //--- retrive child object and id\n oChild = prmCanvasLoc.children(i); strChildId = oChild.id\n\n //--- process only if object is header tab\n if( strChildId.substr(0,6) == \"tabHdr\" ) \n { \n if(oChild.id==prmtabHdrLoc.id) \n {\n oChild.style.top=\"4px\"; oChild.style.width= \"108px\";\n oChild.style.borderBottomColor= \"buttonface\";\n oChild.style.borderBottomStyle= \"solid\";\n oChild.style.borderBottomWidth= \"1px\";\n oChild.style.cursor= 'default';\n oChild.style.zIndex= 4;\n }\n else \n {\n oChild.style.top=\"8px\"; oChild.style.width= \"100px\";\n oChild.style.cursor= 'hand';\n oChild.style.zIndex= -1;\n }\n }\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 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 }", "async function bookmarkHandler(id,nodeorchange){\n\n let node = null\n\n try {\n node = await chrome.bookmarks.get(String(id))\n }\n catch(error) {\n // temp bookmark doesn't exist anymore\n return;\n }\n\n\n node = node[0]\n console.log(id,node);\n\n // Move the bookmark if it's in one of the base folders (bookmark bar, other bookmarks, root)\n if(node.parentId <=2 ) {\n let tabs = await chrome.tabs.query({active: true, currentWindow: true})\n\n if(tabs && tabs[0] && tabs[0].status == \"complete\") {\n let tab = tabs[0];\n\n // Only if current active tab was bookmarked or moved and is in a tabGroup ...\n if(tab.url == node.url && tab.groupId != -1) {\n groupid = tab.groupId;\n\n // ... bookmark/move active Tab by Group\n bookmarkByGroup(tab,String(id));\n }\n }\n\n }\n // move the tab if necessary\n else {\n let tabs = await chrome.tabs.query({url: node.url }) //, currentWindow: true})\n\n if(tabs && tabs[0] && tabs[0].status == \"complete\") {\n let tab = tabs[0];\n\n let folder = await chrome.bookmarks.get(String(node.parentId));\n folder = folder[0]\n let tgroup = false\n \n if(tab.groupId != -1) tgroup = await chrome.tabGroups.get(tab.groupId)\n\n // check if tab is already in correct group\n if(tab.groupId == -1 || tgroup.title != folder.title ) {\n\n console.log('move',tab,tgroup.title,folder.title);\n addToGroup(folder.title,tab.id)\n\n }\n\n }\n\n }\n\n}", "function xTabPanelGroup(id, w, h, th, clsTP, clsTG, clsTD, clsTS) // object prototype\r\n{\r\n // Private Methods\r\n\r\n function onClick() //r7\r\n {\r\n paint(this);\r\n return false;\r\n }\r\n function onFocus() //r7\r\n {\r\n paint(this);\r\n }\r\n function paint(tab)\r\n {\r\n tab.className = clsTS;\r\n xZIndex(tab, highZ++);\r\n xDisplay(panels[tab.xTabIndex], 'block'); //r6\r\n if (selectedIndex != tab.xTabIndex) {\r\n xDisplay(panels[selectedIndex], 'none'); //r6\r\n tabs[selectedIndex].className = clsTD;\r\n selectedIndex = tab.xTabIndex;\r\n }\r\n }\r\n\r\n // Private Properties\r\n\r\n var panelGrp, tabGrp, panels, tabs, highZ, selectedIndex;\r\n \r\n // Public Methods\r\n\r\n this.select = function(n) //r7\r\n {\r\n if (n && n <= tabs.length) {\r\n var t = tabs[n-1];\r\n if (t.focus) t.focus();\r\n else t.onclick();\r\n }\r\n };\r\n this.onUnload = function()\r\n {\r\n if (!window.opera) for (var i = 0; i < tabs.length; ++i) {tabs[i].onfocus = tabs[i].onclick = null;}\r\n };\r\n this.onResize = function(newW, newH) //r9\r\n {\r\n var x = 0, i;\r\n // [r9\r\n if (newW) {\r\n w = newW;\r\n xWidth(panelGrp, w);\r\n }\r\n else w = xWidth(panelGrp);\r\n if (newH) {\r\n h = newH;\r\n xHeight(panelGrp, h);\r\n }\r\n else h = xHeight(panelGrp);\r\n // r9]\r\n xResizeTo(tabGrp[0], w, th);\r\n xMoveTo(tabGrp[0], 0, 0);\r\n w -= 2; // remove border widths\r\n var tw = w / tabs.length;\r\n for (i = 0; i < tabs.length; ++i) {\r\n xResizeTo(tabs[i], tw, th); \r\n xMoveTo(tabs[i], x, 0);\r\n x += tw;\r\n tabs[i].xTabIndex = i;\r\n tabs[i].onclick = onClick;\r\n tabs[i].onfocus = onFocus; //r7\r\n xDisplay(panels[i], 'none'); //r6\r\n xResizeTo(panels[i], w, h - th - 2); // -2 removes border widths\r\n xMoveTo(panels[i], 0, th);\r\n }\r\n highZ = i;\r\n tabs[selectedIndex].onclick(); //r9\r\n };\r\n\r\n // Constructor Code\r\n\r\n panelGrp = xGetElementById(id);\r\n if (!panelGrp) { return null; }\r\n panels = xGetElementsByClassName(clsTP, panelGrp);\r\n tabs = xGetElementsByClassName(clsTD, panelGrp);\r\n tabGrp = xGetElementsByClassName(clsTG, panelGrp);\r\n if (!panels || !tabs || !tabGrp || panels.length != tabs.length || tabGrp.length != 1) { return null; }\r\n selectedIndex = 0;\r\n this.onResize(w, h); //r9\r\n}", "function addTabEventListeners(fid) {\n\n // When the tab close icon is clicked\n $('#tab-' + fid + ' i').click(function() {\n closeFile(fid);\n resizeTabs();\n });\n\n // When the tab itself is clicked\n $('#tab-' + fid).click(function() {\n resizeTabs();\n tabActive(fid);\n });\n}", "function tabdisable(tabname, disablestatus) {\n var tab = Xrm.Page.ui.tabs.get(tabname);\n if (tab == null) alert(\"Error: The tab: \" + tabname + \" is not on the form\");\n else {\n var tabsections = tab.sections.get();\n for (var i in tabsections) {\n var secname = tabsections[i].getName();\n sectiondisable(secname, disablestatus);\n }\n }\n} // tabdisable", "get _tab( )\n\t{\n\t\tif (!this._valid) return(null);\n\n\t\tif (!(\"tab\" in this._ctx))\n\t\t{\n\t\t\tthis._ctx.tab = null;\n\n\t\t\tfor (var i = 0; i < gBrowser.mTabs.length; ++i)\n\t\t\t{\n\t\t\t\tif (gBrowser.mTabs[i].linkedBrowser == this._ctx.browser)\n\t\t\t\t{\n\t\t\t\t\tthis._ctx.tab = gBrowser.mTabs[i];\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn(this._ctx.tab);\n\t}", "function onTabRemoved (tabId) {\n if (tabStore[tabId]) {\n deregister(tabId);\n }\n}", "function moveTab(sourceGroupID, tabID, destGroupID){\n var destGroup, sourceGroup, tab;\n sourceGroup = groups[sourceGroupID];\n destGroup = groups[destGroupID];\n tab = sourceGroup.tabs[tabID];\n if(sourceGroupID===activeGroup){\n chrome.tabs.remove(tab.id);\n }\n console.log(tab);\n destGroup.tabs.push(tab);\n sourceGroup.tabs.splice(tabID,1);\n storeGroups();\n if(destGroupID===activeGroup){\n chrome.tabs.create({url:tab.url,selected:false});\n }\n}", "disableTab() {\n this.setTabIndex(\"-1\");\n this.rating.disableTab();\n }", "function setMarkVisible(c_index, show) {\n var page = ($('#page-' + c_index)[0]).innerHTML;\n\n var title = $('#title-' + c_index);\n // var cancel_button = $('#title-cancel-' + c_index);\n var current_summary = $('#summary-' + c_index);\n // Deprecated, saving for reference\n if (show) {\n // if the component has a page saved, open the PDF to that page\n // opening directories/frames based off of code in openDiv and openFrame functions\n\n // make sure submissions folder has files\n var submissions = $('#div_viewer_1');\n if (page > 0 && submissions.children().length > 0) {\n\n // find the first file that is a PDF\n var divs = $('#div_viewer_1 > div > div');\n var pdf_div = \"\";\n for (var i=0; i<divs.length; i++) {\n if ($(divs[i]).is('[data-file_url]')) {\n file_url = $(divs[i]).attr(\"data-file_url\");\n if(file_url.substring(file_url.length - 3) == \"pdf\") {\n pdf_div = $($(divs[i]));\n break;\n }\n }\n }\n\n // only open submissions folder + PDF is a PDF file exists within the submissions folder\n if (pdf_div != \"\") {\n submissions.show();\n submissions.addClass('open');\n $($($(submissions.parent().children()[0]).children()[0]).children()[0]).removeClass('fa-folder').addClass('fa-folder-open');\n\n var file_url = pdf_div.attr(\"data-file_url\");\n var file_name = pdf_div.attr(\"data-file_name\");\n if (!pdf_div.hasClass('open')) {\n openFrame(file_name,file_url,pdf_div.attr(\"id\").substring(pdf_div.attr(\"id\").lastIndexOf(\"_\")+1));\n }\n var iframeId = pdf_div.attr(\"id\") + \"_iframe\";\n var directory = \"submissions\";\n var src = $(\"#\"+iframeId).prop('src');\n if (src.indexOf(\"#page=\") === -1) {\n src = src + \"#page=\" + page;\n }\n else {\n src = src.slice(0,src.indexOf(\"#page=\")) + \"#page=\" + page;\n }\n pdf_div.html(\"<iframe id='\" + iframeId + \"' src='\" + src + \"' width='95%' height='1200px' style='border: 0'></iframe>\");\n\n if (!pdf_div.hasClass('open')) {\n pdf_div.addClass('open');\n }\n if (!pdf_div.hasClass('shown')) {\n pdf_div.show();\n pdf_div.addClass('shown');\n }\n }\n }\n }\n\n // Updated all the background colors and displays of each element that has\n // the corresponding data tag\n // $(\"[id$='-\"+c_index+\"'][data-changebg='true']\") .css(\"background-color\", (show ? \"#e6e6e6\" : \"initial\"));\n $(\"[id$='-\"+c_index+\"'][data-changedisplay1='true']\").css(\"display\", (show ? \"\" : \"none\"));\n $(\"[id$='-\"+c_index+\"'][data-changedisplay2='true']\").css(\"display\", (show ? \"none\" : \"\"));\n\n title.attr('colspan', (show ? 3 : 4));\n // cancel_button.attr('colspan', (show ? 1 : 0));\n}" ]
[ "0.60052884", "0.5792593", "0.57242966", "0.56535596", "0.5599043", "0.55933475", "0.557134", "0.557134", "0.557134", "0.5533603", "0.55155206", "0.54987967", "0.54798806", "0.5465833", "0.54649013", "0.54603064", "0.54462886", "0.5443687", "0.5432642", "0.54309964", "0.5422232", "0.54156464", "0.5402241", "0.5399403", "0.5398966", "0.53984016", "0.53970397", "0.53715914", "0.53696287", "0.5357412", "0.5346984", "0.5340157", "0.53323424", "0.53287756", "0.5316333", "0.5297518", "0.5288319", "0.52880305", "0.5285986", "0.52835894", "0.52755517", "0.52629495", "0.52629495", "0.52629495", "0.5259504", "0.5258429", "0.5258058", "0.52364904", "0.5236477", "0.52298725", "0.52292264", "0.5218972", "0.52153033", "0.5210337", "0.5194825", "0.5190044", "0.5187479", "0.5179746", "0.5177767", "0.5171116", "0.5163207", "0.51544696", "0.51295084", "0.512776", "0.51247334", "0.51181537", "0.511503", "0.5112135", "0.5108962", "0.5107832", "0.51064014", "0.51032424", "0.51022243", "0.5101487", "0.5093079", "0.509261", "0.50879604", "0.5083943", "0.5083181", "0.5081479", "0.5080988", "0.50800323", "0.50733405", "0.5070076", "0.5065529", "0.50645894", "0.50630844", "0.5053928", "0.5048171", "0.5047428", "0.50466776", "0.50461656", "0.50416946", "0.50202245", "0.5014895", "0.50140804", "0.5011266", "0.5010965", "0.50100994", "0.50084144" ]
0.5016745
94
'raised': default styling give button a slightly better look We're going to pass down a prop from the Welcome screen, this callback should be called whenever user presses. 'this.props.onComplete' not any parentheses. This is supposed to be a function right here. We only want to call this at some point in the future (call callback funtion in 'welcome' screen) If we add () that means the callback will be called the instant that the button is rendered which is of course not what we want.
renderLastSlide(index) { if (index === this.props.data.length - 1) { return ( <View style={{ marginTop: 15 }}> <Button title="Onwards!" raised buttonStyle={styles.buttonStyle} onPress={this.props.onComplete} /> </View> ) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleOnClick () {\n this.props.callback()\n }", "renderThank()\n {\n \treturn (\n \t\t<div>\n \t\t<h3 style={{color:myMuiTheme.palette.primary1Color}}>Thanks for filling out our survey! Click the button below to proceed to our main website. </h3><br/>\n <RaisedButton label=\"Main Page\" secondary={true} labelColor={myMuiTheme.palette.labelColor} \n onClick={this.handleOnClick}\n />\n </div>\n \t\t)\n }", "onFinish() {\n\t\tif (this.props.onFinish) {\n\t\t\tthis.props.onFinish();\n\t\t}\n\t}", "renderButton(color) {\n return (\n <button className={`ui button ${color}`}>\n <LanguageContext.Consumer>\n {({ language }) => this.renderSubmit(language)}\n </LanguageContext.Consumer>\n </button>\n );\n }", "renderButton() {\n //if loading is true, then return the Spinner component\n //otherwise, return the button\n if (this.state.loading) {\n return <Spinner size=\"small\" />;\n }\n //use bind when passing a function off that is going to be invoked\n //sometime in the futre and we don't know the context that it will be called with\n //we have to bind the context to (this)\n return (\n <Button onPress={this.onButtonPress.bind(this)}>\n LOG IN\n </Button>\n );\n }", "showContinueButton() {\n return(\n <TouchableOpacity style = { styles.nextButton } onPressOut = { this.showConfirmation.bind(this) } >\n <Text style = { styles.nextButtonText }>CONTINUE</Text>\n </TouchableOpacity>\n );\n }", "render() {\n const isFirstTime = this.state.isFirstTimeDisplaying\n const snapped = this.state.userGotSnapped\n const num_clicks = this.state.num_thanosClicks\n\n // we need to create an empty variable that will store the Button object\n // after we decide what to display on it\n let b \n\n // if this is the first time loading, we provide the welcome message of\n // the default this.state.thanosText\n if (isFirstTime) {\n b = <Button variant = \"primary\" onClick = {this.handleThanosClick}>\n {this.state.thanosText}\n </Button>\n }\n else {\n // if the user just got snapped, we tell them how many clicks they lasted\n // based on the amount of clicks, we'll display a different message\n if (snapped) {\n // i'm a stickler for grammar, so if they only survived 1 click, it's important\n // for me to display \"1 click\"\n if (num_clicks == 1) {\n b = <Button variant = \"outline-danger\" onClick = {this.handleThanosClick}>\n {this.state.thanosText}\n <br/>\n You got snapped after {this.state.num_thanosClicks} click.\n <br/>\n This does... put a smile on my face.\n </Button>\n }\n // if they got snapped after 0 or 2-5 clicks, they're an amateur\n else if (num_clicks < 6) {\n b = <Button variant = \"outline-danger\" onClick = {this.handleThanosClick}>\n {this.state.thanosText}\n <br/>\n You got snapped after {this.state.num_thanosClicks} clicks.\n <br/>\n This does... put a smile on my face.\n </Button>\n }\n // but if they survive more than 5 clicks, they must be something special\n else {\n b = <Button variant = \"outline-danger\" onClick = {this.handleThanosClick}>\n {this.state.thanosText}\n <br/>\n You finally got snapped after {this.state.num_thanosClicks} clicks.\n <br/>\n I am inevitable.\n </Button>\n }\n }\n // and if the user's last click was NOT a snap, they can keep proceeding\n // like usual\n else {\n // i'm a stickler for grammar, like i said\n if (num_clicks == 1) {\n b = <Button variant = \"outline-success\" onClick = {this.handleThanosClick}>\n {this.state.thanosText}\n <br/>\n {this.state.num_thanosClicks} click survived\n </Button>\n }\n else {\n b = <Button variant = \"outline-success\" onClick = {this.handleThanosClick}>\n {this.state.thanosText}\n <br/>\n {this.state.num_thanosClicks} clicks survived\n </Button>\n }\n }\n }\n\n // we've already handled the logic for displaying different things on the button,\n // so all we have left to do is display the button itself, conatined in variable b\n return (\n <div className = \"thanosButton\">\n {b}\n </div>\n );\n }", "renderButtons() {\n const { onCancel } = this.props;\n\n return (\n <div>\n <button\n className=\"black darken-3 white-text btn-flat\"\n onClick={onCancel}\n >\n Back\n </button>\n <button className=\"green btn-flat right white-text\">\n Save Blog\n <i className=\"material-icons right\">email</i>\n </button>\n </div>\n );\n }", "renderSignupBtn() {\n if (this.state.loading) {\n return <Spinner size=\"large\" />;\n }\n return (\n <CustomButton onPress={() => this.onButtonPress(this)}>\n Register\n </CustomButton>\n\n );\n11\n}", "renderButton() {\n if (this.state.success) {\n return (\n <TouchableHighlight\n disabled\n style={[styles.button, { backgroundColor: '#24e07c' }]}\n underlayColor=\"#24e07c\"\n >\n <Text>Success!</Text>\n </TouchableHighlight>\n );\n } else if (!this.state.loading) {\n return (\n <TouchableHighlight\n disabled={this.state.loading}\n style={styles.button}\n underlayColor=\"#4d98d6\"\n onPress={this.onPress}\n >\n <Text>Press Me!</Text>\n </TouchableHighlight>\n );\n }\n return (\n <TouchableHighlight\n disabled={this.state.loading}\n style={styles.button}\n underlayColor=\"#4d98d6\"\n onPress={this.onPress}\n >\n <View\n style={{\n flexDirection: 'row',\n justifyContent: 'center',\n alignItems: 'center'\n }}\n >\n <ActivityIndicator />\n <Text style={{ paddingLeft: 10 }}>Loading...</Text>\n </View>\n </TouchableHighlight>\n );\n }", "function StartButton(props) {\n const { handleClick } = props;\n const fg = '#fff';\n const bg = '#0c0';\n // TODO: Should we use onClick, or the 2 events below?\n return(\n <button\n onClick={handleClick}\n className=\"btn pressable\">\n START\n </button>\n );\n}", "render() {\n\t\tvar labelText = undefined\n\t\t// optional props, and a default value if no props found \n\t\tif (this.props.greet) {\n\t\t\tlabelText = this.props.greet\n\t\t} else {\n\t\t\tlabelText = 'OK'\n\t\t}\n\t\treturn (\n\t\t\t\t<div><button>{labelText}</button></div>\n\t\t);\n\t}", "render() {\n const { message } = this.props\n\n if (!message.length) {\n return null\n }\n\n return (\n <FlatButton label={message} secondary />\n )\n }", "handleLoading() {\n if (this.props.loading) {\n return <LoadingButton />\n }\n return (\n <PrimaryButton\n title='PUBLISH'\n onPress={this.verifyForm}\n />\n );\n }", "render () {\n return (\n <div>\n <button onClick={this.message}> click</button> \n </div>\n //{this.message} is called on click of the button, which causes\n ); //the alert to appear on screen\n }", "renderButton(colour) {\n\t\treturn (\n\t\t\t<button className={`ui button ${colour}`}>\n\t\t\t\t<LanguageContext.Consumer>\n\t\t\t\t\t{value => (value === \"english\" ? \"Submit\" : \"Enviar\")}\n\t\t\t\t</LanguageContext.Consumer>\n\t\t\t</button>\n\t\t);\n\t}", "render() {\n return (\n <button style={{background: this.context.color}}>\n {this.props.children}\n </button>\n );\n }", "renderButton () {\n if (this.props.loading) {\n return <Spinner size='large' />\n }\n return (\n <Button\n icon={\n <Icon\n name='account-plus'\n type='material-community'\n size={20}\n color='white'\n />\n }\n title='Register'\n titleStyle={{ fontFamily: 'GeosansLight' }}\n buttonStyle={{\n backgroundColor: '#D1AF46',\n width: 250,\n height: 40,\n marginLeft: 45,\n borderColor: 'transparent',\n borderWidth: 0,\n borderRadius: 5\n\n }}\n onPress={this.onButtonPress.bind(this)}\n />\n )\n }", "render() {\n const { children, className = '', ...rest } = this.props\n\n return (\n <button className={`button bg-transparent relative bg-transparent z-1 white ba b--white db pointer center fw4 f5 f4-l pa3 pl4 pr4 ${className}`} {...rest}>{children}</button>\n )\n }", "render() {\n return ( \n <button className={this.props.buttonType}>{this.props.buttonText}</button>\n );\n }", "handleButton() {}", "_handleClick (e) {\n // invoke onResolving before action, the action can be canceled if onResolving return false\n if (!this.state.disabled && this.props.onResolving() !== false) {\n // set disable if set only to true\n this._setDisableWhenOnly(true)\n // add class\n this.setState({ className: cNames(this.state.className, 'loading') })\n\n // declare\n const action = this.props.action,\n rmLoadingClass = () => {\n this.setState({ className: cNames(this.state.className, { 'loading': false }) })\n },\n setDisable = curry(this._setDisableWhenOnly, this, false),\n onFinish = () => { setTimeout(() => { const func = this.props.onFinish || noop; func() }, 0) },\n onResolved = once(this.props.onResolved, rmLoadingClass, setDisable, onFinish),\n onError = once(this.props.onError, rmLoadingClass, setDisable, onFinish),\n callback = (err, ...args) => {\n if (err) onError.call(null, err)\n else {\n onResolved.apply(null, args)\n }\n }\n\n if (action.length > 1) { // callback as second parameter\n action.call(null, e, callback)\n }\n else {\n if (type(action.then) === 'function') { // action is promise\n action.then.call(action, onResolved, onError)\n }\n else { // it is a sync action\n const ret = action.call(null, e)\n if (ret && type(ret.then) === 'function') ret.then.call(ret, onResolved, onError)\n else onResolved.call(null, ret)\n }\n }\n }\n }", "renderPopularThemes() {\n return (\n popularThemes.map((theme) => {\n const name = theme.name;\n const props = this.props;\n\n return <Button key={name}\n callback={() => props.uiStyleChange(\n theme.background,\n theme.buttonBackground,\n theme.buttonColor,\n theme.color\n )}\n content={name} />\n })\n )\n }", "blueClick() {\n\t\tthis._actions.onNext('blue');\n\t}", "render () {\n return (\n <View style={styles.container}>\n <ScoreDisplay successRatio={this.props.navigation.state.params.successRatio} />\n <View style={styles.buttonContainer}>\n <Button onPress={this.onReplayClick}>\n <MaterialCommunityIcons name=\"replay\" size={50} />\n </Button>\n <Button onPress={this.onBackClick} style={{ backgroundColor: red }}>\n <MaterialCommunityIcons name=\"exit-to-app\" size={50} />\n </Button>\n </View>\n </View>\n );\n }", "buttonHandler(){\n\t\tvar items = this.props.hey.questions.present;\n\t\tlet conditions = this.props.hey.conditions.present;\n\t\tlet counter = this.props.hey.counter.present;\n\t\tconst action = this.props.action;\n\t\tconst increment = this.props.increment;\n\t\tconst hide = this.props.hideState;\n\t\tsendButtonHandler(items,conditions,counter,action,increment,hide);\n\t}", "render() { \n\n console.log('Counter Component Rendered');\n return ( \n <div className=\"counter\">\n <span className={this.getbadgeClass()+' value'}>{this.formatCount()}</span>\n <button className=\"btn btn-primary btn-lg\" onClick={()=>this.props.onIncrement(this.props.counter)}>Increment</button>\n <button className=\"btn btn-danger btn-sm m-2\" onClick={()=>this.props.onDelete(this.props.counter.id)}>Delete</button> {/* Idea:function was passed as prop*/}\n </div> \n );\n }", "function Example() {\n const clickedAction = () => {\n alert(\"Action Clicked !\");\n }\n return (\n <div>\n\n <IMCardHeaderAction icon=\"MoreVert\" onClick={clickedAction} />\n <p>With Custom Background and Color</p>\n <IMCardHeaderAction icon=\"MoreVert\" onClick={clickedAction} bgColor=\"green\" color=\"white\" />\n \n\n </div>\n );\n}", "function cb( )\n{ var button = document.createElement( \"div\" );\n\tbutton.id = \"button\";\n\tbutton.className = \"button blue_background hidden\";\n\tbutton.innerHTML = \"Begin\";\n\tdocument.body.appendChild( button );\n\t\n}", "function onCompletedClick() {\n console.log(\"Clicked!\");\n console.log('Hello');\n}", "componentDidMount() {\n actions.get(this.props.visible)(\n this.props.title,\n this.props.message,\n this.props.buttons,\n );\n }", "render() {\n // With Provider\n // const text = this.context === \"english\" ? \"Submit\" : \"Voorleggen\";\n \n return(\n // With Provider\n // <button className=\"ui button primary\">{text}</button>\n\n // With Consumer\n <ColorContext.Consumer>\n {(color) =>\n <button className={`ui button ${color}`}>\n <LanguageContext.Consumer>\n {(value) => value === \"english\" ? \"Submit\" : \"Voorleggen\"}\n </LanguageContext.Consumer>\n </button>\n }\n </ColorContext.Consumer>\n \n )\n }", "sendDataToParent() {\n this.setState({\n color: \"red\"\n })\n this.props.callback(this.state.minutes, this.state.seconds)\n }", "connectedCallback() {\n // Trigger show event\n this.dispatchCustomEvent('tk.alert.show');\n this.setAttribute('role', 'alert');\n this.classList.add('tk-alert--show');\n\n // If no type has been defined, the default as \"info\"\n if (!this.type) {\n this.setAttribute('type', 'info');\n }\n\n // Append button\n if (this.hasAttribute('dismiss') || this.hasAttribute('acknowledge') || (this.hasAttribute('href') && this.getAttribute('href') !== '')) {\n if (!this.querySelector('button.tk-alert--close') && !this.querySelector('button.tk-alert-button--close')) {\n this.appendCloseButton.bind(this)();\n }\n }\n\n // Trigger shown event\n this.dispatchCustomEvent('tk.alert.show');\n\n if (this.closeButton) {\n this.closeButton.focus();\n }\n }", "renderHelpfulButton() {\n const { markedHelpful } = this.state;\n let helpfulButton = <span className=\"link\" role=\"button\" onClick={this.markHelpful}>Yes</span>;\n if (markedHelpful) {\n helpfulButton = <span>Yes</span>;\n }\n return helpfulButton;\n }", "toggleSignup() {\n if (this.state.loading) {\n return <Loader size='small' />;\n }\n else if (this.state.userCheck) {\n return (\n <Card>\n <CardSection>\n <Button onPress={this.initScreen.bind(this)}>\n Back\n </Button>\n </CardSection>\n </Card>\n );\n }\n return (\n <Card>\n <CardSection>\n <Button onPress={this.userCreate.bind(this)}>\n Create User\n </Button>\n </CardSection>\n <CardSection>\n <Text style={styles.textStyle} onPress={this.passwordReset.bind(this)}>\n Forgot Password?\n </Text>\n </CardSection>\n </Card>\n );\n }", "componentWillReceiveProps(props) {\n actions.get(props.visible)(\n props.title,\n props.message,\n props.buttons,\n );\n }", "render () {\n return (\n <SmallButton\n {...this.props}\n textStyle={Object.assign({}, styles.buttonText, this.props.textStyle)}\n style={[styles.button, this.props.style]} />\n )\n }", "function onHamburgerClick() {\n this.props.onHamburgerClick && this.props.onHamburgerClick();\n }", "function FbDoneBtn(props) {\n \n return(\n <button \n {...props}\n className='restart' \n type=\"submit\">Restart{props.children}\n </button>\n ); \n}", "handleHome(e){\n this.props.callback({\n page: pages.main,\n user: this.props.user\n });\n }", "renderButton(value) {\n return (\n <button className={`ui button ${value}`}>\n <LanguageContext.Consumer>\n {({ language }) => this.renderSubmit(language)}\n </LanguageContext.Consumer>\n </button>\n )\n }", "renderButton () {\n this.btnWatchAd = new IconButton({\n game: this.game,\n x: 0,\n y: this.mainFrame.height / masterScale(2),\n scale: 1.3,\n key: 'start-screen-bottom',\n callback: () => this.playAd(),\n callbackContext: this,\n outFrame: 'button_empty.png',\n overFrame: 'button_empty.png',\n downFrame: 'button_empty.png',\n upFrame: 'button_empty.png'\n });\n\n this.btnWatchAd.input.priorityID = 16; // mid priority\n\n this.btnWatchAd.anchor.set(0.5);\n\n this.txtStyle.fontSize = 48;\n const txtWatchAd = this.game.add.text(5, 0, 'Watch Ad', this.txtStyle);\n txtWatchAd.anchor.set(0.5);\n\n this.btnWatchAd.addChild(txtWatchAd);\n\n this.mainFrame.addChild(this.btnWatchAd);\n }", "render() {\n const { expert={}, status='' } = this.props.expert\n const approved = status === 'approved'\n const button = (\n <Button onClick={this.changeStatus} color={approved ? 'danger' : 'success' } size=\"sm\">\n {approved ? 'Reject' : 'Approve' }\n </Button>\n )\n return (\n <div className=\"d-flex align-items-center\">\n <div>{`${expert.firstname} ${expert.lastname}`}</div>\n <Badge color={approved ? 'success' : 'danger'} className=\"ml-2 mr-auto\">{status}</Badge>\n {this.props.user.data.email && button}\n </div>\n )\n }", "render(){\n return (\n <button onClick={this.handleClick}>Delayed</button>\n )\n }", "onComplete() {// Do nothing, this is defined for flow if extended classes implement this function\n }", "function pressButton(callback) {\n console.log('Button is pressed');\n callback();\n}", "render() {\n return (\n <View style={styles.container}>\n <Text style={styles.welcome}> Let us know your feedback!</Text>\n <Button\n raised\n buttonStyle={{width: deviceWidth, height: 50, }}\n color = \"#FFFFFF\"\n title =\"Send an email feedback\"\n backgroundColor=\"#FFA500\"\n onPress={() => Communications.email(['jtc.saeropark@gmail.com'],null,null,'SAP App Feedback', '#Please leave your name and contact details behind.#')}/>\n <Button\n raised\n buttonStyle={{width: deviceWidth,height: 50, }}\n color = \"#FFFFFF\"\n title =\"General Enquiries\"\n backgroundColor=\"#FFA500\"\n onPress={() => Communications.email(['askjtc@jtc.gov.sg'],null,null,'JTC General Enquiries','#Please leave your name and contact details behind.#')}/>\n \n </View>\n );\n }", "render() {\n const text = this.state.followed ? 'un-follow' : 'follow';\n const label = this.state.followed ? 'Following' : 'Follow'\n return (\n <div className=\"customContainer\">\n <button className=\"btn-primary\" onClick={this.handleClick} >\n {label}</button>\n <p className={styles.followText}>\n Click to {text} this Country (must be logged in to follow)\n </p>\n </div>\n );\n }", "render(){\n return (\n <div>\n \n <button onClick={this.props.onAdd}>Hijo B ({this.props.num})</button>\n </div>\n )\n }", "render() {\n return (\n <Button onClick={this.props.toggle} variant=\"primary\">\n Primary\n </Button>\n );\n }", "render() {\n let buttonClasses = [];\n let colorClass = getButtonClassesByColor(this.props.color, classes);\n let sizeClass = getClassesBySize(this.props.size, classes);\n buttonClasses.push(classes.Button, colorClass,sizeClass);\n\n return (\n <div className={buttonClasses.join(\" \")}>\n <button onClick={this.props.clicked} className={classes.Btn}>{this.props.title}</button>\n </div>\n );\n }", "render(){\n return (\n <div> \n <button onClick={this.props.onAdd}>Hijo A ({this.props.num})</button>\n </div>\n )\n }", "render() {\n return (\n <Card>\n <CardSection style={styles.CardSectionStyle} >\n <Text style={styles.TextStyle}>\n What do you want to watch ?\n </Text>\n </CardSection>\n\n <CardSection>\n <Button block\n style={styles.ButtonStyle}\n textStyle={{ color: 'white' }}\n onPress={() => Actions.favouritesList()}>\n <Icon name=\"star\" style={{ color: 'white' }} />\n <Text>MY FAVOURITES</Text>\n </Button>\n </CardSection>\n\n <CardSection>\n <Button block\n style={styles.ButtonStyle}\n textStyle={{ color: 'white' }}\n onPress={() => this.setState({ showModal: true })}>\n <Icon name=\"log-out\" style={{ color: 'white' }} />\n <Text>LOGOUT</Text>\n </Button>\n </CardSection>\n\n <Confirm\n visible={this.state.showModal}\n onAccept={this.onAccept.bind(this)}\n onDecline={() => this.setState({ showModal: false })}>\n Are you sure you want to Log Out??\n </Confirm>\n\n </Card>\n );\n }", "function myCallback(event) {\n console.log(\"The button was clicked\", event);\n}", "render() {\n return (\n <div className={this.props.modal ? 'Dialog DialogModal' : 'Dialog'}>\n <div className={this.props.modal ? 'DialogModalWrap' : null}>\n <div className=\"DialogHeader\">{this.props.header}</div>\n <div className=\"DialogBody\">{this.props.children}</div>\n <div className=\"DialogFooter\">\n {this.props.hasCancel ? <span className=\"DialogDismiss\" onClick={this.props.onAction.bind(this, 'dismiss')}>Cancel</span> : null }\n <Button onClick={this.props.onAction.bind(this, this.props.hasCancel ? 'confirm' : 'dismiss')}>\n {this.props.confirmLabel}\n </Button>\n </div>\n </div>\n </div>\n );\n }", "render() {\n const { attributes, defaultFrom } = this.props.task\n return (\n <IconButton\n icon={<Call />}\n className={callbutton}\n onClick={(e) => {\n this.props.flex.Actions.invokeAction('StartOutboundCall', {\n destination: defaultFrom,\n taskAttributes: { ...attributes }\n })\n }}\n />\n )\n }", "render() {\n return (\n <Card id=\"mainCard\" elevation={3}>\n <h2>Ready to leave some feedback?</h2>\n <Button size=\"large\" variant=\"contained\" color=\"primary\" onClick={this.startFeedback}>Yeah! Let's do this!</Button>\n </Card>\n )\n }", "onPressCell(){\n if(this.props.callback != null &&\n typeof this.props.callback === 'function'){\n this.props.callback();\n }\n }", "onPress(){\n if(this.props.onPress !== undefined) {\n this.props.onPress();\n }\n }", "onPress(event) {\n this.props.changeTheme();\n }", "render() {\n return <button onClick={this.onClick}>Emit Something!</button>;\n }", "render() {\n return (\n <button onClick={this.handleClick}>\n {this.props.on ? 'on' : 'off'}\n </button>\n );\n }", "rightButton() {\r\n if (!this.props.uBlocked) {\r\n if (this.props.following) {\r\n return (\r\n <TouchableOpacity\r\n style={styles.following}\r\n onPress={() => { this.unfollow(); }}\r\n >\r\n <Text style={{ color: '#fff', fontWeight: 'bold', fontSize: 15 }}>\r\n Following\r\n </Text>\r\n </TouchableOpacity>\r\n );\r\n }\r\n if (this.props.blocked) {\r\n return (\r\n <TouchableOpacity\r\n style={styles.blocked}\r\n onPress={() => { this.unblock(); }}\r\n >\r\n <Text style={{ color: 'red', fontWeight: 'bold', fontSize: 15 }}>\r\n Blocked\r\n </Text>\r\n </TouchableOpacity>\r\n );\r\n }\r\n if (this.props.following === false) {\r\n return (\r\n <TouchableOpacity\r\n style={styles.follow}\r\n onPress={() => { this.follow(); }}\r\n >\r\n <Text style={{ color: '#1DA1F2', fontWeight: 'bold', fontSize: 15 }}>\r\n Follow\r\n </Text>\r\n </TouchableOpacity>\r\n );\r\n }\r\n if (this.props.myProfile) {\r\n return (\r\n <TouchableOpacity\r\n style={styles.EditProfile}\r\n onPress={this.props.EditProfile}\r\n >\r\n <Text style={{ color: '#657786', fontWeight: 'bold' }}>\r\n Edit Profile\r\n </Text>\r\n </TouchableOpacity>\r\n );\r\n }\r\n }\r\n\r\n\r\n return (null);\r\n }", "renderFetchButton() {\n if(this.props.fetching)\n {\n return <Spinner/>\n }\n return (\n <Button\n onPress={ this.onFetchButtonPress.bind(this) }\n buttonStyle={ styles.buttonFetchStyle }\n textStyle={ styles.textStyle }\n >\n Fetch Next IP\n </Button>\n )\n }", "loadingCheck() {\n if (this.state.loading) {\n return <Loader size='small' />;\n }\n else if (this.state.userCheck) {\n return (\n <Button onPress={this.onUserCreate.bind(this)}>\n Create User\n </Button>\n );\n }\n return (\n <Button disabled={!this.state.email} onPress={this.onloginSubmit.bind(this)}>\n Login\n </Button>\n );\n }", "render() {\n return (\n /*\n 2) MAKING AN INTERACTIVE COMPONENT: \n\n Let’s fill the Square component with an “X” when we click it.\n First, change the button tag that is returned from the Square\n component’s render() function:\n */\n <button className=\"square\" onClick={function() {alert('click')}}>\n {this.props.value}\n </button>\n );\n }", "function AppButton(props) {\n return (\n <TouchableOpacity style={styles(props).button} onPress={props.onPress}>\n <Text style={styles(props).text}>{props.title}</Text>\n </TouchableOpacity>\n )\n}", "renderConfirmalButton() {\n const { onArrivalConfirmed, showConfirmationButton } = this.props;\n const { destinationReached } = this.state;\n\n if (!showConfirmationButton || !destinationReached) {\n return null;\n }\n\n return this.renderButton('Confirm Arrival', onArrivalConfirmed);\n }", "render() {\n // log\n AppLogger.info('Button props : ', this.props)\n AppLogger.info('Button DefaultButton : ', DefaultButton)\n const { primary, secondary } = this.props\n\n // return primary button\n if (primary) {\n return <PrimaryButton {...this.props} />\n }\n\n // return secondary button\n if (secondary) {\n return <SecondaryButton {...this.props} />\n }\n\n // return button case type\n // primary, secondary or default\n return <DefaultButton {...this.props} />\n }", "function Button(props) {\n\t var active = props.active,\n\t animated = props.animated,\n\t attached = props.attached,\n\t basic = props.basic,\n\t children = props.children,\n\t circular = props.circular,\n\t className = props.className,\n\t color = props.color,\n\t compact = props.compact,\n\t content = props.content,\n\t disabled = props.disabled,\n\t floated = props.floated,\n\t fluid = props.fluid,\n\t icon = props.icon,\n\t inverted = props.inverted,\n\t label = props.label,\n\t labelPosition = props.labelPosition,\n\t loading = props.loading,\n\t negative = props.negative,\n\t positive = props.positive,\n\t primary = props.primary,\n\t secondary = props.secondary,\n\t size = props.size,\n\t toggle = props.toggle;\n\n\n\t var labeledClasses = (0, _classnames2.default)((0, _lib.useKeyOrValueAndKey)(labelPosition || !!label, 'labeled'));\n\n\t var baseClasses = (0, _classnames2.default)(color, size, (0, _lib.useKeyOnly)(active, 'active'), (0, _lib.useKeyOrValueAndKey)(animated, 'animated'), (0, _lib.useKeyOrValueAndKey)(attached, 'attached'), (0, _lib.useKeyOnly)(basic, 'basic'), (0, _lib.useKeyOnly)(circular, 'circular'), (0, _lib.useKeyOnly)(compact, 'compact'), (0, _lib.useKeyOnly)(disabled, 'disabled'), (0, _lib.useValueAndKey)(floated, 'floated'), (0, _lib.useKeyOnly)(fluid, 'fluid'), (0, _lib.useKeyOnly)(icon === true || icon && (labelPosition || !children && !content), 'icon'), (0, _lib.useKeyOnly)(inverted, 'inverted'), (0, _lib.useKeyOnly)(loading, 'loading'), (0, _lib.useKeyOnly)(negative, 'negative'), (0, _lib.useKeyOnly)(positive, 'positive'), (0, _lib.useKeyOnly)(primary, 'primary'), (0, _lib.useKeyOnly)(secondary, 'secondary'), (0, _lib.useKeyOnly)(toggle, 'toggle'));\n\t var rest = (0, _lib.getUnhandledProps)(Button, props);\n\t var ElementType = (0, _lib.getElementType)(Button, props, function () {\n\t if (label || attached) return 'div';\n\t });\n\t var tabIndex = ElementType === 'div' ? 0 : undefined;\n\n\t if (children) {\n\t var _classes = (0, _classnames2.default)('ui', baseClasses, labeledClasses, 'button', className);\n\t debug('render children:', { classes: _classes });\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: _classes, tabIndex: tabIndex }),\n\t children\n\t );\n\t }\n\n\t if (label) {\n\t var _classes2 = (0, _classnames2.default)('ui', baseClasses, 'button', className);\n\t var containerClasses = (0, _classnames2.default)('ui', labeledClasses, 'button', className);\n\t debug('render label:', { classes: _classes2, containerClasses: containerClasses }, props);\n\t var labelElement = _Label2.default.create(label, {\n\t basic: true,\n\t pointing: labelPosition === 'left' ? 'right' : 'left'\n\t });\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: containerClasses }),\n\t labelPosition === 'left' && labelElement,\n\t _react2.default.createElement(\n\t 'button',\n\t { className: _classes2 },\n\t _Icon2.default.create(icon),\n\t ' ',\n\t content\n\t ),\n\t (labelPosition === 'right' || !labelPosition) && labelElement\n\t );\n\t }\n\n\t if (icon && !label) {\n\t var _classes3 = (0, _classnames2.default)('ui', labeledClasses, baseClasses, 'button', className);\n\t debug('render icon && !label:', { classes: _classes3 });\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: _classes3, tabIndex: tabIndex }),\n\t _Icon2.default.create(icon),\n\t ' ',\n\t content\n\t );\n\t }\n\n\t var classes = (0, _classnames2.default)('ui', labeledClasses, baseClasses, 'button', className);\n\t debug('render default:', { classes: classes });\n\n\t return _react2.default.createElement(\n\t ElementType,\n\t _extends({}, rest, { className: classes, tabIndex: tabIndex }),\n\t content\n\t );\n\t}", "render() {\n\n console.log(\"Render of class MEthod gets called\")\n\n \n return (\n <div>\n I am a class componnet\n\n <button onClick={this.something}>\n Modify the state\n \n </button>\n </div>\n )\n }", "async buttonClick(event) {\n event.preventDefault();\n this.speak(\"BEGIN WELCOME BUTTON CLICK: \" + event.currentTarget);\n if (event.currentTarget === this.buttCreateCategory) {\n this.speak(\"Time to create a category!\");\n this.hide();\n this.createCategoryScreen.init();\n this.createCategoryScreen.show();\n } else if (event.currentTarget === this.buttCreateGame) {\n this.speak(\"Time to create a game!\");\n this.hide();\n this.cats = await this.dbman.getAllCategories();\n this.createGameScreen.init(this.cats);\n this.createGameScreen.show();\n } else if (event.currentTarget === this.buttChooseGame) {\n this.speak(\"Time to choose a game!\");\n this.hide();\n this.games = await this.dbman.getAllGames();\n this.chooseGameScreen.init(this.games);\n this.chooseGameScreen.show();\n } else if (event.currentTarget === this.buttPlayGame) {\n this.speak(\"Time to Play a game!\");\n this.hide();\n if (this.chosenGame === undefined) {\n this.playGameScreen.init(SINGLE_JEOPARDY);\n } else {\n this.playGameScreen.init(this.chosenGame);\n }\n this.playGameScreen.show();\n } else if (event.currentTarget === this.buttRouteTests) {\n let routeResult = await this.dbman.runRouteTests();\n } else if (event.currentTarget === this.buttXferDefaults) {\n let xferResult = await this.dbman.xferDefaults();\n } else {\n this.speak(\"Should not get here!\");\n }\n\n this.speak(\"END WELCOME BUTTON CLICK: \" + event.currentTarget);\n }", "onCompleteBtnClick() {\n this._completeTodoBtn.addEventListener('click', () => {\n this.dispatchEvent(new CustomEvent('toggleCompleted', { bubbles: true }));\n })\n }", "function Contact(props){\n\nvar colorChoice;\nvar torf;\n\nif(props.status === \"pending\"){\n colorChoice = {\n background: 'orange'\n };\n} else if(props.status === \"done\"){\n colorChoice = {\n background: 'green'\n };\n}\n\n function handleClick(e) {\n e.preventDefault();\n}\n\n return(\n <div>\n <p>You need to contact {props.fname} {props.lname} at {props.pnumber}</p>\n <button onClick={handleClick}>{props.status}</button>\n <div style={colorChoice} className=\"icon\"></div>\n\n </div>\n )\n}", "function ResetButton(props) {\n return(<Button className='ResetButton' onClick={()=>{ResetCapacity()}}>\n <div className='Reset Button'> Reset count to zero</div>\n </Button>);\n\n}", "onRegistrationSuccess() {\n messageStyle = successMessage;\n this.setState({\n loading: false,\n message: messages.success\n });\n }", "render() {\n const classes = {\n \"mdc-fab--mini\": this.mini,\n \"mdc-fab--exited\": this.exited,\n \"mdc-fab--extended\": this.extended,\n };\n const showLabel = this.label !== \"\" && this.extended;\n return _material_mwc_base_base_element__WEBPACK_IMPORTED_MODULE_1__[\"html\"] `\n <button\n .ripple=\"${Object(_material_mwc_ripple_ripple_directive_js__WEBPACK_IMPORTED_MODULE_2__[\"ripple\"])()}\"\n class=\"mdc-fab ${Object(_material_mwc_base_base_element__WEBPACK_IMPORTED_MODULE_1__[\"classMap\"])(classes)}\"\n ?disabled=\"${this.disabled}\"\n aria-label=\"${this.label || this.icon}\"\n >\n ${showLabel && this.showIconAtEnd ? this.label : \"\"}\n ${this.icon\n ? _material_mwc_base_base_element__WEBPACK_IMPORTED_MODULE_1__[\"html\"] `\n <ha-icon .icon=${this.icon}></ha-icon>\n `\n : \"\"}\n ${showLabel && !this.showIconAtEnd ? this.label : \"\"}\n </button>\n `;\n }", "onMouseEnter(buttonStyle) {\n buttonStyle.color = 'rgb(204, 164, 59)';\n this.setState({\n style: buttonStyle\n });\n }", "function DoneScreen({ route, navigation }) {\n const stat = route.params.status;\n //brings user back to goalsListScreen\n function gotoGoalsListScreen() {\n navigation.navigate('goalsListScreen');\n }\n\n //displays different message depending on status\n function DoneMessage() {\n if (stat == status.completed)\n return (<Text>CONGRATULATIONS!!!!!! YOU'VE ACHIEVED YOUR GOAL!!!!!</Text>);\n if (stat == status.archived)\n return (<Text>wow.... lame.</Text>);\n }\n\n return (\n <SafeAreaView style={styles.safe}>\n <View style={styles.main}>\n <DoneMessage />\n <TouchableOpacity\n onPress={() => gotoGoalsListScreen()}>\n <Text>\n Go Home\n </Text>\n </TouchableOpacity>\n </View>\n </SafeAreaView>\n );\n}", "buttonPress(action) {\n this.props.onPress(\n action,\n this.props.entry.notificationName,\n this.props.entry.email,\n this.props.entry.senderEmail,\n this.props.entry.priority,\n this.props.entry.value,\n this.props.entry.description,\n this.props.entry.redeemed,\n this.props.entry.notificationType,\n this.props.entry.deadline,\n );\n }", "render() {\n return !this.state.isLoading ? (this.state.isSubscribed ?\n <Button onClick={this.handleUnsubscribe.bind(this)} className=\"h-50\" variant=\"outline-primary\">\n <BookmarkCheck className=\"mr-2\" />Unfolloow\n </Button> :\n <Button onClick={this.handleSubscribe.bind(this)} className=\"h-50\" variant=\"outline-secondary\">\n <BookmarkPlus className=\"mr-2\" />&nbsp; Folloow &nbsp;\n </Button>) \n : <Button variant=\"outline-secondary\">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; ... &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</Button>\n }", "render(){\n\t\t\t\treturn <button className=\"ui button primary\">Submit</button>\n\t\t\t}", "function Square(props) {\n if(!(props.finished == \"true\" || props.match == \"true\")){\n return <button type=\"button\" className=\"hidden\" onClick={() => props.onClick()}>wut</button>\n }\n else if(props.finished == \"true\") {\n return <button type=\"button\" className=\"disabled\" disabled> {props.lett} </button>\n }\n\n else {\n return <button type=\"button\" className=\"matching\"> {props.lett} </button>\n }\n return <button type=\"button\" className=\"hidden\" onClick={() => props.onClick()}>wut</button>\n\n}", "function Button (props) {\n return(\n <div className=\"Button\">\n <button onClick={(e)=>props.handleOnClick(e)}> {props.label} </button>\n </div>\n )\n}", "render () {\n let buttonText\n let wrapper\n const { exists, available, quantity = true, checkoutUrl} = this.props\n\n if (exists && available) {\n buttonText = 'Buy Now'\n } else if (exists) {\n buttonText = 'Out of Stock'\n } else {\n buttonText = 'Unavailable'\n }\n\n const classes = classnames('btn', {\n 'btn-success': exists && available,\n 'disabled btn-default': !exists || !available\n })\n\n const buyNowButton = (\n <button className={classes} onClick={this.onBuyNow} href={checkoutUrl}>{buttonText}</button>\n )\n\n const addToCartButton = (\n <button className=\"btn btn-default\"\n data-tip=\"Add To Cart is not implemented, but is here to demonstrate the use of functional handler using Fake Cart\"\n onClick={this.onAddCart}>\n Add To Cart\n </button>\n )\n\n if (quantity) {\n wrapper = (\n <div className=\"AddToCart\">\n <div className=\"input-group\">\n <input type=\"number\"\n value={this.props.quantity}\n className=\"form-control\" \n placeholder=\"Enter quantity here\" \n onChange={this.onChangeQuantity}\n />\n <span className=\"input-group-btn\">\n {buyNowButton}\n {addToCartButton}\n </span>\n </div>\n </div>\n )\n } else {\n wrapper = (\n <div className=\"AddToCart\">\n {buyNowButton}\n </div>\n )\n }\n\n return wrapper\n }", "checkNewUserButton(){\n if(this.props.isNewUser===true){\n return <Button id=\"signupButton\" kind='primary' style={{ padding: \"20px\" ,fontSize:\"20px\"}} onClick={()=>this.signUp()}>Sign Up</Button>\n }\n else{\n return <Button className=\"loginb\" id=\"loginButton\" kind='primary' style={{ padding: \"20px\" ,fontSize:\"20px\"}} onClick={()=>this.logIn()}>Log In</Button>\n }\n }", "onPress() {\n if (this.props.onPress) {\n this.props.onPress()\n }\n }", "registerButtonHandler()\n {\n this.setState({registering: true});\n }", "handleSubmit(e){\r\n e.preventDefault();\r\n this.props.onComplete({...this.state});\r\n this.setState({title: '', content: ''});\r\n }", "render () {\n return (\n <div>\n <h1>Hello, world!</h1>\n <h2>It is {this.state.date.toLocaleTimeString()}</h2>\n <p>\n <button onClick={this.handleClickSaludo}>Saludar</button>\n </p>\n <p>\n <button onClick={this.handleClickDespedida}>Despedida</button>\n </p>\n <p>\n <button onClick={this.handleClickPassArgs.bind(this, 20)}>Pass Argument</button>\n </p>\n </div>\n )\n }", "handleClick() {\n this.setState({\n isForcedDone: true\n });\n }", "render(){\n return(\n <div>\n <button className='btn btn-secondary' onClick={() => this.props.onClickFunc(this.props.answer)}>{this.props.answer}</button>\n </div>\n );\n }", "function ButtonFunction (props) {\n return (\n <button> {props.btnLabel} </button>\t\n );\n}", "_onLongRest(event) {\n event.preventDefault();\n new Dialog({\n title: \"Long Rest\",\n content: '<p>Take a long rest?</p><p>On a long rest you will recover hit points, half your maximum hit dice, ' +\n 'primary or secondary resources, and spell slots per day.</p>',\n buttons: {\n rest: {\n icon: '<i class=\"fas fa-bed\"></i>',\n label: \"Rest\",\n callback: async dlg => {\n const update = await this.actor.longRest();\n let msg = `${this.actor.name} takes a long rest and recovers ${update.dhp} Hit Points and ${update.dhd} Hit Dice.`;\n ChatMessage.create({\n user: game.user._id,\n speaker: {actor: this.actor, alias: this.actor.name},\n content: msg\n });\n }\n },\n cancel: {\n icon: '<i class=\"fas fa-times\"></i>',\n label: \"Cancel\"\n },\n },\n default: 'rest'\n }).render(true);\n }", "render() {\n const { hasBookings } = this.props\n\n return (\n <div className={classes.container}>\n <img\n className={classes.title}\n src='/images/helpstitle.png'\n />\n <img\n className={classes.step1}\n src='/images/helps1.png'\n />\n <img\n className={classes.step2}\n src='/images/helps2.png'\n />\n {!hasBookings &&\n <img\n className={classes.step3}\n src='/images/helps3a.png'\n />\n }\n <RaisedButton\n className={classes.button}\n label='Got it!'\n onTouchTap={this.props.onClose}\n primary\n />\n </div>\n )\n }", "function ChildComponent(props) {\n return (\n <div>\n <button onClick={() => props.greetHandler('child')}>Greet Parent</button>\n </div>\n )\n}", "renderButtons() {\n // No confirmation needed so 1 OK button to dismiss the modal.\n if (this.props.type !== 'confirm') {\n return (\n <button\n className=\"o-button c-modal-button u-margin-top\"\n onClick={this.close}\n >\n OK\n </button>\n )\n }\n\n // If it is a confirm type, render 2 buttons, 1 to dismiss the\n // modal and 1 to call the confirm function.\n return (\n <div className=\"o-button-group c-modal-button-group u-margin-top\">\n <button\n className=\"o-button o-button--secondary c-modal-button\"\n onClick={this.close}\n >\n Cancel\n </button>\n <button\n className=\"o-button c-modal-button\"\n onClick={this.confirm}\n >\n Confirm\n </button>\n </div>\n )\n }", "render(){\n return(\n <button onFocus={this.focus} onBlur={this.blur}>Press Me</button>\n )\n }", "onNextButtonPressed_() {\n this.userActed('next');\n }" ]
[ "0.5806638", "0.5769376", "0.57244176", "0.5631941", "0.56248766", "0.5567545", "0.5444422", "0.54423654", "0.54245824", "0.5413877", "0.5387529", "0.53782547", "0.5376096", "0.5366528", "0.53556865", "0.53441066", "0.5342579", "0.5336331", "0.5334516", "0.53343713", "0.53257", "0.53243613", "0.53180534", "0.5315312", "0.5310224", "0.5285631", "0.52767664", "0.52493256", "0.5247022", "0.5234944", "0.5231346", "0.52289796", "0.52227694", "0.5222111", "0.52009034", "0.5193493", "0.51815766", "0.51814246", "0.5173682", "0.51629555", "0.5162435", "0.51609796", "0.51596826", "0.51517385", "0.51513183", "0.51475793", "0.51435775", "0.5143528", "0.5142713", "0.51360774", "0.51319885", "0.5131324", "0.51288706", "0.51245904", "0.5117093", "0.51165146", "0.5105681", "0.5100992", "0.5098936", "0.50918376", "0.5091723", "0.50895953", "0.50872", "0.50868064", "0.50857663", "0.5084808", "0.50770694", "0.50700593", "0.5069526", "0.506457", "0.5056213", "0.5049386", "0.5045093", "0.5044774", "0.50405365", "0.5035512", "0.501283", "0.50086445", "0.50017047", "0.5000325", "0.49968797", "0.49955228", "0.49813956", "0.497454", "0.4971399", "0.49713033", "0.49689427", "0.49546608", "0.49542844", "0.495357", "0.49388123", "0.49349123", "0.4933581", "0.49321786", "0.4930193", "0.4924926", "0.4918983", "0.49162143", "0.49132997", "0.49116737" ]
0.49627197
87
render each slides of Welcome screen
renderSlides() { // Every single object that's inside of props stack data will create a new view contain the slide text // 'slide' is record object of 'data' in 'map' function, ex: { text: 'Welcome to JobApp' } return this.props.data.map((slide, index) => { return ( <View key={slide.text} style={[styles.slideStyle, { backgroundColor: slide.color }]} > <Text style={styles.slideText}>{slide.text}</Text> {this.renderLastSlide(index)} </View> ) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderWelcomeScreen(){\r\n getTemplateAjax('./templates/welcome.handlebars', function(template) {\r\n welcomeData =\r\n {welcomeTitle: \"Hey. Where do you want to park?\", welcomeMessage: \"Single-origin coffee portland squid tofu 3 wolf moon fixie thundercats single-origin coffee tofu jean shorts.\"}\r\n $('#welcomeScreen').html(template(welcomeData));\r\n })\r\n }", "function generateSlides() {\n const parentEle = document.querySelector('#container');\n currentQContent = [dataVizPage[state.q_id], ...sharedContent]\n\n currentQContent.forEach((slide, i) => {\n const slideElement = document.createElement('div');\n //element position absolute\n slideElement.style.zIndex = `-${i}`;\n slideElement.style.position = 'absolute';\n slideElement.classList.add('slide');\n slideElement.setAttribute('id', `slide${state.q_id}-${i}`)\n if (i == 0) {\n slideElement.classList.add('center');\n } else {\n slideElement.classList.add('right');\n }\n slideElement.innerHTML = `${currentQContent[i].slide_text}`;\n parentEle.appendChild(slideElement);\n });\n\n}", "function showDivs(n) {\n if (n > mySlides.length) {slideIndex = 1}\n if (n < 1) {slideIndex = mySlides.length} ;\n for (i = 0; i < mySlides.length; i++) {\n mySlides[i].style.display = \"none\";\n }//Gère la boucle de défilement des images et cache les divs mySlides\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\"backgroundWhite\", \"\");\n }//Enlève la classe de colorisation de la puce par défaut\n mySlides[slideIndex-1].style.display = \"block\";\n dots[slideIndex-1].className += \" backgroundWhite\";\n //Colore la puce associée à l'image associée\n}", "function renderSections(){\n \n\n store.sections.forEach((section,index) => {\n \n \n $(\"body\").append(`<section class=${section}> \n </section>`);\n renderParts(section,index);\n \n });\n\n}", "function render() {\n isAnimating = true;\n\n /** Show current slide */\n items[currentSlideIndex].classList.add('is-slide-visible');\n\n /** Animate container scroll to current slide */\n const containerLeft = itemsContainer.style.left ? itemsContainer.style.left : '0px';\n const currentSlideLeft = items[currentSlideIndex].offsetLeft ? -(items[currentSlideIndex].offsetLeft) + 'px' : '0px';\n const animation = itemsContainer.animate([\n { left: containerLeft },\n { left: currentSlideLeft }\n ], { duration: 150 });\n\n animation.addEventListener('finish', function () {\n isAnimating = false;\n\n /** Need to set left manually after animation */\n itemsContainer.style.left = currentSlideLeft;\n\n /** Hide slides other than current */\n const otherSlides = itemsContainer.getElementsByClassName('is-slide-visible');\n for (var index = 0; index < otherSlides.length; index++) {\n if (otherSlides[index] === items[currentSlideIndex]) {\n continue;\n }\n\n otherSlides[index].classList.remove('is-slide-visible');\n }\n });\n\n /** Clean event binding */\n document.removeEventListener('finish', animation);\n }", "function render(){\n var state = store.getState();\n\n console.log(state);\n\n\n root.innerHTML = `\n ${Navigation(state[state.active])}\n ${Header(state)}\n ${Content(state)}\n ${Footer(state)}\n `;\n greeter.render(root);\n \n document\n .querySelector('h1')\n .addEventListener('click', (event) => {\n var animation = tween({\n 'from': {\n 'color': '#fff100',\n 'fontSize': '100%'\n },\n 'to': {\n 'color': '#fff000',\n 'fontSize': '200%'\n },\n 'duration': 750\n });\n \n var title = styler(event.target);\n \n animation.start((value) => title.set(value));\n });\n \n router.updatePageLinks();\n}", "function make_slides(f) {\n var slides = {};\n var present_list = stimfile// _.shuffle(stims.concat(fillers)); //\n // var present_list = _.shuffle(fillers);\n slides.consent = slide({\n name : \"consent\",\n start: function() {\n exp.startT = Date.now();\n $(\"#consent_2\").hide();\n exp.consent_position = 0;\n },\n button : function() {\n if(exp.consent_position === 0) {\n exp.consent_position++;\n $(\"#consent_1\").hide();\n $(\"#consent_2\").show();\n } else {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n }\n });\n\n slides.i0 = slide({\n name : \"i0\",\n start: function() {\n exp.startT = Date.now();\n }\n });\n\n slides.trial = slide({\n name : \"trial\",\n present : present_list,\n start: function() {\n exp.startT = Date.now();\n },\n\n present_handle : function(stim) {\n // if stim is an attention check, pass html \n this.stim = stim;\n $(\".prompt\").html(\"<p><strong>\" + stim.stim + \"</strong></p>\"); /*\"<u>Speaker A</u>: <p class='hangingindent'>\" + stim.setup + \". \" + \n stim.question + \"</p><br>\" + \"<u>Speaker B</u>: <p class='hangingindent'><b>\" + \n stim.response + \".</b></p>\") ;*/\n},\nbutton: function(stim) {\n if ($('input[name=\"rating\"]:checked').val() === undefined) {\n $(\".error\").show();\n } else {\n $(\".error\").hide()\n /* use _stream.apply(this); if and only if there is\n \"present\" data. (and only *after* responses are logged) */\n /*if (this.stim.type == \"filler\" & this.stim.truefalse_question != \"na\" & $('input[name=\"truefalse\"]:checked').val() === undefined) {\n $('.truefalse-buttons').show()\n $('.vertical-radio-buttons').hide()\n $(\".prompt\").html(\"Given what you just read, is the following true or false: <p><b>\" +\n this.stim.truefalse_question + \"</b>.\") ;\n } else {\n if (this.stim.truefalse_question === \"na\") {\n truefalse_response = \"na\";\n } else {\n truefalse_response = $('input[name=\"truefalse\"]:checked').val();\n }*/\n this.log_responses();\n _stream.apply(this);\n $('input[name=\"rating\"]').attr('checked',false)\n //$('input[name=\"truefalse\"]').attr('checked',false)\n //$('.truefalse-buttons').hide()\n $('.vertical-radio-buttons').show()\n //}\n }\n },\n log_responses: function() {\n exp.data_trials.push({\n \"rating\" : $('input[name=\"rating\"]:checked').val(),\n \"stim\" : this.stim.stim,\n \"first_conj_subj\" : this.stim.first_conj_subj,\n \"last_conj_subj\" : this.stim.last_conj_subj,\n \"stim_type\" : this.stim.stim_type,\n \"predicate_type\" : this.stim.predicate_type,\n \"has_gapping\" : this.stim.has_gapping,\n \"has_negation\" : this.stim.has_negation,\n \"tense\" : this.stim.tense,\n \"verb\" : this.stim.verb,\n \"first_conj_arg\" : this.stim.first_conj_arg,\n \"last_conj_arg\" : this.stim.last_conj_arg,\n //\"question\" : this.stim.question,\n //\"answer\" : this.stim.response,\n //\"type\" : this.stim.type,\n //\"expression\" : this.stim.expr,\n //\"polarity\" : this.stim.polarity,\n //\"truefalse_question\" : this.stim.truefalse_question,\n //\"truefalse_answer\" : this.stim.truefalse_answer,\n //\"truefalse_response\" : truefalse_response,\n \"order\" : order,\n });\n order = order + 1;\n }\n });\n\n slides.instructions = slide({\n name : \"instructions\",\n button : function() {\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n\n slides.subj_info = slide({\n name : \"subj_info\",\n submit : function(e){\n //if (e.preventDefault) e.preventDefault(); // I don't know what this means.\n exp.subj_data = {\n language : $(\"#language\").val(),\n enjoyment : $(\"#enjoyment\").val(),\n asses : $('input[name=\"assess\"]:checked').val(),\n age : $(\"#age\").val(),\n gender : $(\"#gender\").val(),\n education : $(\"#education\").val(),\n comments : $(\"#comments\").val(),\n problems: $(\"#problems\").val(),\n fairprice: $(\"#fairprice\").val()\n };\n exp.go(); //use exp.go() if and only if there is no \"present\" data.\n }\n });\n\n slides.thanks = slide({\n name : \"thanks\",\n start : function() {\n exp.data= {\n \"trials\" : exp.data_trials,\n \"catch_trials\" : exp.catch_trials,\n \"system\" : exp.system,\n \"subject_information\" : exp.subj_data,\n \"time_in_minutes\" : (Date.now() - exp.startT)/60000\n };\n setTimeout(function() {turk.submit(exp.data);}, 1000);\n }\n });\n\n return slides;\n}", "function showSlides(){\r\n\t\tlet slides = document.getElementsByClassName(\"eachslide\");\r\n\t\t\tfor (let i=0; i < slides.length; i++){\r\n\t\t\t\tslides[i].style.display = \"none\";\r\n\t\t\t}\r\n\t\t\tslideIndx++;\r\n\t\t\tif (slideIndx > slides.length){\r\n\t\t\t\tslideIndx = 1;\r\n\t\t\t}\r\n\t\t\tslides[slideIndx-1].style.display = \"block\";\r\n\t\t\ttimerSlide = setTimeout(showSlides, 2500); //2.5 seconds\r\n\t}", "function render() {\n //zarejdame si templeitite i im zakachame event\n ctx.partial('./templates/welcome.hbs')\n .then(attachEvents);\n }", "function listSlides() {\n gapi.client.slides.presentations.get({\n presentationId: ogSlideId\n }).then(function (response) {\n var presentation = response.result;\n var length = presentation.slides.length;\n\n appendPre('The presentation contains ' + length + ' slides:');\n for (var i = 0; i < length; i++) {\n\n console.log(\"slide number\");\n console.log(i);\n\n var slide = presentation.slides[i];\n\n appendPre('- Slide #' + (i + 1) + ' contains ' +\n slide.pageElements.length + ' elements.')\n }\n }, function (response) {\n appendPre('Error: ' + response.result.error.message);\n });\n}", "function welcome_screen()\n{\n $(document).on(\"pagecreate\",\"#welcomeScreen\",function(){\n $(\"#welcomeText\").fadeIn(2000,function(){\n $(\"#easy\").fadeIn(1000,function(){\n $(\"#medium\").fadeIn(1000,function(){\n $(\"#hard\").fadeIn(1000);\n });\n });\n });\n $(\"#logo\").fadeIn();\n $(\"#easy\").on(\"tap\",function(){\n diff_lev=1;\n knock.play();\n computeAndRender();\n });\n $(\"#medium\").on(\"tap\",function(){\n diff_lev=2;\n knock.play();\n computeAndRender();\n });\n $(\"#hard\").on(\"tap\",function(){\n diff_lev=3;\n knock.play();\n computeAndRender();\n });\n });\n}", "function renderStartPage(){\n const setHtml = generateIntro();\n $('main').html(setHtml);\n}", "function showSlides(n) {\n let i;\n if (n > slides.length) {\n slideIndex = 1\n }\n if (n < 1) {\n slideIndex = slides.length\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n}", "function generateSlidesHTML(index, item) {\n return `<img class=\"slider-image ${index === 0 ? 'showing' : ''}\" src=${item.bg_image} id=\"slide${item.id}\">`\n}", "function Initialize()\n{\n const Slides = document.querySelectorAll('.slides');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function showThisSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n}", "rendering(){\n let renderPlace = \"\";\n let count = 0;\n place.innerHTML = renderPlace;\n slides.forEach((slide)=>{\n count++\n if(slide.tipe == \"teks\"){\n renderPlace += textRender(slide,count);\n place.innerHTML = renderPlace;\n }\n else if(slide.tipe == \"gambar\"){\n renderPlace +=gambarRender(slide,count);\n place.innerHTML = renderPlace;\n }else{\n place.innerHTML = renderPlace;\n }\n loadFile.hapusBtn();\n });\n }", "function render() {\r\n let content = '';\r\n if (STORE.view === 'home') {\r\n $('main').html(welcomePage());\r\n }\r\n else if (STORE.view === 'question') {\r\n content = questionAsked();\r\n content += generateAnswers();\r\n content += questionAndScoreStanding();\r\n $('main').html(`<form>${content}</form>`);\r\n } else if (STORE.view === 'feedback') {\r\n answerFeedback();\r\n } else if (STORE.view === 'score') {\r\n finalScore();\r\n }\r\n}", "function showSlideContent() {\n\tfor (let i = 0; i < slideContents.length; i++) {\n\t\tslideContents[i].classList.remove('currentSlider');\n\t}\n\n\t//add currentslider class to the right slideContent div\n\tslideContents[slideCount].classList.add('currentSlider');\n}", "renderScreenContent(){}", "function start() {\n\n // Make sure we've got all the DOM elements we need\n setupDOM();\n\n // Updates the presentation to match the current configuration values\n configure();\n\n // Read the initial hash\n readURL();\n\n // Notify listeners that the presentation is ready but use a 1ms\n // timeout to ensure it's not fired synchronously after #initialize()\n setTimeout(function () {\n dispatchEvent('ready', {\n 'indexh': indexh,\n 'indexv': indexv,\n 'currentSlide': currentSlide\n });\n }, 1);\n\n }", "function addMoviesHMTL(data) {\n const title = data.base.title;\n const movieImage = data.base.image.url;\n const movieSlide = document.createElement('li');\n movieSlide.className = \"carousel-slide\"\n if (firstMovie) { // add the current-slide class to the first movie to make the slider work\n movieSlide.classList.add('current-slide');\n firstMovie = false;\n }\n movieSlide.innerHTML = `\n <h4>${title}</h4>\n <img src=${movieImage} alt=${title}>\n `\n carousel.appendChild(movieSlide);\n}", "function onBodyLoad() {\n document.querySelector('.presentation').classList.add('visible')\n\n // Set up\n getSlideNumberFromUrlFragment()\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber], true)\n\n // Slide manipulation\n hyphenateSlides()\n setUpBetterPunctuation()\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "function schoolSlides() {\n return ['00-school/00-TITLE.md', '00-school/speaker-jef.md'];\n}", "function render() {\n if (store.quizStarted === false) {\n $('main').html(generateWelcome());\n return;\n }\n else if (store.questionNumber < store.questions.length) {\n let html = '';\n html = generateQuestion();\n html += generateQuestionNumberAndScore();\n $('main').html(html);\n }\n else {\n $('main').html(generateResultsScreen());\n }\n}", "function displayPages() {\n // Retrieve the page div.\n var $pageDiv = $('#pageDiv');\n \n // Clear the contents of the div.\n $pageDiv.empty();\n \n // Iterate through all of the page objects.\n for (var i = 0; i < pages.length; i++)\n displayPage(pages[i]);\n}", "function handleHTMLMounted() {\n\tPromise.all([handleSession(), getConfiguration(), getPopularMovies(false, false, 'movie', 0), getTop_ratedMovies(false, false, 'movie', 1), getNow_playingMovies(false, false, 'movie', 2), getUpcomingMovies(false, false, 'movie', 3)]).then(() => {\n\t\t// ci permette di lavorare con i dati ottenuti dall'esterno\n\t\trenderCarousel(stateMovies[sectionNameId[0]], nodeSectionId[0]);\n\t\trenderCarousel(stateMovies[sectionNameId[1]], nodeSectionId[1]);\n\t\trenderCarousel(stateMovies[sectionNameId[2]], nodeSectionId[2]);\n\t\trenderCarousel(stateMovies[sectionNameId[3]], nodeSectionId[3]);\n\t});\n}", "plusSlides(n){\n showSlides(this.state.slideIndex)\n }", "function Next() {\n if (currentSlide < presentationSlides.length - 1) {\n // Check if this is a playlist or library presentation\n if (presentationPath.charAt(0) == '0') {\n // Sent the request to ProPresenter\n webSocket.send('{\"action\":\"presentationTriggerIndex\",\"slideIndex\":\"' + (currentSlide + 1) + '\",\"presentationPath\":\"' + presentationPath + '\"}');\n } else {\n // Sent the request to ProPresenter\n webSocket.send('{\"action\":\"presentationTriggerIndex\",\"slideIndex\":\"' + (currentSlide + 1) + '\",\"presentationPath\":\"' + presentationPath.replace(/\\//g, \"\\\\/\") + '\"}');\n }\n }\n}", "showSlides(n){\n var i;//the counter\n var index = this.state.slideIndex; //the state property\n var slides = document.querySelector(\".mySlide\"); //selecting the slide components\n if ( n > slides.length) {index = 1}//if the slide is the last one, go back to first\n if ( n < 1 ) {index = slides.length}//if slide is the first one, you can go to last\n for (i = 0; i < slides.length; i++){//for ever slide\n slides[i].style.display = \"none\";//make it invisible\n }\n slides[index-1].style.display = \"block\";//but for now, make visible\n }", "renderPage() {\t\t\n\t\tswitch (this.props.data.active) {\n\t\t\tcase 'user': \n\t\t\t\treturn this.renderUserInfo(this.props.data.body);\t\t\t\n\t\t\tcase 'repos': \n\t\t\t\treturn this.renderRepos(this.props.data.body);\n\t\t\tcase 'about': \n\t\t\t\treturn this.renderAbout();\t\t\t\t\t\n\t\t}\n\t}", "function displaySlide( arr, container ) {\n //console.log(container);\n var el = container.querySelectorAll(\".gallry .slides > figure\");\n\n // if elements created and variable successful\n if (el) {\n for ( var i = 0; i < arr.length; i++ ) {\n // clear out all active class assignments\n el[i].classList.remove(\"active\");\n // set default active state\n if ( arr[i].active ) {\n el[i].classList.add(\"active\");\n Velocity( el[i], { left: \"0%\" }, { display: \"block\" }, { duration: prefs.timing, easing: prefs.easing });\n }\n else if ( i < currentSlide( arr ).index() ) {\n Velocity( el[i], { left: \"-100%\" }, { display: \"none\" }, { duration: prefs.timing, easing: prefs.easing });\n }\n else {\n Velocity( el[i], { left: \"100%\" }, { display: \"none\" }, { duration: prefs.timing, easing: prefs.easing });\n }\n\n if (arr[i].backgroundPosition !== undefined) {\n el[i].style.backgroundSize = arr[i].size;\n el[i].style.backgroundPosition = arr[i].backgroundPosition;\n }\n else {\n el[i].style.backgroundSize = \"cover\";\n el[i].style.backgroundPosition = \"center\";\n }\n\n // this conditional currently requires 2x assets to be available. If no 2x assets are available,\n // no fallback images are provided.\n if (prefs.retina) {\n // do some device sniffing to determine if the screen is retina display or not\n if (window.devicePixelRatio > 1.5) {\n var str = arr[i].src;\n var first = str.slice(0, str.length - 4); // get first part of string\n var last = str.slice(str.length - 4, str.length); // get .jpg, .png, .svg, .gif files --- must be 4 character file extension\n el[i].style.backgroundImage = \"url('\" + first + \"_2x\" + last + \"')\"; // defining gallery slide image via arr.src prop\n }\n else {\n // if the device pixel ratio doesnt match up, use the 1x asset\n el[i].style.backgroundImage = \"url('\" + arr[i].src + \"')\"; // defining gallery slide image via arr.src prop\n }\n }\n // if prefs.retina is false, use the 1x image asset.\n else {\n el[i].style.backgroundImage = \"url('\" + arr[i].src + \"')\"; // defining gallery slide image via arr.src prop\n }\n\n el[i].classList.add( arr[i].name, \"slide\" ); // cycle through array.name values to assign as class to element\n el[i].style.backgroundRepeat = \"no-repeat\";\n el[i].style.height = \"100%\";\n el[i].style.margin = \"0\";\n }\n }\n else {\n console.log(\"Check el element is assigned to correct querySelectorAll value.\");\n }\n }", "function introScreen() {\n SDPresents = new image(DEMO_ROOT + \"/def/resources/senior.png\");\n presentsScreen = SeniorDads.ScreenHandler.Codef(640,400,name,zIndex++);\n \t\tSDPresents.draw(presentsScreen,0,0);\n \t}", "function carousel() {\n for (const element of mySlides) { //pour chaque élément de $mySlides \n element.style.display = \"none\";//appliquer le style css \"display: none\" à chaque élement\n };\n\n slideIndex++; // ajoute un à la valeure actuelle de slideIndex\n\n if (slideIndex > mySlides.length) { //si slideIndex est supérieur au nombre d'objet dans $mySlides\n slideIndex = 1 //alors slideIndex est égale à 1\n };\n\n mySlides[slideIndex - 1].style.display = \"block\"; //applique le style css \"display: block\" à l'élement correspondant à l'index $mySlides. Le nombre insérré dans l'index correspond à la variable slideIndex -1\n \n setTimeout(carousel, 5000); //execute la fonction carousel tout les X secondes\n}", "function displayAll() {\r\n $('.mainDiv').hide();\r\n $('.bodyContainer').show();\r\n $('.main-container').show();\r\n\r\n var timerTemp = setInterval(setTime, 1000);\r\n idTimerTemp = timerTemp;\r\n\r\n $(\"#jquery_jplayer_3\").jPlayer(\"clearMedia\");\r\n $('.mainDiv').find('.audioContainer').remove();\r\n \r\n var data = config\r\n\t\t\tController = {\r\n\t\t\t\tpaths: {\r\n\t\t\t\t\t'Data': 'Data',\r\n\t\t\t\t\t'Templates': 'Templates',\r\n\t\t\t\t\t'EngineTemplate': 'Scripts/engine/html/',\r\n\t\t\t\t\t'EngineImage': 'Media/eng/images/'\r\n\t\t\t\t},\r\n\t\t\t\t'lang': config[0].Controller.settings.defaultLanguage,\r\n\t\t\t\t'scorm': config[0].Controller.settings.lms,\r\n\t\t\t\t'service': config[0].Controller.settings.webservice,\r\n\t\t\t};\r\n Engine.initialize();\r\n \r\n\r\n if (is_touch_device()) {\r\n $('.nav_style #next').show();\r\n $('.nav_style #prev').show();\r\n }\r\n\r\n $('.nav_style #next').addClass('outNext')\r\n $('.nav_style #prev').addClass('outPrev')\r\n\r\n}", "function renderListSlides(type) {\n\t\t\tvar _ilCount = 0;\n\n\t\t\tthumbs.each(function(){\n\t\t\t\tif (type === 'all') {\n\t\t\t\t\t_ilCount++;\n\t\t\t\t\t$(this).clone().hide().appendTo($slider.find('ul').eq(-1)).fadeIn(speed);\n\t\t\t\t} else if (type === 'exterior') {\n\t\t\t\t\tif ( $(this).find('img').data('type') === type ) {\n\t\t\t\t\t\t_ilCount++;\n\t\t\t\t\t\t$(this).clone().hide().appendTo($slider.find('ul').eq(-1)).fadeIn(speed);\n\t\t\t\t\t}\n\t\t\t\t} else if ( type === 'interior' && $(this).find('img').data('type') === type ) {\n\t\t\t\t\t$(this).clone().hide().appendTo($slider.find('ul').eq(-1)).fadeIn(speed);\n\t\t\t\t\t_ilCount++;\n\t\t\t\t}\n\n\t\t\t\tif (_ilCount > 11) {\n\t\t\t\t\t$slider.append('<ul class=\"clearfix\"></ul>');\n\t\t\t\t\t_ilCount = 0;\n\t\t\t\t}\n\n\t\t\t});\n\n\t\t\tvar _slides = $slider.find('ul');\n\t\t\t$slider.width(holderW * _slides.length);\n\t\t\t_slides.eq(0).addClass('alive').css('display', 'block');\n\t\t\tfor (var i=0;i < _slides.length; i++) {\n\t\t\t\t$pg.append(pgItemTpl);\n\t\t\t}\n\t\t\tif (_slides.length < 2) {\n\t\t\t\t$prev.addClass('dead');\n\t\t\t\t$next.addClass('dead');\n\t\t\t} else {\n\t\t\t\t$prev.removeClass('dead');\n\t\t\t\t$next.removeClass('dead');\n\t\t\t}\n\t\t\t$pgItem = $pg.find('li');\n\t\t\t$pgItem.eq(0).addClass('alive');\n\t\t\t$sliderSubItems = $('.gallery-list-slider').find('li');\n\t\t}", "function displaySlide(index) {\n\n\t\t\tif (typeof index === \"string\" && index === \"last\") {\n\t\t\t\tcurrentIndex = len - 1;\n\n\t\t\t} else if (typeof index === \"string\" && index === \"fist\") {\n\t\t\t\tcurrentIndex = 0;\n\n\t\t\t} else if (index === undefined || index < 0 || index >= len) {\n\t\t\t\t// invalid value > auto play\n\t\t\t\tcurrentIndex = (currentIndex + 1) % len;\n\n\t\t\t} else {\n\t\t\t\tcurrentIndex = index;\n\t\t\t}\n\n\t\t\t// Program next slide\n\t\t\tdisplaySlide.future = (autoplay) ? setTimeout(function () {\n\t\t\t\trequestAnimationFrame(displaySlide);\n\t\t\t}, settings.slideDuration) : 0;\n\n\t\t\t// display the new slide\n\t\t\tvar slide = slides[currentIndex];\n\t\t\tif (typeof slide === \"object\") {\n\t\t\t\tonScreen(slide.src, $.extend({}, settings, slide));\n\n\t\t\t} else { // string\n\t\t\t\tonScreen(slide, settings);\n\t\t\t}\n\n\t\t\t// dispatch slide events as requested\n\t\t\tif (settings.events) $(settings.screen).trigger(\"slide\", slides[currentIndex]);\n\t\t}", "render() {\n // Get the index\n const index = this.state.activeIndex;\n\n // Get the slide information\n const { title, instructions, options } = slides[index];\n\n // Return the component\n return (\n <div className=\"container\">\n <Slide\n title={title}\n instructions={instructions}\n options={options}\n payload={this.state.payload}\n handler={\n options === Manufacturers || options === Features\n ? this.updateArrayInPayload\n : this.updatePayload\n }\n />\n <ProgressBar\n history={this.props.history}\n count={slides.length}\n active={index}\n leftClick={this.previousSlide}\n rightClick={this.nextSlide}\n goToResults={this.goToResults}\n />\n </div>\n );\n }", "function main() {\n NodeList.prototype.forEach = HTMLCollection.prototype.forEach = Array.prototype.forEach\n\n slideEls = document.querySelectorAll('.presentation > div')\n\n // Specific slide tech\n $('pre, code').each(function(i, block) {\n hljs.highlightBlock(block)\n });\n\n // Set up\n getSlideNumberFromUrlFragment()\n document.querySelector('.presentation').classList.add('visible')\n showSlide(true, true)\n onSlideEnter(slideEls[currentSlideNumber], true)\n\n document.body.addEventListener('keydown', onKeyDown)\n document.body.focus()\n}", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "function renderStartQuiz() {\n //console.log('Generating start of quiz');\n $('.intro').html(generateStartPage());\n}", "function Initialize2()\n{\n const Slides = document.querySelectorAll('.slides1');\n const pages = document.querySelectorAll('section');\n let current=0;\n\n Slides.forEach((slide,index) => {\n slide.addEventListener('click', function(){\n changeDots(this);\n nextSlide(index);\n });\n });\n\n\n function changeDots(dot)\n {\n Slides.forEach(slide => {\n slide.classList.remove(\"active\");\n })\n\n dot.classList.add(\"active\");\n }\n\n function nextSlide(pageNumber)\n {\n const nextPage = pages[pageNumber];\n const currentPage = pages[current];\n\n const tl = new TimelineMax({defaults:{ease:\"power2.out\"}});\n\n tl.fromTo(currentPage , 0.8,{opacity:1,pointerEvents:\"all\"},{opacity:0,pointerEvents:\"none\"})\n .fromTo(nextPage,0.8,{opacity:0,pointerEvents:\"none\"},{opacity:1,pointerEvents:\"all\"},'-=0.4') \n\n current = pageNumber;\n }\n}", "function slideshow(iii) {\n\t\treturn m(\".col-sm-12.blog-main\",\n\t\t\t[m(\".embed-responsive.embed-responsive-16by9\",\n\t\t\t\tm(\"iframe[frameborder='no'][height='600'][scrolling='no'][src=\" + iii.iframe + \"&autoStart=0&captions=1&navigation=1&playButton=1&randomize=0&speed=3&transition=fade&transitionSpeed=1'][width='800']\")\n\t\t\t),\n\t\t\t\tm(\"a.center-block[href=\" + iii.smugAlbum + \"]\",\n\t\t\t\t\tiii.smugAlbumName && m(\"h4\", \"Link to \" + iii.smugAlbumName + \" Album\")\n\t\t\t\t)\n\t\t\t]);\n\t}", "function rool(){\n\tsetInterval(function(){showSlides('card-body',1);\n\t\t\tshowSlides('card-body',2);},3000);\n\tsetInterval(function(){showSlides('card-body',3);\n\t\t\tshowSlides('card-body',4);},3000);\n\tsetInterval(function(){showSlides('card-body',5);\n\t\t\tshowSlides('card-body',6);},6000);\n}", "function showCarousel() {\n carouselInner.innerHTML = \"\";\n carouselInner.appendChild(printCarouselPages(1, posts));\n carouselInner.appendChild(printCarouselPages(2, posts));\n carouselInner.appendChild(printCarouselPages(3, posts));\n // carouselInner.innerHTML += \"<div class='after'></div>\";\n}", "render() {\n this.configPage();\n history.pushState({ href: '/first-entrance' }, null, '/first-entrance');\n this.wrapper.append(this.main);\n\n this.main.innerHTML = firstTemplate();\n\n document.querySelector('.icon-list').classList.add('active');\n\n this.attachListeners(this.main);\n }", "function display_multiple(hashmap, name, context) {\r\n\r\n Word.run(function (context) {\r\n console.log(\"Name to display : \" + name);\r\n // Mettez en file d'attente une commande pour obtenir la selection actuelle, puis\r\n // creez un objet de plage proxy avec les resultats.\r\n var body = context.document.body;\r\n context.load(body, 'text');\r\n\r\n for (var i = 0; i < hashmap[name].length; i++) {\r\n var person = hashmap[name][i];\r\n var bdate = new Date(person[6] + 'T10:20:30Z');\r\n bdate = calculateAge(bdate);\r\n\r\n $('#politicians').append(\r\n '<div class=\"panel panel-default\" id=\"panel' + counter.i + '\">\\\r\n <div class=\"panel-heading\">\\\r\n <a data-toggle=\"collapse\" data-target=\"#collapse'+ counter.i + '\">\\\r\n <h4 class=\"panel-title\">' + person[4] + \" \" + person[5] + '</h4>\\\r\n </a>\\\r\n </div>\\\r\n <div id=\"collapse'+ counter.i + '\" class=\"panel-collapse collapse \">\\\r\n <div class=\"panel-body\">\\\r\n <div class=\"row\">\\\r\n <div class=\"col-xs-2\" id=\"photo\"> <i class=\"material-icons md-60\">face</i> </div>\\\r\n <div class=\"col-xs-10\">\\\r\n <div class=\"row\"> ' + person[8] + '</div>\\\r\n <div class=\"row\"> ' + person[2] + '</div>\\\r\n <div class=\"row\"> ' + person[7] + '</div>\\\r\n <div class=\"row\"> ' + bdate + ' years old' + '</div>\\\r\n <div class=\"row\"> <a href=\"http://www.wecitizens.be\">More on Wecitizens.be</a> </div>\\\r\n </div>\\\r\n </div>\\\r\n </div>\\\r\n </div>\\\r\n </div>\\ '\r\n );\r\n\t\t\t\tcounter.i++;\r\n }\r\n })\r\n }", "function switch_slides () {\n // Animate to next slide by facing opacity of foreground from 100% to 0%\n foreground_element.animate({ opacity: 0 }, that.options.speed, function () {\n load_slide(foreground_element, that.options.slides[current_slide_id]);\n foreground_element.css('opacity', 1); // turn foreground on full opacity\n load_slide(background_element, that.options.slides[next_slide_id]); // load next slide into background\n });\n\n // Update slide_id's\n current_slide_id += 1; //next_slide_id - 1;\n if (current_slide_id >= slide_count) {\n current_slide_id = 0;\n }\n next_slide_id = current_slide_id + 1;\n if (next_slide_id >= slide_count) {\n next_slide_id = 0;\n }\n }", "_renderSlide() {\n\t\t\t\tif (this.slideView) {\n\t\t\t\t\tthis.slideView.remove();\n\t\t\t\t}\n\n\t\t\t\tthis.slideView = new SlideView({model: this.collection.getCurrentModel()});\n\t\t\t\tthis.$el.find('ul.slides').append(this.slideView.el);\n\t\t\t}", "function showSlide()\r\n{\r\n // create objects\r\n const image1 = {file: \"ocean_beach_2.jpg\", description: \"Ocean Beach\", alt: \"Ocean Beach\"};\r\n const image2 = {file: \"back_beach_sorrento.jpg\", description: \"Sorrento Back Beach\", alt: \"Sorrento Back Beach\"};\r\n const image3 = {file: \"ocean_beach.jpg\", description: \"Ocean Beach\", alt: \"Ocean Beach\"};\r\n \r\n // using an array\r\n const images = [image1, image2, image3];\r\n \r\n // limit slideshow\r\n if (slideIndex >= images.length)\r\n {\r\n slideIndex = 0; // reset to the start\r\n }\r\n if (slideIndex === -1)\r\n {\r\n slideIndex = images.length-1; // reset to last slide \r\n }\r\n\r\n // display the slide\r\n const slideImage = document.querySelector(\".slides img\");\r\n slideImage.src = \"ICTWEB431_AE_Pro_1of2_SR1/\" + images[slideIndex].file;\r\n slideImage.alt = images[slideIndex].alt;\r\n\r\n // slides[slideIndex - 1].style.display = \"block\";\r\n\r\n // display description\r\n const description = document.querySelector(\".description\");\r\n description.innerHTML = images[slideIndex].description;\r\n\r\n // display the slide dot as the current dot\r\n // remove the class active from all dots\r\n const dotsList = document.getElementsByClassName(\"dot\");\r\n\r\n for (let i = 0; i < dotsList.length; i++)\r\n {\r\n dotsList[i].classList.remove(\"active\");\r\n }\r\n \r\n // set the class for the slide as \"active\" \r\n dotsList[slideIndex].classList.add(\"active\");\r\n\r\n}", "function showSlides(n) {\r\n var slides = document.querySelectorAll(\".mySlides\");\r\n //var dots = document.querySelectorAll(\".dot\");\r\n\r\n if (n > slides.length) { slideIndex = 1 } //snap to beginning of slideshow\r\n\r\n if (n < 1) { slideIndex = slides.length } //fell off the end, show final slide\r\n\r\n slides.forEach((slide) => {\r\n slide.style.display = \"none\";\r\n })\r\n \r\n slides[slideIndex - 1].style.display = \"block\";\r\n}", "async function displayPresentations(response) {\n\tlet data = await response.json(); // loading data\n\tpresentations.innerHTML = \"\";\n\n\t// create an object for every presentation\n\tfor (let presentation of data) {\n\t\t// container div\n\t\tlet newP = document.createElement(\"div\");\n\t\tlet id = presentation.id;\n\t\tnewP.id = id;\n\t\tnewP.className = \"presentation\";\n\n\t\t// small display of first slide\n\t\tlet imageP = document.createElement(\"div\");\n\t\timageP.id = id+'image';\n\t\timageP.className = \"miniView\";\n\t\timageP.onclick = editPresentation;\n\n\t\t// button for deleting presentation\n\t\tlet buttonDeleteP = document.createElement(\"button\");\n\t\tbuttonDeleteP.type = \"button\";\n\t\tbuttonDeleteP.innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\n\t\tbuttonDeleteP.className = \"buttonDeleteP\";\n\t\tbuttonDeleteP.onclick = deletePresentation;\n\n\t\t// select for choosing sharing option\n\t\tlet buttonShareP = document.createElement(\"select\");\n\t\tbuttonShareP.className = \"buttonShareP\";\n\t\tbuttonShareP.id = \"selectShare\" + id;\n\n\t\t// private option\n\t\tlet optionPrivate = document.createElement(\"option\");\n\t\toptionPrivate.value = 0;\n\t\toptionPrivate.innerHTML = \"Private\";\n\t\tbuttonShareP.appendChild(optionPrivate);\n\n\t\t// public option\n\t\tlet optionPublic = document.createElement(\"option\");\n\t\toptionPublic.value = 1;\n\t\toptionPublic.innerHTML = \"Public\";\n\t\tbuttonShareP.appendChild(optionPublic);\n\n\t\t// individual option\n\t\tlet optionIndividual = document.createElement(\"option\");\n\t\toptionIndividual.value = 2;\n\t\toptionIndividual.innerHTML = \"Individual\";\n\t\tbuttonShareP.appendChild(optionIndividual);\n\t\tbuttonShareP.onchange = updateShareOptions;\n\t\tbuttonShareP.selectedIndex = (presentation.share_option);\n\n\t\t// button for editing presentation\n\t\tlet buttonEditP = document.createElement(\"button\");\n\t\tbuttonEditP.type = \"button\";\n\t\tbuttonEditP.innerHTML = '<i class=\"fas fa-pencil-alt\">';\n\t\tbuttonEditP.className = \"buttonEditP\";\n\t\tbuttonEditP.id = id + 'editButton';\n\t\tbuttonEditP.onclick = editPresentation;\n\n\t\tlet nameDiv = document.createElement('div');\n\t\tlet name = document.createElement('h2');\n\t\tnameDiv.className = \"namePresentation\";\n\t\tname.innerHTML = presentation.presentation_json.presentation.name;\n\t\tnameDiv.appendChild(name);\n\n\t\t// appending all the elements in the container\n\t\tnewP.appendChild(imageP);\n\t\tnewP.appendChild(nameDiv);\n\t\tnewP.appendChild(buttonDeleteP);\n\t\tnewP.appendChild(buttonShareP);\n\t\tnewP.appendChild(buttonEditP);\n\n\t\t// append the presentation container to the page\n\t\tpresentations.appendChild(newP);\n\t\t// insert the slide image into the presentation\n\t\tgetFirstSlideImage(presentation.presentation_json, imageP);\n\n\t}\n}", "function renderList(res, data, numPages, currentLetter, currentPage) {\n\tres.render('index', {\n\t\ttitle: 'iPlayer A to Z',\n\t\tletters: generateLetters(26),\n\t\tprogrammes: data,\n\t\tpages: generatePagination(numPages),\n\t\tcurrentLetter,\n\t\tcurrentPage\n\t});\n}", "function showSlides(n) {\n\t\tif (n > slidelength - 1) {\n\t\t\tn -= slidelength;\n\t\t}\n\t\tif (n < 0) {\n\t\t\tn += slidelength;\n\t\t}\n\t\t\n\t\tfor (i = 0; i < slidelength; i++) {\n\t\t\t$(\".archive-item\").removeClass(\"js-active\");\n\t\t}\n\n\t\t// var slides = $(\".archive-item\").removeClass(\"js-active\");\n\n\t\tvar slides = $(\".archive-item\");\n\t\tvar newSlide = slides.eq(n);\n\t\tnewSlide.addClass(\"js-active\");\n\t\tslideContent();\n\t\tslideIndex = n;\n\t}", "initSlides () {\n let i = 0,\n sections = document.getElementsByClassName(\"slide__section\");\n for ( let section of sections ) {\n let slide = new Slide(section, this)\n this.slides.push(slide)\n\n let control = this.controls[i]\n slide.control = control\n control.slideIndex = i\n\n this.bindEventToControl(control)\n\n i++\n }\n this.controls[this.current].classList.add(\"current\")\n this.len = this.slides.length\n }", "function render() {\n var body = document.getElementsByTagName(\"body\")[0];\n applyStyle(body, { margin: \"0px\", padding: \"0px\", backgroundColor: \"#ccc\",\n fontFamily: \"arial, sans-serif\" });\n while (body.lastChild) {\n body.removeChild(body.lastChild);\n }var addDiv = function addDiv(body, arg) {\n return body.appendChild(e(\"div\", { backgroundColor: \"#fff\", position: \"absolute\",\n overflow: \"hidden\", fontSize: arg.width / 32 }, arg));\n };\n\n var centerDiv = function centerDiv(body) {\n var r = state.aspectRatio;\n var win = { w: window.innerWidth, h: window.innerHeight };\n var sz = win.w / r > win.h ? { w: win.h * r, h: win.h } : { w: win.w, h: win.w / r };\n return addDiv(body, { height: sz.h, width: sz.w, top: (win.h - sz.h) / 2, left: (win.w - sz.w) / 2 });\n };\n\n var showHelp = function showHelp(body) {\n var w = window.innerWidth;\n var keyboardShortcuts = \"<h1>Keyboard Shortcuts</h1>\\n <dl>\\n <dt>&lt;Left&gt; <span style=\\\"color: #fff\\\">or</span> k</dt> <dd>: Previous slide</dd>\\n <dt>&lt;Right&gt; <span style=\\\"color: #fff\\\">or</span> j</dt> <dd>: Next slide</dd>\\n <dt>&lt;space&gt;</dt> <dd>: Toggle animations</dd>\\n <dt>w</dt> <dd>: Toggle aspect ratio (16:9/3:4)</dd>\\n <dt>v</dt> <dd>: Toggle view (slides/list)</dd>\\n <dt>r</dt> <dd>: Force reload</dd>\\n <dt>h <span style=\\\"color: #fff\\\">or</span> ?</dt> <dd>: Toggle help</dd>\\n </dl>\";\n var div = e(\"div\", { html: keyboardShortcuts, fontSize: 13,\n width: 300, left: w - 400, top: 50, backgroundColor: \"#000\", color: \"#fff\", padding: 20,\n opacity: 0.8, borderRadius: \"10px\", position: \"fixed\" });\n [].forEach.call(div.getElementsByTagName(\"h1\"), function (e) {\n return applyStyle(e, { marginBottom: \"1em\",\n fontSize: 15, borderBottomStyle: \"solid\", borderBottomWidth: \"1px\", paddingBottom: \"0.5em\" });\n });\n [].forEach.call(div.getElementsByTagName(\"dt\"), function (e) {\n return applyStyle(e, { color: \"#ff0\", width: 100,\n float: \"left\", clear: \"left\", lineHeight: \"2em\", textAlign: \"right\", marginRight: \"0.5em\" });\n });\n [].forEach.call(div.getElementsByTagName(\"dd\"), function (e) {\n return applyStyle(e, { lineHeight: \"2em\" });\n });\n body.appendChild(div);\n };\n\n state.canReload = true;\n state.currentSlide = Math.max(0, Math.min(state.currentSlide, slides.length - 1));\n if (window.orientation !== undefined) state.view = Math.abs(window.orientation) === 90 ? \"slide\" : \"list\";\n\n var root = e(\"div\", {});\n if (state.view == \"list\") {\n var w = 300 * state.aspectRatio,\n h = 300;\n var x = 0,\n y = 0;\n\n var _loop = function _loop(i) {\n var div = addDiv(root, { left: x, top: y, width: w, height: h });\n (slides[i].template || defaultTemplate)(div, slides[i]);\n x += w + 10;\n if (x + w + 10 > window.innerWidth) {\n x = 0;y += h + 10;\n }\n div.onmousedown = function () {\n state.currentSlide = i;state.view = \"slide\";render();\n };\n };\n\n for (var i = 0; i < slides.length; ++i) {\n _loop(i);\n }\n } else (slides[state.currentSlide].template || defaultTemplate)(centerDiv(root), slides[state.currentSlide]);\n body.appendChild(root);\n\n if (state.showHelp) showHelp(body);\n\n body.onresize = render;\n body.onorientationchange = render;\n body.onkeydown = function (evt) {\n if (evt.keyCode == 37) state.currentSlide--;else if (evt.keyCode == 39) state.currentSlide++;else return;\n render();\n };\n body.onkeypress = function (evt) {\n var s = String.fromCharCode(evt.which || evt.keyCode);\n if (s == \"w\") state.aspectRatio = state.aspectRatio > 14 / 9 ? 12 / 9 : 16 / 9;else if (s == \"v\") state.view = state.view == \"list\" ? \"slide\" : \"list\";else if (s == \"?\" || s == \"h\") state.showHelp = !state.showHelp;else if (s == \" \") {\n state.isPlaying = !state.isPlaying;\n } else if (s == \"k\") state.currentSlide--;else if (s == \"j\") state.currentSlide++;else if (s == \"r\") {\n _require(\"index.js\");window.setTimeout(render, 200);return;\n } else return;\n render();\n };\n body.ontouchend = function (evt) {\n if (evt.changedTouches[0].clientX > window.innerWidth / 2.0) state.currentSlide++;else state.currentSlide--;\n render();\n };\n}", "function main() {\n startSlideShowAnimation();\n renderProject();\n}", "function render() {\n\t$(\"#content\").empty();\n\n\tfor (let i = 0; i < employeeList.length; i++) {\n\t\tlet info = employeeList[i];\n\n\t\tlet nameData = info.name;\n\t\tlet officeData = info.office;\n\t\tlet phoneData = info.phone;\n\n\t\tlet objectDiv = `<div class=\"objectDiv\"><p>Employee: ${nameData}</p><p>Office: ${officeData}</p><p>Phone Number: ${phoneData}</p></div>`\n\t\t$(\"#content\").append(objectDiv);\n\t}\n}", "function render() {\r\n if (store.quizStarted === false){\r\n $('main').html(startScreen());\r\n }\r\n else if (store.quizStarted === true){\r\n // $('main').html(showAnswers())\r\n $('main').html(showQuestion());\r\n }\r\n\r\n}", "function GetSlides() {\n\n var slides = document.getElementsByClassName('slide');\n\n setTimeout(function () {\n\n for (var i = 0, limit = slides.length; i < limit; ++i) {\n\n // Set z-index for each slide from top to bottom.\n slides[i].style.zIndex = 100 - i;\n\n // Hide other slides\n if (i > 0) {\n slides[i].style.opacity = 0;\n slides[i].style.right = '-100%';\n }\n \n }\n\n slider.SetSlides(slides);\n\n }, 0);\n\n }", "function showSlides(n) {\r\n var i;\r\n var slides = document.getElementsByClassName(\"mySlides\");\r\n var slidesParagraph = document.getElementsByClassName(\"paragraph\");\r\n var dots = document.getElementsByClassName(\"dot\");\r\n\r\n if (n > slides.length) { slideIndex = 1 }\r\n if (n < 1) { slideIndex = slides.length }\r\n\r\n if (n > slidesParagraph.length) { slideIndex = 1 }\r\n if (n < 1) { slideIndex = slidesParagraph.length }\r\n\r\n for (i = 0; i < slides.length; i++) {\r\n slides[i].style.display = \"none\";\r\n }\r\n for (i = 0; i < dots.length; i++) {\r\n dots[i].className = dots[i].className.replace(\" active\", \"\");\r\n }\r\n for (i = 0; i < slidesParagraph.length; i++) {\r\n slidesParagraph[i].style.display = \"none\";\r\n }\r\n\r\n slidesParagraph[slideIndex - 1].style.display = \"block\";\r\n slides[slideIndex - 1].style.display = \"block\";\r\n dots[slideIndex - 1].className += \" active\";\r\n}", "function start() {\n $('#waitPanel').remove();\n\n // build slides dynamically\n const slides = $('div.slides');\n const areyoureadyTemplate = $('#areyouready-template').html();\n slides.append(areyoureadyTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n const wordTemplate = $('#word-template').html();\n $.each(sessionData['wordList'], function(idx, data) {\n slides.append(wordTemplate\n .replace(/ID/g, idx+1)\n );\n });\n const goodjobTemplate = $('#goodjob-template').html();\n slides.append(goodjobTemplate\n .replace(/VOICE_ID/g, sessionData['voice']['id'])\n );\n\n Reveal.initialize({\n controlsLayout: \"edges\",\n overview: false,\n autoPlayMedia: true,\n hash: false,\n viewDistance: Number.MAX_VALUE,\n keyboard: {\n 13: listenAgain,\n 65: listenAgain, // A - again\n 82: listenAgain, // R - repeat\n }\n });\n\n Reveal.addEventListener('slidechanged', function(p) {\n const slideNum = p['indexh'];\n playSound(slideNum);\n });\n\n // change to first (later changes will be captured above\n playSound(0);\n}", "function showSlides(n) {\r\n var x;\r\n var slides = document.getElementsByClassName(\"slides\");\r\n var dots = document.getElementsByClassName(\"dot\");\r\n if (n > slides.length) {slideInd = 1}\r\n if (n < 1) {slideInd = slides.length}\r\n \r\n for (x = 0; x < slides.length; x++) {\r\n slides[x].style.display = \"none\";\r\n }\r\n for (x = 0; x < dots.length; x++) {\r\n dots[x].className = dots[x].className.replace(\" active\", \"\");\r\n }\r\n if (slideInd > slides.length) {slideInd = 1}\r\n slides[slideInd-1].style.display = \"block\";\r\n dots[slideInd-1].className += \" active\";\r\n slideInd++;\r\n}", "function pageDisplay(iteration) {\n // save the info from this iteration in the appendages array\n var title = appendages[iteration].title;\n var intro = appendages[iteration].intro;\n var link = appendages[iteration].link;\n var video = decodeURI(appendages[iteration].video);\n\n // format the info\n var titleText = $('<h4>').text(title);\n var introText = $('<p>').text(intro);\n var wikiLink = $('<a>').text(\"Click here for more info\")\n .addClass('wiki-link')\n .attr('target', '_blank')\n .attr('href', link);\n var videoDiv = $('<div>').append(video)\n .addClass(\"embed-container\");\n\n // append it all to the proper divs\n $('#wikiSpot').empty().append(titleText, introText, wikiLink);\n $('#videoSpot').empty().append(videoDiv);\n}", "_render() {\n\n this._el.innerHTML = `\n <div class='itk-slider'>\n <button class='show-prev-btn'> left </button>\n <img class='slide-img' src=''>\n <button class='show-next-btn'> right </button>\n </div>`;\n\n this.showPrevBtn = this._el.querySelector('.show-prev-btn');\n this.showNextBtn = this._el.querySelector('.show-next-btn');\n this.slideImage = this._el.querySelector('.slide-img');\n }", "createSlideText(\n {\n tipe,\n judul,\n teks,\n }\n ){ \n const newSlide = {\n id:this.uniqid(),\n tipe,\n judul,\n teks,\n }\n slides.push(newSlide);\n console.log(slides);\n this.rendering();\n return true;\n }", "function setupPage() {\n\tfor(i = 0; i < state.numberOfPlayers; i++) {\n\t\t$(\"#panels\").append('<div id=\"player_' + i + '\" class=\"player\"></div>')\n\t\t\n\t\t// Player name\n\t\t$(\"#player_\"+i).append('<div id=\"name_' + i + '\" class=\"playerName\"></div>')\n\t\t\n\t\t// Scores\n\t\t$(\"#player_\"+i).append('<div class=\"scoreWrapper\"><div id=\"score_' + i + '\" class=\"score\"></div><div id=\"delta_' + i + '\" class=\"scoreDelta\"></div></div>')\n\t\t$(\"#score_\"+i).hide()\n\t\t$(\"#delta_\"+i).hide()\n\t\t\n\t\t// Order\n\t\t$(\"#player_\"+i).append('<div class=\"orderWrapper\"><div id=\"order0_' + i + '\" class=\"order\"></div><div id=\"order1_' + i + '\" class=\"order\"></div><div id=\"order2_' + i + '\" class=\"order\"> </div><div id=\"order3_' + i + '\" class=\"order\"> </div></div>')\n\t\t\n\t\t// Ranking\n\t\t$(\"#player_\"+i).append('<div id=\"ranking_' + i + '\" class=\"playerField\"></div>')\n\t\t$(\"#ranking_\"+i).hide()\n\t\t\n\t\t// Status image\n\t\t$(\"#player_\"+i).append('<div id=\"status_' + i + '\" class=\"statusWrapper\"><div id=\"wait_' + i + '\" class=\"playerField\"><img src=\"img/waiting.png\" width=\"200\" height=\"200\" /></div><div id=\"ok_' + i + '\" class=\"playerField\"><img src=\"img/star.png\" width=\"200\" height=\"200\" /></div><div id=\"correct_' + i + '\" class=\"playerField\"><img src=\"img/correct.png\" width=\"200\" height=\"200\" /></div><div id=\"wrong_' + i + '\" class=\"playerField\"><img src=\"img/wrong.png\" width=\"200\" height=\"200\" /></div><div id=\"neutral_' + i + '\" class=\"playerField\"><img src=\"img/neutral.png\" width=\"200\" height=\"200\" /></div></div>')\n\t\t$(\"#wait_\"+i).hide()\n\t\t$(\"#ok_\"+i).hide()\n\t\t$(\"#correct_\"+i).hide()\n\t\t$(\"#wrong_\"+i).hide()\n\t\t$(\"#neutral_\"+i).hide()\n\t}\n\t$(\"#panels\").append('<div class=\"counter\" id=\"counter\"></div>')\n\tpageLoaded = true\n\trefreshPage()\n}", "async function slider () {\n headLine.textContent = heroHeadlines[0];\n for (var e = 0; e < x; e--) {\n await stageOne();\n await stageOne1();\n await stageOne2();\n await stageOne3();\n await stageOne4();\n await stageOne5();\n await stageOne6();\n await stageOne7();\n await stageOne8();\n await stageOne9();\n await stageTwo(count, sec);\n await changeHeadline(count, heading);\n await stageOne10();\n await stageOne11();\n await stageOne12();\n await stageOne13();\n await stageOne14();\n await stageOne15();\n await stageOne16();\n await stageOne17();\n await stageOne18();\n await stageThree();\n count++;\n if (count === end) {\n count = 0;\n } else {\n count = count;\n }\n }\n }", "function init() {\n renderGallery();\n renderSection('meme-gallery');\n}", "function SetPresentation(obj) {\n // Reset the current presentation slides\n presentationSlides = [];\n // Save the current presentation location\n presentationPath = obj.presentationPath;\n // Iterate through each slide group\n obj.presentation.presentationSlideGroups.forEach(\n function (presentationSlideGroup) {\n // Iterate through each slide in the group\n presentationSlideGroup.groupSlides.forEach(\n function (groupSlide) {\n // Add the slide image\n presentationSlides.push(groupSlide.slideImage);\n // Set the status\n document.getElementById(\"slide-status\").innerHTML = \" (\"+(presentationSlides.length+1)+\")\";\n }\n );\n }\n );\n // Set the status\n document.getElementById(\"slide-status\").innerHTML = \"\";\n // Get the current slide\n GetCurrentSlide();\n}", "function main() {\n var images = [\n 'http://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',\n 'http://www.google.com/services/images/phone-animation-results_2x.png',\n 'http://www.google.com/services/images/section-work-card-img_2x.jpg',\n 'http://gsuite.google.com/img/icons/product-lockup.png',\n 'http://gsuite.google.com/img/home-hero_2x.jpg'\n ];\n var [title, subtitle] = presentation.getSlides()[0].getPageElements();\n title.asShape().getText().setText(NAME);\n subtitle.asShape().getText().setText('Google Apps Script\\nSlides Service demo');\n images.forEach(addImageSlide);\n}", "function render() {\n for (let i = 0; i < storedCreatedObj.length; i++) {\n storedCreatedObj[i].render_for_body();\n }\n storedCreatedObj[0].render_for_head();\n storedCreatedObj[0].render_for_foot();\n}", "function render() {\n let html = '';\n\n if (questionnaire.quizStarted === false) {\n $('main').html(generateStartButton());\n \n return;\n } else if (\n questionnaire.currentQuestion >= 0 &&\n questionnaire.currentQuestion < questionnaire.questions.length\n ) {\n $(\"header\").css({ \"margin-top\": \"50px\" });\n \n html = printQuiz();\n html += printQuestion();\n $('main').html(html);\n } \n \n \n else {\n \n \n $('main').html(generateResultsScreen());\n \n \n }\n}", "function displayPages() {\r\n // Retrieve the the pages div element.\r\n var $pageDiv = $(\"#pageDiv\");\r\n \r\n // Clear the page div.\r\n while ($pageDiv[0].firstChild)\r\n $pageDiv[0].removeChild($pageDiv[0].firstChild);\r\n \r\n // Iterate through all of the pages in the pagesList.\r\n for (var i = 0; i < pageList.length; i++) {\r\n var page = pageList[i];\r\n \r\n // Create a new image element to represent the page.\r\n var img = document.createElement(\"IMG\");\r\n img.onload = function() {\r\n $(this).hide().pageToggle();\r\n };\r\n img.src = \"/ShowAndTellProject/\" + page.audio;\r\n img.id = \"pageThumbnail\";\r\n \r\n // Add highlight functionality to the image element.\r\n highlight(img);\r\n \r\n // Add the image to the pages div.\r\n $pageDiv.append(img); \r\n }\r\n}", "render() {\n return (\n <ScrollView\n horizontal\n style={{ flex: 1}}\n pagingEnabled\n >\n {this.renderSlides()}\n </ScrollView>\n )\n }", "function showSlides(n) {\n var i;\n var color = [\"rgb(239,73,48)\", \"rgb(4,136,230)\", \"rgb(26,26,26)\"];\n var path = \"https://jiade-tech2020.en.made-in-china.com/product\";\n var paths = [\n \"/odrEBQJksTWL/China-Jd-20A06-1-Fat-Tire-48V-10-4ah-11-6ah-14-5ah-16ah-Lithium-Battery-Power-Folding-Electric-Bicycle.html\",\n \"/vdRmSkEchahH/China-Jd-20A06-2-Fat-Tire-Foldable-500W-750W-1000W-Electric-Bike-Rear-Motor-with-Lithium-Battery.html\",\n \"/xFRnvaEJTGcb/China-Jd-20A06-3-Folding-Fat-Tire-Ebike-48V-500W-Fold-Ebike-Fat-Tire-Adult-Electric-Bicycle.html\",\n ];\n var slides = document.getElementsByClassName(\"mySlides\");\n var dots = document.getElementsByClassName(\"dot\");\n var action = document.getElementById(\"buy\");\n if (n > slides.length) {\n slideIndex = 1;\n }\n if (n < 1) {\n slideIndex = slides.length;\n }\n for (i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n for (i = 0; i < dots.length; i++) {\n dots[i].className = dots[i].className.replace(\" active\", \"\");\n }\n slides[slideIndex - 1].style.display = \"block\";\n dots[slideIndex - 1].className += \" active\";\n action.style.backgroundColor = color[slideIndex - 1];\n action.href = path + paths[slideIndex - 1];\n}", "function drawHomePage(req, res) {\n var db = req.db;\n var collection = db.get('pageContent');\n\n var data = collection.find({}, {}, function(e, docs) {\n var homeIntro = docs[0].homeIntro;\n var homeTitle = docs[0].homeTitle;\n var usrname = loggedInUser(req);\n\n if (usrname) {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Logout',\n username: usrname });\n }\n else {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Login',\n username: usrname });\n }\n });\n}", "render() {\n let slides;\n let current = this.props.slide\n let qqLength = this.props.data.length\n let checkout = false;\n if (current === qqLength-1) { checkout = true}\n\n slides = this.props.data.map((slide, index) => {\n let isActive = current == index;\n return (\n <Slide getOption={this.props.getOptions}\n checkOut={this.props.checkOut}\n active={isActive} ident={slide.id} key={slide.id} label={slide.label} before={slide.image_before} after={slide.image_after} description={slide.product_description} options={slide.options} checkout={checkout} />\n\n )})\n return (\n <div className=\"slides\">\n {slides}\n </div>\n );\n }", "function render(){\n leftEl.src = Product.allProducts[randomLeft].filepath; //current\n leftEl.alt = Product.allProducts[randomLeft].name;\n\n centerEl.src = Product.allProducts[randomCenter].filepath;\n centerEl.alt = Product.allProducts[randomCenter].name;\n\n rightEl.src = Product.allProducts[randomRight].filepath;\n rightEl.alt = Product.allProducts[randomRight].name;\n\n //increment the number of times each image was shown\n Product.allProducts[randomLeft].timesDisplayed += 1;\n Product.allProducts[randomCenter].timesDisplayed += 1;\n Product.allProducts[randomRight].timesDisplayed += 1;\n\n //keep track of these as the previously displayed products\n Product.lastDisplayed[0] = randomLeft;\n Product.lastDisplayed[1] = randomCenter;\n Product.lastDisplayed[2] = randomRight;\n}", "function nextSlides() {\n presetStyle()\n visuals[slideIndex].style.zIndex = '100'\n visuals[slideIndex].style.opacity = '1'\n dots[slideIndex].style.backgroundColor = 'black'\n\n if (slideIndex >= dots.length - 1) {\n slideIndex = 0\n } else {\n slideIndex++\n }\n}", "function Home() {\n return (\n <div>\n <Slider /> \n <div className =\"images\">\n <div className = 'slideshow1'>\n <img alt=\"\" src={slideshow1} height=\"300\" width=\"200\" />\n </div>\n <div className =\"slideshow2\">\n <img alt=\"\" src={slideshow2} height=\"300\" width=\"200\"/>\n </div>\n <div className=\"slideshow3\">\n <img alt=\"\" src={slideshow3} height=\"300\" width=\"200\"/>\n </div>\n <div className=\"slideshow4\">\n <img alt=\"\" src={slideshow4} height=\"300\" width=\"200\"/>\n </div>\n \n </div>\n \n </div>\n\n );\n}", "function render() {\n $videogameList.empty();\n // pass allVideogames into the template function\n let videogameHtml = getAllVideogamesHtml(allVideogames);\n $videogameList.append(videogameHtml);\n }", "function initHtml () {\n\t\t\t$container.slick(config);\n\t\t}", "function showSlide() {\n // the first slide will be shown when a user clicks right being on the last slide\n if (sliderIndex == slides.length){\n sliderIndex = 0;\n }\n // the last slide will be shown when a user clicks left being on the first slide\n if (sliderIndex < 0){\n sliderIndex = 3;\n }\n\n slides.forEach((item) => item.style.display = 'none');\n slides[sliderIndex].style.display = 'block';\n\n dots.forEach((item) => item.classList.remove('dot-active'));\n dots[sliderIndex].classList.add('dot-active');\n }", "function showSlides(n) {\n var dotsArr = document.getElementById('dotsHere').children;\n if(n < 1) {slideIndex = slides.length;}\n if(n > slides.length) {slideIndex = 1;}\n\n for(i=0; i < slides.length; i++){\n slides[i].style.display = 'none';\n dotsArr[i].classList.remove('active');\n }\n\n slides[slideIndex - 1].style.display = 'block';\n dotsArr[slideIndex - 1].classList.add('active');\n}", "function render() {\n let html = '';\n\n if (STORE.quizStarted === false) {\n $('main').html(displayStartScreen());\n return;\n }\n else if (STORE.questionNumber >= 0 && STORE.questionNumber < STORE.questions.length) {\n html = displayQuestNumAndScore();\n html += displayQuestion();\n $('main').html(html);\n }\n else {\n $('main').html(displayResults());\n }\n }", "function changeSlide(){\r\n if(numberOfSlide > 4) {\r\n numberOfSlide = 1;\r\n } else if(numberOfSlide < 1) {\r\n numberOfSlide = 4;\r\n }\r\n\r\n var headingImage = \"<img src=\\\"img/piano\" + numberOfSlide + \".png\\\">\";\r\n\r\n document.querySelector(\".heading-image\").innerHTML = headingImage;\r\n document.querySelector(\".heading-text\").innerHTML = headingText[numberOfSlide - 1] + headingButtons;\r\n $('.heading-image').fadeIn(500);\r\n $('.heading-text').fadeIn(500);\r\n}", "function render(){\n let html='';\n if (store.quizStarted === false){\n html = generateStartPage();\n }else if (store.giveFeedback === true){\n html = generateQuestionsPage();\n } else if (store.giveFeedback === false && store.questionNumber === store.questions.length -1){\n html = generateLastPage();\n }\n else {\n html= generateRightWrong();\n }\n \n $('main').html(html);\n}", "function currentslide(n)\n{\n\tshowDivs(slideIndex = n);\n}", "function buildSectionsScreen() {\r\n var WIDTH = 1920;\r\n var SCALED = 185 / WIDTH;\r\n var HEIGHT = 1080;\r\n\r\n $(\"#agendaButton\").css(\"background\", \"#515151\");\r\n $(\"#slidesButton\").css(\"background\", \"#ee4c4e\");\r\n\r\n if ( slidedeck ) {\r\n $(\"#sectionsTitle\").html( EM.scenemanager.presentation.core.name );\r\n var $sectionList = $(\"#sectionList\");\r\n $sectionList.empty();\r\n var counter = 0;\r\n var sCounter = 0; //Sections counter\r\n\r\n for (var i = 0; i < slidedeck.sections.length; i++) {\r\n var section = slidedeck.sections[i];\r\n var aSection = '<div id=\"section_' + (i + 1) + '\" data-slide=\"' + (sCounter + 1) + '\" class=\"sectionsSlidesSectionNames\">\\n' + section.title + '</div>';\r\n \r\n $sectionList.append(aSection);\r\n\r\n sCounter += section.slides.length;\r\n $(\"#section_\" + (i + 1)).click(function () {\r\n hideSectionsFrame();\r\n go( +this.getAttribute(\"data-slide\") );\r\n });\r\n\r\n $sectionList.append(\"<div id='dummy_\" + (i + 1) + \"' class='agenda-slides-wrapper'></div><div class='clearfix' style='height: 15px;'></div>\");\r\n \r\n var $section = $(\"#dummy_\" + (i + 1));\r\n\r\n for (var j = 0; j < counter; j++) {\r\n $section.append(\"<div class='slide-wrapper' style='display:none'></div>\");\r\n }\r\n\r\n for (var s = 0; s < section.slides.length; s++) {\r\n counter++;\r\n var aSlide = '<div id=\"slider_' + (counter) + '\" data-slide=\"' + (counter) + '\" class=\"aSectionSlide slide-wrapper\">\\n' +\r\n '</div>';\r\n $section.append(aSlide);\r\n var $slideFrame = $('#slider_' + (counter));\r\n $slideFrame.append(section.slides[s]);\r\n var $theSlide = $slideFrame.children(\":first\");\r\n\r\n toggleTransformOnSlideElements( $theSlide );\r\n\r\n $theSlide.css('width', '' + WIDTH + 'px');\r\n $theSlide.css('height', '' + HEIGHT + 'px');\r\n $theSlide.css('-webkit-transform-origin', '0 0 0');\r\n $theSlide.css('-moz-transform-origin', '0 0 0');\r\n $theSlide.css('-ms-transform-origin', '0 0 0');\r\n $theSlide.css('transform-origin', '0 0 0');\r\n $theSlide.css('-webkit-transform', 'scale(' + SCALED + ')');\r\n $theSlide.css('-moz-transform', 'scale(' + SCALED + ')');\r\n $theSlide.css('-ms-transform', 'scale(' + SCALED + ')');\r\n $theSlide.css('transform', 'scale(' + SCALED + ')');\r\n\r\n $slideFrame.click(function () {\r\n hideSectionsFrame();\r\n go( +this.getAttribute(\"data-slide\") );\r\n });\r\n\r\n $('#sectionsClose').click(function () {\r\n hideSectionsFrame();\r\n });\r\n }\r\n }\r\n }\r\n }", "function displaySlides(n) {\n let slides = document.getElementsByClassName(\"carousel__item\");\n\n if (n > slides.length) slide_index = 1;\n if (n < 1) slide_index = slides.length;\n\n for (let i = 0; i < slides.length; i++) {\n slides[i].style.display = \"none\";\n }\n\n if (slides.length > 0) slides[slide_index - 1].style.display = \"block\";\n}", "function render() {\n if (STORE.view === 'start') {\n renderStartQuiz();\n $('.intro').show();\n $('.quiz').hide();\n $('.result').hide();\n $('.quizStatus').hide();\n } else if (STORE.view === 'quiz') {\n renderQuestionText();\n renderQuizStatusBar();\n $('.intro').hide();\n $('.quiz').show();\n $('.result').hide();\n $('.quizStatus').show();\n } else if (STORE.view === 'questionResult') {\n renderQuestionResult();\n renderQuizStatusBar();\n $('.intro').hide();\n $('.quiz').hide();\n $('.result').show();\n $('.quizStatus').show();\n } else if (STORE.view === 'finalResult') {\n renderFinalResult();\n $('.intro').hide();\n $('.quiz').hide();\n $('.result').show();\n $('.quizStatus').hide();\n }\n }", "function renderHome(req, res) {\n res.ViewData.title = \"Labumentous\";\n ChatMessage.all({order:\"ts DESC\", limit:20}, function(err, chatMessages) {\n res.set(noCacheResHeaders);\n res.ViewData.messages = JSON.stringify(chatMessages);\n res.render(\"default\", res.ViewData);\n });\n }", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "index() {\n new IndexView({ el: '.pages-wrapper' });\n }", "function fetchSlideCon(){\n fetch('https://api.jikan.moe/v3/top/anime/1/upcoming')\n .then(response => response.json()) \n .then(function(data){\n console.log(data)\n\n let i = 0\n while (i < 4){\n if (i == 0){\n document.getElementById(\"sImg\").src = data.top[i].image_url\n document.getElementById(\"sTxt\").innerHTML = data.top[i].title\n $('.slides').attr(\"id\", data.top[i].mal_id)\n i++\n }\n else{\n console.log(i)\n con3.innerHTML += \"<div class='slides' style='text-align: center;' id='\"+ data.top[i].mal_id +\"' title='anime'><img src='\"+ data.top[i].image_url +\"' style='width:45%'><div class='text'>\"+ data.top[i].title +\"</div></div>\"\n i ++\n }\n }\n });\n }", "async slideLeft(slides) {\n slides.map((slide, index) =>\n slide.classList.add(...[animation.animated, animation.slideOutRight])\n );\n\n this.frame = [];\n // We don't wont overflow here, it's not easy reacheble, but still\n // If We complete full round, just reseting to -1\n // (should be -1 because totalFrames position it's 0)\n this.startFrame =\n this.startFrame > -1 * this.totalFrames ? this.startFrame - STEP : -1;\n\n // Going throught all frames in current window, and moving it left or right if needed\n for (let i = this.startFrame; i < this.startFrame + elementsLimit; i++)\n this.calculateFramePosition(i);\n\n // All others slides we want to hide\n await this.animateSlideRight(this.childrens);\n this.hideExtraSlides(this.childrens, this.frame, \"left\");\n }", "renderFirst(){\n let slideIndex= this.state.slideIndex;\n slideIndex = slideIndex+1;\n let currentProducts = this.state.products.slice(0, this.state.pageLimit); \n //console.log('<<<<<< Home page first==== >>>> ---> ', slideIndex );\n let pageItems= this.createPageItems(currentProducts);\n this.state.slideIndex = slideIndex;\n return pageItems;\n }", "function setup_slideshow() {\n slide_count = img_array.length;\n current_slide_index = 0;\n set_current_slide(img_array[0].src);\n play();\n}", "function addBlankSlides(startPage, n) {\n\tvar s;\n\tfor (var page = startPage; page < startPage + n; page ++) {\n\t\ts = p.Slides.Add(page, 2);\n\t}\n\treturn s;\n}" ]
[ "0.63974184", "0.61666", "0.5977492", "0.58972645", "0.5822634", "0.57612383", "0.5759071", "0.5750823", "0.57508206", "0.57394934", "0.570845", "0.5707086", "0.5699832", "0.56935453", "0.56266135", "0.56191504", "0.56122166", "0.5607254", "0.55944765", "0.5589179", "0.5574754", "0.55703944", "0.5567835", "0.5567542", "0.5560612", "0.55558634", "0.5548322", "0.5544788", "0.5501815", "0.5501256", "0.5500716", "0.5490517", "0.5487", "0.5481324", "0.54735225", "0.5473108", "0.5471775", "0.54715127", "0.54704535", "0.5469904", "0.54688466", "0.5466479", "0.54634565", "0.5455947", "0.5455406", "0.5448675", "0.5448639", "0.54471505", "0.54454124", "0.5441061", "0.5416898", "0.5413111", "0.5407979", "0.54070044", "0.5401742", "0.5400441", "0.5398359", "0.53941673", "0.5380521", "0.53787", "0.53740454", "0.5368674", "0.53643984", "0.53633595", "0.53629154", "0.5355551", "0.53554606", "0.5352369", "0.53505594", "0.5350042", "0.53477114", "0.5346889", "0.5346421", "0.5346341", "0.5344517", "0.53422105", "0.53398556", "0.53382707", "0.5337765", "0.53361917", "0.5335623", "0.53344977", "0.5334038", "0.5330265", "0.53289396", "0.5326556", "0.5325311", "0.5323882", "0.5322453", "0.53161246", "0.5312538", "0.5310667", "0.5305003", "0.5302206", "0.53017044", "0.52994204", "0.5298744", "0.5295912", "0.52916336", "0.52912676" ]
0.59890044
2
'pagingEnabled': automatically advance to closest page when user drag halfway
render() { return ( <ScrollView horizontal style={{ flex: 1}} pagingEnabled > {this.renderSlides()} </ScrollView> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updatePage(){\n let curPage = this.options.paging.offset,\n idxs = this.getFirstLastIndexes();\n\n if (this.options.internal.oldScrollPosition === undefined){\n this.options.internal.oldScrollPosition = 0;\n }\n\n let oldScrollPosition = this.options.internal.oldScrollPosition,\n newPage = idxs.first / this.options.paging.size;\n\n this.options.internal.oldScrollPosition = newPage;\n\n if (newPage < oldScrollPosition) {\n // scrolling up\n newPage = Math.floor(newPage);\n } else if (newPage > oldScrollPosition){\n // scrolling down\n newPage = Math.ceil(newPage);\n } else {\n // equal, just stay on the current page\n newPage = curPage;\n }\n\n if(!isNaN(newPage)){\n this.options.paging.offset = newPage;\n }\n }", "function swipeHandler() {\r\n if ((swipeEnd - swipeStart) < -100) {\r\n showNext();\r\n }\r\n else if ((swipeEnd - swipeStart) > 100) {\r\n showPrev();\r\n }\r\n}", "selectPageDown() {\n this.$moveByPage(1, true);\n }", "function pageing() {\r\n opts.actualPage = $(\"#ddPaging\").val();\r\n bindDatasource();\r\n }", "function nextPage () {\n if (!ctrl.canPageForward()) { return; }\n\n var newOffset = MdTabsPaginationService.increasePageOffset(getElements(), ctrl.offsetLeft);\n\n ctrl.offsetLeft = fixOffset(newOffset);\n }", "function paginationForward(event){\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tvar currentEq = $('.sp-thumbs .sp-current').index(),\n\t\t\t\t\ttotalItems = $('.sp-thumbs a').length;\n\t\t\t\tif(currentEq+1 >= totalItems) {\n\t\t\t\t} else {\n\t\t\t\t\tvar nextEq = currentEq + 1,\n\t\t\t\t\t\tnewImg = $('.sp-thumbs').find('a:eq('+nextEq+')').attr('href');\n\t\t\t\t\tif (currentEq == (totalItems - 1)) {\n\t\t\t\t\t\t$('#sp-next').css('opacity','.1');\n\t\t\t\t\t}\n\t\t\t\t\t$('.sp-current').removeClass();\n\t\t\t\t\t$('.sp-thumbs a:eq('+nextEq+')').addClass('sp-current');\n\t\t\t\t\tswapImages(currentEq, nextEq);\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t}", "scrollPageDown() {\n this.$moveByPage(1);\n }", "function movePageleftTo(pageNumber) {\n\n}", "function scroll(event){if(!ctrl.shouldPaginate)return;event.preventDefault();ctrl.offsetLeft=fixOffset(ctrl.offsetLeft-event.wheelDelta);}", "function _snapToPage() {\n\t\n\t // Check whether pagination is active\n\t if (!this.options.paginated ||\n\t this._scroll.scrollForceCount || //don't paginate while moving\n\t (this._scroll.springPosition !== undefined)) {\n\t return;\n\t }\n\t\n\t // When the energy is below the thresshold, paginate to the current page\n\t var item;\n\t switch (this.options.paginationMode) {\n\t case PaginationMode.SCROLL:\n\t if (!this.options.paginationEnergyThreshold || (Math.abs(this._scroll.particle.getEnergy()) <= this.options.paginationEnergyThreshold)) {\n\t item = this.options.alignment ? this.getLastVisibleItem() : this.getFirstVisibleItem();\n\t if (item && item.renderNode) {\n\t this.goToRenderNode(item.renderNode);\n\t }\n\t }\n\t break;\n\t case PaginationMode.PAGE:\n\t item = this.options.alignment ? this.getLastVisibleItem() : this.getFirstVisibleItem();\n\t if (item && item.renderNode) {\n\t this.goToRenderNode(item.renderNode);\n\t }\n\t break;\n\t }\n\t }", "updateAfterDrag() {\n const movement = (this.slider.rtl ? -1 : 1) * (this.drag.endX - this.drag.startX);\n const movementDistance = Math.abs(movement);\n const howManySliderToSlide = this.slider.perPage;\n\n const slideToNegativeClone = movement > 0 && this.slider.currentSlide - howManySliderToSlide < 0;\n const slideToPositiveClone = movement < 0 && this.slider.currentSlide + howManySliderToSlide > this.slider.slength - this.slider.perPage;\n\n if (movement > 0 && movementDistance > this.slider.threshold && this.slider.slength > this.slider.perPage) {\n this.slider.prev(howManySliderToSlide);\n } else if (movement < 0 && movementDistance > this.slider.threshold && this.slider.slength > this.slider.perPage) {\n this.slider.next(howManySliderToSlide);\n }\n this.ui.toggle(false);\n this.slider.slideToCurrent(true); // slideToNegativeClone || slideToPositiveClone\n }", "handlePrevPage() {\n if (this.props.start - 20 <= 0) {\n return;\n }\n this.props.getPrevPage(this.props.page - 1);\n }", "toEnablePager(page, numberLeads){\n console.log('pager');\n \n this.state.prevDisabled=true;\n this.state.nextDisabled=true;\n \n if (page>0)\n this.state.prevDisabled=false;\n if (numberLeads>this.state.limit)\n this.state.nextDisabled=false;\n }", "function nextPage () {\n var viewportWidth = elements.canvas.clientWidth,\n totalWidth = viewportWidth + ctrl.offsetLeft,\n i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth > totalWidth) break;\n }\n ctrl.offsetLeft = fixOffset(tab.offsetLeft);\n }", "function nextPage () {\n var viewportWidth = elements.canvas.clientWidth,\n totalWidth = viewportWidth + ctrl.offsetLeft,\n i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth > totalWidth) break;\n }\n ctrl.offsetLeft = fixOffset(tab.offsetLeft);\n }", "selectPageUp() {\n this.$moveByPage(-1, true);\n }", "function pageSkipper(){\n\tvar pageIndicator = document.getElementById(\"jumpval\").value - 2;\n\tif (pageIndicator >= 0){\n\t\twindow.scrollTo({\n\t\t\ttop: array[pageIndicator] + 1,\n\t\t\tbehavior: \"smooth\"\n\t\t});\n\t}\n\telse {\n\t\twindow.scrollTo({\n\t\t\ttop: 0,\n\t\t\tbehavior: \"smooth\"\n\t\t});\n\t}\n}", "_checkPaginationEnabled() {\n if (this.disablePagination) {\n this._showPaginationControls = false;\n }\n else {\n const isEnabled = this._tabList.nativeElement.scrollWidth > this._elementRef.nativeElement.offsetWidth;\n if (!isEnabled) {\n this.scrollDistance = 0;\n }\n if (isEnabled !== this._showPaginationControls) {\n this._changeDetectorRef.markForCheck();\n }\n this._showPaginationControls = isEnabled;\n }\n }", "function moveNext() {\n if (currentPage == totalPages) return;\n loadTaskList(++currentPage);\n}", "gotoPageDown() {\n this.$moveByPage(1, false);\n }", "movePages(n) { \n this.onPageChanged(this.state.slideIndex += n);\n }", "handlePaging() {\n if (!this.settings.paging) {\n return;\n }\n\n this.element.addClass('paginated');\n this.tableBody.pager({\n componentAPI: this,\n dataset: this.settings.dataset,\n hideOnOnePage: this.settings.hidePagerOnOnePage,\n source: this.settings.source,\n pagesize: this.settings.pagesize,\n indeterminate: this.settings.indeterminate,\n rowTemplate: this.settings.rowTemplate,\n pagesizes: this.settings.pagesizes,\n pageSizeSelectorText: this.settings.groupable ? 'GroupsPerPage' : 'RecordsPerPage',\n showPageSizeSelector: this.settings.showPageSizeSelector,\n activePage: this.restoreActivePage ? parseInt(this.savedActivePage, 10) : 1\n });\n\n if (this.restoreActivePage) {\n this.savedActivePage = null;\n this.restoreActivePage = false;\n }\n }", "if (currentPage <= 6) {\n startPage = 1;\n endPage = totalPages;\n }", "_snapCarouselPage() {\n this._setTransitionDuration(this.getTransitionDuration());\n\n var leastDistance = 10000;\n var nearestPageIndex = 0;\n\n // Determine nearest snapPoint.\n for (var i = 0; i < this.__pages.length; i++) {\n var snapPoint = -i * this.__carouselWidth;\n var distance = this.__onMoveOffset[0] - snapPoint;\n if (Math.abs(distance) < leastDistance) {\n leastDistance = Math.abs(distance);\n nearestPageIndex = i;\n }\n }\n\n if (this.getCurrentIndex() == nearestPageIndex) {\n this._refreshScrollerPosition();\n } else {\n this.setCurrentIndex(nearestPageIndex);\n }\n }", "function goNextPage(){\r\n // ensure does not exceed max page limit\r\n if(page < maxPage){\r\n page = page + 1;\r\n }\r\n}", "function galleryPaginationTouch(){\n\n /* get the height of the gallery before changing anything */\n var galleryHeight = $('#portfolio-items').css('height');\n\n // pagination\n if(!$(this).hasClass('current')) {\n // reapply the current class\n $('#gallery-navigation').find('.current').removeClass('current');\n $(this).addClass('current');\n // move visibility and keyboard accessibility over one page\n var count = $(this).index() + 1;\n $('.portfolio-item').removeClass('visible');\n $('.portfolio-item a').attr('tabindex', -1);\n $('.portfolio-item.page-' + count + '').addClass('visible');\n $('.portfolio-item.page-' + count + ' a').attr('tabindex', 0);\n }\n\n /* make sure the gallery height doesn't shrink */\n $('#portfolio-items').css('min-height', galleryHeight);\n }", "function nextPage () {\n var elements = getElements();\n var viewportWidth = elements.canvas.clientWidth,\n totalWidth = viewportWidth + ctrl.offsetLeft,\n i, tab;\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth > totalWidth) break;\n }\n \n if (viewportWidth > tab.offsetWidth) {\n //Canvas width *greater* than tab width: usual positioning\n ctrl.offsetLeft = fixOffset(tab.offsetLeft);\n } else {\n /**\n * Canvas width *smaller* than tab width: positioning at the *end* of current tab to let \n * pagination \"for loop\" to proceed correctly on next tab when nextPage() is called again\n */\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + (tab.offsetWidth - viewportWidth + 1));\n }\n }", "function includePaging1(obj, rows) {\r\n\tobj.enablePaging(true, rows, 5, \"pagingArea1\", true);\r\n\tobj.setPagingSkin(\"bricks\");\r\n}", "handlerForwardClick() {\n let dealers = this.state.delers;\n let rows = [];\n var count = 0;\n\n if (dealers.length < this.state.pointer + 10) {\n for (var i = this.state.pointer; i < dealers.length; i++) {\n rows[count] = dealers[i];\n count++;\n }\n this.state.page += 1;\n this.setState({\n rows: rows,\n forwardDisabled: true,\n backDisabled: false\n });\n } else {\n this.state.nextPointer = this.state.pointer + 10;\n for (var i = this.state.pointer; i < this.state.nextPointer; i++) {\n rows[count] = dealers[i];\n count++;\n }\n let pointer = this.state.pointer + 10;\n this.state.page += 1;\n this.setState({\n rows: rows,\n backDisabled: false,\n pointer: pointer\n });\n }\n }", "function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }", "function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }", "function scroll (event) {\n if (!ctrl.shouldPaginate) return;\n event.preventDefault();\n ctrl.offsetLeft = fixOffset(ctrl.offsetLeft - event.wheelDelta);\n }", "reposSlide() {\n this.current_button.classList.toggle('scroller__page_current', false);\n this.current_button = this.paginator_buttons[Math.min(Math.max(this.current_page, 0), this.count - 1)];\n this.current_button.classList.toggle('scroller__page_current', true);\n this.move(this.current_page);\n }", "function calculateStartEndPage(newPage) {\n vm.startPage = ((newPage - 1) * vm.itemsByPage) + 1;\n vm.endPage = newPage * vm.itemsByPage;\n\n initPagination();\n }", "function calculateStartEndPage(newPage) {\n vm.startPage = ((newPage - 1) * vm.itemsByPage) + 1;\n vm.endPage = newPage * vm.itemsByPage;\n\n initPagination();\n }", "scrollPageUp() {\n this.$moveByPage(-1);\n }", "function scrollToNextPage() {\n gallery_scroller.scrollBy({\n left: gallery_item_size,\n top: 0,\n behavior: 'smooth'\n });\n// updateBtns()\n}", "function theQwertyGrid_prevPage () {\n\t\t\t_theQwertyGrid_rowEnd = _theQwertyGrid_rowStart;\n\t\t\t_theQwertyGrid_rowStart = _theQwertyGrid_rowEnd - _theQwertyGrid_pageSize < 0 ?\n\t\t\t\t\t\t\t\t\t 0 : _theQwertyGrid_rowEnd - _theQwertyGrid_pageSize;\n\t\t\ttheQwertyGrid_setPageSize(_theQwertyGrid_pageSize);\n\t\t}", "function togglePagination() {\n if (App.CurrentPage) {\n //reset pagination\n $('.pagination li').removeClass(\"active\").removeClass(\"disabled\");\n $('.pagination').find(\".page\" + App.CurrentPage).addClass(\"active\");\n if (App.CurrentPage === 1) {\n $('.prev').addClass(\"disabled\");\n } else if (App.CurrentPage === (App.TotalEntries / App.NumEntriesPerPage)) {\n $('.next').addClass(\"disabled\");\n }\n }\n}", "function slidePage(direction, pageNumber) {\n\n\t\tfor ( i = 0; i < $('.page').length; i++ ) {\n\t\t\tif ($('.page').eq(i).hasClass('current')) {\n\t\t\t\tcurrentId = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\tif (pageNumber == -1 && direction) { // getNextPageIndex\n\t\t\tpageNumber = currentId + 1;\n\t\t\tif (pageNumber >= $('.page').length)\n\t\t\t\treturn;\n\n\t\t} else if (pageNumber == -1 && !direction) { // getPreviousPageIndex\n\t\t\tpageNumber = currentId - 1;\n\t\t\tif (pageNumber < 0)\n\t\t\t\treturn;\n\n\t\t}\n\n\t\tsetPages(pageNumber, false);\n\t}", "function clickMove(e) {\n var x = e.pageX - this.offsetLeft;\n\n if (x < slideWidth() / 2) {\n showPreviousSlide();\n } else {\n showNextSlide();\n }\n }", "function nextPage(){var elements=getElements();var viewportWidth=elements.canvas.clientWidth,totalWidth=viewportWidth+ctrl.offsetLeft,i,tab;for(i=0;i<elements.tabs.length;i++){tab=elements.tabs[i];if(tab.offsetLeft+tab.offsetWidth>totalWidth)break;}if(viewportWidth>tab.offsetWidth){//Canvas width *greater* than tab width: usual positioning\n\tctrl.offsetLeft=fixOffset(tab.offsetLeft);}else{/**\n\t * Canvas width *smaller* than tab width: positioning at the *end* of current tab to let \n\t * pagination \"for loop\" to proceed correctly on next tab when nextPage() is called again\n\t */ctrl.offsetLeft=fixOffset(tab.offsetLeft+(tab.offsetWidth-viewportWidth+1));}}", "function next_page() {\n if(current_offset < MAX_OFFSET) {\n current_offset += 10;\n }\n let offset = \"offset=\"+current_offset;\n $.post('../php/sql_paging.php',offset,update_table);\n}", "function movePageNumbersLeft(e, new_p) {\n\t\t\tvar new_page = new_p;\n\n\t\t\tvar $current_active_link = $(e).siblings('.active_page');\n\n\t\t\tif ($current_active_link.siblings('.page_link[longdesc=' + new_page + ']').css('display') == 'none') {\n\n\t\t\t\t$nav_panels.each(function() {\n\t\t\t\t\t$(this).children('.page_link').hide() // Hide all the page links\n\t\t\t\t\t.slice(parseInt(new_page - options.num_page_links_to_display + 1), new_page + 1).show();\n\t\t\t\t});\n\t\t\t}\n\n\t\t}", "function SetPageHandler(event)\n{\n var action = event.data.action;\n var offset = gSTATE.LAST;\n \n gSTATE.PAGE = (action == \"n\") ? gSTATE.PAGE + 1 : gSTATE.PAGE - 1;\n \n // Check for min.\n if (gSTATE.PAGE == 0) {\n gSTATE.PAGE = offset;\n } \n \n // Check for max.\n else if (gSTATE.PAGE == offset+1) {\n gSTATE.PAGE = 1;\n } \n \n ShowMediaTable(gSTATE.PAGE, gSTATE.SORT);\n}", "function handlePagination(event) {\n event.stopPropagation();\n let target = $(\"li\").has(event.target);\n if (target.length) {\n switch (target.attr(\"id\")) {\n case \"left-arrow\": changePage(currentPage - 1); break;\n case \"right-arrow\": changePage(currentPage + 1); break;\n default: changePage(parseInt(target.attr(\"data-value\"))); break;\n }\n }\n}", "function moveCarouselOnPagination() {\n pagination.forEach((item, index) => {\n item.addEventListener(\"click\", () => {\n carouselItemsActiveIndex = index;\n moveCarousel();\n });\n });\n}", "function _pageMove(){\n \n this.on('slide', function(data){\n var moveDistance = data.delta / window.innerWidth;\n \n this.origins.forEach(function(origin, z){\n var move = [origin.get()[0] + moveDistance, origin.get()[1]];\n \n origin.set(move);\n });\n });\n }", "dragDistance () {\n\t\t\tif (this.mouseDown) {\n\t\t\t\tconst { rtl } = this.settings\n\t\t\t\tconst dragDistance = this.dragDistance * (rtl ? -1 : 1)\n\n\t\t\t\tif (dragDistance > this.swipeDistance && this.canGoToPrev) {\n\t\t\t\t\tthis.goToPrev()\n\t\t\t\t\tthis.handleMouseUp()\n\t\t\t\t}\n\n\t\t\t\tif (dragDistance < -1 * this.swipeDistance && this.canGoToNext) {\n\t\t\t\t\tthis.goToNext()\n\t\t\t\t\tthis.handleMouseUp()\n\t\t\t\t}\n\t\t\t}\n\t\t}", "_checkScrollingControls() {\n if (this.disablePagination) {\n this._disableScrollAfter = this._disableScrollBefore = true;\n }\n else {\n // Check if the pagination arrows should be activated.\n this._disableScrollBefore = this.scrollDistance == 0;\n this._disableScrollAfter = this.scrollDistance == this._getMaxScrollDistance();\n this._changeDetectorRef.markForCheck();\n }\n }", "onDragMove (x) {\n // only work when dragging\n if (!this.isDragging()) {\n return\n }\n\n const dragOffset = x - this.state.dragStart\n this.showNeighborSlide(dragOffset > 0 ? 'prev' : 'next')\n this.setState({ dragOffset })\n }", "function _doSequentialScroll() {\r\n\t\t\t\tvar time0 = new Date().getTime(), i = 0, $currPage, $firstPage, $nextPage, $prevPage, //\r\n\t\t\t\t$firstPages, //\r\n\t\t\t\t// scrollTop = $tree.scrollTop(), treeHeight = $oh($tree) + 10, //\r\n\t\t\t\tfirstTop, firstHeight, maxPageIndex, //\r\n\t\t\t\tcurrPageIndex, prevHiddenSize;//\r\n\r\n\t\t\t\t$firstPages = $f(\">div.TrN-P:first\", $f(\"UL:visible\", $tree));\r\n\r\n\t\t\t\tfor (; i < $firstPages.length; i++) {\r\n\t\t\t\t\t$firstPage = $($firstPages[i]);\r\n\r\n\t\t\t\t\tfirstTop = $firstPage.position().top;\r\n\t\t\t\t\tfirstHeight = $c(\"li\", $firstPage).length * opts.rowHeight;\r\n\r\n\t\t\t\t\tmaxPageIndex = $f(\">div.TrN-P\", $firstPage.parent()).length - 1;\r\n\r\n\t\t\t\t\t// eval current page index\r\n\t\t\t\t\tcurrPageIndex = parseInt((-firstTop) / firstHeight);\r\n\t\t\t\t\tif (currPageIndex >= 0) {\r\n\t\t\t\t\t\tif (currPageIndex > maxPageIndex)\r\n\t\t\t\t\t\t\tcurrPageIndex = maxPageIndex;\r\n\t\t\t\t\t\t$currPage = $f(\">div.TrN-P:eq(\" + currPageIndex + \")\", $firstPage.parent());\r\n\r\n\t\t\t\t\t\tif ($currPage.length) {\r\n\t\t\t\t\t\t\tprevHiddenSize = $currPage.prevAll(\"div.TrN-P:hidden\").show().length;\r\n\t\t\t\t\t\t\t$currPage.show();\r\n\t\t\t\t\t\t\t$currPage.next(\"div.TrN-P\").show();\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// $log(\"ui.tree:scroll: firstPage={node:[{1}], top:[{2}], height:[{3}]}, currPageIndex=[{4}], prevHiddenSize=[{5}], currPageSize=[{6}], nextHiddenSize=[{7}]\", time0, $firstPage.find(\">li:first>div.TrN>span.TrT\").text(), firstTop, firstHeight, currPageIndex, prevHiddenSize,\r\n\t\t\t\t\t\t// $currPage.length, $currPage.nextAll(\"div.TrN-P:hidden\").length);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "function goPrevPage(){\r\n // ensure page number is not less than 1\r\n if(page > 1){\r\n page -= 1;\r\n }\r\n}", "function keyPressed() {\n // but we only want to do this on the first page, since the subsequent\n // ones require a mouse click to choose and advance\n if (pageNum == 0) {\n pageNum = pageNum + 1;\n } \n}", "performAutoScroll(y, pageHeight){\n if(this.isDragging) {\n let scrollAreaHeight = pageHeight * AUTO_SCROLL_PAGE_PORTION;\n\n if(y > scrollAreaHeight && y < pageHeight - scrollAreaHeight){\n this.shouldScroll = false;\n return;\n }\n\n // don't call scrollPage if it's already running\n if(this.shouldScroll){\n return;\n }\n\n if (y <= scrollAreaHeight) {\n this.scrollDirection = -1;\n this.shouldScroll = true;\n this.scrollPage();\n }\n if (y >= pageHeight - scrollAreaHeight) {\n this.scrollDirection = 1;\n this.shouldScroll = true;\n this.scrollPage();\n }\n } else {\n this.shouldScroll = false;\n }\n }", "function enablePageScroll() {\n var scrollTop = parseInt(jQuery('html').css('top'));\n jQuery('html').removeClass('noscroll');\n jQuery('html,body').scrollTop(-scrollTop);\n }", "_onPaginationLabelTap() {\n this.self.setCurrentIndex(this.targetIndex);\n }", "function next() {\n if ($scope.options.index < pageCount - 1) {\n $scope.options.index++;\n }\n }", "async loadPreviousPages() {\n logger.debug('AnnotationListWidget#loadPreviousPages', this._loading);\n try {\n if (this._loading) {\n return;\n }\n this._loading = true;\n const minHeight = this._rootElem.height() * this._minContentRelativeHeight;\n const numPages = this._nav.getNumPages();\n let scrollHeight = this._rootElem[0].scrollHeight;\n\n for (let nextPage = this._nav.getActiveRange().startPage - 1;\n nextPage >= 0 && scrollHeight < minHeight;\n scrollHeight = this._rootElem[0].scrollHeight, --nextPage)\n {\n logger.debug('AnnotationListWidget#_loadPreviousPages nextPage:', nextPage, 'scrollHeight:', scrollHeight, 'minHeight:', minHeight);\n await this._loadPage(nextPage);\n }\n } catch (e) {\n logger.error('AnnotationListWidget#loadPreviousPages failed', e);\n } finally {\n this._loading = false;\n }\n }", "function goNext() {\n if (pageNum == pdfDoc.numPages-1)\n {\n \t$(\"#next\").prop(\"disabled\", true);\n \t}\n pageNum++;\n renderPage(pageNum);\n }", "function updatePagination(){updatePagingWidth();ctrl.maxTabWidth=getMaxTabWidth();ctrl.shouldPaginate=shouldPaginate();}", "function enablePageScroll() {\n\n\tvar scrollTop = parseInt(jQuery('html').css('top'));\n\tjQuery('html').removeClass('noscroll');\n\tjQuery('html,body').scrollTop(-scrollTop);\n}", "function rightMove() {\n if(current.attr(\"data-page\")>=(max-4)) {\n if(ellipse.children(\".ellipseLast\").length>0) {\n ellipse.children(\".ellipseLast\").parent().remove();\n }\n }\n if(current.attr(\"data-page\")<max) {\n current.removeClass(\"current\").parent().next().children().addClass(\"current\");\n }\n if(current.attr(\"data-page\")<(max-3)) {\n current.parent().next().next().after($(\"<li class='lf' data-remove='t'><b class='page-link' data-page=\" + (parseInt(current.attr('data-page') )+ 3) + \">\" + (parseInt(current.attr('data-page')) + 3) + \"</b></li>\"));\n }\n if(current.attr(\"data-page\")>(min+2)&&current.attr(\"data-page\")!=max) {\n if(current.attr(\"data-page\")==(min+3)) {\n current.parent().prev().prev().before($(\"<li class='lf disabled' data-remove='t'><span class='ellipseFirst'>...</span></li>\"))\n }\n current.parent().prev().prev().remove();\n }\n if(!(current.attr(\"data-page\")==max)) {\n news.page = parseInt(current.attr(\"data-page\"))+1;\n //console.log(news.page);\n //console.log(news);\n //$(window).scrollTop(0);\n get_data(news)\n }\n }", "function nextPage(){\n if (page > 0)\n {\n setPage( page +1);\n }\n }", "scrollDown() {\n if (this.currentOffset < this.items.length - 1) {\n this.currentOffset++\n this.goToThePage()\n }\n }", "function getNextPage() {\n // the page number can't beyond over the last page\n if ((curPage + 1) < $(\".page\").size()) {\n flipOver(curPage + 1);\n }\n }", "function handleWheelMove(event) {\n if (event.deltaY > 50) {\n scrollDown = true;\n checkDirection();\n }\n else if (event.deltaY < -50) {\n scrollDown = false;\n checkDirection();\n }\n\n // increase/decrease page index base on direction\n function checkDirection() {\n switch (scrollDown) {\n case true:\n moveDownOnePage();\n break;\n\n case false:\n moveUpOnePage();\n break;\n }\n }\n function moveDownOnePage() {\n if ( pageIndex < listBtns.length - 1 ) {\n ++ pageIndex;\n } else {\n pageIndex = 0;\n }\n }\n function moveUpOnePage() {\n if ( pageIndex > 0 ) {\n -- pageIndex;\n } else {\n pageIndex = listBtns.length -1;\n }\n }\n }", "nextPage() {\n if (this.getCurrentIndex() == this.__pages.length - 1) {\n if (this.isScrollLoop() && this.__pages.length > 1) {\n this._doScrollLoop();\n }\n } else {\n this.setCurrentIndex(this.getCurrentIndex() + 1);\n }\n }", "updatePagination() {\n this._checkPaginationEnabled();\n this._checkScrollingControls();\n this._updateTabScrollPosition();\n }", "function paginationPrevNext() {\n paginationPreviousButton.style.opacity = \"1\";\n paginationPreviousButton.style.pointerEvents = \"auto\";\n paginationNextButton.style.opacity = \"1\";\n paginationNextButton.style.pointerEvents = \"auto\";\n if (page == 1) {\n paginationPreviousButton.style.opacity = \"0\";\n paginationPreviousButton.style.pointerEvents = \"none\";\n }\n if (page == maxPage) {\n paginationNextButton.style.opacity = \"0\";\n paginationNextButton.style.pointerEvents = \"none\";\n }\n}", "function nextPage() {\r\n if (getpage < pagiArray.length - 1) {\r\n getpage++;\r\n itemsContainer.innerHTML = \"\";\r\n loadPages(getpage * 20, contenItems)\r\n }\r\n if (getpage === pagiArray.length - 2) {\r\n paginationRight.classList.add(\"black-focus\");\r\n }\r\n checkFocus(paginationLeft);\r\n checkFocus(paginationRight);\r\n getCurrentList();\r\n view === \"list\" ? styleList(\"l\") : styleList(\"g\");\r\n\r\n\r\n}", "nextPage () {\n const { page, itemsPerPage } = this.computedPagination\n if (this.lastItemIndex > 0 && page * itemsPerPage < this.filteredIcons.length) {\n this.setPagination({ page: page + 1 })\n }\n }", "function moveBack() {\n if (currentPage == 1) return;\n loadTaskList(--currentPage);\n}", "function leftMove() {\n if(current.attr(\"data-page\")<=(6-min)) {\n if(ellipse.children(\".ellipseFirst\").length>0) {\n ellipse.children(\".ellipseFirst\").parent().remove();\n }\n }\n if(current.attr(\"data-page\")>min) {\n current.removeClass(\"current\").parent().prev().children().addClass(\"current\");\n }\n //add elem\n if(current.attr(\"data-page\")>(5-min)) {\n current.parent().prev().prev().before($(\"<li class='lf' data-remove='t'><b class='page-link' data-page=\" + (parseInt(current.attr('data-page') )-3) + \">\" + (parseInt(current.attr('data-page')) - 3) + \"</b></li>\"));\n }\n if(current.attr(\"data-page\")<(max-2)&&current.attr(\"data-page\")!=min) {\n if(current.attr(\"data-page\")==(max-3)) {\n current.parent().next().next().after($(\"<li class='lf disabled' data-remove='t'><span class='ellipseLast'>...</span></li>\"))\n }\n current.parent().next().next().remove();\n }\n if(!(current.attr(\"data-page\")==min)) {\n news.page = parseInt(current.attr(\"data-page\"))-1;\n //console.log(news.page);\n //console.log(news);\n //$(window).scrollTop(0);\n get_data(news)\n }\n }", "function paginationBackward(event) {\n\t\t\t\tevent.stopPropagation();\n\t\t\t\tvar currentEq = $('.sp-thumbs .sp-current').index();\n\t\t\t\tif(currentEq <= 0) {\n\t\t\t\t} else {\n\t\t\t\t\tif (currentEq == 1) {\n\t\t\t\t\t\t$('#sp-prev').css('opacity','.1');\n\t\t\t\t\t}\n\t\t\t\t\tvar nextEq = currentEq - 1;\n\t\t\t\t\t$('#sp-next').css('opacity','1');\n\t\t\t\t\t$('.sp-current').removeClass();\n\t\t\t\t\t$('.sp-thumbs a:eq('+nextEq+')').addClass('sp-current');\n\t\t\t\t\tswapImages(currentEq, nextEq)\n\t\t\t\t}\n\t\t\t\tevent.preventDefault();\n\t\t\t}", "function movePages() {\n\t\t// Move page up\n\t\t$(\".badge-up\").click(function(){\n\t\t\twall = $(this).parent();\n\t\t\tnumber = parseInt(wall.attr(\"data-dps-wall-page\"));\n\n\t\t\t// only move up if not the first wall\n\t\t\tif(number > 0) {\n\t\t\t\tpreviousWall = $(\"a[data-dps-wall-page='\" + (number - 1) + \"']\");\n\t\t\t\tpreviousWall.before(wall);\n\t\t\t\trenumberWalls();\n\n\t\t\t\tpreWall = $(\"#page\" + (number - 1));\n\t\t\t\tafterWall = $(\"#page\" + number);\n\n\t\t\t\tpreWall.attr(\"id\", \"page\" + number);\n\t\t\t\tpreWall.attr(\"data-dps-wall-page\", number);\n\n\t\t\t\tafterWall.attr(\"id\", \"page\" + (number - 1));\n\t\t\t\tafterWall.attr(\"data-dps-wall-page\", (number - 1));\n\n\t\t\t\taudiowallChange();\n\t\t\t}\n\t\t});\n\n\t\t// Move page down\n\t\t$(\".badge-down\").click(function(){\n\t\t\twall = $(this).parent();\n\t\t\tnumber = parseInt(wall.attr(\"data-dps-wall-page\"));\n\n\t\t\t// only move page down if not the last page\n\t\t\tif(number < $(\".list-group-item\").length - 2) {\n\t\t\t\tnextWall = $(\"a[data-dps-wall-page='\" + (number + 1) + \"']\");\n\t\t\t\twall.before(nextWall);\n\t\t\t\trenumberWalls();\n\n\t\t\t\tpreWall = $(\"#page\" + number);\n\t\t\t\tafterWall = $(\"#page\" + (number + 1));\n\n\t\t\t\tpreWall.attr(\"id\", \"page\" + (number + 1));\n\t\t\t\tpreWall.attr(\"data-dps-wall-page\", (number + 1));\n\n\t\t\t\tafterWall.attr(\"id\", \"page\" + number);\n\t\t\t\tafterWall.attr(\"data-dps-wall-page\", number);\n\n\t\t\t\taudiowallChange();\n\t\t\t}\n\t\t});\n\t}", "function smallerpagination() {\r\n var maxPerPage = 5;\r\n\r\n var lastPageNumber = $('#move_left').data('count');\r\n // shows dots or no if more pages than maxPerPage\r\n if (lastPageNumber > maxPerPage) {\r\n // \r\n for (let el of document.querySelectorAll('.pagination_page'))\r\n el.style.display = 'none';\r\n // \r\n document.getElementsByClassName('morePages')[0].style.display = 'block';\r\n document.getElementsByClassName('morePages')[1].style.display = 'block';\r\n document.getElementsByClassName('morePages2')[0].style.display =\r\n 'block';\r\n document.getElementsByClassName('morePages2')[1].style.display =\r\n 'block';\r\n document.getElementsByClassName('pageba1')[0].style.display = 'block';\r\n document.getElementsByClassName('pageba1')[1].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + lastPageNumber,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + lastPageNumber,\r\n )[1].style.display = 'block';\r\n //\r\n\r\n // pulka maxima pagination an strance pro zobrazeni pulky predchozich a pulky nadchazejicih\r\n var howMuch = Math.floor(maxPerPage / 2);\r\n // kdyz mensi stranky nez maximum tak to zobrazi na strane else if zobrazi posledni else zobrazi na konci\r\n if (page <= maxPerPage - howMuch) {\r\n for (let index = 1; index <= maxPerPage; index++) {\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[1].style.display = 'block';\r\n }\r\n document.getElementsByClassName('morePages')[0].style.display =\r\n 'none';\r\n document.getElementsByClassName('morePages')[1].style.display =\r\n 'none';\r\n } else if (page > lastPageNumber - maxPerPage + howMuch) {\r\n for (\r\n let index = lastPageNumber - maxPerPage + 1; index <= lastPageNumber; index++\r\n ) {\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[1].style.display = 'block';\r\n }\r\n document.getElementsByClassName('morePages2')[0].style.display =\r\n 'none';\r\n document.getElementsByClassName('morePages2')[1].style.display =\r\n 'none';\r\n } else {\r\n for (\r\n let index = page - howMuch; index < page - howMuch + maxPerPage; index++\r\n ) {\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[0].style.display = 'block';\r\n document.getElementsByClassName(\r\n 'pageba' + index,\r\n )[1].style.display = 'block';\r\n }\r\n }\r\n } else {\r\n document.getElementsByClassName('morePages')[0].style.display = 'none';\r\n document.getElementsByClassName('morePages')[1].style.display = 'none';\r\n document.getElementsByClassName('morePages2')[0].style.display =\r\n 'none';\r\n document.getElementsByClassName('morePages2')[1].style.display =\r\n 'none';\r\n //\r\n }\r\n}", "function handlePagination(e) {\n if (isModifiedEvent(e) || !isLeftClickEvent(e)) {\n return\n }\n e.stopPropagation();\n e.preventDefault();\n var url = $(this).attr(\"href \");\n if (url) handleNavigation(url, true)\n}", "toggle(useInfiniteScroll, pageContext) {\n if (useInfiniteScroll) {\n /* Toggle back to infinite scroll, adjust scroll position. Otherwise we might load 1000s of items at once. */\n const scrollTop = window.pageYOffset || document.documentElement.scrollTop;\n window.scrollTo(0, scrollTop-1);\n this.setState({\n useInfiniteScroll: true\n })\n } else {\n /* Toggle back to pagination, reset items and cursor. */\n const state = {}\n for (var i=this.state.cursor-1; i>=0; i--) {\n state['page'+i] = undefined\n }\n state['page'+pageContext.currentPage] = pageContext.pageImages\n state['cursor'] = pageContext.currentPage+1\n state['useInfiniteScroll'] = false\n this.setState(state)\n }\n }", "function theQwertyGrid_nextPage () {\n\t\t\t_theQwertyGrid_rowStart = _theQwertyGrid_rowEnd;\n\t\t\t_theQwertyGrid_rowEnd = _theQwertyGrid_rowStart + _theQwertyGrid_pageSize > _theQwertyGrid_data.length ?\n\t\t\t\t\t\t\t\t\t_theQwertyGrid_data.length : _theQwertyGrid_rowStart + _theQwertyGrid_pageSize;\n\t\t\ttheQwertyGrid_setPageSize(_theQwertyGrid_pageSize);\n\t\t}", "onPrevClick(){\n if(this.state.currentPage - 1 >= 1){\n this.changePage(this.state.currentPage - 1);\n }\n }", "next() {\n // if we're still navigating within the same step, just update the page number.\n // otherwise, move to the next step.\n const pageIndex = scope.currentStep().currentPageIndex,\n lastPageIndex = scope.currentStep().pages.length - 1;\n if (pageIndex < lastPageIndex) {\n scope.currentStep().currentPageIndex++;\n }\n\n else {\n scope.currentStepIndex++;\n\n // foce start at the beginning of the step.\n scope.currentStep().currentPageIndex = 0;\n }\n }", "preparingDragScroll(){\n //source : https://codepen.io/toddwebdev/pen/yExKoj\n \n let slider = this.mainBox\n let isDown = false\n let startX \n let positionScrolled\n slider.classList.remove('_disable')\n \n slider.addEventListener('mousedown', function(e){\n isDown = true\n startX = e.pageX - slider.offsetLeft\n positionScrolled = slider.scrollLeft\n \n slider.classList.add('active')\n }) \n \n slider.addEventListener('mouseleave', function(){\n isDown = false\n slider.classList.remove('active')\n })\n \n slider.addEventListener('mouseup', function(){\n isDown = false\n slider.classList.remove('active')\n })\n \n slider.addEventListener('mousemove', function(e){\n if(!isDown) return true\n e.preventDefault()\n \n let x = e.pageX - slider.offsetLeft\n let walk = (x - startX ) * 3 //scroll velocity\n slider.scrollLeft = positionScrolled - walk\n })\n }", "function scroller(){\n\t\t\t\t\t$('.scrollPage').click(function(){\n\t\t\t\t\t\tvar elementClicked = $(this).attr(\"href\");\n\t\t\t\t\t\tvar destination = $(elementClicked).offset().top;\n\t\t\t\t\t\t$(\"html:not(:animated),body:not(:animated)\").animate({\n\t\t\t\t\t\t\tscrollTop: destination - 1 //Number being the pixel distance from destination.\n\t\t\t\t\t\t}, 1000, 'easeInOutQuint');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\n\t\t\t\t\t});\n\t\t\t\t}", "_scrollButtonClickHandler(event) {\n const that = this,\n tabStrip = that.$.tabStrip;\n let modifier = event.target.closest('jqx-repeat-button') === that.$.scrollButtonNear ? -1 : 1;\n\n if (that.scrollMode === 'paging') {\n const orientationSettings = that._orientationSettings,\n swipeInfo = {};\n\n that._dragStartDetails = { startX: 0, startY: 0, pageX: 0, pageY: 0, startTime: Date.now(), target: event.target };\n that._wheelInProgress = true;\n swipeInfo[orientationSettings.coordinate] = -modifier * (tabStrip[orientationSettings.size] / 1.1428571428571428);\n that._endSwiping(swipeInfo, that._dragStartDetails.startTime + 175);\n return;\n }\n\n if (that.hasAttribute('horizontal')) {\n tabStrip.scrollLeft += 10 * modifier;\n }\n else {\n tabStrip.scrollTop += 10 * modifier;\n }\n\n that._updateScrollButtonVisibility(true);\n }", "function updatePagination () {\n if (!shouldStretchTabs()) updatePagingWidth();\n ctrl.maxTabWidth = getMaxTabWidth();\n ctrl.shouldPaginate = shouldPaginate();\n }", "function enable (startEventName, panEventName, endEventName) {\n Array.prototype.forEach.call(self.slides.children, function (slide) {\n slide.addEventListener(startEventName, function (event) {\n // Only accept left click for mouse event\n if (startEventName === 'mousedown' && event.which !== 1) return\n // Track flick gesture\n var flick = true\n setTimeout(function () {\n flick = false\n }, 250)\n // Begin dragging\n self.element.classList.add(self.draggingClass)\n var offset = self.slides.getBoundingClientRect().left + document.body.scrollLeft\n var width = self.slides.offsetWidth\n var originalX = Skid.normalizeEventX(event) - offset\n var x = originalX\n var originalPan = self.activeSlideIndex * -100\n var panPosition = originalPan\n var scheduledPan = false\n function pan (event) {\n if (!scheduledPan) {\n scheduledPan = window.requestAnimationFrame(function () {\n x = Skid.normalizeEventX(event) - offset\n panPosition = originalPan + (x - originalX) / width * 100\n self.pan(panPosition)\n scheduledPan = false\n })\n }\n }\n document.addEventListener(panEventName, pan)\n document.addEventListener(endEventName, function end (event) {\n // End dragging\n document.removeEventListener(endEventName, end)\n document.removeEventListener(panEventName, pan)\n window.cancelAnimationFrame(scheduledPan)\n self.element.classList.remove(self.draggingClass)\n // If any distance was dragged, update active slide\n if (x !== originalX) {\n // Determine the closest slide\n var closestSlideIndex = Math.round(panPosition / -100)\n // Handle horizontal flick gesture\n if (flick && Math.abs(originalX - x) > 80 && closestSlideIndex === self.activeSlideIndex) {\n // Gesture has the right timing, length and is useful\n closestSlideIndex += originalX < x ? -1 : 1\n }\n // No slides beyond first or last\n if (closestSlideIndex < 0) closestSlideIndex = 0\n if (closestSlideIndex > self.slideCount - 1) closestSlideIndex = self.slideCount - 1\n var closestSlide = self.slides.children[closestSlideIndex]\n // Only update URL hash if slide is not already active\n if (closestSlide === self.hurdler.target) self.activateSlide(closestSlide.id)\n else self.hurdler.setTarget(closestSlide)\n }\n })\n })\n })\n }", "checkForBeginning() {\n if (this.leftPage !== 1) {\n this.onFirstPage = false;\n } else {\n this.onFirstPage = true;\n }\n }", "function mousemoveForSearchResults(event)\n{\n //console.log('mousemove event on scrollable');\n \n if(!global_mouseButtonDown)\n {\n return false; //do nothing if the mouse button isn't pressed down\n //false is ok to return?\n }\n \n doVerticalDragScrolling(this, event.clientY);\n \n event.preventDefault();\n}", "_switchThumbDragStartHandler(event) {\n const that = this;\n\n if (that.disabled) {\n return;\n }\n\n if ((that.switchMode === 'click') && (that.clickMode !== 'release')) {\n event.preventDefault();\n event.stopPropagation();\n }\n\n if (that._isInactiveOn('drag')) {\n return;\n }\n\n that._mouseDown = true;\n that._getContainersSizeAndBreakPoint();\n that._pointerPosition = (that.orientation === 'vertical' ? event.pageY : event.pageX);\n event.preventDefault();\n }", "prevPage() {\n if (this.page > 1) {\n this.page--;\n this.search();\n }\n }", "function moveDrag(event) {\n var current = event[eventElementName],\n offset = dragStart - current;\n\n if (Math.abs(offset) > 3) {\n if (!dragging) {\n dragging = true;\n $el.trigger('start.oc.dragScroll');\n self.options.start();\n $(document.body).addClass(self.options.dragClass)\n }\n\n self.options.vertical\n ? $el.scrollTop(startOffset + offset)\n : $el.scrollLeft(startOffset + offset);\n\n $el.trigger('drag.oc.dragScroll');\n self.options.drag()\n }\n }", "function onDisplayedPointMousedown(event) {\n\t\tpreviousPageX = event.pageX;\n\t\t\n\t\tpreviousPageY = event.pageY;\n\t\t\n\t\t$(this).on('mousemove', onDisplayedPointMousemove); \n\t}", "async loadPreviousPage() {\n logger.debug('AnnotationListWidget#loadPreviousPage loading:', this._loading);\n try {\n if (this._loading) {\n return;\n }\n this._loading = true;\n const nextPage = this._nav.getActiveRange().startPage - 1;\n if (nextPage >= 0) {\n await this._loadPage(nextPage);\n this._scrollHelper.scrollUp(30);\n }\n } catch (e) {\n logger.error('AnnotationListWidget#loadNextPages failed', e);\n } finally {\n this._loading = false;\n }\n }", "function updatePagination () {\n updatePagingWidth();\n ctrl.maxTabWidth = getMaxTabWidth();\n ctrl.shouldPaginate = shouldPaginate();\n }", "function updatePagination () {\n updatePagingWidth();\n ctrl.maxTabWidth = getMaxTabWidth();\n ctrl.shouldPaginate = shouldPaginate();\n }", "function resetPagingBut()\n { \n \n }", "function _forwardThumbnailScroll() {\n\t\tif (thumbindex < 0) {\n\t\t\tstopSlideshow();\n\n\t\t\tvar\n\t\t\t\tvw = _safeWidth(thumbsBar),\n\t\t\t\ttw = _safeWidth(thumbs);\n\t\t\tvar pos = _getRTLPosition(thumbs); // current left offset of thumbs ribbon w.r.t. left edge of viewer\n\t\t\tvar minpos = vw - tw; // maximum negative value permitted as left offset w.r.t. left edge of viewer\n\n\t\t\tif (tw + pos < vw) { // right end of ribbon is to the right of right edge of viewer\n\t\t\t\t_updateThumbnailNavigation();\n\t\t\t} else {\n\t\t\t\tvar target = {};\n\t\t\t\ttarget[rtlpos] = minpos;\n\t\t\t\tthumbs.animate(target, -4 * (minpos - pos), 'linear', _updateThumbnailNavigation);\n\t\t\t}\n\t\t}\n\t}", "function previousPage () {\n var i, tab, elements = getElements();\n\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n \n if (elements.canvas.clientWidth > tab.offsetWidth) {\n //Canvas width *greater* than tab width: usual positioning\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n } else {\n /**\n * Canvas width *smaller* than tab width: positioning at the *beginning* of current tab to let \n * pagination \"for loop\" to break correctly on previous tab when previousPage() is called again\n */\n ctrl.offsetLeft = fixOffset(tab.offsetLeft); \n }\n }", "function scrollToNextPage() {\n card_scroller.scrollBy(card_item_size, 0);\n }", "async loadNextPage() {\n logger.debug('AnnotationListWidget#loadNextPage loading:', this._loading);\n try {\n if (this._loading) {\n return;\n }\n this._loading = true;\n const nextPage = this._nav.getActiveRange().endPage + 1;\n if (nextPage < this._nav.getNumPages()) {\n await this._loadPage(nextPage);\n this._scrollHelper.scrollDown(30);\n }\n } catch (e) {\n logger.error('AnnotationListWidget#loadNextPages failed', e);\n } finally {\n this._loading = false;\n }\n }" ]
[ "0.6890989", "0.6751678", "0.664563", "0.6590988", "0.6527942", "0.652545", "0.65144897", "0.64308304", "0.6430493", "0.63952345", "0.6382977", "0.6330999", "0.6318201", "0.6307241", "0.6307241", "0.62920284", "0.62862074", "0.62853485", "0.6269437", "0.6225432", "0.62129825", "0.6185394", "0.61704135", "0.6147327", "0.610678", "0.6105537", "0.60554534", "0.6053139", "0.60015434", "0.60013306", "0.60013306", "0.60013306", "0.6000023", "0.59963405", "0.59963405", "0.59925646", "0.59919876", "0.5984643", "0.59766495", "0.5962471", "0.5959161", "0.5930544", "0.5927837", "0.59191203", "0.5918468", "0.59073853", "0.5905421", "0.59031004", "0.5882711", "0.58549356", "0.5840699", "0.5835173", "0.58339685", "0.583162", "0.58289635", "0.58189285", "0.5814525", "0.5812204", "0.5810731", "0.580766", "0.5805184", "0.58023804", "0.5802211", "0.579936", "0.57901174", "0.5775588", "0.57635814", "0.57614744", "0.575553", "0.5746612", "0.5742532", "0.5741084", "0.5738553", "0.5737957", "0.57351273", "0.5733022", "0.57304496", "0.57292956", "0.5711512", "0.57017595", "0.56998175", "0.5691335", "0.56863534", "0.5685079", "0.56833696", "0.56810915", "0.56796443", "0.5671845", "0.56539476", "0.56512463", "0.5650464", "0.56477565", "0.564612", "0.56446713", "0.5636623", "0.5636623", "0.5633388", "0.5628394", "0.562817", "0.56174207", "0.5604939" ]
0.0
-1
Returns a jwt token signed by the app secret
function signToken(id) { return jwt.sign({ _id: id }, config.server.session.secret, { expiresIn: config.server.session.expiresIn } ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateToken(params = {}) {\n return jwt.sign(params, 'secret', {\n expiresIn: '30d',\n });\n}", "function signJWT () {\n return jwt.sign({ retire: 'fearlessly' }, secret);\n}", "function generateToken(params = {}) {\r\n return jwt.sign(params, authConfig.secret, {\r\n expiresIn: 86400,\r\n });\r\n}", "function generateToken(params = {}) {\n return jwt.sign(params, authConfig.secret, {\n expiresIn: 86400\n });\n}", "function tokenConAlgoritmo(){\n const secretKey='secretKey';\n //secret key que será usada en el token\n\n const claims = {\n userName:'The user name'\n } // contenido del JWT playload\n\n\n const token =jwt.sign(claims,secretKey, {algorithm:'RS256'});\n console.log(token);\n}", "function generateToken(params = {}) {\n return jwt.sign(params, authConfig.jwtSecret, {\n expiresIn: 86400 // expires in 1 day = 86400s\n })\n}", "function generateToken(payload){\n var secret=\"IamTheTougestLogic\";\n var token = jwt.encode(payload, secret);\n return token;\n}", "function simpleJWT(){\n const secretKey= 'secretKey'; //secret key que será usada en el token\n const claims={ //contenido del JWT playload\n userName:'The user name'\n }\n //generamos el jwt\n const token =jwt.sign(claims,secretKey);\n console.log(token);\n}", "function tokenForUser(user) {\n const timeStamp = new Date().getTime();\n console.log(process.env.SECRET);\n return jwt.encode({userId: user.id, iat: timeStamp}, process.env.SECRET);\n}", "function generateToken(params = {}) {\n return jwt.sign(params, authConfig.secret, { // ({ id: user.id }, )\n expiresIn: 86400, // time to token expiration 1 day\n });\n}", "function generatetoken(phone,password){\n const token=jwt.sign({phone,password},'mysecret');\n return token;\n \n}", "function createToken(payload){\n return jwt.sign(payload, SECRET_KEY)\n}", "function jwtCreateToken(payload){\n return jwt.sign(payload, secret, { expiresIn: tokenExpiration } );\n}", "function generateToken(user) {\n return jwt.sign(user, process.env.SECRET, {\n expiresIn : 60*60*24 // in seconds\n });\n}", "function getToken(id){\r\n return jwt.sign({object: id}, 'Hello_123');\r\n}", "function tokenForUser (user){\n const timestamp = new Date().getTime()\n return jwt.encode({ sub: user, iat: timestamp }, process.env.SECRET)\n}", "function jwt() {\n return User.jwt();\n}", "function createToken(payload){\r\n return jwt.sign(payload, SECRET_KEY, {expiresIn});\r\n}", "function generateToken(payload) {\n return jwt.sign(payload, process.env.SECRET_KEY_JWT);\n}", "function createToken( user ) \n{\n return jwt.sign( user, 'secret', { expiresIn: 60 * 60 * 5 } );\n}", "function createToken(payload){\n return jwt.sign(payload, SECRET_KEY, {expiresIn})\n}", "static getAuthToken(authSecret, expiresIn = 2 * 60)\n {\n if (authSecret)\n {\n if (!expiresIn)\n {\n return jwt.sign({}, authSecret, {});\n }\n return jwt.sign({}, authSecret, { expiresIn: expiresIn });\n }\n return '';\n }", "function generateJwtToken(payload){\n\t\treturn jwt.sign(payload,app.get('secret'),{\n\t\t\texpiresIn: 86400 //\n\t\t});\n\t}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.API_SECRET);\n}", "function generateToken (user, secret) {\n return jsonwebtoken.sign(\n {\n expiresIn: Date.now() + 1000 * 60 * 60 * 24 * 7, // 1 week\n // exp: Date.now() + 2000, // 2 seconds\n // exp: 60,\n user: user\n },\n secret\n );\n}", "function generateToken(user){\n return jwt.sign(user, authConfig.secret, {\n expiresIn: 10080\n });\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.AUTH_SECRET);\n}", "createToken() {\n\t\tconst date = new Date();\n\t\tconst timestamp = date.getTime() + parseInt(process.env.JWT_EXPIRATION, 10);\n\t\tconst expiry_date = new Date(timestamp);\n\n\t\treturn jwt.sign(\n\t\t\t{\n\t\t\t\t_id: this._id,\n\t\t\t\temail: this.email,\n\t\t\t\texpiry_date: expiry_date.toISOString(),\n\t\t\t},\n\t\t\tprocess.env.JWT_SECRET,\n\t\t\t{\n\t\t\t\texpiresIn: process.env.JWT_EXPIRATION,\n\t\t\t}\n\t\t);\n\t}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.JWT_SECRET);\n}", "function generateToken(userId) {\n // Include some data and an expiration timestamp in the JWT\n return jwt.sign(\n {\n exp: Math.floor(Date.now() / 1000) + 60 * 60 * 24, // This key expires in 1 hour\n data: { userId },\n },\n process.env.JWT_SECRET\n );\n}", "generateToken ({\n id\n }) {\n return jwt.sign({\n id\n }, authentication.jwtSecret, {\n expiresIn: authentication.expireTime\n })\n }", "function createToken(payload) {\r\n return jwt.sign(payload, SECRET_KEY, { expiresIn })\r\n }", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn });\n}", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn });\n}", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn });\n}", "verifyJwt(token) {\n return jwt.verify(token, config.JWT_SECRET, {\n algorithms: ['HS256']\n });\n }", "generateToken(id) {\n let payload = {\n id: id\n };\n\n let token = JWT.sign(payload, process.env.JWT_SECRET, { expiresIn: process.env.JWT_DURATION });\n\n return token;\n }", "function generateToken(user) {\n return jwt.sign(user, config.secret, { expiresIn: 86400});\n}", "function generateToken(user) {\n return jwt.sign(user, config.secret, { expiresIn: 86400});\n}", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, { expiresIn })\n}", "function generateToken (user) {\n return jwt.sign(user, config.secret, {\n expiresIn: 10080 // milliseconds\n })\n}", "verifyJwt(token) {\n return jwt.verify(token, config.JWT_SECRET, {\n algorithms: ['HS256'],\n });\n }", "function getJWT() {\r\n return fetch(auth0Url, {\r\n method: \"POST\",\r\n headers: {\r\n 'content-type': 'application/json',\r\n },\r\n body: JSON.stringify(authPayload)\r\n })\r\n .then(result => result.json())\r\n .then(body => {\r\n console.dir(body);\r\n return body.access_token\r\n });\r\n}", "tokenForUser(user) {\n const timeStamp = new Date().getTime();\n return jwt.encode({ sub: user.id, iat: timeStamp }, config.secret);\n }", "function createToken(payload) {\n return jwt.sign(payload, SECRET_KEY, {\n expiresIn,\n jwtid: uuidv4(),\n audience: [AUDIENCE]\n })\n}", "function tokenForUser(id) {\n const ts = new Date().getTime();\n return jwt.encode({\n uid: id,\n ts: ts\n }, keys.secret);\n}", "function generateToken(user) {\n return jwt.sign(user, config.secret, {\n expiresIn: 604800 // in seconds\n });\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n console.log(user);\n return jwt.encode({ sub: user.id, iat: timestamp }, process.env.AUTH_SECRET);\n}", "function signToken(data) {\n const token = jwt.sign(data, jwtSecret, { expiresIn: \"1h\" });\n //console.log({ token });\n return token;\n}", "function signToken(id) {\n return jwt.sign({ _id: id }, config.secrets.jwt, { expiresInMintes: 60*24*7 /* a week */ });\n}", "function createToken(payload){\n const expiresIn = myOptions.expiresIn;\n return jwt.sign(payload, myOptions.secretKey, { expiresIn })\n}", "function maketoken(info){\n info.expires=Date.now()+tokenExpiresTime\n return jwt.encode(info,secret)\n}", "function tokenForUser(user){\n const timestamp = new Date().getTime();\n return jwt.encode({\n sub: user._id,\n iat: timestamp\n }, config.secretString);\n}", "async function createJwt() {\n\n const now = DateTime.utc();\n\n const payload = {\n iat: now.toSeconds(),\n exp: now.plus(config.jwt.lifetime).toSeconds(),\n };\n\n const token = await new Promise((resolve, reject) => {\n sign(payload, config.jwt.secret, { algorithm: config.jwt.algo }, (error, token) => {\n if (error) {\n reject(error);\n } else {\n resolve(token);\n }\n });\n });\n\n return token;\n\n}", "function genarToken(idUser = {}) {\n return jwt.sign(idUser, authConfig.secret,\n {expiresIn: 86400})\n}", "function getJwt() {\n return localStorage.getItem(jwt_str);\n}", "getToken({\n\t\tid, email, firstName, lastName\n\t}) {\n\t\tconst token = jwt.sign({\n\t\t\tid, email, firstName, lastName\n\t\t}, SECRET_KEY);\n\t\treturn token;\n\t}", "function generateToken(user){\n return jwt.sign({\n id: user.id,\n email: user.email,\n username: user.username,\n profileImageLink: user.profileImageLink\n }, process.env.SECRET_KEY, { expiresIn: process.env.TOKEN_EXP });\n}", "async function getJwt() {\n const genericUser = {\n username: 'admin',\n };\n\n return (await authLogic.login(genericUser)).jwt;\n}", "static decodeJwt(token) {\n let payload = null;\n\n try {\n payload = jwt.decode(token, config.TOKEN_SECRET);\n } catch (err) {\n utils.helpers.handleError(err, 'Authentication.authenticate');\n }\n return payload;\n }", "function tokenForUser(user) {\n const timestamp = new Date().getTime()\n return jwt.encode({ sub: user.id, iat: timestamp }, config.secret);\n}", "function tokenForUser(user) {\n var timestamp = new Date().getTime();\n return _jwtSimple2.default.encode({ sub: user.id, iat: timestamp }, _config2.default.secret);\n}", "createJWT() {\n const header = {\n alg: \"RS384\",\n typ: \"JWT\",\n kid: \"3ab8b05b64d799e289e10a201786b38c\"\n };\n const headerStr = JSON.stringify(header);\n\n const fiveMinutes = 350;\n const payload = {\n iss: PASConfig.clientId,\n sub: PASConfig.clientId,\n aud: this.state.tokenUrl,\n exp: Math.floor(Date.now() / 1000) + fiveMinutes,\n jti: shortid.generate()\n };\n const payloadStr = JSON.stringify(payload);\n\n const data = base64(headerStr) + \".\" + base64(payloadStr);\n const sign = createSign(\"RSA-SHA384\");\n sign.update(data);\n\n const signature = base64.fromBase64(\n sign.sign(PASConfig.privateKey, \"base64\")\n );\n const jwt = data + \".\" + signature;\n\n console.log(jwt);\n return jwt;\n }", "function getAppSigningSecret(app) {\n var signing_options = app.service.config.get('apiJWT');\n if (!signing_options || !signing_options.secret) {\n throw errors.internal_error;\n }\n return signing_options.secret;\n}", "function get_jwt_token(ctx)\n{\n\t// Parses \"Authorization: Bearer ${token}\"\n\tif (ctx.header.authorization)\n\t{\n\t\tconst match = ctx.header.authorization.match(/^Bearer (.+)$/i)\n\n\t\tif (match)\n\t\t{\n\t\t\treturn match[1]\n\t\t}\n\t}\n\n\t// (doesn't read cookies anymore to protect users from CSRF attacks)\n\t// // Tries the \"authentication\" cookie\n\t// if (ctx.cookies.get('authentication'))\n\t// {\n\t// \treturn ctx.cookies.get('authentication')\n\t// }\n}", "function signToken(id) {\n return jwt.sign({_id: id}, config.JWTsecret, {expiresIn: '7d'});\n}", "function generateToken(payload) {\n return _jsonwebtoken2.default.sign(payload, secret, {\n expiresIn: 28800 //Esse token é válido em até 8 HORAS!!\n });\n}", "function createToken(payload) {\n return sign(payload, JWT_SECRET, {\n expiresIn: '1h',\n })\n}", "function tokenForUser(user) {\n const timestamp = new Date().getTime();\n return jwt.encode({sub: user.id, iat: timestamp}, config.secret)\n}", "issueToken (_payload) {\n return jwt.sign(_payload, config.JWT_SECRET, {\n expiresIn: config.JWT_EXPIRES_IN\n })\n }", "verifyJwt(token) {\n return jwt.verify(token,config.JWT_SECRET,{\n algorithms: ['HS256']\n })\n }", "createToken(username) {\n return jwt.sign({\n issuer: username,\n iat: Math.floor(Date.now() / 1000),\n exp: Math.floor(Date.now() / 1000) + ((60 * 60) * 10)\n }, 'secret');\n }", "function getAuthenticationToken() {\n var time = Math.floor(Date.now() / 1000);\n var outgoing = encryptAppData(\n { 'app': name,\n 'time': time,\n 'salt': getSalt(128) }\n );\n\n return {\n 'signature': outgoing.data,\n 'iv': outgoing.iv\n };\n }", "function generateAccessToken(user){\n return jsonwebtoken.sign(user, process.env.SECRET, {expiresIn: '50m'});\n}", "function generateToken(user) {\n //1. Don't use password and other sensitive fields\n //2. Use the information that are useful in other parts\n if (!user) return null;\n var u = {\n id: user.id,\n name: user.name,\n username: user.username,\n isAdmin: user.isAdmin,\n password: user.password\n }; // .env should contain a line like JWT_SECRET=V3RY#1MP0RT@NT$3CR3T#\n\n return jwt.sign(u, process.env.JWT_SECRET, {\n expiresIn: 60 * 60 * 24 // expires in 24 hours\n\n });\n} // return basic user details", "function getJWTToken (socialUserId) {\n return jwt.create(socialUserId)\n}", "function generateToken(payload) {\n var token = jwt.sign(payload, privateKEY, { algorithm: \"RS256\" });\n return token;\n}", "function generateToken(payload) {\n return new Promise((resolve, reject) => {\n jwt.sign(payload, JWT_SECRET_KEY, {\n expiresIn: JWT_EXPIRES_AT\n }, (err, token) => {\n if (err) {\n return reject(err);\n }\n resolve(token);\n })\n })\n}", "function jwtTokenGetter() {\n return localStorage.getItem('id_token');\n}", "function signToken(id) {\n return jwt.sign({ _id: id }, config.secrets.session, { expiresInMinutes: 60*5 });\n}", "function signToken(id) {\n return jwt.sign({ _id: id }, config.secrets.session, { expiresInMinutes: 60*5 });\n}", "function generateJWTToken (user) {\n return jwt.sign(user, jwtSecret, {\n subject: user.Username, // This is the username encoding in the JWTStrategy\n expiresIn: '7d', // This specifies the length of time before the token expiresIn\n algorithm: 'HS256' // The algorithm used to \"sign\" or encode JWT values\n })\n}", "static generateToken(user) {\n const userData = {\n userId: user.id,\n userRoles: user.roles\n };\n return jwt.sign(userData, process.env.JWT_SECRET, {\n expiresIn : 60*60*72 //expires in 30 days\n });\n }", "async function getDashboardToken() {\n const secret = process.env.AUTH0_DASHBOARD_SECRET\n const opts = { algorithm: 'HS256'}\n\n return new Promise((resolve, reject) => {\n jwt.sign({}, secret, opts, (err, token) => {\n if (err) return reject(err);\n\n resolve({token, tokenType: 'Bearer'})\n })\n })\n}", "function tokenForUser(user){\n //when this token was issued\n const timestamp=new Date().getTime();\n //first arg passed to jwt is the info we want to encode, second argument is the secret string we will use to encrypt it\n //jwt is a standard, as a convention json web tokens have a sub property (short for subject-who is the token about), iat-stands for issued at time\n return jwt.encode({ sub: user.id, iat: timestamp }, config.secret)\n}", "function signToken(id) {\n\treturn jwt.sign({ _id: id }, config.secrets.session, { expiresInMinutes: 60*5 });\n}", "function createToken() {\n var token = jwt.sign({\n \"userId\": \"ruhan-jwt-js\",\n \"userDirectory\": \"JWT\"\n // \"email\": \"boz@example.com\",\n // \"Group\": [\"sales\", \"finance\", \"marketing\"]\n }, jwtEncryptionKey, {\n \"algorithm\": \"RS256\"\n })\n return token;\n}", "function jwtGenerator(user_id) {\n const payload = {\n user: {\n id: user_id\n }\n };\n \n return jwt.sign(payload, process.env.jwtSecret, { expiresIn: \"1h\" });\n}", "function generateToken(userid, username) {\n return jwt.sign(\n {\n // Storing typical values that are used during mutations\n id: userid,\n username: username\n // email: user.email,\n //avatarUrl: user.avatarUrl\n },\n process.env.TOKEN_SECRET_KEY,\n { expiresIn: \"15m\" }\n )\n}", "verifyJWT(token) {\n return jwt.verify(token, configService.SECRET);\n }", "createJwt(subject,payload){\n return jwt.sign(payload, config.JWT_SECRET, {\n subject,\n algorithm: 'HS256'\n })\n }", "function generateJwtToken(user){\n const payload = {\n subject:user.id,\n username:user.username,\n }\n\n const secret = process.env.JWT_SECRET\n\n const options = {\n expiresIn: '1hr'\n }\n return jwt.sign(payload, secret, options);\n}", "function getToken({ id, username }) {\n const payload = {\n user: {\n id,\n username\n }\n };\n\n const token = jwt.sign(payload, config.get('jwtSecret'), {\n expiresIn: 3600\n });\n\n return token;\n}", "createJwt(subject, payload) {\n return jwt.sign(payload, config.JWT_SECRET, {\n subject,\n algorithm: 'HS256'\n });\n }", "function getToken() {\n return sessionStorage.getItem('auth');\n }", "function getAccessToken() {\n return 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDBGNEI5OWE0QTdiZTBBNzA3OEE0OGRDNjQwZEZjMjY3QzI2MDAxRjAiLCJpc3MiOiJ3ZWIzLXN0b3JhZ2UiLCJpYXQiOjE2Mjg3NzE1MDkzODYsIm5hbWUiOiJ4aXJ2YTIifQ.AW16Sau5kIPMk0ZlFuqpEalGzxWft0oVc6-UEgPIYb4';\n }", "async generateAuthToken() {\n const token = jwt.sign(\n { _id: this._id.toHexString(), userId: this.userId },\n 'tokencode',\n {\n expiresIn: '30d',\n }\n );\n\n await this.updateOne({\n $push: {\n tokens: token,\n },\n });\n return token;\n }", "function signToken(id) {\n return jwt.sign({ _id: id }, config.secrets.session, { expiresIn: '10h' });\n}", "function createJwtToken(user) {\n return jsonwebtoken.sign({ user }, JWT_SECRET, {\n subject: user.username,\n expiresIn: JWT_EXPIRY,\n algorithm: 'HS256'\n });\n}", "function getJWTToken (){\r\n return typeof JWTToken === \"function\" ? JWTToken() : JWTToken;\r\n }" ]
[ "0.77316517", "0.766371", "0.75443083", "0.7524454", "0.7481579", "0.74680007", "0.7443508", "0.7406235", "0.7388811", "0.73745656", "0.7321042", "0.72938555", "0.72862524", "0.7280918", "0.7272536", "0.7270543", "0.7265712", "0.7243825", "0.72203034", "0.7209451", "0.7208188", "0.72073156", "0.7203661", "0.7155489", "0.71181107", "0.71106356", "0.71065086", "0.7090981", "0.7068381", "0.7065191", "0.7058262", "0.70261353", "0.7025412", "0.7025412", "0.7025412", "0.7020123", "0.701955", "0.7015645", "0.7015645", "0.7015189", "0.7013258", "0.70074534", "0.69972456", "0.6993328", "0.6992617", "0.69855756", "0.6972459", "0.6966852", "0.6957245", "0.6951411", "0.6941229", "0.6915894", "0.6910705", "0.6906551", "0.6901969", "0.6890851", "0.6887665", "0.6876428", "0.68566394", "0.6850827", "0.6848785", "0.6837987", "0.68343043", "0.6829572", "0.68168175", "0.6812334", "0.68097293", "0.6801985", "0.6793368", "0.67857224", "0.6774998", "0.6769335", "0.6759846", "0.6746263", "0.6742101", "0.67286944", "0.672295", "0.67168134", "0.6715756", "0.67090815", "0.67090815", "0.6708024", "0.66963893", "0.66935974", "0.66784424", "0.6660414", "0.66510856", "0.66461945", "0.6645691", "0.6633013", "0.6630921", "0.66177267", "0.66027075", "0.65990514", "0.6598122", "0.659786", "0.65831983", "0.6579027", "0.65777993", "0.6575264" ]
0.67913646
69
Compare two point objects. If the points are not of the same type, returns false. Otherwise, compares the points based on point type and returns true if all of their attributes are equal.
function comparePoints(point1, point2) { if (point1['point-type'] != point2['point-type']) { return false; } if (point1['point-type'] == 'text') { return point1['point-standout'] == point2['point-standout'] && point1['point-body'] == point2['point-body']; } else if (point1['point-type'] == 'badge') { return point1['point-image-url'] == point2['point-image-url']; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "compare(otherPoint) {\n if (typeof otherPoint === 'undefined') {\n console.warn('Compare Points: point not defined.');\n return false;\n }\n const a = E.toFixed(this.x) === E.toFixed(otherPoint.x);\n const b = E.toFixed(this.y) === E.toFixed(otherPoint.y);\n const c = E.toFixed(this.z) === E.toFixed(otherPoint.z);\n if (a && b && c) return true;\n return false;\n }", "function equalPoints(point1, point2) {\r\n\treturn (point1.x == point2.x) && (point1.y == point2.y)\r\n}", "function pointEq(a, b) {\n return a.x === b.x && a.y === b.y;\n}", "equals(x,y){\n let point = new Point(x,y); //this will handle the 'x' being numbers, array, a simple object, or another Point \n return (this.x === point.x && this.y === point.y); \n }", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n var p1 = points1[i];\n var p2 = points2[i];\n\n if (p1[0] !== p2[0] || p1[1] !== p2[1]) {\n return;\n }\n }\n\n return true;\n}", "function isPointsSame(points1, points2) {\n if (points1.length !== points2.length) {\n return;\n }\n\n for (var i = 0; i < points1.length; i++) {\n if (points1[i] !== points2[i]) {\n return;\n }\n }\n\n return true;\n}", "equals(_point) {\n return this.x === _point.x && this.y === _point.y;\n }", "isEqual(point) {\n return (this.x == point.x && this.y == point.y && this.z == point.z);\n }", "function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n }", "shouldComponentUpdate(nextProps) {\n const nonPointsAreEqual = Object.keys(propTypes).every(\n // eslint-disable-next-line react/destructuring-assignment\n prop => prop === 'points' || this.props[prop] === nextProps[prop],\n );\n const { points } = this.props;\n const pointsAreEqual =\n nextProps.points.length === points.length &&\n nextProps.points.every(point => points.indexOf(point) > -1);\n\n return !(pointsAreEqual && nonPointsAreEqual);\n }", "function pointEqual(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "function pointEqual(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "function pointsEqual(a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}", "function pointsEqual(a, b) {\n for (let i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}", "function pointsEqual (a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false\n }\n }\n return true\n}", "function pointsEqual (a, b) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n return true;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n}", "function pointsAreEqual(pointOne, pointTwo, tol) {\n var ptOneDefined = (pointOne && \n pointOne.isDefined() &&\n pointOne.isFinite()),\n ptTwoDefined = (pointTwo &&\n pointTwo.isDefined() &&\n pointTwo.isFinite());\n \n if (ptOneDefined && ptTwoDefined) {\n return GSP.GeometricPoint.expect(pointOne, pointTwo, tol);\n } else {\n return ptOneDefined === ptTwoDefined;\n }\n }", "function pointsEqual (a, b) {\n\t for (var i = 0; i < a.length; i++) {\n\t if (a[i] !== b[i]) {\n\t return false;\n\t }\n\t }\n\t return true;\n\t}", "function equals(p1, p2) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n}", "isAlmostEqual(other) {\n if (!(other instanceof PointString3d))\n return false;\n return PointHelpers_1.Point3dArray.isAlmostEqual(this._points, other._points);\n }", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function equals( p1, p2 ) {\n\n\treturn p1.x === p2.x && p1.y === p2.y;\n\n}", "function pointEqual$1(a, b) {\n return a && b && a[0] === b[0] && a[1] === b[1];\n}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals(p1, p2) {\n\t return p1.x === p2.x && p1.y === p2.y;\n\t}", "function equals( p1, p2 ) {\n\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\n\t}", "function equals( p1, p2 ) {\n\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\n\t}", "function equals( p1, p2 ) {\n\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\n\t}", "function equals( p1, p2 ) {\n\n\t\treturn p1.x === p2.x && p1.y === p2.y;\n\n\t}", "static equals(p1, p2) {\n return p1.x === p2.x && p1.y === p2.y;\n }", "function samePoint(point1, point2, epsilon) {\r\n\treturn (game.math.fuzzyEqual(point1.x, point2.x, epsilon) && game.math.fuzzyEqual(point1.y, point2.y, epsilon));\r\n}", "static isEquivalent(a, b) \n {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n \n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n \n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n \n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n \n // If we made it this far, objects\n // are considered equivalent\n return true;\n }", "comparePoints (a, b) {\n let comparison = 0\n\n if (a.points > b.points) {\n comparison = -1\n } else if (b.points > a.points) {\n comparison = 1\n }\n return comparison\n }", "equals(point, another) {\n // PERF: ensure the offsets are equal first since they are cheaper to check.\n return point.offset === another.offset && Path.equals(point.path, another.path);\n }", "equals(point, another) {\n // PERF: ensure the offsets are equal first since they are cheaper to check.\n return point.offset === another.offset && Path.equals(point.path, another.path);\n }", "function arePropertiesEqual(p1, p2) {\n if (Array.isArray(p1) && Array.isArray(p2)) {\n if (p1.length != p2.length) {\n return false;\n }\n\n for (var i = 0; i < p1.length; i++) {\n var found = false;\n for (var j = 0; j < p2.length; j++) {\n if (arePropertiesEqual(p1[i], p2[j])) {\n found = true;\n break;\n }\n }\n\n if (!found) {\n return false;\n }\n }\n\n return true;\n }\n else if (typeof p1 == 'object' && typeof p2 == 'object') {\n var areEqual = (p1 != null);\n if (areEqual) {\n radiant.each(p1, function (k, v) {\n if (!areEqual) {\n return;\n }\n areEqual = arePropertiesEqual(v, p2 && p2[k]);\n });\n }\n\n return areEqual;\n }\n\n return p1 == p2;\n}", "static isEquivalent (objA, objB) {\n\t\tconst objAProperties = Object.getOwnPropertyNames(objA);\n\t\tconst objBProperties = Object.getOwnPropertyNames(objB);\n\n\t\tif (objAProperties.length !== objBProperties.length) return false;\n\n\t\treturn objAProperties.every( property => objA[property] === objB[property]);\n\t}", "function isEquivalent(a, b) {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n if (a[propName].constructor !== b[propName].constructor) {\n // If values do not have the same type, they are not\n // equal and the objects are not equivalent\n return false;\n }\n if (a[propName].constructor === Array || a[propName].constructor === Object) {\n if (!isEquivalent(a[propName], b[propName])) {\n return false;\n }\n } else if (a[propName] !== b[propName]) {\n // If values of same property are not equal,\n // objects are not equivalent\n return false;\n }\n }\n\n // If we made it this far, objects\n // are considered equivalent\n return true;\n}", "function isPointIdentical(activity, xValue, yValue) {\n var identicalResult = false;\n //compare the values on the chart itself so that the points don't overlap\n activity.dataPoints.forEach(function(dataPoint) {\n if (dataPoint.x !== null || dataPoint.y !== null) { //ignore deleted points\n if (x(dataPoint.x) <= x(xValue + 2)\n && x(dataPoint.x) >= x(xValue - 2)\n && y(dataPoint.y) <= y(yValue + 2)\n && y(dataPoint.y) >= y(yValue - 2)) {\n identicalResult = true;\n }\n }\n });\n return identicalResult; //cannot return out of forEach loop\n}", "function compareP(a, b) {\n if (a.Points > b.Points)\n return -1;\n if (a.Points < b.Points)\n return 1;\n\n if (a.GD < b.GD)\n return -1;\n if (a.GD > b.GD)\n return 1;\n if (a.GF > b.GF)\n return -1;\n if (a.GF < b.GF)\n return 1;\n return 0;\n }", "function sameProps(objA, objB) {\n var keysA = Object.keys(objA)\n var keysB = Object.keys(objB)\n\n if (keysA.length !== keysB.length)\n return false\n\n for (var i = 0; i < keysA.length; i++) {\n if (keysA[i] !== keysB[i])\n return false\n }\n\n return true\n}", "function Point(x, y) {\n //properties\n this.x = x;\n this.y = y;\n\n //Gets or sets the coordinates of the point\n this.coords = function (xy) {\n if (xy) {\n this.x = xy.x;\n this.y = xy.y;\n } else {\n return { x: this.x, y: this.y };\n }\n };\n\n this.equals = function (xy) {\n if (xy.x == this.x && xy.y == this.y) {\n return true;\n } else {\n return false;\n }\n }\n}", "function equal(a, b) {\n\n if (Object.is(a, b))\n return true;\n\n\t// Dates must have equal time values\n\tif (isDate(a) && isDate(b))\n\t\treturn a.getTime() === b.getTime();\n\n\t// Non-objects must be strictly equal (types must be equal)\n\tif (!isObject(a) || !isObject(b))\n\t\treturn a === b;\n\n\t// Prototypes must be identical. getPrototypeOf may throw on\n\t// ES3 engines that don't provide access to the prototype.\n\ttry {\n\n\t if (Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))\n\t\t return false;\n\n\t} catch (err) {}\n\n\tvar aKeys = Object.keys(a),\n\t\tbKeys = Object.keys(b);\n\n\t// Number of own properties must be identical\n\tif (aKeys.length !== bKeys.length)\n\t\treturn false;\n\n\tfor (var i$0 = 0; i$0 < aKeys.length; ++i$0) {\n\n\t\t// Names of own properties must be identical\n\t\tif (!OP_hasOwnProperty.call(b, aKeys[i$0]))\n\t\t\treturn false;\n\n\t\t// Values of own properties must be equal\n\t\tif (!equal(a[aKeys[i$0]], b[aKeys[i$0]]))\n\t\t\treturn false;\n\t}\n\n\treturn true;\n}", "function compare(a, b) {\r\n\t\t\t\tvar prop;\r\n\t\t\t\tif (props) {\r\n\t\t\t\t\tfor (var j = 0; j < props.length; j++) {\r\n\t\t\t\t\t\tprop = props[j];\r\n\r\n\t\t\t\t\t\tif (a[prop] != b[prop]) return false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else {\r\n\t\t\t\t\tfor (prop in a) {\r\n\t\t\t\t\t\tif (a[prop] != b[prop]) return 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}", "isEqual(x, y) {\n return this.x === x && this.y === y;\n }", "compare_application_points(point_a, point_b, threshold) {\n for(var i = 0; i < point_a.length; i++)\n if(point_a[i] != null && point_b[i] != null && Math.abs(point_a[i] - point_b[i]) > threshold)\n return false;\n return true;\n }", "function isEquivalent(a, b) {\n // Create arrays of property names\n let aProps = Object.getOwnPropertyNames(a);\n let bProps = Object.getOwnPropertyNames(b);\n\n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n\n for (let i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n\n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n\n // If we made it this far, objects\n // are considered equivalent\n return true;\n}", "function comparePoints(pointA, pointB) {\n let status;\n if (pointB[1] >= pointA[1]) {\n if (pointB[0] >= pointA[0]) {\n //unten rechts\n status = \"unten rechts\";\n } else {\n //unten links\n status = \"unten links\";\n }\n } else {\n if (pointB[0] >= pointA[0]) {\n //oben rechts\n status = \"oben rechts\";\n } else {\n //oben links\n status = \"oben links\";\n }\n }\n return status;\n}", "function deepEqual(el1, el2)\n{\n if ((typeof el1) == (typeof el2))\n {\n if ((typeof el1) === 'object')\n {\n if ((el1 == null) && (el2 == null))\n {\n console.log(\"Both null\");\n return true;\n }\n else\n {\n //compares number of properties from each object\n if (Object.keys(el1).length != Object.keys(el2).length)\n {\n return false;\n }\n\n var match = true;\n for (var elem in el1)\n {\n //makes sure that the property is from object, not from prototype\n if (el1.hasOwnProperty(elem) && (el2[elem] != undefined))\n {\n if (el1[elem] != el2[elem])\n {\n match = false;\n }\n }\n }\n return match;\n }\n }\n else\n {\n return el1 === el2;\n }\n }\n else\n {\n console.log(\"Not the same type\");\n return false;\n }\n}", "equals(...args) \r\n {\r\n let a, b;\r\n if (args[0] instanceof Vector2D) \r\n {\r\n a = args[0].x || 0;\r\n b = args[0].y || 0;\r\n } \r\n else if (args[0] instanceof Array) \r\n {\r\n a = args[0][0] || 0;\r\n b = args[0][1] || 0;\r\n } \r\n else \r\n {\r\n a = args[0] || 0;\r\n b = args[1] || 0;\r\n }\r\n return this.x === a && this.y === b;\r\n }", "function isEquivalent(a, b) {\n // Create arrays of property names\n var aProps = Object.getOwnPropertyNames(a);\n var bProps = Object.getOwnPropertyNames(b);\n\n // If number of properties is different,\n // objects are not equivalent\n if (aProps.length != bProps.length) {\n return false;\n }\n\n for (var i = 0; i < aProps.length; i++) {\n var propName = aProps[i];\n\n // If values of same property are not equal,\n // objects are not equivalent\n if (a[propName] !== b[propName]) {\n return false;\n }\n }\n // If we made it this far, objects\n // are considered equivalent\n return true;\n}", "function compareObjects(obj1, obj2){\n\tswitch(typeof(obj1)){\n\t\tcase 'string':\n\t\t\tif(obj1 != obj2) return false;\n\t\t\tbreak;\n\t\tcase 'number':\n\t\t\tif(obj1 != obj2) return false;\n\t\t\tbreak;\n\t\tcase 'boolean':\n\t\t\tif(obj1 != obj2) return false;\n\t\t\tbreak;\n\t}\n\t\n\t//If they aren't both objects they can't match, either.\n\tif( typeof(obj1) != typeof(obj2) ){\n\t\treturn false;\n\t}\n\t\n\tfor(p in obj1){\n\t\tswitch(typeof(obj1[p])){\n\t\t\tcase 'object':\n\t\t\t\tif (!compareObjects(obj1[p], obj2[p])){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t/*we'll ignore methods in objects as harmless.\n\t\t\tcase 'function':\n\t\t\t\tif ( typeof(obj2[p])=='undefined' || obj1[p].toString() != obj2[p].toString() ){\n\t\t\t\t\treturn false;\n\t\t\t\t};\n\t\t\t\tbreak;\n\t\t\t*/\n\t\t\tdefault:\n\t\t\t\tif (obj1[p] != obj2[p]){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t}\n\t}\n\t\n\tfor(p in obj2){\n\t\tif(typeof obj1[p] == 'undefined'){\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\n}", "checkDist ( point1, point2 ) {\n\t\tlet dist = (point1.x - point2.x) * (point1.x - point2.x)\n\t\t\t+ (point1.y - point2.y) * (point1.y - point2.y);\n\t\tlet th = this.params.distMerge * this.params.distMerge;\n\n\t\treturn (dist > th);\n\t}", "function objects_hold_same_values(o1, o2)\n{\n\tif (typeof(o1) != typeof(o2))\n\t\treturn false;\n\t\t\n\tswitch (typeof(o1))\n\t{\n\t\tcase \"number\":\n\t\t\tif (isNaN(o1) && isNaN(o2))\n\t\t\t\treturn true;\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t\tcase \"boolean\":\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t\tcase \"string\": \n\t\t\tif (o1 != null && o2 != null && o1.length != o2.length)\n\t\t\t\treturn false;\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t\tcase \"object\": /* also, arrays */\n\t\t\tif (o1 != null && o2 != null && o1.length != o2.length)\n\t\t\t\treturn false;\n\t\t\tvar i;\n\t\t\tfor (i in o1)\n\t\t\t{\n\t\t\t\tif(!objects_hold_same_values(o1[i], o2[i]))\n\t\t\t\treturn false;\n\t\t\t}\n\t\tbreak;\n\t\tdefault:\n\t\t\treturn o1 == o2;\n\t\tbreak;\n\t}\n\n\treturn true;\n}", "function e(o) {\n return \"point\" === o || \"multipoint\" === o || \"polyline\" === o || \"polygon\" === o;\n }", "function areEquals(a, b) {\n\n\tlet aProps = Object.getOwnPropertyNames(a);\n let bProps = Object.getOwnPropertyNames(b);\n\n if (bProps.length !== aProps.length)\n \treturn false;\n\n for (let key of aProps) {\n \tif (!bProps.includes(key) || b[key] !== a[key])\n \t\treturn false;\n }\n\n for (let key of bProps) {\n \tif (!aProps.includes(key) || b[key] !== a[key])\n \t\treturn false;\n }\n\n return true;\n}", "function pointCompare(aRow, bRow, key){\n if(key !== \"points\" && key !== \"custPoints\") return false;\n let cmp = aRow[key] - bRow[key];\n if(cmp !== 0) return cmp;\n return tieBreakerCompare(aRow, bRow);\n}", "function isConnectedXY (polygonA, polygonB) {\n if (polygonA[0] instanceof Array) polygonA=polygonA[0]; //this takes care of the fact that jsclip will return inner array\n if (polygonB[0] instanceof Array) polygonB=polygonB[0];\n for (var y = 0; y < polygonA.length; y++) { //compare points\n\tfor (var z=0; z< polygonB.length; z++) {\n\t //IMPORTANT. rounding to two decimal places b/c of errors with matching points\n\t var aX = polygonA[y].X.toFixed(0),//rounded to zero decimals b/c that's what jsclipperdoes\n\t\tbX = polygonB[z].X.toFixed(0),\n\t\taY = polygonA[y].Y.toFixed(0),\n\t\tbY = polygonB[z].Y.toFixed(0);\n\t polygonA[y].X = +aX;\n\t polygonB[z].X = +bX;\n\t polygonA[y].Y = +aY;\n\t polygonB[z].Y = +bY;\n\t // reassigning rounded point values in polygons for future use\n\t if (aX===bX && aY===bY) //points match\n\t\treturn true;\n\t}\n }\n return false;\n}", "function comparator(a, b, meta) {\r\n if (a === b) {\r\n return true;\r\n }\r\n if (a && b && typeof a === 'object' && typeof b === 'object') {\r\n if (isPlainObject(a) && isPlainObject(b)) {\r\n return areObjectsEqual(a, b, isEqual, meta);\r\n }\r\n var aShape = Array.isArray(a);\r\n var bShape = Array.isArray(b);\r\n if (aShape || bShape) {\r\n return aShape === bShape && areArraysEqual(a, b, isEqual, meta);\r\n }\r\n aShape = a instanceof Date;\r\n bShape = b instanceof Date;\r\n if (aShape || bShape) {\r\n return (aShape === bShape && sameValueZeroEqual(a.getTime(), b.getTime()));\r\n }\r\n aShape = a instanceof RegExp;\r\n bShape = b instanceof RegExp;\r\n if (aShape || bShape) {\r\n return aShape === bShape && areRegExpsEqual(a, b);\r\n }\r\n if (isPromiseLike(a) || isPromiseLike(b)) {\r\n return a === b;\r\n }\r\n if (HAS_MAP_SUPPORT) {\r\n aShape = a instanceof Map;\r\n bShape = b instanceof Map;\r\n if (aShape || bShape) {\r\n return aShape === bShape && areMapsEqual(a, b, isEqual, meta);\r\n }\r\n }\r\n if (HAS_SET_SUPPORT) {\r\n aShape = a instanceof Set;\r\n bShape = b instanceof Set;\r\n if (aShape || bShape) {\r\n return aShape === bShape && areSetsEqual(a, b, isEqual, meta);\r\n }\r\n }\r\n return areObjectsEqual(a, b, isEqual, meta);\r\n }\r\n return a !== a && b !== b;\r\n }", "eqs(other) {\n if ( other === null ) return false;\n return this.x === other.x && this.y === other.y && this.z === other.z;\n }", "function typeEquals(type1, type2) {\n if (type1 === type2) return true;\n // TODO handle intersection types\n if (!(type1 instanceof UnionType)) return false;\n if (!(type2 instanceof UnionType)) return false;\n if (type1.types.length !== type2.types.length) return false;\n for (var i = 0; i < type1.types.length; i++) {\n // Theoretically we should use 'typeEquals' here, but we don't have nested unions in practice:\n if (type1.types[i] !== type2.types[i]) {\n return false;\n }\n }\n return true;\n }", "function samePoint(p, q) {\n return p.x === q.x && p.y === q.y;\n}", "function validatePointsObject(pointsObject)\n{ \n var valid = true;\n valid &= pointsObject['point1'] != null && pointsObject['point2'] != null; // first check parent nodes\n\n if (!valid)\n return false;\n\n valid &= !isNaN(pointsObject['point1']['lat']) && !isNaN(pointsObject['point1']['lng']);\n valid &= !isNaN(pointsObject['point2']['lat']) && !isNaN(pointsObject['point2']['lng']);\n\n return valid;\n}", "equivalent(point,epsilon) {return new M.XY(this.x,this.y).equivalent(point,epsilon);}", "function sameType(x, y) {\n return typeof x === typeof y && type(x) === type(y);\n }", "function sameShapeAndProto(a, b) {\n return JSON.stringify(a) === JSON.stringify(b) && hasSamePrototypeChain(a, b)\n}" ]
[ "0.73032194", "0.6706084", "0.6620259", "0.65700006", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.6461407", "0.64458275", "0.635015", "0.6307292", "0.62162405", "0.6213716", "0.6202452", "0.6202452", "0.61630476", "0.61588955", "0.61543036", "0.6138301", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6119228", "0.6099791", "0.6096451", "0.6091881", "0.60880756", "0.6087957", "0.6087957", "0.6087957", "0.6087957", "0.6087957", "0.60383964", "0.60300255", "0.60300255", "0.60300255", "0.60300255", "0.60300255", "0.59907055", "0.59907055", "0.59907055", "0.59907055", "0.590316", "0.58613896", "0.5789917", "0.5785356", "0.57533765", "0.57533765", "0.5633571", "0.5571545", "0.5548495", "0.5512774", "0.54632753", "0.5462489", "0.5446758", "0.54449356", "0.5433584", "0.5399084", "0.5389712", "0.53896314", "0.5389207", "0.53611505", "0.5348311", "0.53360635", "0.53357637", "0.53349555", "0.5332299", "0.5325977", "0.5321382", "0.5312855", "0.5306729", "0.5293322", "0.5283714", "0.5279244", "0.5264602", "0.5255285", "0.5240853", "0.523081", "0.5216971" ]
0.7397731
0
Challenge: Please fill the fridge array with 5 items of your choice. Challenge 2: You have bought some chicharon. Please remove it from the buyList and add it to the items in fridge. Challenge 3: Write a function that will remove an item from the fridge, and put it in the buyList, on the press of the moveUp button.
function moveUp() { //your code const fromFridge = fridge.pop(); if (fromFridge) { buyList.push(fromFridge); updateDisplay(); } else { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveDown() {\n //your code\n const fromBuyList = buyList.pop();\n if (fromBuyList) {\n fridge.push(fromBuyList);\n updateDisplay();\n } else {\n return;\n }\n}", "function moveUp(){\n //your code\n\n // if(fridge.length !== 0){\n // buyList.push(fridge[0]);\n // fridge.shift();\n \n // console.log(fridge);\n // console.log(buyList);\n // } else {\n // return null\n // }\n \n // fridge.forEach(function(item, index) {\n // fridge.splice(index, 1);\n // buyList.push(item);\n // console.log(fridge)\n // });\n \n \n if(fridge.length !== 0){\n var data = fridge.shift()\n buyList.push(data)\n console.log(buyList);\n buyListDisplay.innerHTML = buyList\n fridgeListDisplay.innerHTML = fridge\n\n } else {\n console.log(fridge);\n return null\n }\n}", "function moveDown(){\n //your code\n \n if(buyList.length !== 0){\n var data = buyList.pop(data);\n fridge.push(data)\n console.log(buyList);\n console.log(fridge);\n buyListDisplay.innerHTML = buyList\n fridgeListDisplay.innerHTML = fridge\n } else {\n return null\n }\n}", "function addItemToFridge() {\n\n\tconsole.log(\"Clicked\");\n\n\t// var toAdd = prompt(\"Enter an item\");\n\tvar toAdd = document.getElementById(\"fridgeItemToAdd\").value;\n\tvar qty = Number(document.getElementById(\"fridgeAddNum\").value);\n\n\t// Returns if user cancelled.\n\tif (toAdd == null) {\n\t\treturn;\n\t}\n\n\t// Removes leading and trailing whitespaces.\n\ttoAdd = toAdd.trim();\n\n\t// Returns if user did not enter any non-whitespace characters.\n\tif (toAdd === \"\") {\n\t\talert(\"Please enter a valid item name\");\n\t\treturn;\n\t}\n\n\tif (qty <= 0) {\n\t\talert(\"Please enter a valid quantity\");\n\t\t$(\"#fridgeAddNum\").val(\"\");\n\t\treturn;\n\t}\n\n\t// Clears the input field.\n\t$(\"#fridgeItemToAdd\").val(\"\");\n\t$(\"#fridgeAddNum\").val(\"\");\n\n\tconsole.log(toAdd);\n\n\t// Adds to the fridge.\n\tif (!inArray(toAdd, fridge)) {\n\n\t\tconsole.log(\"Adding the item\");\n\n\t\tfridge.push([qty, toAdd]);\n\n\t\t// Gets the html element with the id fridgeList.\n\t\tvar fridgeList = $(\"#fridgeList\");\n\n\t\t// Appends the new item to the list.\n\t\tvar i = fridge.length - 1;\n\n\t\tfridgeList.append(\"<div class='row item' id='fridgeItem\" + i + \"'><div class='col-xs-4'><input class='changeQuant' type='text' id='fridgeQty\" + i + \"' onkeypress='return event.charCode >= 48 && event.charCode <= 57'></input></div><div class='col-xs-8'><p>\" + toAdd + \"</p></div></div>\");\n\t\t$(\"#fridgeQty\" + i).val(qty);\n\t\t$(\"#fridgeQty\" + i).keypress(updateFridgeQty);\n\t}\n\telse {\n\n\t\tconsole.log(\"Incrementing item\");\n\n\t\tvar i = indexInArray(toAdd, fridge);\n\n\t\tqty = qty + fridge[indexInArray(toAdd, fridge)][0];\n\t\tfridge[indexInArray(toAdd, fridge)][0] = qty;\n\n\t\t$(\"#fridgeItem\" + i).html(\"<div class='col-xs-4'><input class='changeQuant' type='text' id='fridgeQty\" + i + \"' onkeypress='return event.charCode >= 48 && event.charCode <= 57'></input></div><div class='col-xs-8'><p>\" + toAdd + \"</p></div>\");\n\t\t$(\"#fridgeQty\" + i).val(qty);\n\t\t$(\"#fridgeQty\" + i).keypress(updateFridgeQty);\n\t}\n\n\t// Saves the updated fridge to local storage.\n \tlocalStorage.setItem(\"fridge\", JSON.stringify(fridge));\n}", "function untickItem(UntickItem){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList == null){\n boughtList = [];\n }\n else{\n boughtList = JSON.parse(boughtList);\n boughtList = convertObjArrayToItemArray(boughtList);\n }\n var chosenList = localStorage.getItem(\"chosenList\");\n var shoppingList = localStorage.getItem(chosenList);\n if(shoppingList != null){\n shoppingList = JSON.parse(shoppingList);\n shoppingList = convertObjArrayToItemArray(shoppingList);\n }\n for (var i = 0; i < boughtList.length; i++){\n if(UntickItem[0] == boughtList[i].name){\n var tempUntickItem = boughtList[i];\n boughtList.splice(i, 1);\n shoppingList.push(tempUntickItem);\n }\n }\n localStorage.setItem(chosenBoughtList, JSON.stringify(boughtList));\n localStorage.setItem(chosenList, JSON.stringify(shoppingList));\n}", "takeout(item) {\n var index = this.item.indexOf(item);\n if (this.open = true && index > -1) {\n this.item.splice(index, 1);\n alert(\"Item has been removed from the backpack.\");\n }\n }", "function dropItem(itemName){\r\n\tvar x, y;\r\n\tdo{\r\n\t\tx = randomAlong(canvasWidth, pixelSize);\r\n\t\ty = randomAlong(canvasHeight, pixelSize);\r\n\t}while(snake.bodyContains(x, y));\r\n\t\r\n\titems.push(new Item(itemName, x, y));\r\n\t\r\n\tdo{\r\n\t\tx = randomAlong(canvasWidth, pixelSize);\r\n\t\ty = randomAlong(canvasHeight, pixelSize);\r\n\t}while(snake.bodyContains(x, y));\r\n\t\r\n\tif(randomInclusive(0, 3) == 0){\r\n\t\titems.push(new Item(\"cherry\", x, y));\r\n\t}\r\n\telse if(randomInclusive(0, 3) == 0){\r\n\t\titems.push(new Item(\"chocolate\", x, y));\r\n\t}\r\n\telse{\r\n\t\tif(randomInclusive(0, 3) == 0){\r\n\t\t\titems.push(new Item(\"icecream\", x, y));\r\n\t\t}\r\n\t\telse{\r\n\t\t\tif(randomInclusive(0, 3) == 0){\r\n\t\t\t\tif(partyOn){\r\n\t\t\t\t\titems.push(new Item(\"party\", x, y));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function glutenFreeBeer(){\n\tvar glutenFreeArray = [];\n\tfor(var i = 0; i < beer.length; i++){\n\t\tif(beer[i].gluten == false){\n\t\t\tglutenFreeArray.push(beer[i]);\n\t\t}\n\t}\n\t\n\tnameSort(glutenFreeArray);\n\tvar id = 0;\n\tfor(var i = 0; i < glutenFreeArray.length; i++){\n\t\t\t\t$('#item-collection').append('<div class=\"menucard\" id=\"card-item'+ id +'\"> ' +\n\t\t\t\t\t\t'<img src=\"' + glutenFreeArray[i].img +'\" id=\"pic' + id + '\" class=\"pic\"> <div class=\"menucardcontainer\">' +\n\t\t\t\t\t\t'<img src=\"'+ glutenFreeArray[i].detailimg +'\" id=\"detailpic'+ id + '\" class=\"detailpic\">' + \n\t\t\t\t\t\t'<h4 class=\"drink\" id=\"drink'+ id +'\"><b>' + glutenFreeArray[i].name + '</b></h4> <p class=\"pricetag\" id=\"pricetag' + id + '\">'\n\t\t\t\t\t\t + glutenFreeArray[i].price + ' kr</p> <button class=\"plussign\" id=\"addplus'+ id +'\" aria-hidden=\"true\">add</button>' +\n\t\t\t\t\t\t'<p class=\"desc\" id=\"desc' + id + '\">'+ glutenFreeArray[i].description +'</p> <p class=\"desc\" id=\"country' + \n\t\t\t\t\t\tid + '\">'+ glutenFreeArray[i].country +'</p> </div></div>');\t\t\n\t\t\t\tid++;\n\t}\t\n\t\n\tfor(var i = 0; i < glutenFreeArray.length; i++) {\n\t\t$('#pic' + i).draggable({\n\t\t\trevert : \"invalid\",\n\t\t\thelper : \"clone\",\n\t\t\tstack : \".draggable\"\n\t\t});\n\t\tmakeDraggable();\n\t}\n}", "function deleteItem(e) {\n // get weight of item from span\n const weightString = e.target.previousSibling.previousSibling.innerHTML;\n // convert item weight from string to number\n const newNum = parseInt(weightString, 10);\n\n // loop thru array\n for (let i = 0; i < kitArray.length; i++) {\n // find matching value of target\n if (kitArray[i] === newNum) {\n // delete match from array\n kitArray.splice(i, 1);\n // break loop after 1 match\n break;\n }\n }\n \n // recalculate weight for head\n if (kitArray.length > 1) {\n const add = (a, b) =>\n a + b;\n const sum = kitArray.reduce(add);\n weight.innerHTML = (sum + ' oz');\n \n } else if (kitArray.length === 1) {\n let numb = kitArray[0];\n weight.innerHTML = (numb + ' oz');\n } else {\n kitArray = [];\n weight.innerHTML = (0 + ' oz');\n }\n \n // remove li\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n\n weightGauge();\n calculateGauge4();\n\n }", "function removeInventory() {\n const removeItem = document.getElementById(\"removeInventory\").value\n inventory.splice((removeItem - 1),1)\n updateInventory()\n}", "function removeFruit(){\n var remove = prompt('enter an index number');\n fruits.splice(remove,1);\n fruits.sort();\n// console.log(fruits);\n outputFruits(fruits);\n}", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "function chap16(){\n var foodArray = [\"Salmon\", \" Tilapia \", \" Tuna \", \" Lobster \"];\n foodArray.pop(3);\n foodArray.push(\" Shark\");\n alert(foodArray);\n}", "function hitMe(){\n if(dealed && under){\n var deal = cards.pop();\n yourHand.push(deal);\n tempArr = [deal];\n displayCards(tempArr);\n }\n check(yourHand);\n}//end of hitMe()", "function removeItems(nameAndPrice){\n \n //Command won't work if no items are in list\n if (nameAndPrice.length == 0){\n println(\"Invalid Command\");\n } else {\n while (true){ //Creates a loop until the user does not want to remove any more items\n var removeItems = readLine(\"Which item would you like to remove? (Please, use same Capital Case as original item)\");\n var index = nameAndPrice.indexOf(removeItems); // Finds the item to remove in the list\n \n //If the desired item cannot be found:\n if(nameAndPrice[index] != removeItems){ \n println(\"Item Not Found!\");\n } else { //Removes the item's name and price from the list\n nameAndPrice.remove(index);\n nameAndPrice.remove(index);\n }\n \n //Exits function if user doesn't want to remove another item, otherwise asks for the other item\n var check = readBoolean(\"Would you like to remove another item?\");\n if (check == false){\n break;\n }\n }\n }\n}", "drinkUp() {\n this.brewskis.splice(this.index, 1);\n this.drinks += 1;\n if (this.drinks === 3) {\n this.secondsToSober = 5;\n this.drunk = true;\n drunkDrums.setVolume(0.6);\n drunkDrums.loop();\n setTimeout(() => {\n drunkDrums.pause();\n this.drunk = false;\n this.drinks = 0;\n }, 5000);\n }\n }", "removeHearthFromInventory(item) {\n for (let i = 0; i < this.inventory.length; i++) {\n if (this.inventory[i].item === item) {\n this.inventory.splice(i, 1);\n }\n }\n console.log(\"This is the new hearth list\", this.inventory);\n }", "function initializeListItems(){\n var shoppingItems = new Array();\n shoppingItems[0] = \"Apple\";\n shoppingItems[1] = \"Banana\";\n shoppingItems[2] = \"Battery\";\n shoppingItems[3] = \"Beef\";\n shoppingItems[4] = \"Bread\";\n shoppingItems[5] = \"Butter\";\n shoppingItems[6] = \"Candy\";\n shoppingItems[7] = \"Cereal\";\n shoppingItems[8] = \"Cheese\";\n shoppingItems[9] = \"Chicken\";\n shoppingItems[10] = \"Chocolate\";\n shoppingItems[11] = \"Coffee\";\n shoppingItems[12] = \"Cookies\";\n shoppingItems[13] = \"Deodorant\";\n shoppingItems[14] = \"Detergent\";\n shoppingItems[15] = \"Eggs\";\n shoppingItems[16] = \"Fish\";\n shoppingItems[17] = \"Floss\";\n shoppingItems[18] = \"Flour\";\n shoppingItems[19] = \"Juice\";\n shoppingItems[20] = \"Lemons\";\n shoppingItems[21] = \"Milk\";\n shoppingItems[22] = \"Mouthwash\";\n shoppingItems[23] = \"Nuts\";\n shoppingItems[24] = \"Olive Oil\";\n shoppingItems[25] = \"Oranges\";\n shoppingItems[26] = \"Pasta\";\n shoppingItems[27] = \"Popcorn\";\n shoppingItems[28] = \"Pork\";\n shoppingItems[29] = \"Raisins\";\n shoppingItems[30] = \"Razor\";\n shoppingItems[31] = \"Sausage\";\n shoppingItems[32] = \"Seafood\";\n shoppingItems[33] = \"Shampoo\";\n shoppingItems[34] = \"Soft Drink\";\n shoppingItems[35] = \"Soup\";\n shoppingItems[36] = \"Tea\";\n shoppingItems[37] = \"Tissue\";\n shoppingItems[38] = \"Toilet Paper\";\n shoppingItems[39] = \"Toothpaste\";\n shoppingItems[40] = \"Vegetable Oil\";\n shoppingItems[41] = \"Water\";\n shoppingItems[42] = \"Watermelon\";\n shoppingItems[43] = \"Yogurt\";\n localStorage[\"shoppingItems\"] = JSON.stringify(shoppingItems);\n}", "dealDealerCard() {\n let randDealerNum = this.randomDealerCard();\n this.dealerHand.push(this.cardsInDeck[randDealerNum]);\n this.cardsInDeck.splice(randDealerNum, 1);\n }", "chooseFaceUp(a){\n console.log(this.hand[a[0]],this.hand[a[1]],this.hand[a[2]]);\n this.faceup.push(this.hand[a[0]]);\n this.faceup.push(this.hand[a[1]]);\n this.faceup.push(this.hand[a[2]]);\n a.sort(function(a,b){ // Sort the index to be in order\n return a-b;\n });\n this.removeFromHand(a[2]);\n this.removeFromHand(a[1]);\n this.removeFromHand(a[0]);\n }", "function boughtItem(BoughtItem){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList == null){\n boughtList = [];\n }\n else{\n boughtList = JSON.parse(boughtList);\n boughtList = convertObjArrayToItemArray(boughtList);\n }\n var chosenList = localStorage.getItem(\"chosenList\");\n var shoppingList = localStorage.getItem(chosenList);\n if(shoppingList != null){\n shoppingList = JSON.parse(shoppingList);\n shoppingList = convertObjArrayToItemArray(shoppingList);\n }\n for (var i = 0; i < shoppingList.length; i++){\n if(BoughtItem[0] == shoppingList[i].name){\n var tempBoughtItem = shoppingList[i];\n shoppingList.splice(i, 1);\n boughtList.push(tempBoughtItem);\n }\n }\n localStorage.setItem(chosenBoughtList, JSON.stringify(boughtList));\n localStorage.setItem(chosenList, JSON.stringify(shoppingList));\n}", "function tryFunction(){\n vegetables.pop();\n vegetables.push(vegetables.length);\n fruit.shift();\n var x = fruit.indexOf('orange');\n fruit.push(x);\n var food = fruit.concat(vegetables);\n food.splice(4, 2);\n food.reverse();\n var foodString = food.toString();\n \n console.log(foodString)\n}", "function putCardsDown(){\n var newCards=[];\n\t\tvar count=0;\n\t\tvar newCard;\n\t\tfor (var j=1;j<7;j++){\n\t\t\tfor (var i=1;i<4;i++){\n\t\t\t\tif (cardsOnBoard[j][i]==null && count<3){ //put a card here!!!!!\n\t\t\t\t\tnewCard=Math.round((Math.random()*availableCards.length));\n\t\t\t\t\tcardsOnBoard[j][i]=availableCards[newCard];\n\t\t\t\t\tnewCards[count]=cardsOnBoard[j][i];\n\t\t\t\t\tnextCards[count]=new pair(j,i);\n\t\t\t\t\tcount++;\n\t\t\t\t\tavailableCards.splice(newCard,1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn newCards;\n }", "function checkIsSnakeEating() {\n for(var i = 0; i < currentFoodItems.length; i++) {\n\n if(s.eat(currentFoodItems[i])) {\n currentFoodItems.splice(i, 1);\n pics.splice(i, 1); //\n i = currentFoodItems.length;\n }\n }\n}", "function C010_Revenge_SidneyJennifer_StealItems() {\n\t\n\t// Backup and remove the player inventory\n\tPlayerSaveAllInventory();\n\tPlayerRemoveAllInventory();\n\tC010_Revenge_SidneyJennifer_ItemStolen = true;\n\tCurrentTime = CurrentTime + 50000;\n\t\n}", "function removeCards() {\n // console.log(\"The cards do not match\");\n displaySymbol(openCards[0]);\n displaySymbol(openCards[1]);\n // Reset open card array so it includes a new pair of cards\n openCards = [];\n}", "function onRemoveFiveClicked(){\n\t\tif(poker._bet > 0 && draw == 0){\n\t\t\tif(!cardsFliped)\n\t\t\t\tflipCards();\n\t\t\tresetHeld();\n\t\t\tpoker._bet -= +5;\n\t\t\tpoker._cash += +5;\n\t\t\t\n\t\t}\n\t\tbet.html(poker._bet);\n\t\tcash.html(poker._cash);\n\t}", "function glutenFreeSvBeer(){\n\tvar glutenFreeArray = [];\n\tfor(var i = 0; i < svBeer.length; i++){\n\t\tif(svBeer[i].gluten == false){\n\t\t\tglutenFreeArray.push(svBeer[i]);\n\t\t}\n\t}\n\t\n\tnameSort(glutenFreeArray);\n\tvar id = 0;\n\tfor(var i = 0; i < glutenFreeArray.length; i++){\n\t\t\t\t$('#item-collection').append('<div class=\"menucard\" id=\"card-item'+ id +'\"> ' +\n\t\t\t\t\t\t'<img src=\"' + glutenFreeArray[i].img +'\" id=\"pic' + id + '\" class=\"pic\"> <div class=\"menucardcontainer\">' +\n\t\t\t\t\t\t'<img src=\"'+ glutenFreeArray[i].detailimg +'\" id=\"detailpic'+ id + '\" class=\"detailpic\">' + \n\t\t\t\t\t\t'<h4 class=\"drink\" id=\"drink'+ id +'\"><b>' + glutenFreeArray[i].name + '</b></h4> <p class=\"pricetag\" id=\"pricetag' + id + '\">'\n\t\t\t\t\t\t + glutenFreeArray[i].price + ' kr</p> <button class=\"plussign\" id=\"addplus'+ id +'\" aria-hidden=\"true\">add</button>' +\n\t\t\t\t\t\t'<p class=\"desc\" id=\"desc' + id + '\">'+ glutenFreeArray[i].description +'</p> <p class=\"desc\" id=\"country' + \n\t\t\t\t\t\tid + '\">'+ glutenFreeArray[i].country +'</p> </div></div>');\t\t\n\t\t\t\tid++;\n\t}\t\n\t\n\tfor(var i = 0; i < glutenFreeArray.length; i++) {\n\t\t$('#pic' + i).draggable({\n\t\t\trevert : \"invalid\",\n\t\t\thelper : \"clone\",\n\t\t\tstack : \".draggable\"\n\t\t});\n\t\tmakeDraggable();\n\t}\n}", "function PickupCards(newCards) {\n\tvar testBonus = false;\n\tgetCurrHand();\n\tif (newCards.startsWith(\"PickupCardsProsperity\")) {\n\t\twhichEvent = \"Prosperity\";\n\t\tnewCards = newCards.replace(\"PickupCardsProsperity\", \"\");\n\t}\n\tif(newCards.startsWith(\"PickupCardsTestBonus\")) {\n\t\tnewCards = newCards.replace(\"PickupCardsTestBonus\",\"\");\n\t\ttestBonus = true;\n\t}\n\tif(newCards.startsWith(\"PickupCardsQueensFavor\")) {\n\t\twhichEvent = \"Queens Favor\";\n\t\tnewCards = newCards.replace(\"PickupCardsQueensFavor\",\"\");\n\t}\n\tif(newCards==\"null\") return;\n\tnewCards = newCards.split(\";\");\n\tnewCards.pop();\n\tvar numNewCards = newCards.length;\n\tfor (var i = 0; i < handCardID.length; i++) {\n\t\tif (handCardSRC[i] == \"http://\"+ip+\"/resources/images/all.png\") {\n\t\t\tvar imageId = handCardID[i];\n\t\t\tif(testBonus) { var tempLink = getLinkFromName(newCards.pop()) } else {\n\t\t\t\tvar tempLink = newCards.pop();\n\t\t\t}\n\t\t\t\n\t\t\t$(\"#\" + imageId).attr(\"src\",\n\t\t\t\t\t\"http://\"+ ip + tempLink);\n\t\t\tif (newCards.length == 0)\n\t\t\t\tbreak;\n\t\t}\n\t}\n\n\tvar cardTracker = 0;\n\tfor (var i = 0; i < handCardSRC.length; i++) {\n\t\tvar tempCardLink = handCardSRC[i].replace(\"http://\"+ip, \"\");\n\t\ttempCardLink = tempCardLink.split('%20').join(' ');\n\t\tif (tempCardLink != \"/resources/images/all.png\")\n\t\t\tcardTracker++;\n\t}\n\n\tcardTracker += numNewCards;\n\tnumCards = cardTracker;\n\tif (cardTracker > 12) {\n\t\tvar serverMsg = document.getElementById('serverMsg');\n\t\tserverMsg.value += \"\\n> right click to remove extra cards to continue (for discard)\";\n\t\tif (isAI == true) {\n\t\t\tvar data = JSON.stringify({\n\t\t\t\t'AICommand' : 'DiscardChoice',\n\t\t\t\t'numCards' : (cardTracker - 12),\n\t\t\t\t'name' : PlayerName\n\t\t\t})\n\t\t\tsocketConn.send(data);\n\t\t\treturn;\n\t\t}\n\n\t\tdiscard();\n\t}\n\t\n\tif(numCards <= 12 && whichEvent == \"Queens Favor\") {\n\t\tconsole.log(\"sending queens favor\");\n\t\tvar data = JSON.stringify({\n\n\t\t\t'doneEventQueensFavor' : 0\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t}\n\t\n\tif(numCards <= 12 && whichEvent == \"Prosperity\") {\n\t\tconsole.log(\"sending prosperity\");\n\t\tvar data = JSON.stringify({\n\n\t\t\t'doneEventProsperity' : 0\n\t\t})\n\t\tsetTimeout(function(){ socketConn.send(data); }, 1000);\n\t}\n\n}", "function snakeGrow(){\n if(snakex == preFood[0] && snakey == preFood[1]){\n foodReady = false;\n snake.push([])\n snakeTail++;\n };\n}", "function removeItem(nameInput, timeInput, removeBtn, br1, br2, isFromList) {\n // Remove the name of the exercise from the itemsChosen array\n if (isFromList) {\n const index = itemsChosen.indexOf(nameInput.value);\n if (index > -1) {\n itemsChosen.splice(index, 1);\n }\n }\n\n // Remove nameInput element\n let elem = document.getElementById(nameInput.id);\n elem.remove();\n\n // Remove timeInput element\n elem = document.getElementById(timeInput.id);\n elem.remove();\n\n // Remove the remove button element\n elem = document.getElementById(removeBtn.id);\n elem.remove();\n\n // Remove first line break\n elem = document.getElementById(br1.id);\n elem.remove();\n\n // Remove second line break\n elem = document.getElementById(br2.id);\n elem.remove();\n\n if (isFromList) {\n --numOfSelectedItems;\n }\n else {\n --numOfCustomItems;\n }\n\n showExercises(event);\n}", "function arrayFunctions() {\n let stooges = [ // Define an array\n \"Moe\",\n \"Larry\",\n \"Curly\"\n ]\n console.table(stooges); // Display the array as a table\n\n stooges.push(\"Shemp\"); // Add an element to the end of the array, similarly to ArrayLists\n console.table(stooges);\n\n stooges.unshift(\"Curly Joe\"); // Add an element to the start of the array\n console.table(stooges);\n\n stooges.splice(3, 0, \"Groucho\", \"Chico\", \"Harpo\"); // Remove 0 elements, insert new elements at index 3\n console.table(stooges);\n\n stooges.splice(3, 1); // Remove the element at index 3 (index, #-of-elements-to-remove)\n console.table(stooges);\n\n stooges.splice(3, 2); // Remove 2 elements at index 3 (index, #-of-elements-to-remove)\n console.table(stooges);\n\n stooges.shift(); // Remove one element at the start of the array\n console.table(stooges);\n\n stooges.pop(); // Remove one element from the end of the array\n console.table(stooges);\n\n stooges.splice(stooges.indexOf(\"Larry\"), 1); // Find index of \"Larry\" and remove the element at that index\n console.table(stooges);\n\n let marxBros = [\"Groucho\", \"Chico\", \"Harpo\"]; // Define a new array\n\n let oldFunnyGuys = stooges.concat(marxBros); // Combine the stooges array and marxBros array into one\n console.table(oldFunnyGuys);\n}", "function dealCards(){\n if(!dealed){\n yourHand.push(cards.pop());\n houseHand.push(cards.pop());\n yourHand.push(cards.pop());\n houseHand.push(cards.pop());\n displayCards(yourHand);\n dealed = true;\n }\n check(yourHand);\n displayDealer(houseHand);\n}//end of dealCards", "function removeItem(arr) {\r\n let answer = prompt('what item have you finished and you want to delete');\r\n let correct = answer.toLowerCase().trim();\r\n if (doesExist(arr, correct)) {\r\n console.log(`the removed item is \"${arr[arr.indexOf(correct)]}\"`);\r\n arr.splice(arr.indexOf(correct), 1);\r\n } else alert('their is no such item in your todo list');\r\n}", "function buyClickUpgrade(clickItem) {\n\n\n //console.log(`You purchased a(n) ${clickItem}`);\n\n player.clickInventory.push(clickUpgrades[clickItem]);\n\n //console.log(player.clickInventory);\n\n\n\n //find price\n /*\n let inv = player.clickInventory.filter(item => {\n console.log(player.clickInventory)\n console.log(item.name);\n console.log(clickItem);\n return item.name === clickItem;\n });\n */\n\n //console.log(`the inventory for ${clickItem} is ${inv}`);\n\n //update quantity and price of item\n clickUpgrades[clickItem].quantity++;\n\n let quantity = clickUpgrades[clickItem].quantity;\n\n //console.log(`The current quantity of ${clickItem}s is ${quantity}`);\n\n clickUpgrades[clickItem].newprice *= clickUpgrades[clickItem].multiplier;\n\n clickUpgrades[clickItem].newprice =\n Math.round(clickUpgrades[clickItem].newprice);\n\n let price = clickUpgrades[clickItem].price;\n let newprice = clickUpgrades[clickItem].newprice;\n\n //console.log(`The price of a ${clickItem} is ${clickUpgrades[clickItem].price}`);\n //console.log(`The new price of a ${clickItem} is ${clickUpgrades[clickItem].newprice}`);\n\n player.currentCheeseBricks -= price;\n players[0].currentCheeseBricks = player.currentCheeseBricks;\n\n document.getElementById('input-tc').value =\n player.currentCheeseBricks;\n //console.log(`in buyClickUpgrade player.cheeseBricks = ${player.cheeseBricks}`);\n\n switch (clickItem) {\n case ('shovel'):\n document.getElementById('i-shovel-count').value = quantity;\n document.getElementById('i-shovel-price').value = newprice;\n break;\n case ('excavator'):\n document.getElementById('i-excavator-count').value = quantity;\n document.getElementById('i-excavator-price').value = newprice;\n break;\n\n default:\n break;\n }\n\n\n\n turnButtonsOnOff();\n updatePrices();\n saveClickUpgrades(); //saves clickUpgrade to local storage\n savePlayer(); //any player updates are stored such as number of cheeseBricks\n\n}", "function pizzaFlavor() {\n // Logs menu to console after each action\n console.log(\"\");\n console.log(\"Please choose your actions:\");\n console.log(\"\");\n console.log(\"1 - List all the pizza flavors\");\n console.log(\"2 - Add a new pizza flavor\");\n console.log(\"3 - Remove a pizza flavor\");\n console.log(\"4 - Exit this program\");\n console.log(\"\");\n\n // Variable that stores menu option\n let x = Number(readlineSync.question(\"Enter your action's number: \"));\n\n // Logs list of pizza flavors to console when menu option 1 is chosen and returns to menu\n if (x === 1) {\n console.log(flavs);\n pizzaFlavor();\n }\n\n // Enters do while loop to keep asking for new pizza flavor input\n if (x === 2) {\n // Do while loop breaks when \"X\" is entered and returns to menu\n do {\n flavs.push(readlineSync.question(\"Please enter pizza flavor. \"));\n console.log(\"Enter X to return or press enter to add another pizza flavor.\");\n } while (readlineSync.question() != \"X\")\n pizzaFlavor();\n }\n\n // Will remove array item when menu option 3 is chosen\n if (x === 3) {\n // Variable that stores array item to be removed\n let rm = readlineSync.question(\"Please enter pizza flavor number to remove. \");\n\n // If statement to check is input matches an item in array\n if (flavs.includes(rm)) {\n // If item exists the given item will be removed from the array and returns to menu\n flavs.splice(flavs.indexOf(rm), 1);\n pizzaFlavor();\n } else {\n // If item does not exist a message will be logged to console and returns to menu\n console.log(`Pizza flavors does not include ${rm}.`);\n pizzaFlavor();\n }\n\n }\n\n // If menu option 4 is chosen a message will be returned before exiting\n if (x === 4) {\n return console.log(\"Goodbye\");\n }\n}", "function moveFood() {\n for( i = 0; i < food.length; i ++) {\n let fud = food[i];\n fud.render();\n fud.fall();\n if (hitBottom(fud)) {\n if (!fud.isVeg) {\n lives --;\n aww.play(0, 1.5, 2);\n }\n food.splice(i, 1);\n isGameOver = (lives === 0);\n }\n }\n}", "function removeItemFromList()\n{\n\t// Item list to append new item to\n\tvar itemList = document.getElementById(\"itemlist\");\n\t\n\t// Array of individual items in list\n\tvar saleArray = [];\n\tsaleArray = document.getElementsByClassName(\"item\");\n\n\tsaleArray[0].remove();\n\n\t// Set unique id\"s for all item elements in saleArray\n\tvar i = 0;\n\twhile (i < saleArray.length)\n\t{\n\t\tsaleArray[i].id = \"item_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"itemname\")[0].id = \"itemname_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"itemname\")[0].name = \"itemname_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"itemid\")[0].id = \"itemid_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"itemid\")[0].name = \"itemid_\" + i;\n\t\t\n\t\tsaleArray[i].getElementsByClassName(\"itemquantity\")[0].id = \"itemquantity_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"itemquantity\")[0].name = \"itemquantity_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"unitcost\")[0].id = \"unitcost_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"unitcost\")[0].name = \"unitcost_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"totalcost\")[0].id = \"totalcost_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"totalcost\")[0].name = \"totalcost_\" + i;\n\n\t\ti++;\n\t}\n\n\tif (saleArray.length == 1)\n\t{\n\t\t// Remove the remove button if there\"s only one item in the sale list\n\t\tdocument.getElementById(\"item_0\").getElementsByClassName(\"removeItem\")[0].remove();\n\t}\n\n\tformUpdate();\n}", "function fosterRemoveItem(e){\n console.log(e.target.id)\n let itemname = e.target.id\n console.log(itemname)\n for (let item in basket){\n if (itemname == basket[item]['name']){\n basket.splice(item, 1)\n fosterStorage['foster-basket'] = JSON.stringify(basket)\n console.log(fosterStorage.getItem('foster-basket'))\n createBasket()\n }\n }\n if ((fosterStorage.getItem('foster-basket')).length > 0){\n window.location.href = \"foster_page.html\"\n }\n \n }", "function itemDie(itemIdx){\r\n\tif(items[itemIdx].name == \"apple\"){\r\n\t\tdropItem(\"apple\");\r\n\t}\r\n\titems.splice(itemIdx, 1);\r\n}", "function hotPotato(nameList, number){\n\n\tvar queue = new Queue()\n\n\t//fill the queue\n\tfor(var i = 0; i< nameList.length; i++){\n\t\tqueue.enqueue(nameList[i])\n\t}\n\n\tvar eliminated = ''\n\twhile(queue.size() > 1){\n\t\tfor(var i = 0; i<number; i++){\n\t\t\t//this is what allows for the simulation of a circular hot potatoe. \n\t\t\t//first person is removed, and then added to the back of the list\n\t\t\t//this happends until we reach 'number' in the for loop\n\t\t\tqueue.enqueue(queue.dequeue())\n\t\t}\n\n\t\t//once 'number' is reached, the for loop ends and we eliminate whoever is at the front of the array.\n\t\t//the person at the front of the arrary always has the hot potatoe in this game\n\t\teliminated = queue.dequeue()\n\t\t// console.log(`${eliminated} has been eliminated!`)\n\t}\n\n\t// queue.print()\n\t// console.log(`${queue.front} is the winner!`)\n\tqueue.print()\n\treturn queue.dequeue()\n}", "function removeItemAndCommand(itemName, itemAction) {\r\n var itemPosition = inventory.indexOf(itemName) - 1;\r\n var actionPosition = availableActions.indexOf(itemAction) - 1;\r\n if (inventory.includes(itemName)) {\r\n inventory.splice(itemPosition, 3);\r\n inventoryAside.innerHTML = inventory.join(\" \");\r\n availableActions.splice(actionPosition, 3);\r\n commandsFooter.innerHTML = availableActions.join(\" \");\r\n }\r\n}", "updateBasket(item, amount){\n let itemsBought = Object.assign({}, this.state.itemsBought);\n //if changed mind and down to 0, remove from bought items list\n if(amount < 1){\n delete itemsBought[item];\n }else{\n itemsBought[item] = this.state.items[item];\n }\n this.setState({itemsBought : itemsBought});\n }", "function addBlackPudding( fryUp ) { \n\n var baseCost = fryUp.cost(); \n fryUp.cost = function() { \n return baseCost + 1; \n }; \n fryUp.addItem( \"black pudding\" );\n\n}", "function fortunes() {\n\tvar num = randNum(cards.length);\n\tvar future = cards[num];\n\tcards.splice(num, 1);\n\treturn future;\n}", "function blankSlate() { //This function is called\n player1Moves = []; //on row 211\n player2Moves = [];\n for (i=0; i<allLI.length; i ++) {\n allLI[i].classList.remove('box-filled-2', 'box-filled-1', 'clicked');\n }\n player2.classList.remove('active');\n addRemoveEL(1);\n theCount2 = 0;\n theCount1 = 0;\n}", "function dealCards() {\n \n //variable for the position in the deck that hasn't been picked\n var notPicked = [];\n for (let i = 0; i < 24;i++) {\n notPicked[i] = i;\n }\n\n\n for (let i = 0; i < 4; i++) { //4 players\n for (let k = 0; k < 5; k++) { // get 5 cards\n\n //pick a random number that is not higher than the number of cards not yet picked\n let randomNumber = Math.floor(Math.random()*notPicked.length);\n\n // switch statement so that each k(card) gets a card for each i(player)\n switch(k) {\n case 0:\n players[i].card1 = euchreDeck[notPicked[randomNumber]];\n break;\n case 1:\n players[i].card2 = euchreDeck[notPicked[randomNumber]];\n break;\n case 2:\n players[i].card3 = euchreDeck[notPicked[randomNumber]];\n break;\n case 3:\n players[i].card4 = euchreDeck[notPicked[randomNumber]];\n break;\n case 4:\n players[i].card5 = euchreDeck[notPicked[randomNumber]];\n break;\n default: console.log(\"error with dealCards() @ Line 92 gameLogic.js\");\n }\n // after the card has been assigned, it is removed from the not picked array\n notPicked.splice(randomNumber, 1);\n }\n }\n // pick a number between 0-3 to randomly select what trump will be out of the remaining 4 cards.\n let randomNumber = Math.floor(Math.random()*4);\n\n // variable for the card flipped over that decides trump.\n trumpCard = euchreDeck[notPicked[randomNumber]];\n\n // console.log(trumpCard);\n\n}", "function mouseReleased() {\n if (growthValue >= growthMax && currentselected == \"basket\" && fruitsHidden.length < maxFruits && fruitsInBasket < basketCapacity && canPickUp == true) {\n \n randIndex = floor(random(maxFruits));\n while(fruitsHidden.includes(randIndex)) {\n randIndex = floor(random(maxFruits));\n }\n fruitsHidden.push(randIndex);\n fruitsInBasket++;\n fruitsPickedUp++;\n }\n // if basket is full\n if (fruitsInBasket >= basketCapacity) {\n console.log(\"basket is full\")\n setTimeout(() => {\n fruitsInBasket = 0;\n console.log(\"basket cleared\");\n }, 5000)\n }\n // if all fruits are collected\n if (maxFruits != 0 && fruitsHidden.length >= maxFruits) {\n if (noFruits == false) {\n noFruits = true;\n canPickUp = false;\n fruitsInBasket = 0;\n dayWhenNoFruits = dayCounter;\n } \n }\n}", "function repositionStoreItems() {\n if (collectItems.storeItems[4].owned == 0) { buyGeneralItem6.setHidden(true); buyGeneralItem7.setHidden(true); }\n else { buyGeneralItem6.setHidden(false); buyGeneralItem7.setHidden(false); }\n //move pick\n if (collectItems.storeItems[2].owned == 1) { item3y = 0; }\n else { item3y = 65; }\n //move Press\n if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 1) { item4y = 0; }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 0) { item4y = 65; }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 1) { item4y = 65; }\n else { item4y = 130; }\n\n //move Bottles and barrels\n if (collectItems.storeItems[4].owned == 1) { buyGeneralItem4.setHidden(true); buyGeneralItem6.setHidden(false); buyGeneralItem7.setHidden(false); }\n if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 1) { item6y = 0; item7y = 65; buyGeneralItem4.setHidden(true); buyGeneralItem6.setHidden(false).setPosition(0, item5y); buyGeneralItem7.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 0 && collectItems.storeItems[4].owned == 1) { item6y = 0; item7y = 65; buyGeneralItem6.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 1) { item6y = 0; item7y = 65; buyGeneralItem6.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 0) { item6y = 0; item7y = 65; buyGeneralItem4.setHidden(false); buyGeneralItem6.setHidden(true); }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 0 && collectItems.storeItems[4].owned == 1) { item6y = 130; item7y = 195; buyGeneralItem6.setHidden(false); }\n else if (collectItems.storeItems[2].owned == 1 && collectItems.storeItems[3].owned == 0 && collectItems.storeItems[4].owned == 0) { item6y = 130; item7y = 195; buyGeneralItem4.setHidden(false); buyGeneralItem6.setHidden(true); buyGeneralItem7.setHidden(true); }\n else if (collectItems.storeItems[2].owned == 0 && collectItems.storeItems[3].owned == 1 && collectItems.storeItems[4].owned == 0) { item6y = 130; item7y = 195; buyGeneralItem4.setHidden(false); buyGeneralItem6.setHidden(true); buyGeneralItem7.setHidden(true); }\n if (collectItems.storeItems[4].owned == 1) { buyGeneralItem4.setHidden(true); buyGeneralItem6.setHidden(false); buyGeneralItem7.setHidden(false); }\n buyGeneralItem3.setPosition(0, item3y);\n buyGeneralItem4.setPosition(0, item4y);\n \n buyGeneralItem6.setPosition(0, item5y);\n buyGeneralItem7.setPosition(0, item6y);\n //console.log(\"item6 is hidden = \" + buyGeneralItem6.getHidden() + \" position = \" + buyGeneralItem6.getPosition().y)\n if (collectItems.storeItems[7].owned == 1) { buyGeneralItem7.setHidden(true); }\n }", "function arrayFunctions() {\n let stooges = [ // Define an array\n \"Moe\",\n \"Larry\",\n \"Curly\"\n ]\n\n console.table(stooges) // Display the array as a table\n\n stooges.push(\"Shemp\") // Add an element to end of the array\n console.table(stooges) // Display the array as a table\n\n stooges.unshift(\"Curly Joe\") // Add an element to start of the array\n console.table(stooges) // Display the array as a table\n\n stooges.splice(3,0,\"Groucho\", \"Chico\", \"Harpo\") // Remove 0 elements and insert new elements at index 3\n console.table(stooges) // Display the array as a table\n\n stooges.splice(3,1) // Remove the element at index 3\n console.table(stooges) // Display the array as a table\n \n stooges.splice(3,2) // Remove two elements at index 3\n console.table(stooges) // Display the array as a table\n\n stooges.shift() // Remove one element at the start of the array (shift elements up 1 position)\n console.table(stooges) // Display the array as a table\n\n stooges.pop() // Remove the last element from the array\n console.table(stooges) // Display the array as a table\n\n stooges.splice(stooges.indexOf(\"Larry\"),1) // Find index of \"Larry\" and remove the element at that index\n console.table(stooges) // Display the array as a table\n \n let marxBros = [\"Groucho\", \"Chico\", \"Harpo\"] // Define a new array\n\n let oldFunnyGuys = stooges.concat(marxBros) // combine the stooges array and marxBros array into one\n console.table(oldFunnyGuys)\n\n}", "removeClick(index){\n //REMOVE ITEM INFO\n gross = gross - itemsArray[index].price;\n tax = gross * .0825;\n total = gross + tax;\n \n grossFormat = Math.abs(gross.toFixed(2));\n taxFormat = Math.abs(tax.toFixed(2));\n totalFormat = Math.abs(total.toFixed(2));\n \n itemsArray.splice(index, 1);\n \n this.setState({\n items: this.state.items - 1\n });\n }", "getsPicked(){\n this.picked = true;\n let fruitIndex = allFruit.indexOf(this);\n console.log('picked ' + fruitIndex);\n if (fruitIndex > -1) {\n allFruit.splice(fruitIndex, 1);\n }\n }", "function stay() {\n dealerHand.push(deck[Math.floor(Math.random() * deck.length)]);\n console.log(dealerHand);\n}", "pickUpFood() {\n var surTile = this.Survivor.getCurrentTile();\n for (const f of this.foodStock) {\n if (surTile === f.getTile() && f.getActive()) {\n f.setActive(false);\n this.playerFood += this.foodValue;\n this.playerScore += 10;\n }\n }\n }", "function updateItemTank() {\n const crashedItemLife = myitemTank.some(function (obstacle) {\n return player.crashWith(obstacle);\n });\n if (crashedItemLife) {\n player.increaseLive();\n let filter = myitemTank.filter(function (obstacle) {\n return player.crashWith(obstacle);\n });\n let index = myitemTank.indexOf(filter[0]);\n myitemTank.splice(index, 1);\n } else {\n for (i = 0; i < myitemTank.length; i++) {\n myitemTank[i].y += -1;\n myitemTank[i].update();\n }\n if (myGameArea.frames % 200 === 0) {\n let x = myGameArea.canvas.width;\n let y = myGameArea.canvas.height;\n let randomHeight = Math.floor(Math.random() * (x - 110)) + 50;\n myitemTank.push(new Component(60, 70, \"./imagenes/tanque.png\", randomHeight, y));\n }\n }\n}", "function dropItem() {\r\n\t itemDrop = document.getElementById(\"playeritem\").value;\r\n\t drop = playerInv.indexOf(itemDrop);\r\n\t if ((currentRoom == 3) && (drop == 0)) {\r\n\t\tdocument.getElementById(\"playerScore\").innerHTML = playerScore += 1;\r\n\t\tdocument.getElementById(\"playeritem\").innerHTML = gameItems[currentRoom] = [];\r\n\t\tplayerInv.pop(drop);\r\n\t\tdropThis = userCommandSplit[1];\r\n\t\talert(\"You dropped \" + dropThis);\r\n\t }\r\n\t \r\n\t // If the player gets the max score of 4, than they win\r\n\t document.getElementById(\"inputField\").value = \"\";\r\n\t if (playerScore == 4) {\r\n\t\t alert(\"congrats, you found all the clues! Now the police won't arrest you for murder, they will catch the true killer!\");\r\n\t\t var theImage = document.getElementById(\"theImage\");\r\n\t\t currentRoom=8;\r\n\t\t theImage.src = imageArray[currentRoom];\t\r\n\t\t document.getElementById(\"description\").innerHTML = roomDescriptions[currentRoom];\r\n\t }\r\n}", "function retractCards() {\n let image = this.src;\n cards.push(image);\n pickedCards.splice(this, 1);\n this.remove();\n console.log(\"Cards Left: \", cards);\n console.log(\"Used Cards: \", pickedCards);\n}", "function addChicken(){\n priceArray[0] += 9.99;\n itemArray[0] ++; \n alert(\"You have added \" + itemArray[0] + \" Chicken(s). Your Chicken total is $\" + priceArray[0] ) \n}", "function removeScrapBuck(index){\r\n scarpBuckList.splice(index,1)\r\n}", "function RemoveItem(item){\n var index = basket.indexOf(item);\n if (index > -1) {\n console.log(\"Taking \" + item.Name + \" out of the basket!\");\n basket.splice(index, 1);\n return;\n }\n Console.log(item.Name + \" is not in the basket!\");\n}", "function addBeer(){\n priceArray[4] += 14.99;\n itemArray[4] ++; \n alert(\"You have added \" + itemArray[4] + \" case(s) of beer. Your beer total is $\" + priceArray[4] )\n}", "function glutenFreeSvWine(){\n\t$('#item-collection').empty();\n\tvar glutenFreeArray = [];\n\tfor(var i = 0; i < svWine.length; i++){\n\t\tif(svWine[i].gluten == false){\n\t\t\tglutenFreeArray.push(svWine[i]);\n\t\t}\n\t}\n\t\n\tnameSort(glutenFreeArray);\n\t\n\t//These elements provide information for wine items only\n\tdocument.getElementById('drink-loc').style.display = \"inline\";\n\tdocument.getElementById('drink-year').style.display = \"inline\";\n\t\n\tvar wineId = 0;\n\tfor(var i = 0; i < glutenFreeArray.length; i++) {\n\t\t$('#item-collection').append('<div class=\"menucard\" id=\"card-item'+ wineId +'\"> <img src=\"' + glutenFreeArray[i].img +\n\t\t\t'\" id=\"pic' + wineId + '\" class=\"pic\"> <div class=\"menucardcontainer\"> <img src=\"'+ glutenFreeArray[i].detailimg +\n\t\t\t'\" id=\"detailpic'+ wineId + '\" class=\"detailpic\"><h4 class=\"drink\" id=\"drink' + wineId + '\"><b>' + glutenFreeArray[i].name + \n\t\t\t'</b></h4> <p class=\"pricetag\" id=\"pricetag' + wineId + '\">' + glutenFreeArray[i].price + ' kr</p><button class=\"plussign\"' + \n\t\t\t'id=\"addplus'+ wineId +'\" aria-hidden=\"true\">add</button> <p class=\"desc\" id=\"desc' + wineId + '\">'+ glutenFreeArray[i].description +'</p> '+\n\t\t\t' <p class=\"desc\" id=\"country' + wineId + '\">'+ glutenFreeArray[i].country +'</p> <p class=\"desc\" id=\"loc' + wineId + '\">'+ glutenFreeArray[i].location +'</p>' +\n\t\t\t' <p class=\"desc\" id=\"year' + wineId + '\">'+ glutenFreeArray[i].year +'</p> </div></div>');\n\t\twineId++;\n\t}\t\n\t\n\tfor(var i = 0; i < glutenFreeArray.length; i++) {\n\t\t$('#pic' + i).draggable({\n\t\t\trevert : \"invalid\",\n\t\t\thelper : \"clone\",\n\t\t\tstack : \".draggable\"\n\t\t});\n\t\tmakeDraggable();\n\t}\n}", "function handelButton(){\r\n \r\n flowerslist1.push(items)\r\n \r\n \r\n setflowerslist(flowerslist1)\r\n console.log(flowerslist1)\r\n alert('add to table')\r\n }", "function deleteCards() {\n for (let i = 0; i < deckOfCards.length; i++) {\n let deckSelected = document.querySelector(\".deck\");\n let oldCard = deckSelected.querySelector(\".card\");\n oldCard.remove();}\n movements=0;\n let movesSelected = document.querySelector(\".moves\");\n movesSelected.innerHTML = (movements);\n setStars();\n}", "function deal(){\n\t\n\t//shuffel the array of deck to catch new arr \n shuffle(card);\n getCards();\n}", "function glutenFreeWine(){\n\t$('#item-collection').empty();\n\tvar glutenFreeArray = [];\n\tfor(var i = 0; i < wine.length; i++){\n\t\tif(wine[i].gluten == false){\n\t\t\tglutenFreeArray.push(wine[i]);\n\t\t}\n\t}\n\t\n\tnameSort(glutenFreeArray);\n\t\n\t//These elements provide information for wine items only\n\tdocument.getElementById('drink-loc').style.display = \"inline\";\n\tdocument.getElementById('drink-year').style.display = \"inline\";\n\t\n\tvar wineId = 0;\n\tfor(var i = 0; i < glutenFreeArray.length; i++) {\n\t\t$('#item-collection').append('<div class=\"menucard\" id=\"card-item'+ wineId +'\"> <img src=\"' + glutenFreeArray[i].img +\n\t\t\t'\" id=\"pic' + wineId + '\" class=\"pic\"> <div class=\"menucardcontainer\"> <img src=\"'+ glutenFreeArray[i].detailimg +\n\t\t\t'\" id=\"detailpic'+ wineId + '\" class=\"detailpic\"><h4 class=\"drink\" id=\"drink' + wineId + '\"><b>' + glutenFreeArray[i].name + \n\t\t\t'</b></h4> <p class=\"pricetag\" id=\"pricetag' + wineId + '\">' + glutenFreeArray[i].price + ' kr</p><button class=\"plussign\"' + \n\t\t\t'id=\"addplus'+ wineId +'\" aria-hidden=\"true\">add</button> <p class=\"desc\" id=\"desc' + wineId + '\">'+ glutenFreeArray[i].description +'</p> '+\n\t\t\t' <p class=\"desc\" id=\"country' + wineId + '\">'+ glutenFreeArray[i].country +'</p> <p class=\"desc\" id=\"loc' + wineId + '\">'+ glutenFreeArray[i].location +'</p>' +\n\t\t\t' <p class=\"desc\" id=\"year' + wineId + '\">'+ glutenFreeArray[i].year +'</p> </div></div>');\n\t\twineId++;\n\t}\t\n\t\n\tfor(var i = 0; i < glutenFreeArray.length; i++) {\n\t\t$('#pic' + i).draggable({\n\t\t\trevert : \"invalid\",\n\t\t\thelper : \"clone\",\n\t\t\tstack : \".draggable\"\n\t\t});\n\t\tmakeDraggable();\n\t}\n}", "function karteZiehen() {\n if (deck.length > 0) {\n let i = Math.floor(Math.random() * (deck.length));\n hand.push(deck[i]); /* Karte aus dem Deck wird den Handkarten hinzugefügt */\n deck.splice(i, 1);\n handkarten();\n console.log(hand);\n }\n else {\n alert(\"Der Nachziehstpel ist leer.\");\n }\n}", "function moveBubblesOnTeamHome()\r\n{\r\n\tif (arryItems.length > 0)\r\n\t{\r\n\t\tfor (x=1; x <= arryItems.length; x++) \r\n\t\t{\r\n\t\t\tinTop = getImageTop(\"discountitem_\" + x) - 22;\r\n\t\t\tinLeft = getImageLeft(\"discountitem_\" + x) + 96;\t\r\n\t\t\t\r\n\t\t\t//move the price bubble to the location.\r\n\t\t\tmoveXY(\"discountbubble_\" + x,inLeft,inTop);\r\n\t\t}\r\n\t}\r\n}", "dealPlayerCard() {\n let randPlayerNum = this.randomPlayerCard();\n this.playerHand.push(this.cardsInDeck[randPlayerNum]);\n this.cardsInDeck.splice(randPlayerNum, 1);\n }", "grab() {\n // if you try to grab an item that doesn't exist it errors out\n if (this.grabbable && currentRoom === this.location) {\n inventory.push(this.name);\n return `You grabbed the ${this.name}.`;\n //push item to personal inventory to add it // this part works!\n //console.log(contents);\n //console.log(inventory);\n\n //(filter!==this.name) {\n // let newContents = content.filter(this.name)\n // contents.indexOf(this.name);\n // let pos = contents.indexOf(this.name);\n //newContents = contents.splice(pos, 1);\n // console.log(newContents);\n //}\n } else if (this.grabbable === false) { // if an item isn't grabbable it wont go into their inventory and the game will tell them they can't grab it. \n return `You can't grab that.\\n>_`;\n }\n //console.log(this.name);\n ///let newContents = contents.filter(this.name); // do we need to create a new variable newcontents?\n // console.log(newContents);\n //console.log(contents);\n //let index = contents.indexOf(this.name);\n //console.log(index);\n //contents.splice(indexOf(this.name), 0, this.name);\n //let pos = contents.indexOf(this.name); //indexof is character based?\n //console.log(pos); // item is not found ....\n //let removedItem = contents.splice(index); //mayb not splice...\n //it is not working to remove item from contents\n //contents.pop(removedItem); //pop item from room contents to remove it\n //console.log(removedItem);\n \n }", "function moveAlien(){\n for(var x = 0; x < aliens.length ; x++){\n aliens[x].top += 3; //Alien movement speed \n if(aliens[x].top >= 540){\n aliens.splice(x,1);\n console.log(\"you lose\");\n if( isTheGameOver == false){\n gameOver();\n }\n }\n }\n}", "function removeOneItem(itemName) {\r\n var itemPosition = inventory.indexOf(itemName) - 1;\r\n if (inventory.includes(itemName)) {\r\n inventory.splice(itemPosition, 3);\r\n inventoryAside.innerHTML = inventory.join(\" \");\r\n }\r\n}", "function levelUp(){\n collectedFruit = collectedFruit.concat(pickedFruit); // fruit is secured to player score\n pickedFruit = [];\n allFruit = [];\n player.runs -= 1; // one less go for the player now\n if (player.runs < 1){\n endGame(); // end of game reached?\n } else {\n createFruit(); // new fruit\n\n // update game Level for more & faster snails, 3 is max\n if (gameLevel === 3){\n updateInfo();\n } else {\n gameLevel ++;\n createEnemies(1);\n updateInfo();\n }\n }\n}", "function transfer(){\r\n\t playerInv = [];\r\n\t var itemPickUp = document.getElementById(\"roomitem\").value;\r\n\t playerInv.push(itemPickUp);\r\n\t document.getElementById(\"roomitem\").innerHTML = gameItems[currentRoom] = [];\r\n\t for (i=0; i<playerInv.length; i++) {\r\n\t\t var newItem = playerInv[i];\r\n\t }\r\n\t document.getElementById(\"playeritem\").innerHTML += newItem;\r\n\t document.getElementById(\"inputField\").value = \"\";\r\n}", "function makeDucks() {\n\tfor (i=0; i < 2; i++) {\n\t\tducks.push( {posX: Math.random()*700, posY: Math.random()*550, targetX: Math.random()*700, targetY: Math.random()*550} );\n\t}\n}", "function removeCards(Element1,Element2){\n openCards.splice(0,2);\n}", "function pickUpItem(tempItem){\n if(bagInventory.length < bagSize) {\n var item = { \"Description\": tempItem.description, \"ItemName\": tempItem.itemName, \"ItemType\":tempItem.itemType, \"Attribute\":tempItem.attributeNumber,\"BagImage\":tempItem.bagImage };\n bagInventory.push(item);\n tempItem.destroy();\n }else{\n //todo: the bag is full, display a message to let the player know they need to drop/ use something to empty a spot.\n console.log('bag is full, drop or use a held item to add this item.');\n }\n}", "function moveShopping(num) {\n\tswitch(prompt('Select the list to move the item to:\\n' + \n\t\t'1. Produce 2. Meat \\n3. Snacks 4. Condiments \\n5. Various 6. Cold')) {\n\t\tcase '1':\n\t\tcase 'produce':\n\t\tcase 'Produce':\n\t\t\tproduceList.push(shoppingList[num]);\n\t\t\tbreak;\n\t\tcase '2':\n\t\tcase 'meat':\n\t\tcase 'Meat':\n\t\t\tmeatList.push(shoppingList[num]);\n\t\t\tbreak;\n\t\tcase '3':\n\t\tcase 'snacks':\n\t\tcase 'Snacks':\n\t\t\tsnacksList.push(shoppingList[num]);\n\t\t\tbreak;\n\t\tcase '4':\n\t\tcase 'condiments':\n\t\tcase 'Condiments':\n\t\t\tcondimentsList.push(shoppingList[num]);\n\t\t\tbreak;\n\t\tcase '5':\n\t\tcase 'various':\n\t\tcase 'Various':\n\t\t\tvariousList.push(shoppingList[num]);\n\t\t\tbreak;\n\t\tcase '6':\n\t\tcase 'cold':\n\t\tcase 'Cold':\n\t\t\tcoldList.push(shoppingList[num]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('something broke');\n\t}\n\n\tremoveShopping(num);\n\tshowList();\n}", "function useItem(index) {\n if (phaseCounter === 2) {\n if (player.itemsBelt[index].name === 'balm vial') {\n heal(player);\n } else if (player.itemsBelt[index].name === 'powder shell') {\n newMessage(player.name + ' threw a powdershell at the ' + creature.name + '!');\n burn(creature);\n } else if (player.itemsBelt[index].name === 'spike') {\n newMessage(player.name + ' threw a spike at the ' + creature.name + '!');\n pierce(creature);\n } else if (player.itemsBelt[index].name === 'spore pod') {\n newMessage(player.name + ' tossed a spore pod at the ' + creature.name + '!');\n poxChance(creature);\n }\n player.itemsBelt.splice(index, 1);\n itemBox[index].firstChild.remove();\n for (var i = 0; i < 3; i++) {\n itemBox[i].innerHTML = '<p>Empty</p>';\n }\n itemsCheck();\n enemyHp.innerText = creature.name + ' hit points: ' + creature.hp;\n } else {\n newMessage(player.name + ' can\\'t use an item during this phase!');\n }\n \n}", "function playerOneBake() {\n compareArray = userArray.sort();\n if (compareArray.length === randPizza.length && compareArray.every(function(value, index) { return value === randPizza[index]})\n ){\n woohoo.play();\n playerOneCurrentScore++;\n playerOneScore.innerHTML = `${playerOne.value}<br>Pizzas: ${playerOneCurrentScore}`; \n pizzaType.innerText = '';\n ingredientList.innerText = \"Nice pizza, how about another?\"\n setTimeout(PizzaReset, 1000)\n userArray = [];\n compareArray = [];\n randPizza =[];\n\n } else {\n oof.play();\n pizzaType.innerText = ':('\n ingredientList.innerHTML = \"Sorry, that's the wrong pizza.<br>Try again\"\n setTimeout(PizzaReset, 1500)\n userArray = [];\n compareArray = [];\n \n }\n while (game.firstChild){\n game.removeChild(game.lastChild);\n }\n game.append(pizzaDough);\n game.append(bakeButtonUserOne);\n\n}", "function removeItem(cart1) {\n $(\"button.remove\").on(\"click\", function () {\n let index = parseInt(this.value);\n cart1.splice(index,1);\n generateCart(cart1);\n });\n}", "function deleteFruit() {\n if (fruit.value) {\n for (let i = 0; i < fruitArr.length; i++) {\n if (fruitArr[i].innerHTML.indexOf(fruit.value) !== -1) {\n list.removeChild(fruitArr[i]);\n fruitArr.sort();\n } else {\n continue;\n }\n }\n } else {\n error[3].innerHTML = 'Skriv en frukt';\n error[3].style.display = 'block';\n }\n}", "function dropItem() {\r\n\t//check equip\r\n\t//traverse playerBag, splice item from array.\r\n\t//close menu window.\r\n\t//set inventory display appropriately.\r\n\tfor(var i = 0; i < playerBag.length; i++) {\r\n\t\tif(currItemCode == playerBag[i]) {\r\n\t\t\tif(currItemCode == equippedArmorArr[0] || currItemCode == equippedWpnArr[0]) {\r\n\t\t\t\tget(\"bottom-display\").innerHTML = \"You cannot drop something that you are using!\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tplayerBag.splice(i, 1);\r\n\t\t\t\tget(\"item\" + itemHoverVal).style.display = \"none\";\r\n\t\t\t\tget(\"item\" + playerBag.length).style.display = \"none\";\r\n\t\t\t\tget(\"icon\" + playerBag.length).style.display = \"none\";\r\n\t\t\t\tget(\"bottom-display\").innerHTML = \"You drop the \" + currItemName + \". It disappears in a puff of black smoke.\";\r\n\t\t\t\tclosedVBox();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tdisplayInventory(playerBag);\r\n\tgetLocCode();\r\n\tloadZone(playerLocCode, locStorageArray);\r\n}", "distribute(jugglers_) {\n let curHand = RIGHT_HAND;\n let jugglerIndex = 0;\n for(let i = 0; i < this.list.length; ++i) {\n jugglers_[jugglerIndex].pickup(curHand, this.list[i]);\n ++jugglerIndex;\n if (jugglerIndex >= jugglers_.length) {\n jugglerIndex = 0;\n curHand = (curHand === RIGHT_HAND) ? LEFT_HAND : RIGHT_HAND;\n }\n\n }\n }", "function remove_inventory(){ \n//take the top item from the list \n\n\tproducts.shift(); \n\t// you dont need to do \"var anything\" because you dont need to assign the variable\n\n\tprinting(); \n\n}", "function updateItems() {\n var ShufArray = shuffleSpawns(items1d, itemSpawns);\n for (var i = 0; i < itemsNum; i++) {\n items[i].posX = ShufArray[i].x;\n items[i].posY = ShufArray[i].y;\n items[i].c = new Victor(items[i].posX + 16, items[i].posY + 16);\n items[i].grabbed = false;\n }\n\n }", "function itemDrop() {\n\troll = Math.random();\n\t\n\tfor (i = 0; i < description.length; i++) {\n\t\tif (roll >= rarity[i]) {\n\t\t\t// Generate the item and the damage it gives when \"equipped\"\n\t\t\t\n\t\t\titem = drops[Math.floor(Math.random() * drops.length)];\n\t\t\titemDamage = Math.floor((itemLevel * Math.random() * 2) * itemDamageMult[i]);\n\t\t\t\n\t\t\t// Save the item and its states in the lists\n\t\t\treward.push(description[i] + \" \" + item);\n\t\t\titemBonus.push(itemDamage);\n\t\t\t\n\t\t\t// Display the item on the main page\n\t\t\tstatus = \"Item dropped!\";\n\t\t\tdisplay += \" You found a(n) \" + description[i] + \" \" + item + \"! <br>\"; \n\t\t\t\n\t\t\t// Add the button to loot the drop\n\t\t\taddButton();\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\treload();\n}", "function addRice(){\n priceArray[2] += 1.99;\n itemArray[2] ++; \n alert(\"You have added \" + itemArray[2] + \" Easy-Make rice pack(s). Your rice total is $\" + priceArray[2] )\n}", "function clickedCard() {\n if (event.target.classList.contains('card')) {\n event.target.classList.add('open', 'show', 'temp');\n tempArray.push(event.target);\n if (tempArray.length == 2) {\n if (tempArray[0] != tempArray[1]) {\n move++;\n moves.innerHTML = move;\n checkMatch();\n if (move === 15) {\n stars.children[2].classList.add('hide');\n starsArray.pop();\n } else if (move === 19) {\n stars.children[1].classList.add('hide');\n starsArray.pop();\n }\n } else {\n tempArray.splice(1);\n }\n }\n }\n}", "function displayLootBags() {\n\n for (var j = 0; j < lootBagList.length; j++) {\n \n lootBagList[j].draw();\n\n if (lootBagList[j].inventory.length < 1 || lootBagList[j].lifeTime < 1) { \n\n lootBagList.splice(j, 1); \n }\n }\n}", "function enemyBuyU() {\n var newCard = $(\"<li>\").addClass(\"euCard\");\n var name = $(\"<p>\").addClass(\"name\").text(currentPosition.name).css(\"background-color\", currentPosition.color).css(\"color\",\"white\");\n var l1 = $(\"<p>\").text(\"Price: $\" + currentPosition.price);\n var l2 = $(\"<p>\").text(\"Own 1: Pay 4 times dice roll\");\n var l3 = $(\"<p>\").text(\"Own 2: Pay 10 times dice roll\");\n var l4 = $(\"<p>\").text(\"Mortgage Value: $\" + currentPosition.mortgage);\n newCard.append(name).append(l1).append(l2).append(l3).append(l4);\n newCard.insertBefore(\".hideEnemyProperties\")\n $(\"#promptp\").remove();\n playerCash -= currentPosition.price;\n updateCash();\n enemyUpdate(\"Enemy just purchased the \"+ currentPosition.name)\n currentPosition.owned=\"enemy\";\n currentPosition.inPlay=\"yes\";\n checkUtilitiesOwned();\n if(utilitiesOwnedEnemy == 1){\n currentPosition.rentStatus=\"own1\";\n }else if(utilitiesOwnedEnemy == 2){\n function getUtilities (obj){\n if(obj.type == \"uCard\" && obj.owned == \"enemy\"){\n return true\n }\n }\n var toUpdate = propertyCards.filter(getUtilities);\n for(var i =0; i<toUpdate.length; i++){\n toUpdate[i].rentStatus = \"own2\";\n }\n }\n}", "function collisions(){\n\n // this variable will allow us to test if collision is true or false\n var test2 = false;\n\n // this will loop through my squid array to see if any objects are colliding\n for ( let i = 1; i < squid.length ; i ++){\n test2 = have_collided(squid[0], squid[i]);\n if (test2 == true){\n break; // if the objects overlap, then we break out of the loop.\n }\n\n }\n // if the collisions happen, then we push the player character back the opposite way.\n if (test2){\n if (movement ==\"up\"){\n down(squid[player]);\n }\n else if(movement == \"down\"){\n up(squid[player]);\n }\n else if (movement == \"left\"){\n right(squid[player]);\n }\n else if (movement == \"right\"){\n left(squid[player]);\n }\n }\n// This removes the collectable item after its spliced from the array.\n setTimeout(remove_food, 1000);\n}", "function addNewItem() {\n //Adds a new item to the array then updates the list\n let newItem = document.getElementById(\"new-item-input\").value;\n let exitFuncton = false;\n //Stops adding more than one of the same item, not sure if there's a simplar method but it works!\n shoppingList.forEach((item) => {\n if (item.ingredients === newItem) {\n exitFuncton = true;\n return;\n }\n });\n if (exitFuncton) {\n return;\n }\n let newListObject = { ingredients: newItem, acquired: false };\n shoppingList.push(newListObject);\n addListItem(newListObject);\n}", "function foodEaten() {\n if (snakeArray[0].x == food.x && snakeArray[0].y == food.y) {\n score+=1;\n foodSound.play();\n let obj = {\n x: snakeArray[0].x + direction.x,\n y: snakeArray[0].y + direction.y,\n };\n snakeArray.push(obj);\n foodGenerate();\n }\n\n}", "function makeDeck() {\n D1846.errtxt = \"\";\n D1846.deck = [\n 'Big 4', 'Chicago and W. Indiana', 'Mail Contract',\n 'Michigan Southern', 'Lake Shore Line',\n 'Michigan Central', 'Ohio and Indiana', 'Meat Packing Co.',\n 'Steamboat Co.', 'Tunnel Blasting Co.'\n ];\n// Purge removed private companies.\n if (D1846.playercount !== 5){\n $('.boxes:checked').each(function(){\n purgeitem(D1846.deck, $(this).val());\n });\n }\n// Test deck size \n if (D1846.playercount === 3 && D1846.deck.length !== 6){\n D1846.errtxt = 'Please check 2 privates from each group.' ;\n $(\"#emsg\").text(D1846.errtxt).show(); \n }\n if (D1846.playercount === 4 && D1846.deck.length !== 8){\n D1846.errtxt = 'Please check 1 private from each group.';\n $(\"#emsg\").text(D1846.errtxt).show(); \n }\n if (D1846.playercount === 5 && D1846.deck.length !== 10){\n D1846.errtxt = 'The deck size is wrong.';\n $(\"#emsg\").text(D1846.errtxt).show(); \n }\n if (D1846.errtxt === \"\") {\n// Add blank cards.\n var i, j;\n for (i = 1; i <= D1846.playercount; i++) {\n j = D1846.deck.push('Blank Card');\n }\n// Shuffle deck.\n shuffle(D1846.deck);\n }\n}", "function moveDroplets() {\n for(var i=0;i < droplets.length;i++) {\n droplets[i].move(-1);\n for(var j=0;j < flowers.length;j++) {\n if(droplets[i].hits(flowers[j])) {\n flowers[j].grow();\n droplets[i].destroy();\n }\n }\n\n //Check if oob\n if(droplets[i].y <= 0) {\n droplets[i].destroy();\n }\n }\n}", "processMoveItemUp(itemArgs) {\n // stop propagation\n event.stopPropagation();\n\n if (itemArgs == 0 ) {\n\n } else {\n // itemArgs is the item card index\n let listBeingEdited = window.todo.model.listToEdit;\n let itemsArray = listBeingEdited.items;\n // swap\n // A is item at itemArgs\n // B, A. temp = B\n // A, A\n // A, temp = B\n let prevIndex = Number(itemArgs) - 1;\n let temp = listBeingEdited.getItemAtIndex(prevIndex);\n itemsArray[prevIndex] = listBeingEdited.getItemAtIndex(itemArgs);\n itemsArray[itemArgs] = temp;\n // update list\n window.todo.model.loadList(listBeingEdited.getName());\n }\n }", "function manageStars(noOfMoves) {\n if (noOfMoves > 16 && noOfMoves <= 32) {\n let fifthStar = document.getElementsByClassName('stars')[0]\n .getElementsByTagName('li')[4];\n if (fifthStar != null)\n fifthStar.remove();\n }\n if (noOfMoves > 32 && noOfMoves <= 48) {\n let fourthStar = document.getElementsByClassName('stars')[0]\n .getElementsByTagName('li')[3];\n if (fourthStar != null)\n fourthStar.remove();\n }\n if (noOfMoves > 48 && noOfMoves <= 64) {\n let thirdStar = document.getElementsByClassName('stars')[0]\n .getElementsByTagName('li')[2];\n if (thirdStar != null)\n thirdStar.remove();\n }\n if (noOfMoves > 64 && noOfMoves <= 80) {\n let secondStar = document.getElementsByClassName('stars')[0]\n .getElementsByTagName('li')[1];\n if (secondStar != null)\n secondStar.remove();\n }\n if (noOfMoves > 80) {\n let firstStar = document.getElementsByClassName('stars')[0]\n .getElementsByTagName('li')[0];\n if (firstStar != null)\n firstStar.remove();\n }\n}", "function goHunt(){\n let selection = Math.floor(Math.random() * huntResults.length)\n if (huntResults[selection].item != ''){\n foodItems[selection].quantity += 1\n console.log(foodItems)\n}\n\n $('#food').html(\n `<table>\n <tr>\n <th>Food</th>\n <th>Quantity</th>\n <th>Eat</th>\n </tr>\n <tr>\n <th>${foodItems[1].name}</th>\n <th>${foodItems[1].quantity}</th>\n <th><button>50 hp</button></th>\n </tr>\n <tr>\n <th>${foodItems[2].name}</th>\n <th>${foodItems[2].quantity}</th>\n <th><button>100 hp</button></th>\n </tr>\n <tr>\n <th>${foodItems[4].name}</th>\n <th>${foodItems[4].quantity}</th>\n <th><button>25 hp</button></th>\n </tr>\n </table>`)\n \n $('#textWindow').html(`${huntResults[selection].displayMessage}`)\n\n if(food != []){\n $('#foodHeading').html('Food:')\n }\n}", "function addBombs(){\n numBombs.innerHTML = bombAmount\n suffledArray = gameArray.sort(()=>Math.random()-0.5);\n //you can see where are the bombs in the console\n console.log(suffledArray)\n squares.forEach(square =>{\n square.classList.add('hidden');\n })\n}" ]
[ "0.7375945", "0.7222851", "0.68677896", "0.65775746", "0.63470984", "0.6286866", "0.62413913", "0.6146107", "0.61089677", "0.609384", "0.6055145", "0.6038697", "0.6032609", "0.6022265", "0.6020042", "0.6019261", "0.6009115", "0.5976073", "0.59412724", "0.59295917", "0.5921889", "0.59194756", "0.58957875", "0.58814996", "0.5871456", "0.5867906", "0.5865695", "0.5864332", "0.583545", "0.58337224", "0.58226657", "0.581397", "0.5810163", "0.5801471", "0.57834727", "0.57829255", "0.57660973", "0.576219", "0.5757796", "0.57540077", "0.5743305", "0.57373816", "0.5734207", "0.5719801", "0.5717001", "0.57151073", "0.5710978", "0.57097465", "0.570398", "0.57023364", "0.5681032", "0.56810147", "0.5678835", "0.56764", "0.5675175", "0.5672478", "0.56621057", "0.5655011", "0.56476295", "0.5640271", "0.5632093", "0.56261224", "0.56202316", "0.56200385", "0.5613997", "0.56097215", "0.5608845", "0.5603707", "0.5601647", "0.5600938", "0.55974615", "0.55792296", "0.5567883", "0.5561632", "0.5555814", "0.5551797", "0.55450034", "0.5539981", "0.5538321", "0.5536156", "0.55347127", "0.5532238", "0.5527894", "0.552659", "0.5525913", "0.5523181", "0.55212003", "0.55205655", "0.5513421", "0.5513191", "0.5510168", "0.5508009", "0.5507186", "0.550322", "0.5496933", "0.54951906", "0.5494378", "0.5490033", "0.54826474", "0.54799265" ]
0.74078137
0
Challenge 4: Write a function that will remove the last item in the buyList, and put it in the fridge.
function moveDown() { //your code const fromBuyList = buyList.pop(); if (fromBuyList) { fridge.push(fromBuyList); updateDisplay(); } else { return; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveDown(){\n //your code\n \n if(buyList.length !== 0){\n var data = buyList.pop(data);\n fridge.push(data)\n console.log(buyList);\n console.log(fridge);\n buyListDisplay.innerHTML = buyList\n fridgeListDisplay.innerHTML = fridge\n } else {\n return null\n }\n}", "function moveUp() {\n //your code\n const fromFridge = fridge.pop();\n if (fromFridge) {\n buyList.push(fromFridge);\n updateDisplay();\n } else {\n return;\n }\n}", "function untickItem(UntickItem){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList == null){\n boughtList = [];\n }\n else{\n boughtList = JSON.parse(boughtList);\n boughtList = convertObjArrayToItemArray(boughtList);\n }\n var chosenList = localStorage.getItem(\"chosenList\");\n var shoppingList = localStorage.getItem(chosenList);\n if(shoppingList != null){\n shoppingList = JSON.parse(shoppingList);\n shoppingList = convertObjArrayToItemArray(shoppingList);\n }\n for (var i = 0; i < boughtList.length; i++){\n if(UntickItem[0] == boughtList[i].name){\n var tempUntickItem = boughtList[i];\n boughtList.splice(i, 1);\n shoppingList.push(tempUntickItem);\n }\n }\n localStorage.setItem(chosenBoughtList, JSON.stringify(boughtList));\n localStorage.setItem(chosenList, JSON.stringify(shoppingList));\n}", "function moveUp(){\n //your code\n\n // if(fridge.length !== 0){\n // buyList.push(fridge[0]);\n // fridge.shift();\n \n // console.log(fridge);\n // console.log(buyList);\n // } else {\n // return null\n // }\n \n // fridge.forEach(function(item, index) {\n // fridge.splice(index, 1);\n // buyList.push(item);\n // console.log(fridge)\n // });\n \n \n if(fridge.length !== 0){\n var data = fridge.shift()\n buyList.push(data)\n console.log(buyList);\n buyListDisplay.innerHTML = buyList\n fridgeListDisplay.innerHTML = fridge\n\n } else {\n console.log(fridge);\n return null\n }\n}", "function destructivelyRemoveLastKitten(){\n kittens.pop();\n return kittens;\n}", "function remove_inventory(){ \n//take the top item from the list \n\n\tproducts.shift(); \n\t// you dont need to do \"var anything\" because you dont need to assign the variable\n\n\tprinting(); \n\n}", "function destructivelyRemoveLastKitten () {\n kittens.pop ()\n return kittens\n}", "function destructivelyRemoveLastKitten() {\n return kittens.pop() \n}", "function removeItemFromList(listName,targetElement){\n\t\tvar noItems, i, j;\n\t\tnoItems = gapi.hangout.data.getValue(listName) || \"0\";\t\t\t\t\t\t\t\t\t\t// get the list length\n\t\tj = targetElement;\t\n\t\tfor ( i = targetElement; i < noItems; i++) {\n\t\t\tj++;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// j in loop always is i + 1\n\t\t\tgapi.hangout.data.setValue(listName + i, gapi.hangout.data.getValue(listName + j));\t\t// save data in pos j into i\n\t\t}\n\t\tgapi.hangout.data.clearValue(listName + j);\t\t\t\t\t\t\t\t\t\t\t\t\t// removes top variable holder\n\t\tgapi.hangout.data.setValue(listName, (parseInt(noItems, 10) - 1).toString());\t\t\t\t// saves list length -1 to shared state\n\t}", "takeout(item) {\n var index = this.item.indexOf(item);\n if (this.open = true && index > -1) {\n this.item.splice(index, 1);\n alert(\"Item has been removed from the backpack.\");\n }\n }", "function destructivelyRemoveLastKitten(name){\n kittens.pop(\"Garfield\");\n return kittens;\n}", "function RemoveItem(item){\n var index = basket.indexOf(item);\n if (index > -1) {\n console.log(\"Taking \" + item.Name + \" out of the basket!\");\n basket.splice(index, 1);\n return;\n }\n Console.log(item.Name + \" is not in the basket!\");\n}", "function removeFromList(x) {\n groceryList.splice(x, 1);\n}", "function boughtItem(BoughtItem){\n var chosenBoughtList = localStorage.getItem(\"chosenBoughtList\");\n var boughtList = localStorage.getItem(chosenBoughtList);\n if(boughtList == null){\n boughtList = [];\n }\n else{\n boughtList = JSON.parse(boughtList);\n boughtList = convertObjArrayToItemArray(boughtList);\n }\n var chosenList = localStorage.getItem(\"chosenList\");\n var shoppingList = localStorage.getItem(chosenList);\n if(shoppingList != null){\n shoppingList = JSON.parse(shoppingList);\n shoppingList = convertObjArrayToItemArray(shoppingList);\n }\n for (var i = 0; i < shoppingList.length; i++){\n if(BoughtItem[0] == shoppingList[i].name){\n var tempBoughtItem = shoppingList[i];\n shoppingList.splice(i, 1);\n boughtList.push(tempBoughtItem);\n }\n }\n localStorage.setItem(chosenBoughtList, JSON.stringify(boughtList));\n localStorage.setItem(chosenList, JSON.stringify(shoppingList));\n}", "function removeScrapBuck(index){\r\n scarpBuckList.splice(index,1)\r\n}", "function destructivelyRemoveLastKitten(name){\n kittens.pop(name)\n}", "function removeLast() {\r\n\tmyList.pop();\r\n\tdocument.getElementById('list-content').innerHTML = myList.join(\"\");\r\n}", "function removeLastKitten() {\n return kittens.slice(0, kittens.length - 1) //starting from the first index, to the end of the array, then removing the last one\n}", "function removeLastItem(){\n\n console.log(\"===\\nremoving ITEM\\n===\");\n var list=document.getElementById('list-input');\n if(document.getElementsByClassName('list-entry').length>0){// if there are any to remove\n list.removeChild(list.lastChild);\n }\n else{\n alert(String(\"Woah slow down there, dont be so tap happy on that button. \\n you can only remove\"+\n \" entries if there are some to remove. \\'\\'\\'⌐(ಠ۾ಠ)¬\\'\\'\\' \"));\n }\n}", "removeFromback() {\r\n // If the list is empty, there's nothing to remove!\r\n if(this.isEmpty()) {\r\n console.log(\"The list is already empty!\")\r\n return this;\r\n }\r\n // Otherwise, let's check to see if the list has only 1 element!\r\n else if(this.head.next == null) {\r\n // If the list only has 1 element, let's hold onto the node\r\n let temp = this.head;\r\n // Set the head of the list to null (emptying the list)\r\n this.head = null;\r\n // and return what was previously the only node in the list\r\n return temp;\r\n }\r\n else {\r\n // If we made it here, the list must have multiple nodes\r\n\r\n // So let's set a runner and a walker, so we can keep track of the previous node.\r\n let runner = this.head.next;\r\n let walker = this.head;\r\n // We want to progress both walker and runner down the list until the runner is the LAST node\r\n while(runner.next != null) {\r\n // Setting walker to runner before moving runner to runner's next\r\n // makes it so once runner is the LAST node, walker will be the SECOND TO LAST node\r\n walker = runner;\r\n runner = runner.next;\r\n }\r\n // Now that walker is the SECOND TO LAST node, setting its .next to null will remove the LAST node\r\n // from the SLL\r\n walker.next = null;\r\n\r\n // and return the node we just chopped off!\r\n return runner;\r\n }\r\n\r\n }", "function tryFunction(){\n vegetables.pop();\n vegetables.push(vegetables.length);\n fruit.shift();\n var x = fruit.indexOf('orange');\n fruit.push(x);\n var food = fruit.concat(vegetables);\n food.splice(4, 2);\n food.reverse();\n var foodString = food.toString();\n \n console.log(foodString)\n}", "pop() {\n if (this.count == 0) return undefined; //checking whether array is empty\n let deleteItem = this.items[this.count - 1];\n this.count = this.count - 1;\n return deleteItem;\n }", "function extraer(list,x) {\n if(last(list)==x) {\n return pop(list);\n } else {\n return cons(last(list),extraer(pop(list),x));\n }\n}", "function last(list, count) {\n\n}", "pop (){\n if (this.count === 0) {\n return undefined;\n }\n this.count--;\n let result = this.items[this.count];\n delete this.items[this.count];\n return result;\n }", "function removeItemFromList()\n{\n\t// Item list to append new item to\n\tvar itemList = document.getElementById(\"itemlist\");\n\t\n\t// Array of individual items in list\n\tvar saleArray = [];\n\tsaleArray = document.getElementsByClassName(\"item\");\n\n\tsaleArray[0].remove();\n\n\t// Set unique id\"s for all item elements in saleArray\n\tvar i = 0;\n\twhile (i < saleArray.length)\n\t{\n\t\tsaleArray[i].id = \"item_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"itemname\")[0].id = \"itemname_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"itemname\")[0].name = \"itemname_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"itemid\")[0].id = \"itemid_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"itemid\")[0].name = \"itemid_\" + i;\n\t\t\n\t\tsaleArray[i].getElementsByClassName(\"itemquantity\")[0].id = \"itemquantity_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"itemquantity\")[0].name = \"itemquantity_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"unitcost\")[0].id = \"unitcost_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"unitcost\")[0].name = \"unitcost_\" + i;\n\n\t\tsaleArray[i].getElementsByClassName(\"totalcost\")[0].id = \"totalcost_\" + i;\n\t\tsaleArray[i].getElementsByClassName(\"totalcost\")[0].name = \"totalcost_\" + i;\n\n\t\ti++;\n\t}\n\n\tif (saleArray.length == 1)\n\t{\n\t\t// Remove the remove button if there\"s only one item in the sale list\n\t\tdocument.getElementById(\"item_0\").getElementsByClassName(\"removeItem\")[0].remove();\n\t}\n\n\tformUpdate();\n}", "removeHearthFromInventory(item) {\n for (let i = 0; i < this.inventory.length; i++) {\n if (this.inventory[i].item === item) {\n this.inventory.splice(i, 1);\n }\n }\n console.log(\"This is the new hearth list\", this.inventory);\n }", "function removeLastKitten(){\n var kitten= kittens.slice(0, kittens.length-1);\n return kitten;\n}", "deal(){\n return this.deck.pop();\n }", "function deleteItem(e) {\n // get weight of item from span\n const weightString = e.target.previousSibling.previousSibling.innerHTML;\n // convert item weight from string to number\n const newNum = parseInt(weightString, 10);\n\n // loop thru array\n for (let i = 0; i < kitArray.length; i++) {\n // find matching value of target\n if (kitArray[i] === newNum) {\n // delete match from array\n kitArray.splice(i, 1);\n // break loop after 1 match\n break;\n }\n }\n \n // recalculate weight for head\n if (kitArray.length > 1) {\n const add = (a, b) =>\n a + b;\n const sum = kitArray.reduce(add);\n weight.innerHTML = (sum + ' oz');\n \n } else if (kitArray.length === 1) {\n let numb = kitArray[0];\n weight.innerHTML = (numb + ' oz');\n } else {\n kitArray = [];\n weight.innerHTML = (0 + ' oz');\n }\n \n // remove li\n e.target.parentNode.parentNode.removeChild(e.target.parentNode);\n\n weightGauge();\n calculateGauge4();\n\n }", "function destructivelyRemoveFirstKitten(){\n kittens.shift();\n return kittens;\n }", "function remove (list, bookName) {\n let updatedList = [...list]\n if (updatedList.indexOf(bookName) >= 0) {\n\n updatedList.splice(updatedList.indexOf(bookName),1);\n \n return updatedList;\n // Add your code above this line\n }\n}", "deal() {\n return this._deck.pop();\n }", "function removeItemFromCartAll(name) {\n for (var i in shoppingList) {\n if (shoppingList[i].name === name){\n shoppingList[i].count--;\n if(shoppingList[i] === 0){\n shoppingList.splice(i, 1);\n }\n break;\n }\n}\n}", "function remove (lista) {\n lista.shift();\n return lista;\n}", "pop() {\n //Removing a node from the end of the list\n //Pseudocode \n //If nothing in list, return undefined\n //loop through the list until you hit the tail \n //set the next property of the second to last node to be null \n //decrement the length of the list by 1\n //return the last node \n if (!this.head) {\n return undefined\n }\n\n let current = this.head\n let newTail = current;\n while (current.next) {\n newTail = current\n current = current.next;\n //At the end of this list, newTail will be the second last value and current will be the last value\n }\n newTail.next = null;\n this.length--\n this.tail = newTail;\n /**This is to ensure that when there is one item left in the array, set them to be null for head and tail */\n if (this.length == 0) {\n this.head = null\n this.tail = null\n }\n return current\n }", "removeFromBack() {\n if(!this.head) {\n console.log(\"There is no list!\");\n return null;\n } \n if(this.head.next == null) {\n this.head = null;\n console.log(\"The list is now empty!\")\n }\n var runner = this.head;\n while(runner.next.next != null) {\n runner = runner.next;\n }\n runner.next = null;\n return this;\n }", "function removeItem(item){\n // Remove the item from the list.\n list.splice(item, 1);\n\n // Display the list.\n printList();\n\n // Save the list.\n saveList(list);\n}", "function destructivelyRemoveFirstKitten () {\n kittens.shift ()\n return kittens\n}", "function C010_Revenge_SidneyJennifer_StealItems() {\n\t\n\t// Backup and remove the player inventory\n\tPlayerSaveAllInventory();\n\tPlayerRemoveAllInventory();\n\tC010_Revenge_SidneyJennifer_ItemStolen = true;\n\tCurrentTime = CurrentTime + 50000;\n\t\n}", "function removeSpent() {\n var player = GM_getValue(\"currentPlayer\",\"\");\n if (player==\"\")\n return;\n var sumlist = retrieveSumlist(player);\n var lastrecord=getLastRecord(sumlist);\n if (lastrecord>=0) {\n var entry=sumlist[lastrecord];\n var etext=\"\";\n if (entry.desc && entry.desc!=\"\") {\n var desc=entry.desc;\n if (!entry.desc.match('[0-9][0-9]* '))\n desc=\"1 \"+desc;\n etext=\" buying \"+desc;\n } \n var selected = confirm(\"Remove last expense\"+etext+\" for \"+makeThousands(String(entry.amt))+\" Meat, on \"+textFromDate(entry.date)+\"?\");\n if (selected) {\n sumlist[lastrecord].amt=0;\n storeSumlist(player,sumlist);\n window.location.reload();\n }\n }\n}", "function Purge(inventory) {\n return inventory.splice(2, inventory.length);\n}", "remove()\n {\n this.list.delete((this.list.size-1) + \"\");\n }", "pop(){\n if(this.isEmpty()){\n return undefined;\n }\n\n // volta um no contador para acessarmos a chave do ultimo elemento adicionado, \n // visto que após o adicionarmos, já adicionamos mais um ao contador.\n this.count--\n\n const topElement = this.items[this.count];\n\n delete this.items[this.count];\n\n return topElement;\n }", "function removeElementFromEndOfArray(chocolateBars) {\n chocolateBars.slice(0, chocolateBars.length - 1);\n return chocolateBars;\n}", "function removeLastKitten () {\n return kittens.slice (0, kittens.length -1)\n}", "function remove(){\n\t\tif(this.items.length === 0) return null;\n\t\tif(this.items.length === 1) return this.items.shift();\n\t\tlet element = this.items[0];\n\t\tthis.items[0] = this.items.pop();\n\t\t_siftDown.call(this);\n\t\treturn element;\n\t}", "function spliceOne(list,index){for(var i=index,k=i+1,n=list.length;k<n;i+=1,k+=1){list[i]=list[k];}list.pop();}", "function spliceOne(list,index){for(var i=index,k=i+1,n=list.length;k<n;i+=1,k+=1){list[i]=list[k];}list.pop();}", "function dropCardAndContinue() {\n\tlist.splice(current, 1);\n\t\n\tvar userListPane = document.getElementById(\"userListPane\");\n\tuserListPane.removeChild(userListPane.getElementsByClassName(\"listItem\")[current]);\n\t\n\tsaveUserList();\n\t\n\tcurrent--;\n\tnextCard();\n}", "updateBasket(item, amount){\n let itemsBought = Object.assign({}, this.state.itemsBought);\n //if changed mind and down to 0, remove from bought items list\n if(amount < 1){\n delete itemsBought[item];\n }else{\n itemsBought[item] = this.state.items[item];\n }\n this.setState({itemsBought : itemsBought});\n }", "function hotPotato(nameList, number){\n\n\tvar queue = new Queue()\n\n\t//fill the queue\n\tfor(var i = 0; i< nameList.length; i++){\n\t\tqueue.enqueue(nameList[i])\n\t}\n\n\tvar eliminated = ''\n\twhile(queue.size() > 1){\n\t\tfor(var i = 0; i<number; i++){\n\t\t\t//this is what allows for the simulation of a circular hot potatoe. \n\t\t\t//first person is removed, and then added to the back of the list\n\t\t\t//this happends until we reach 'number' in the for loop\n\t\t\tqueue.enqueue(queue.dequeue())\n\t\t}\n\n\t\t//once 'number' is reached, the for loop ends and we eliminate whoever is at the front of the array.\n\t\t//the person at the front of the arrary always has the hot potatoe in this game\n\t\teliminated = queue.dequeue()\n\t\t// console.log(`${eliminated} has been eliminated!`)\n\t}\n\n\t// queue.print()\n\t// console.log(`${queue.front} is the winner!`)\n\tqueue.print()\n\treturn queue.dequeue()\n}", "pop () {\n if (!this.head) {\n return undefined\n } else {\n\n // to pop the last item off of a linked list, we need to first traverse up to it from the head \n // do this with a loop \n // have two pointers; one for the current item, and one for the previous item \n // both pointers start at the head because its always the first item in a linked list \n let current = this.head; \n let newTail = this.head; // this is to track the previous item \n\n while (current.next) {\n // if the current item has a next property, it means there are more items after it \n /*** AS LONG AS CURRENT HAS A NEXT PROPERTY, NEW TAIL WILL ALWAYS BE THE CURRENT AKA ALWAYS ONE STEP BEHIND */\n newTail = current; \n\n // ******** set current to its next value to continue moving the loop forward ******\n current = current.next \n }\n\n //when the loop is done, we set the previous item as this.tail because it will be the new tail\n this.tail = newTail;\n // we cut the link to the last item we're popping by setting the tail's next property to null \n this.tail.next = null;\n // then we decrase the list length by one \n this.length --;\n\n if (this.length === 0) {\n this.head = null; \n this.tail = null; \n }\n \n // return the item node that was popped off \n return current\n }\n }", "pop() {\n const lastItem = this.data[this.length - 1];\n\n delete this.data[this.length - 1];\n\n this.length--;\n\n return lastItem;\n }", "fastPop(list, index) {\n\t\t// If an array doesn't need to be in order, replacing the\n\t\t// element at the given index with the removed element\n\t\t// is much, much faster than using list.splice(index, 1).\n\t\tconst length = list.length;\n\t\tconst element = list[index];\n\t\tlist[index] = list[length - 1];\n\t\tlist.pop();\n\t\treturn element;\n\t}", "removeFromBack(){\n // Basic logic:\n // first, check to see if the list is empty. if it is, we're done.\n // if the list is only 1 element in length, set the head to null\n // otherwise, let's get to the second to last node, then lop off the last node\n\n if(this.isEmpty()){ // if the list has no nodes to remove\n return this; // just return\n } else if (this.head.next == null) { // if the list only has ONE node\n this.head = null; // then set the head to null\n return this; // and return\n } else { // otherwise\n let lagger = this.head; // this is how we're going to stay 1 behind the last node\n let runner = this.head.next; // this will be the last node (eventually)\n\n while(runner.next != null) { // running until runner.next is null will put runner at the last node, and lagger at the 2nd to last node\n lagger = runner; // move the lagger up to the runner\n runner = runner.next; // and move the runner to the next node\n }\n\n lagger.next = null; // setting lagger's .next to null effectively removes the last node from the list\n return this; // and voila we're done!\n }\n }", "function remove (bookList, bookName) {\n const bookListCopy = [...bookList];\n var book_index = bookListCopy.indexOf(bookName);\n if (book_index >= 0) {\n\n bookListCopy.splice(book_index, 1);\n return bookListCopy;\n // Add your code above this line\n }\n}", "function dealCard(player) {\n return player.hand.pop();\n}", "function hitMe(){\n if(dealed && under){\n var deal = cards.pop();\n yourHand.push(deal);\n tempArr = [deal];\n displayCards(tempArr);\n }\n check(yourHand);\n}//end of hitMe()", "function removeItems(nameAndPrice){\n \n //Command won't work if no items are in list\n if (nameAndPrice.length == 0){\n println(\"Invalid Command\");\n } else {\n while (true){ //Creates a loop until the user does not want to remove any more items\n var removeItems = readLine(\"Which item would you like to remove? (Please, use same Capital Case as original item)\");\n var index = nameAndPrice.indexOf(removeItems); // Finds the item to remove in the list\n \n //If the desired item cannot be found:\n if(nameAndPrice[index] != removeItems){ \n println(\"Item Not Found!\");\n } else { //Removes the item's name and price from the list\n nameAndPrice.remove(index);\n nameAndPrice.remove(index);\n }\n \n //Exits function if user doesn't want to remove another item, otherwise asks for the other item\n var check = readBoolean(\"Would you like to remove another item?\");\n if (check == false){\n break;\n }\n }\n }\n}", "function BOT_last(list) {\r\n\tif(list.length>0) return list[list.length-1]\r\n\telse return (undefined);\r\n}", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "function removeitemFromCart(name) { //remove one item from cart\r\n for (var i in cart) {\r\n if (cart[i].name == name) {\r\n cart[i].count--;\r\n if (cart[i].count == 0) {\r\n cart.splice(i, 1);\r\n }\r\n break;\r\n }\r\n }\r\n savecart();\r\n}", "function dropLast(n) {\n return function(xs) {\n return Z.map (Z.reverse, drop (n) (Z.reverse (xs)));\n };\n }", "function down(list) {\r\n if(length(list)==1) {\r\n return list;\r\n } else {\r\n return cons(maxList(list),down(removeX(list,maxList(list))));\r\n }\r\n}", "function deleteTodoItem(todoArray){\n todoArray.pop();\n}", "function removeWishItem(item) {\n console.log(\"called\");\n item.remove();\n let z = JSON.parse(localStorage.getItem(\"WishlistItem\"));\n wishArr = [];\n for (let k = 0; k < Object.keys(z).length; k++) {\n if (z[k].name == item.children[1].innerText) continue;\n else wishArr.push(z[k]);\n }\n localStorage.setItem(\"WishlistItem\", JSON.stringify(wishArr));\n wishEmptyCheck();\n}", "function removeKthLast(listNode, k) {\n let fastPointer = listNode;\n let runner = listNode;\n\n while(k > 0) {\n fastPointer = fastPointer.next;\n k--;\n }\n\n while(fastPointer.next !== null) {\n runner = runner.next;\n fastPointer = fastPointer.next;\n }\n\n // delete the required node by pointing to it's next node instead.\n runner.next = runner.next.next;\n return listNode;\n}", "[REMOVE_MEAL_ITEM](state, item) {\n state.meal.items = state.meal.items.filter(i => i !== item);\n }", "draw(){\n if(this.list.length != 0){\n return this.list.pop();\n }\n else{\n console.log(\"Deck is Empty.\");\n }\n \n }", "function remove (bookName) {\n if (bookList.indexOf(bookName) >= 0) {\n let updatedList = bookList\n return updatedList.splice(0, 1, bookName);\n \n // Add your code above this line\n }\n}", "function removeItem(arr) {\n arr.pop();\n console.log(arr);\n}", "function loseAttempt () { \n if (remainingLives.length > 0 && usedLives.length < 3) {\n remainingLives.pop;\n usedLives.push(\"X\\n\");\n console.log(remainingLives);\n console.log(usedLives);\n }\n}", "pop() {\n if (this.hasItem()) {\n let currentItem = this.history[this.size - 1]\n this.size -= 1\n\n return currentItem\n } else {\n return null\n }\n }", "function getLastItem() {\n var goods = [\"blue cheese\", \"apple\", \"popcorn\"];\n \n alert( \"last item is: \" + goods[goods.length - 1] );\n \n var add = prompt(\"Would you like to add a new element to the massive\", \"\");\n\n if (add !== null || add !== undefined) {\n goods.push(add);\n alert(\"The new last item is: \" + goods[goods.length - 1] );\n } else {\n alert(\"The last item is still: \" + goods[goods.length - 1] );\n }\n\n}", "pop(){\n if(this.top==-1)\n {\n return -1;\n }\n else\n {\n return this.items[this.top--]; //delete the one paranthesis from stack\n }\n }", "removeItem(_item) { }", "function remove (bookName) {\n var book_index = bookList.indexOf(bookName);\n if (book_index >= 0) {\n\n bookList.splice(book_index, 1);\n return bookList;\n\n // Change code above this line\n }\n}", "removeItem(item, count){\n if(this.inventory[item] == null || count > this.inventory[item] || count < 0)\n {\n console.log(\"%cCannot remove \" + count + \" \" + item, \"color:red\");\n return false;\n }\n else if(this.inventory[item] - count == 0) {\n console.log(\"removing \" + item);\n delete this.inventory[item];\n return true;\n }\n else{\n console.log(\"removing \" + count + \" \" + item);\n this.inventory[item] -= count;\n return true;\n }\n }", "function removeLastKitten(){\n var newArr = kittens.slice(0, kittens.length - 1);\n return newArr;\n}", "function itemDie(itemIdx){\r\n\tif(items[itemIdx].name == \"apple\"){\r\n\t\tdropItem(\"apple\");\r\n\t}\r\n\titems.splice(itemIdx, 1);\r\n}", "removeClick(index){\n //REMOVE ITEM INFO\n gross = gross - itemsArray[index].price;\n tax = gross * .0825;\n total = gross + tax;\n \n grossFormat = Math.abs(gross.toFixed(2));\n taxFormat = Math.abs(tax.toFixed(2));\n totalFormat = Math.abs(total.toFixed(2));\n \n itemsArray.splice(index, 1);\n \n this.setState({\n items: this.state.items - 1\n });\n }", "function removeFromCart(item) {\n var countup = 0;\n var itemFails = 0;\n while (countup < cart.length) {\n if(cart[countup].itemName === item) {\n cart.splice(countup, countup);\n countup++;\n } else {\n itemFails++;\n countup++;\n }\n }\n if(itemFails === cart.length){\n console.log(cart);\n return 'That item is not in your cart.';\n } else {\n console.log(cart);\n return cart;\n }\n}", "function fosterRemoveItem(e){\n console.log(e.target.id)\n let itemname = e.target.id\n console.log(itemname)\n for (let item in basket){\n if (itemname == basket[item]['name']){\n basket.splice(item, 1)\n fosterStorage['foster-basket'] = JSON.stringify(basket)\n console.log(fosterStorage.getItem('foster-basket'))\n createBasket()\n }\n }\n if ((fosterStorage.getItem('foster-basket')).length > 0){\n window.location.href = \"foster_page.html\"\n }\n \n }", "popDefensiveItem() {\n if (this.defensive.length == 0) {\n return null;\n }\n return this.defensive.pop();\n }", "function removeInventory() {\n const removeItem = document.getElementById(\"removeInventory\").value\n inventory.splice((removeItem - 1),1)\n updateInventory()\n}", "function remove(localBookList, bookName) {\n\tlet newBookList = localBookList.slice(); //This will create a new copy of a entered bookList\n\tvar book_index = localBookList.indexOf(bookName);\n\tif (book_index >= 0) {\n\t\tnewBookList.splice(book_index, 1);\n\t\treturn newBookList;\n\n\t\t// Change code above this line\n\t}\n}", "pop() {\n const lastItem = this.data[this.lenght - 1];\n delete this.data[this.lenght - 1];\n this.lenght--;\n return lastItem;\n }", "function addBlackPudding( fryUp ) { \n\n var baseCost = fryUp.cost(); \n fryUp.cost = function() { \n return baseCost + 1; \n }; \n fryUp.addItem( \"black pudding\" );\n\n}", "function removeLast(array) {\n // code\n array.pop();\n return array;\n}", "removeFromBack() {\n if ( ! this.head ) {\n console.log( \"There's nothing in this list!\" )\n\n return this\n }\n\n if ( ! this.head.next ) {\n this.head = null\n\n return this\n }\n\n let runner = this.head\n\n while ( runner.next.next )\n runner = runner.next\n\n runner.next = null\n\n return this\n }", "function fortunes() {\n\tvar num = randNum(cards.length);\n\tvar future = cards[num];\n\tcards.splice(num, 1);\n\treturn future;\n}", "dequeue() {\n while (this.list.size > 1) {\n this.helper.push(this.list.pop());\n }\n const returnNode = this.list.pop();\n\n while (this.helper.size > 0) {\n this.list.push(this.helper.pop());\n }\n return returnNode;\n }", "function remove(bookList, bookName) {\n let arr = bookList.slice() \n var book_index = arr.indexOf(bookName);\n if (book_index >= 0) {\n arr.splice(book_index, 1);\n return arr;\n\n // Change code above this line\n }\n}", "function removeListItem(name)\r\n{\r\n\tfor( var index in allItems) {\r\n\t\tif (name == allItems[index].name) {\r\n\t\t\tallItems.splice(index, 1);\r\n\t\t\tlocalStorage.setObject(\"goods\", allItems);\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n}", "function lostArtist(theLostID){\n\n console.log(theLostID);\n\n for(i=0; i < userList.length; i++){\n if( theLostID == userList[i].id ){\n userList[i].id = \"Free_Pos\";\n }\n }\n\n for(i=0; i < userList.length; i++){\n if( theLostID == userList[i].partnerId){\n userList[i].partnerId = \"none\";\n }\n }\n\n for(i=0; i<userList.length; i++){\n //clear_Junk!\n if(userList[i].id == \"Free_Pos\" && userList[i].partnerId == \"none\"){\n userList.splice(i,1);\n }\n }\n\n console.log(userList);\n console.log(\"Lost_Artist------Free_Pos\");\n}", "pop(){\r\n if (this.top === -1){\r\n return undefined;\r\n }else{\r\n delete this.storage[this.top];\r\n this.top -= 1;\r\n }\r\n }", "function destructivelyRemoveFirstKitten() {\n return kittens.shift()\n}", "rear() {\n console.log(`Rear value: ${this.list[this.list.length - 1]} `);\n return this.list[this.list.length - 1];\n }", "pop(){\n if(this.items.length == 0){\n return \"Underflow\";\n }\n else{\n return this.items.pop();\n }\n }" ]
[ "0.69768715", "0.6678475", "0.66551226", "0.66110116", "0.6450994", "0.6339073", "0.6301781", "0.6203413", "0.6164785", "0.6100684", "0.60594", "0.60248816", "0.59949416", "0.5978988", "0.5969556", "0.59448034", "0.59106505", "0.58444715", "0.5789116", "0.5766718", "0.5746339", "0.5745929", "0.57397616", "0.5738839", "0.57347727", "0.5702931", "0.5695271", "0.5678011", "0.5675991", "0.56703997", "0.5668544", "0.5652536", "0.56513286", "0.5627972", "0.56272763", "0.56238455", "0.55883867", "0.5581074", "0.55750513", "0.556682", "0.5564329", "0.5560069", "0.55546695", "0.55402935", "0.55300885", "0.5528367", "0.55275726", "0.55265963", "0.55265963", "0.55093443", "0.5499345", "0.5498951", "0.54907125", "0.54884565", "0.5480527", "0.5477865", "0.54770124", "0.54700553", "0.5469534", "0.5466574", "0.5465855", "0.54541796", "0.5450831", "0.5448229", "0.5447169", "0.54454166", "0.5445387", "0.54445213", "0.5444468", "0.5443465", "0.54417044", "0.5440642", "0.5436145", "0.5429686", "0.5413788", "0.540699", "0.5403324", "0.53996414", "0.5397804", "0.53964984", "0.53928727", "0.5391505", "0.539033", "0.53858155", "0.538214", "0.53794694", "0.53773785", "0.5376756", "0.53763896", "0.5368168", "0.5367094", "0.53667206", "0.5359521", "0.5352508", "0.5349723", "0.5348629", "0.5348304", "0.5345598", "0.53414786", "0.5337101" ]
0.71033454
0
that the function only takes primitives as arguments. The function should return a function that, when called, will check if it has already computed the result and return that value instead if possible. Example: cacheAdd = myFunction(add); add(1,2) = 3 cacheAdd(1,2) = 3 > executes add function cacheAdd(1,2) = 3 > returns from cache cacheAdd(2,2) = 4> executes add function
function myFunction(fn) { const cache = {}; return (...args) => { const key = args.join(','); if (key in cache) { console.log(`${cache[key]} --> returns from cache`); return cache[key]; } cache[key] = fn(...args); console.log(`${cache[key]} --> executes function`) return cache[key]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function memoize(fn){\n const cache={}\n return function(...args){\n if(cache[args]) return cache[args]\n \n const result = fn.apply(this,args)\n cache[args]=result\n \n return result\n }\n }", "function cacheFn(fn) {\n var cache={}\n return function(arg){\n if (cache[arg]){\n return cache[arg];\n }\n else{\n cache[arg] = fn(arg);\n return cache[arg];\n }\n }\n}", "function cacheFn(fn) {\n var cache={};\n \n return function(arg){\n if (cache[arg]){\n return cache[arg];\n }\n else{\n cache[arg] = fn(arg);\n return cache[arg];\n }\n }\n}", "function memoize(fn) {\n const cache = {};\n return function(...args) {\n if(cache[args]) { // if result already exists\n return cache[args];\n }\n let result = fn.apply(this, args); // perform function\n cache[args] = result; // save result in cache\n return result; \n }\n}", "function memorize(fn) {\n // store function calls\n const cache = {}\n // allow it to take any number of arguments\n return function(..args) {\n // look into cache, if contains key with set of args, return corresponding value\n if (cache[args]) {\n return cache[args];\n }\n // if the function hasn't been called with current set of args, we pass\n // it to the original function (fn) and save result to cache\n newCall = fn.apply(null, args);\n cache[args] = newCall;\n return newCall;\n }\n}", "function makeMemoization(func) {\n validationFunctions.validateParametersAndThrowError('Function expects a function as first parameter',\n !validationFunctions.isFunction(arguments[0]));\n\n var cache = {};\n\n return function (value) {\n if (cache[value] != undefined) {\n return cache[value];\n } else {\n var result = func(value);\n\n cache[value] = result;\n\n return result;\n }\n };\n}", "function memoize(fn) {\n // The cache object\n const cache = {};\n //we return b new function that accepts an array of arguments\n //because we want to make it generic, not for this problem only\n // ...args returns an array of the passed arguments\n return function (...args) {\n //we check if the cache has b record with these arguments\n if(cache[args]){\n //if yes - we return the result directly without b function call\n return cache[args];\n }\n // if not - we call the function fn.applu(this, args) === fn(x,y,z)\n // because args is an array.\n const result = fn.apply(this, args);\n // we record this call with new arguments\n cache[args] = result;\n //and then return the result\n return result;\n }\n}", "function memoize(fn) {\n var cache = {};\n return function (arg) {\n var cachedValue = cache[arg];\n\n // when value is not present in cache, compute it\n if (cachedValue === undefined) {\n cachedValue = cache[arg] = fn(arg);\n }\n return cachedValue;\n }\n }", "function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (! (arg in cache)) {\n return cache[arg] = fn(arg);\n }\n return cache[arg];\n };\n}", "function memoize(fn) {\n\n\t// storage object that holds all previous\n\t// calls to fn() and their respective results\n\tconst cache = {};\n\n\t// return super-charged function\n\t// ...args => don't know how many arguments will be\n\t// sent to this function, but take them and put in an array []\n\treturn function(...args) {\n\t\tif (cache[args]) {\n\t\t\treturn cache[args];\n\t\t}\n\n\t\t// never called that function with those arguments before\n\t\tconst result = fn.apply(this, args);\n\t\tcache[args] = result;\n\t\t\n\t\t// console.log('cache =', cache);\n\t\treturn result;\n\t}\n}", "function memoize(fn) {\nconst cache = {};\n return function(...args) {\n if (cache[args]) {\n return cache[args];\n }\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "function memoize(fn){\n const cache = {};\n return function(...args){\n if(cache[args]){\n return cache[args];\n }\n const result = fn.apply(this,args);\n cache[args] = result;\n return result;\n };\n}", "function memoize(func) {\n var cache = [];\n return function () {\n var args = arguments;\n for (var h = 0, hlen = cache.length; h < hlen; h++) {\n var keys = cache[h].args;\n if (keys.length !== hlen) {\n continue;\n }\n var matches = 0;\n var ilen = args.length;\n for (var i = 0; i < ilen; i++) {\n if (keys[i] !== args[i]) {\n break;\n }\n ++matches;\n }\n if (matches === ilen) {\n return cache[h].value;\n }\n }\n var value = func.apply(_, args);\n cache.push({ args: args, value: value });\n return value;\n };\n}", "function cache(func) {\r\n let cacheObject = {};\r\n let cacheArray = new Array();\r\n return function(value1, value2) {\r\n\r\n let argumentArray = [value1,value2];\r\n let argumentPassed = JSON.stringify(argumentArray);\r\n\r\n if (cacheArray.includes(argumentPassed)) {\r\n\r\n return cacheObject[argumentPassed];\r\n\r\n } else {\r\n\r\n cacheArray.push(argumentPassed);\r\n\r\n cacheObject[argumentPassed] = func(value1, value2);\r\n\r\n return cacheObject[argumentPassed];\r\n\r\n }\r\n\r\n };\r\n\r\n}", "function memoize(fn) {\n\tconst cache = {}\n\n\treturn (...args) => {\n\t\tif (cache[args]) {\n\t\t\treturn cache[args]\n\t\t}\n\n\t\tconst result = fn.apply(this, args)\n\t\tcache[args] = result\n\n\t\treturn result\n\t}\n}", "function memoize(fn) {\n let cached = false;\n let result;\n return (...args) => {\n if (!cached) {\n result = fn(...args);\n cached = true;\n }\n return result;\n };\n}", "function memoize (fn) {\n return function memoized (...args) {\n let hash = JSON.stringify(args);\n let cache = memoized.cache;\n // if result exists, return it. otherwise compute and store in cache.\n return cache[hash] || (cache[hash] = fn.call(...args));\n }\n memoized.cache = {}; // initialize empty cache\n}", "function memoize(fn) {\n const cache = {};\n \n return function(...args) {\n if(cache[args]) {\n return cache[args];\n }\n\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "function memoize(f) {\r\n // Create the cache.\r\n const cache = {};\r\n // The momoized function, can have multiple parameters.\r\n return function memoized(...args) {\r\n // Create unique identifier based on the function and the parameters.\r\n const identifier = JSON.stringify(args);\r\n // If the identifier is in the cache return the result.\r\n if (identifier in cache) {\r\n return cache[identifier ];\r\n }\r\n // Otherwise, calculate it.\r\n return (cache[identifier ] = f(...args));\r\n };\r\n}", "function memoize(fn) {\n const cache = {};\n return (...args) => {\n if (cache[args]) {\n return cache[args];\n }\n\n const result = fn.apply(this, args);\n cache[args] = result;\n\n return result;\n };\n}", "function memoizeOneFn(resultFn, isEqual) {\n isEqual = isEqual || simpleIsEqual;\n var lastThis;\n var lastArgs = [];\n var lastResult;\n var calledOnce = false;\n // breaking cache when context (this) or arguments change\n var result = function () {\n var newArgs = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n newArgs[_i] = arguments[_i];\n }\n if (calledOnce && lastThis === this && isEqual(newArgs, lastArgs)) {\n return lastResult;\n }\n // Throwing during an assignment aborts the assignment: https://codepen.io/alexreardon/pen/RYKoaz\n // Doing the lastResult assignment first so that if it throws\n // nothing will be overwritten\n lastResult = resultFn.apply(this, newArgs);\n calledOnce = true;\n lastThis = this;\n lastArgs = newArgs;\n return lastResult;\n };\n return result;\n}", "function memoize(f) {\n return function (x, cache) {\n return exists(cache[x]) ? cache[x] : cache[x] = f(x);\n };\n}", "function memoize(originalFunc) {\n const cache = {};\n return (...args) => {\n // Check cahce for previously calculated result\n if (cache[args]) {\n return cache[args];\n }\n // Apply the args array [n] to the originalFunc and cache the result for next call\n const result = originalFunc.apply(this, args);\n cache[args] = result;\n return result;\n\n }\n}", "function lruMemoize(f) {\n var cache = []\n\n return function (input) {\n for (var i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n var temp = cache[0]\n cache[0] = cache[i]\n cache[i] = temp\n return cache[0].result\n }\n }\n\n var result = f(input)\n\n cache.unshift({\n input,\n result\n })\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop()\n }\n\n return result\n }\n }", "function memoize(fn) {\n if (process.env.NODE_ENV !== \"production\") {\n return fn;\n }\n\n const cache = new LRU({ max: 2000 });\n return (...args) => {\n let invalidate = false;\n if (args.includes(MEMOIZE_INVALIDATE)) {\n args.splice(args.indexOf(MEMOIZE_INVALIDATE), 1);\n invalidate = true;\n }\n const key = JSON.stringify(args);\n\n if (cache.has(key)) {\n if (invalidate) {\n cache.del(key);\n } else {\n return cache.get(key);\n }\n }\n\n const value = fn(...args);\n if (isPromise(value)) {\n return value.then((actualValue) => {\n cache.set(key, actualValue);\n return actualValue;\n });\n }\n cache.set(key, value);\n return value;\n };\n}", "function cacheFunction(cb) {\n const cache = {};\n const func = (arg) => {\n if (!cache.hasOwnProperty(arg)) {\n cache[arg] = cb(arg);\n } \n return cache[arg];\n }\n\n return func;\n}", "function memoize(f) {\r\n // Create the cache.\r\n const cache = {};\r\n // The momoized function, gets a single parameter.\r\n return function memoized(n) {\r\n // Create unique identifier based on the function and the parameter.\r\n const identifier = JSON.stringify(n);\r\n // If the identifier is in the cache return the result.\r\n if (identifier in cache) {\r\n return cache[identifier];\r\n }\r\n // Otherwise, calculate it.\r\n return (cache[identifier] = f(n));\r\n };\r\n}", "function memoization() {\n const cache = {};\n return function (n) {\n if (n in cache) {\n return cache[n];\n } else {\n console.log(\"not cached\");\n cache[n] = n * n;\n return cache[n];\n }\n };\n}", "function lruMemoize(f) {\n\t var cache = [];\n\t\n\t return function(input) {\n\t for (var i = 0; i < cache.length; i++) {\n\t if (cache[i].input === input) {\n\t var temp = cache[0];\n\t cache[0] = cache[i];\n\t cache[i] = temp;\n\t return cache[0].result;\n\t }\n\t }\n\t\n\t var result = f(input);\n\t\n\t cache.unshift({\n\t input,\n\t result,\n\t });\n\t\n\t if (cache.length > MAX_CACHED_INPUTS) {\n\t cache.pop();\n\t }\n\t\n\t return result;\n\t };\n\t}", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n }", "function memoize(func) {\n var ran = false, memo;\n return function () {\n if (ran) return memo;\n ran = true;\n memo = func.apply(this, arguments);\n func = null;\n return memo;\n };\n }", "function lruMemoize(f) {\n const cache = [];\n\n return function(input) {\n for (let i = 0; i < cache.length; i++) {\n if (cache[i].input === input) {\n const temp = cache[0];\n cache[0] = cache[i];\n cache[i] = temp;\n return cache[0].result;\n }\n }\n\n const result = f(input);\n\n cache.unshift({\n input,\n result,\n });\n\n if (cache.length > MAX_CACHED_INPUTS) {\n cache.pop();\n }\n\n return result;\n };\n}", "function lruMemoize(f) {\n\t var cache = [];\n\n\t return function(input) {\n\t for (var i = 0; i < cache.length; i++) {\n\t if (cache[i].input === input) {\n\t var temp = cache[0];\n\t cache[0] = cache[i];\n\t cache[i] = temp;\n\t return cache[0].result;\n\t }\n\t }\n\n\t var result = f(input);\n\n\t cache.unshift({\n\t input,\n\t result,\n\t });\n\n\t if (cache.length > MAX_CACHED_INPUTS) {\n\t cache.pop();\n\t }\n\n\t return result;\n\t };\n\t}", "_memoize (...args) {\n var param = stringify(args);\n\n return (param in this._cache) ?\n this._cache[param] :\n this._cache[param] = this.f.apply(null, args);\n }", "function cached(fn) {\n var cache = new Map();\n return function cachedFn() {\n var key = arguments.length <= 0 ? undefined : arguments[0];\n if (!cache.has(key)) cache.set(key, fn.apply(void 0, arguments));\n return cache.get(key);\n };\n }", "function memoize(f) {\n var cache = {}; // Value cache stored in the closure.\n return function() {\n // Create a string version of the arguments to use as a cache key.\n var key = arguments.length + Array.prototype.join.call(arguments,\",\");\n if (key in cache) return cache[key];\n else return cache[key] = f.apply(this, arguments);\n };\n}", "function memoize(name, fn) {\n\tlet cache;\n\treturn function() {\n\t\tif (cache === undefined) {\n\t\t\tcache = fn();\n\t\t}\n\t\treturn cache;\n\t};\n}", "function memoizeFunction(fn) {\n var memo = {}, counter = 0;\n\n return function(key) {\n if (hasOwn(memo, key)) {\n return memo[key];\n }\n // istanbul ignore if\n if (counter === INTERNAL_MEMOIZE_LIMIT) {\n memo = {};\n counter = 0;\n }\n counter++;\n return memo[key] = fn(key);\n };\n }", "function memoize(func){\n\tvar results = {};\n\treturn function(){\n\t\tvar args = Array.prototype.slice.call(arguments);\n\t\tvar hash = args.reduce(function(hash, nextArg){\n\t\t\treturn hash+nextArg;\n\t\t}, '');\n\t\tif(results[hash] === undefined){\n\t\t\tvar result = func.apply(this, args);\n\t\t\tresults[hash] = result;\n\t\t}\n\t\tconsole.log(results);\n\t\treturn results[hash];\n\t}\n}", "function memoize( fn ) {\n return function () {\n var args = Array.prototype.slice.call(arguments),\n hash = \"\",\n i = args.length;\n currentArg = null;\n while (i--) {\n currentArg = args[i];\n hash += (currentArg === Object(currentArg)) ?\n JSON.stringify(currentArg) : currentArg;\n fn.memoize || (fn.memoize = {});\n }\n return (hash in fn.memoize) ? fn.memoize[hash] :\n fn.memoize[hash] = fn.apply(this, args);\n };\n}", "function memoizedAddTo80() {\n let cache = {};\n\n return function (n) {\n if (n in cache) {\n console.log('Cached value');\n return cache[n];\n } else {\n console.log('long time');\n cache[n] = 80 + n;\n return cache[n];\n }\n };\n}", "function memoizeDecorator(func, hash) {\n const cache = new Map(); // This is the cache storage\n return function() {\n const key = hash(arguments); // Build the key\n if (cache.has(key)) {\n // Check if there is already a cache value for this key\n return cache.get(key); // Return the value from cache\n }\n\n // If the value has not already been cached, just call the given function\n const value = func.apply(this, arguments); // func.apply() allows to properly handle this\n\n cache.set(key, value); // Store the value and make it immediately available for future calls\n return value;\n };\n}", "function mem(fn)\n{\n\tvar cache = {}\n\treturn function()\n\t{\n\t\tvar str = JSON.stringify(arguments)\n\t\tvar val = cache[str]\n\t\tif (val === undefined)\n\t\t{\n\t\t\tval = fn.apply(this, arguments)\n\t\t\tcache[str] = val\n\t\t}\n\t\treturn val\n\t}\n}", "function memoize(F) {\n var map = {};\n return function() {\n var args = JSON.stringify(arguments);\n\n if (!map[args]) {\n map[args] = F.apply(F, arguments);\n }\n return map[args];\n };\n}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function cached(fn){var cache=Object.create(null);return function cachedFn(str){var hit=cache[str];return hit||(cache[str]=fn(str));};}", "function memoize(func, valueEquals) {\n let lastArgs = null;\n let lastResult = null;\n return (args) => {\n if (lastArgs !== null && argsEquals(args, lastArgs, valueEquals)) {\n return lastResult;\n }\n lastArgs = args;\n lastResult = func(...args);\n return lastResult;\n }\n}", "function addFn(x, y) {\n return x + y;\n}", "function add(a,b){return a+b;}", "function add1Functional(number) {\n return number + 1;\n}", "function add(a, b) {\n return a + b; \n}", "function makeAdd(num1) {\n return function (num2) {\n return num1 + num2;\n }\n}", "function add(a,b){\n return a + b;\n}", "function add(n){\n var addAgain = function(x){\n return add(n+x);\n };\n addAgain.valueOf = function(){\n return n;\n };\n return addAgain;\n}", "function add(a,b){\n return a + b\n}", "function add() {\n\tvar arg1 = arguments[0];\n\tvar arg2 = arguments[1];\n\tif (arg1 && arg2) {\n\t\tif (typeof arg1 == 'number' && typeof arg2 == 'number') {\n\t\t\treturn arg1 + arg2;\n\t\t}\n\t} else if (typeof arg1 == 'number') {\n\t\treturn function (x) {\n\t\t\treturn add(x, arg1);\n\t\t};\n\t} else {\n\t\treturn undefined;\n\t}\n}", "function addFunction(a,b,c){\n return a + b + c;\n}", "function add(a,b){\n return a+b;\n}", "function add(a,b){\n return a+b;\n}", "function add(a, b){\n return a + b;\n}", "function add(a, b){\n return a + b;\n}", "function memorize(f) {\n\tif (!f.cache) f.cache = {};\n\treturn function() {\n\t\tvar cacheId = [].slice.call(arguments).join('');\n\t\treturn f.cache[cacheId] ?\n\t\t\t\tf.cache[cacheId] :\n\t\t\t\tf.cache[cacheId] = f.apply(window, arguments);\n\t};\n}", "function add(a, b){\n return a + b;\n}", "function memoize(func) {\n // For any given function the results object will contain either promises or the results keyed with the argument value.\n // Only single-argument function memoization is supported in this demo. For multiple argument function memoization see the challenge3.\n var results = {};\n\n return function(arg) {\n if (!results.hasOwnProperty(arg)) {\n var retVal = func(arg);\n \n // this is the same check that uses $.when\n if ($.isFunction(retVal.promise)) {\n results[arg] = retVal.promise();\n } else {\n results[arg] = retVal;\n }\n }\n return results[arg]; \n };\n}", "function simpleCalc(arg1, arg2) {\n\treturn arg1 += arg2;\n}", "function add(a, b){\n return a+b;\n}", "function add(n) {\r\n var fn = function(x) {\r\n return add(n + x);\r\n };\r\n\r\n fn.valueOf = function() {\r\n return n;\r\n };\r\n\r\n return fn;\r\n}", "function addFunc(first, second){\r\n return first + second;\r\n}", "function addOne(number){\n return number + 1;\n}", "function addAgain(parameter1, parameter2) {\n parameter1 + parameter2; \n}", "function MyNewFunction(number1, number2) {\r\n let result = number1 + number2;\r\n return result;\r\n }", "function identity(fn){return fn;}", "function add(a,b) {\n return a + b;\n}", "function add(a,b){\r\n return a + b;\r\n}", "function add(){\n let sumFunc = sumOfThirty(30, 2, 20)\n let divFunc = divideProductFunc(sumFunc, 10, 2)\n return divFunc \n }", "function add(number){\n return function(a){\n return a + number;\n }\n}", "function memoize(func, valueEquals) {\n\t var lastArgs = null;\n\t var lastResult = null;\n\t return function (args) {\n\t if (lastArgs !== null && argsEquals(args, lastArgs, valueEquals)) {\n\t return lastResult;\n\t }\n\t lastArgs = args;\n\t lastResult = func.apply(undefined, _toConsumableArray(args));\n\t return lastResult;\n\t };\n\t}", "function add(a, b) {\n return a + b\n}", "function add(a, b) {\n return a + b\n}", "function add(a, b) {\n return a + b\n}", "function addition_Function(a, b) { //Function returns a added to b\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}", "function add(a, b) {\n return a + b;\n}" ]
[ "0.6663477", "0.6653556", "0.66089326", "0.6598487", "0.6592491", "0.65876186", "0.6572419", "0.65713215", "0.65421563", "0.651429", "0.6508785", "0.64846545", "0.64741707", "0.6466675", "0.64562154", "0.64161205", "0.64159185", "0.6398185", "0.6330992", "0.6330615", "0.6306705", "0.62820023", "0.62567496", "0.6246982", "0.62406605", "0.6240625", "0.62028205", "0.6195749", "0.6175617", "0.6164446", "0.6164446", "0.6164446", "0.6164446", "0.6164446", "0.6164446", "0.6164446", "0.6164446", "0.6164446", "0.61429465", "0.61030847", "0.6092796", "0.60580695", "0.60404253", "0.6028891", "0.6013482", "0.6006609", "0.5955088", "0.5919649", "0.5871769", "0.5862271", "0.58434886", "0.5830743", "0.5785864", "0.5785864", "0.5785864", "0.57789016", "0.577856", "0.57518405", "0.5737689", "0.5729561", "0.5720676", "0.5711584", "0.57028526", "0.5697439", "0.56972814", "0.56971836", "0.56949484", "0.56949484", "0.56821656", "0.56821656", "0.56811136", "0.56719375", "0.56687915", "0.56655395", "0.56646985", "0.5660671", "0.56538874", "0.5636278", "0.56362355", "0.5634646", "0.5626692", "0.5626483", "0.56169724", "0.5601358", "0.56001437", "0.5591161", "0.5583364", "0.5583364", "0.5583364", "0.5582758", "0.55794054", "0.55794054", "0.55794054", "0.55794054", "0.55794054", "0.55794054", "0.55794054", "0.55794054", "0.55794054", "0.55794054" ]
0.68270266
0
a and b are javascript Date objects
function absDateDiffInDays(a, b) { // Discard the time and time-zone information. var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate()); var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate()); return Math.abs(Math.floor((utc2 - utc1) / _MS_PER_DAY)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sortDates(a, b){\n\treturn a.getTime() - b.getTime();\n}", "compareDate(a, b) {\n if (a.startDate < b.startDate) return -1\n if (a.startDate > b.startDate) return 1\n else return 0\n }", "function compareDates(a, b) {\n var aDate = a.date;\n var bDate = b.date;\n\n let comparison = 0;\n if (aDate > bDate) {\n comparison = 1;\n } \n else if (aDate < bDate) {\n comparison = -1;\n }\n \n return comparison;\n}", "function compareDates(a,b) {\n if(a.attributes.date.isBefore(b.attributes.date)) {return -1;}\n if(b.attributes.date.isBefore(a.attributes.date)) {return 1;}\n return 0;\n}", "function sortDate(a, b) {\n\t//getTime provides an equal value for h,min,s: the current time\n return new Date(a.date).getTime() - new Date(b.date).getTime();\n}", "function compareDate(a,b) {\n if (a.date < b.date)\n return -1;\n else if (a.date > b.date)\n return 1;\n else\n return 0;\n }", "compareTwoObjectsByDate(a,b) {\n let x = a.approach_date;\n let y = b.approach_date;\n if (x < y) {return -1;}\n if (x > y) {return 1;}\n return 0;\n }", "function compareDates(a, b)\n{\n var x=new Date(a.Date);\n var y=new Date(b.Date);\n \n console.log(\"hello we are hee\");\t\n\n console.log(x);\n console.log(y);\t\n\n if(x>y)\n {\n console.log(1);\n return 1;\n\n }\n else\n {\n console.log(-1);\t \n return -1;\n }\n}", "function compareDates(a, b) {\n\t\tif (b.transaction_date < a.transaction_date) {\n\t\t\treturn -1\n\t\t}\n\t\tif (b.transaction_date > a.transaction_date) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}", "function compareDates(a, b) {\n\t\tif (b.transaction_date < a.transaction_date) {\n\t\t\treturn -1\n\t\t}\n\t\tif (b.transaction_date > a.transaction_date) {\n\t\t\treturn 1\n\t\t}\n\t\treturn 0\n\t}", "function compare_date( a, b ) {\n if ( a.date < b.date){\n return -1;\n }\n if ( a.date > b.date ){\n return 1;\n }\n return 0;\n}", "function fb(b) { var c = Ie.exec(b._i); return null !== c ? void (b._d = new Date(+c[1])) : (eb(b), void (b._isValid === !1 && (delete b._isValid, a.createFromInputFallback(b)))) }", "function eb(b){var c=Af.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Af.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Ae[b]=Ae[b]||V(b),Ae[b](a)):a.localeData().invalidDate()}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Ae[b]=Ae[b]||V(b),Ae[b](a)):a.localeData().invalidDate()}", "function compare(a, b) {\n const dateA = a.date;\n const dateB = b.date;\n\n let comparison = 0;\n if (dateA > dateB) {\n comparison = 1;\n } else if (dateA < dateB) {\n comparison = -1;\n }\n return comparison * -1;\n }", "function compareDate(a, b) {\r\n if (a.date > b.date) return 1;\r\n if (b.date > a.date) return -1;\r\n return 0;\r\n}", "function byDate(a, b) {\n return a.date - b.date;\n}", "function sortByDateAscending(a, b) {\n // Dates will be cast to numbers automagically:\n return a.date - b.date;\n }", "function by_datetime( a, b ) {\n\n const a_date = moment( a.day.split(' - ')[1], 'MM/DD/YYYY');\n const b_date = moment( b.day.split(' - ')[1], 'MM/DD/YYYY');\n\n if ( b_date.isAfter( a_date ) ) {\n return -1;\n } else if ( b_date.isBefore( a_date ) ) {\n return 1;\n } else {\n return 0;\n }\n\n}", "function compare(a,b) {\n\t\t\t\tif (new Date(a.date) < new Date(b.date))\n\t\t\t\t\treturn 1;\n\t\t\t\tif (new Date(a.date) > new Date(b.date))\n\t\t\t\t \treturn -1;\n\t\t\t\treturn 0;\n\t\t\t}", "dateDiffInDays (a, b) {\n const [ua, ub] = [a, b].map(day => dayjs.utc(day))\n return Math.abs(ua.diff(ub, 'day'))\n }", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function eb(b){var c=Ce.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(db(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Dd[b]=Dd[b]||V(b),Dd[b](a)):a.localeData().invalidDate()}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Dd[b]=Dd[b]||V(b),Dd[b](a)):a.localeData().invalidDate()}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Dd[b]=Dd[b]||V(b),Dd[b](a)):a.localeData().invalidDate()}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Dd[b]=Dd[b]||V(b),Dd[b](a)):a.localeData().invalidDate()}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Dd[b]=Dd[b]||V(b),Dd[b](a)):a.localeData().invalidDate()}", "function W(a,b){return a.isValid()?(b=X(b,a.localeData()),Dd[b]=Dd[b]||V(b),Dd[b](a)):a.localeData().invalidDate()}", "function date_diff_in_days(a, b) {\r\n // Discard the time and time-zone information.\r\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\r\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\r\n\r\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\r\n}", "function compare(a, b) {\n var date2 = new Date(parseInt(a.created_time) * 1000),\n date1 = new Date(parseInt(b.created_time) * 1000);\n\n if (date1 < date2)\n return -1;\n if (date1 > date2)\n return 1;\n return 0;\n }", "function sortHelper(a, b){\n // Compare the 2 dates\n return a.start < b.start ? -1 : 1;\n}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Ie.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function sortByDate(a, b) {\n let comparison = 0;\n\n // -------------------------------------------------------------JavaScript - Conditional Statments Ex. 3||\n if (a.getDate >= b.date) {\n comparison = 1;\n } else if (a.date <= b.date) {\n comparison = -1;\n }\n return comparison;\n}", "shallowIntersectsDate(other) {\n return this.dateShallowIntersectsDate(this, other.isDate ? other : new dateInfo_DateInfo(other, this.opts));\n }", "shallowIntersectsDate(other) {\n return this.dateShallowIntersectsDate(this, other.isDate ? other : new dateInfo_DateInfo(other, this.opts));\n }", "function fb(b){var c=Gf.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Gf.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Gf.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function fb(b){var c=Gf.exec(b._i);return null!==c?void(b._d=new Date(+c[1])):(eb(b),void(b._isValid===!1&&(delete b._isValid,a.createFromInputFallback(b))))}", "function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Ee[b]=Ee[b]||W(b),Ee[b](a)):a.localeData().invalidDate()}", "function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Ee[b]=Ee[b]||W(b),Ee[b](a)):a.localeData().invalidDate()}", "function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Ee[b]=Ee[b]||W(b),Ee[b](a)):a.localeData().invalidDate()}", "function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Ee[b]=Ee[b]||W(b),Ee[b](a)):a.localeData().invalidDate()}", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "dateShallowIncludesDate(date1, date2) {\n // First date is simple date\n if (date1.isDate) {\n if (date2.isDate) {\n return date1.dateTime === date2.dateTime;\n }\n\n if (!date2.startTime || !date2.endTime) {\n return false;\n }\n\n return date1.dateTime === date2.startTime && date1.dateTime === date2.endTime;\n } // Second date is simple date and first is date range\n\n\n if (date2.isDate) {\n if (date1.start && date2.date < date1.start) {\n return false;\n }\n\n if (date1.end && date2.date > date1.end) {\n return false;\n }\n\n return true;\n } // Both dates are date ranges\n\n\n if (date1.start && (!date2.start || date2.start < date1.start)) {\n return false;\n }\n\n if (date1.end && (!date2.end || date2.end > date1.end)) {\n return false;\n }\n\n return true;\n }", "function dateDiffInDays(a, b) {\r\n // Discard the time and time-zone information.\r\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\r\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\r\n \r\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\r\n }", "sameDate(dateA, dateB) {\n return ((dateA.getDate() === dateB.getDate()) && (dateA.getMonth() === dateB.getMonth()) && (dateA.getFullYear() === dateB.getFullYear()));\n }", "function dateDiffInDays(a, b) {\n\t\t // Discard the time and time-zone information.\n\t\t var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n\t\t var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n\t\t return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n\t\t}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\n return c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function CompareBirthdays(a, b)\r\n {\r\n return a[\"nextBirthday\"] - b[\"nextBirthday\"];\r\n }", "function less(a,b) {\r\n return a.date < b.date;\r\n}", "function calc_days(a, b) {\r\n const utc1 = new Date(a);\r\n const utc2 = new Date(b);\r\n return Math.floor(utc2 - utc1) / (1000 * 60 * 60 * 24);\r\n}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function Ab(b,c){var d,e;\n// Use low-level api, because this fn is low-level api.\nreturn c._isUTC?(d=c.clone(),e=(r(b)||f(b)?b.valueOf():rb(b).valueOf())-d.valueOf(),d._d.setTime(d._d.valueOf()+e),a.updateOffset(d,!1),d):rb(b).local()}", "function dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "function dateDiffInDays(a, b) {\n const _MS_PER_DAY = 1000 * 60 * 60 * 24;\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n \n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(Bd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Ed[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[_d]<=12&&l(b).bigHour===!0&&b._a[_d]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[_d]=kb(b._locale,b._a[_d],b._meridiem),hb(b),cb(b)}", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(Bd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Ed[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[_d]<=12&&l(b).bigHour===!0&&b._a[_d]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[_d]=kb(b._locale,b._a[_d],b._meridiem),hb(b),cb(b)}", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(Bd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Ed[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[_d]<=12&&l(b).bigHour===!0&&b._a[_d]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[_d]=kb(b._locale,b._a[_d],b._meridiem),hb(b),cb(b)}", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(Bd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Ed[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[_d]<=12&&l(b).bigHour===!0&&b._a[_d]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[_d]=kb(b._locale,b._a[_d],b._meridiem),hb(b),cb(b)}", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(Bd)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Ed[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[_d]<=12&&l(b).bigHour===!0&&b._a[_d]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[_d]=kb(b._locale,b._a[_d],b._meridiem),hb(b),cb(b)}", "function dateDiffInDays(a, b) {\r\n // Discard the time and time-zone information.\r\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\r\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\r\n\r\n return Math.floor((utc2 + _MS_PER_HALFDAY - utc1) / _MS_PER_DAY);\r\n}", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(ye)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Be[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[Ye]<=12&&l(b).bigHour===!0&&b._a[Ye]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[Ye]=kb(b._locale,b._a[Ye],b._meridiem),hb(b),cb(b)}", "function jb(b){\n// TODO: Move this to another part of the creation flow to prevent circular deps\nif(b._f===a.ISO_8601)return void db(b);b._a=[],l(b).empty=!0;\n// This array is used to make a Date, either with `new Date` or `Date.UTC`\nvar c,d,e,f,g,h=\"\"+b._i,i=h.length,j=0;for(e=X(b._f,b._locale).match(ye)||[],c=0;c<e.length;c++)f=e[c],d=(h.match(Z(f,b))||[])[0],d&&(g=h.substr(0,h.indexOf(d)),g.length>0&&l(b).unusedInput.push(g),h=h.slice(h.indexOf(d)+d.length),j+=d.length),Be[f]?(d?l(b).empty=!1:l(b).unusedTokens.push(f),ca(f,d,b)):b._strict&&!d&&l(b).unusedTokens.push(f);\n// add remaining unparsed input length to the string\nl(b).charsLeftOver=i-j,h.length>0&&l(b).unusedInput.push(h),\n// clear _12h flag if hour is <= 12\nb._a[Ye]<=12&&l(b).bigHour===!0&&b._a[Ye]>0&&(l(b).bigHour=void 0),l(b).parsedDateParts=b._a.slice(0),l(b).meridiem=b._meridiem,\n// handle meridiem\nb._a[Ye]=kb(b._locale,b._a[Ye],b._meridiem),hb(b),cb(b)}", "function dateDiffInDays(a, b) {\r\n // Discard the time and time-zone information.\r\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\r\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\r\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\r\n }", "function sortByDate(a, b){\nvar aDate = a.date;\nvar bDate = b.date; \nreturn ((aDate > bDate) ? -1 : ((aDate < bDate) ? 1 : 0));\n}", "function dateDiffInDays(a, b) {\n\tvar utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n\tvar utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n\treturn Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 + _MS_PER_HALFDAY - utc1) / _MS_PER_DAY);\n}", "function dateDiffInDays(a, b) {\n var _MS_PER_DAY = 1000 * 60 * 60 * 24;\n // Discard the time and time-zone information.\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "function dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function compare(a,b) {\n if (a.dateOfEvent > b.dateOfEvent)\n return -1;\n if (a.dateOfEvent < b.dateOfEvent)\n return 1;\n return 0;\n }", "function dateDiffInDays(a, b) {\n const _MS_PER_DAY = 1000 * 60 * 60 * 24;\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function dateDiffInDays(a, b) {\n\n var _MS_PER_DAY = 1000 * 60 * 60 * 24;\n\n // Discard the time and time-zone information.\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "static isSameDate(dateA, dateB) {\n return (\n dateA.getFullYear() === dateB.getFullYear()\n && dateA.getMonth() === dateB.getMonth()\n && dateA.getDate() === dateB.getDate()\n );\n }", "dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n const utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n const utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "function getDiffInDays(a, b) {\n var _MS_PER_DAY = 1000 * 60 * 60 * 24;\n // Discard the time and time-zone information.\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n }", "function byReverseAddDate(a, b) {\n var date1 = a.ud;\n var date2 = b.ud;\n\n\tif (!date1) { date1 = a.ad; }\n\tif (!date2) { date2 = b.ad; }\n\tif (!date1) { date1 = 0; }\n\tif (!date2) { date2 = 0; }\n if (date1 > date2) { return -1; } \n if (date1 < date2) { return +1; }\n if (a.id < b.id) { return -1; }\n if (a.id > b.id) { return +1; }\n\n return 0;\n}", "function dateDiffInDays(a, b) {\n // Discard the time and time-zone information.\n var utc1 = Date.UTC(a.getFullYear(), a.getMonth(), a.getDate());\n var utc2 = Date.UTC(b.getFullYear(), b.getMonth(), b.getDate());\n\n return Math.floor((utc2 - utc1) / _MS_PER_DAY);\n}", "function t(a){return b.isMoment(a)&&(a=a.day()),P[a]}", "function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Hd[b]=Hd[b]||W(b),Hd[b](a)):a.localeData().invalidDate()}", "function X(a,b){return a.isValid()?(b=Y(b,a.localeData()),Hd[b]=Hd[b]||W(b),Hd[b](a)):a.localeData().invalidDate()}" ]
[ "0.6679217", "0.6675048", "0.6673722", "0.64996946", "0.6491238", "0.64875215", "0.64517695", "0.6440893", "0.63916445", "0.63916445", "0.6371553", "0.636811", "0.6336262", "0.6336262", "0.63048345", "0.63048345", "0.62954015", "0.62926555", "0.62893444", "0.62878215", "0.627439", "0.6232122", "0.6222909", "0.6221478", "0.6221478", "0.6221478", "0.6221478", "0.6221478", "0.6221478", "0.621333", "0.621333", "0.621333", "0.621333", "0.621333", "0.621333", "0.6188654", "0.6173901", "0.6167754", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.614637", "0.6144581", "0.6141928", "0.6141928", "0.6129391", "0.6129391", "0.6129391", "0.6129391", "0.6105448", "0.6105448", "0.6105448", "0.6105448", "0.61022174", "0.61022174", "0.6049627", "0.604928", "0.6044517", "0.60274506", "0.6024625", "0.60117453", "0.60029036", "0.5995178", "0.5995178", "0.5978583", "0.597479", "0.5953322", "0.5953322", "0.5953322", "0.5953322", "0.5953322", "0.5944609", "0.59362245", "0.59362245", "0.59357977", "0.59293693", "0.59121454", "0.5903409", "0.5902482", "0.5896135", "0.5896135", "0.588682", "0.5883558", "0.5882788", "0.5874555", "0.58743876", "0.5872186", "0.58671784", "0.58628225", "0.585808", "0.58573556", "0.5852048", "0.5852048" ]
0.0
-1
console.log(sumRec([1, 2, 3, 4, 5]))
function exp1(base, n) { return n === 0 ? 1 : (base * exp1(base, n - 1)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumRec(arr) {\n if (arr.length === 0) {\n return 0;\n }\n let num = arr.pop();\n return (num + sumRec(arr));\n}", "function sumRec(arr) {\n if (arr.length === 0) {\n return 0;\n } else {\n return arr[0] + sumRec(arr.slice(1));\n }\n}", "function sumRec(arr) {\n if (!arr[0]) {\n return false;\n }\n else if (arr.length === 1) {\n return arr[0];\n } else {\n arr[0] += arr.pop();\n return sumRec(arr);\n } \n}", "sum(arr) {\n let add = (a, b) => a + b;\n return arr.reduce(add);\n }", "_sum (arr) {\r\n return arr.reduce((acc,val) => acc+val)\r\n }", "function sum(arr) {\n return arr.reduce(function(a, b) {\n return a + b;\n });\n }", "function sum(arr){\n\nresult = arr.reduce((total, elem)=>{\n return total += elem;\n })\n return result}", "function sum(arr){\n return arr.reduce(function(d, i){ return i + d; });\n }", "function getSums (arr){\n var result = []\n if(!arr.length) return result\n\n var totalSum = arr.reduce(function (previous, current){\n result.push(previous)\n return previous + current\n })\n result.push(totalSum) //without this line the last element of the work reduce will not be displayed\n return result\n}", "function sum(arr) {\n return arr.reduce(function(x, y) {\n return x + y;\n });\n}", "function sum(arr, fn) {\n return _.reduce(arr, function(memo, item){\n return memo + fn(item);\n }, 0);\n }", "sum(arr) {\n return arr.reduce( (sum, val) => sum + val, 0);\n }", "function sumArr(array){\n\n}", "function sum(arr){\n let ourSum=0;\nfor(i=0;i<arr.length;i++){\n ourSum=ourSum+arr[i]\n}\nreturn ourSum;\n}", "function arraySum(arr){\n\n // code goes here\n\n}", "function arraySum(arr){\n var sum = 0;\n for(var i = 0; i < arr.length; i++){\n sum = sum + arr[i];\n }\n console.log(sum); // or: return sum;\n}", "function sum(arr) {\n return null; \n}", "function sumOfArray(arr) {\n //if arr.length is 1 then return the first indexed value from arr\n if(arr.length == 1) {\n return arr[0];\n } else {\n //otherwise, return pull the first value and add it to the result of running the function again\n //this is a bit weird because the function will continue to run its result plus it's result\n //so 1 + 2 + 3 + 4 + 5 ... at this point the array will have length equal to 1, the function doesn't\n //return a recursive call, but rather the last value... so it stops and returns 1+2+3+4+5+6 = 21\n return arr.shift() + sumOfArray(arr);\n }\n}", "function sum(arr) {\n return arr.reduce(function(a, b) {\n return a + b;\n }, 0);\n }", "function sum(nums) {\n return nums.reduce(function(sum, curr) { return sum += curr });\n}", "function sum(numbers) {\r\n //your code is here \r\n return reduce(numbers, function (result, num) {\r\n return result + num\r\n })\r\n}", "function sum(numbers) {\n\t//your code is here \n\treturn numbers.reduce((acc,item) => acc+item);\n\n}", "function total(arr)\n{\n\t//your code here \n\tconst result = arr.reduce(function(num, addedValue){\n\t\taddedValue = addedValue + num; // 0 + 1 = 1, 1 + 2 = 3, 3 + 3 = 6\n\t\treturn addedValue;\n\t});\n\treturn result;\n}", "function sum (){\r\n let res = array[0] + array[1] + array[2] + array[3]+ array[4];\r\n return res;\r\n}", "function sum(arr){\n if(arr.length==0)\n return 0\n else \n return arr[arr.length-1]+sum(arr.slice(0,arr.length-1))\n}", "function sum(accumulator,value,index,arr){\n return accumulator + value; \n}", "function sum(arr) {\n var total = 0;\n for (var i=0;i<arr.length;i++) {\n total += arr[i];\n //console.log(\"This is total: \" + total);\n }\n return total;\n}", "function sum_array(total, sum){\n \t\t\treturn total + sum;\n }", "function sum(arr) {\n \tconst len = arr.length;\n \tlet result = 0;\n \tfor (let i = 0; i < len; i++) {\n \t\tresult += arr[i];\n \t}\n \treturn result;\n }", "function sumArray(arr){\n var total = 0;\n arr.forEach(function(num){\n total = total + num\n });\n return total;\n console.log(total);\n}", "function sum(arrayS){\nconst sumArray=(accumulator,currentValue)=>accumulator+currentValue;\nlet sum=arrayS.reduce(sumArray);\nconsole.log(\"sum of Array item is \"+sum)\n}", "function sum(numbers) {\n\t//your code is here \n\treturn reduce(numbers,(acc,item) => acc+item);\n\n}", "function sum(){\r\n var sumArray = array.reduce((total,num)=>{return total + num;});\r\n console.log(sumArray);\r\n}", "function sum(arr){\n var s=0;\n for(var i=0;i<arr.length;i++){\n s += arr[i];\n }\n return s;\n}", "function sum(arr){\r\n var total = 0;\r\n for (let i = 0; i < arr.length; i++) {\r\n total= total + arr[i];\r\n }\r\n return total;\r\n}", "sum() {}", "function findSum(arr){\nvar sum = 0\n\nfor ( var i=0; i< arr.length; i++){\n sum = sum + arr[i]\n }\nreturn sum \n}", "function sum(arr, acc = 0) {\r\n if (_.isEmpty(arr)) {\r\n return acc;\r\n }\r\n // _.tail(arr); //?\r\n // acc + _.first(arr); //?\r\n return sum(_.tail(arr), acc + _.first(arr));\r\n }", "function sum(arg) {\n return arg.reduce(function (lastValue, curr) { return lastValue + curr; });\n}", "function sum(arr) {\n\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n\n return sum;\n}", "function total(arr) {\n const result = arr.reduce(function(num, finalSum){\n return finalSum = finalSum + num;\n });\n return result;\n \n}", "function sum(arr){\n let sum=0;\n for(let i=0; i<arr.length; i++){\n sum +=arr[i];\n }\n return sum;\n }", "function sumAll(arr) {\n return 1;\n}", "function printSumOfArray(arr){\r\n\tvar sum = 0;\r\n\tfor(let i=0; i<arr.length; i++){\r\n\t\tsum += arr[i];\r\n\t}\r\n\treturn sum;\r\n}", "function reduceMe(tempArr){\r\n //Here we will make it sum all integers in the array\r\n return tempArr.reduce(function(total,currentValue,currentIndex,arr){\r\n return total + currentValue;\r\n //currentIndex,initialValue and arr will be 0 \r\n\r\n },initialValue)\r\n\r\n }", "function sumArr(arr){\n var sum=0;\n for(var i=0; i<arr.length;i++){\n sum+=arr[i];\n }\n return sum;\n}", "function sum(array){\n\tlet somme = 0;\n\tarray.forEach( (element) => { somme+=element;})\n\treturn somme;\n}", "function sumWithReduceMethod (arr){\n var result = arr.reduce((sumSoFar, number) => (sumSoFar + number));\n return result;\n}", "function sum(arr){\n\tif(!(arr instanceof Array)){\n\t\treturn \"SAY ARRAY ONE MORE TIME\";\n\t}\n\tvar sum = 0;\n\tvar addStuffToSum = function(value){\n\t\tif(typeof value !== \"number\") {\n\t\t\treturn; //EARLY EXECUTION, GUILLOTINE STYLE\n\t\t}\n\n\t\tsum = sum + value;\n\t\t// sum += value\n\t};\n\tarr.forEach(addStuffToSum);\n\n\treturn sum;\n}", "function arrSumR(arr) {\n if (!(arr.length)) return 0;\n const copyArr = [...arr];\n return copyArr.pop() + arrSumR(copyArr);\n }", "function sum(x) {\n sum = 0;\n for (var i = 0; i < x.length; i++) {\n sum = sum + x[i];\n console.log(sum);\n }\n return sum;\n}", "function sumArray(arr) {\n if (arr.length === 0) {\n return 0;\n }\n let [first, ...rest] = arr;\n return first + sumArray(rest);\n}", "function getSum(array){\n return array.reduce(function(a,b) {return a+b;}); //Not supported by all browsers\n}", "function sum(arr){\n let sum = 0\n\n for(let i = 0;i<arr.length;i++){\n sum += arr[i]\n }\n return sum\n}", "function getSum(numArr){\n var total = 0;\n for (var index = 0; index < numArr.length; index++){\n total += numArr[index];\n }\n\n return total;\n}", "function iterray(arr){\n var summ = 0;\n for(var i = 0; i < arr.length; i++){\n summ+=arr[i];\n }\n return summ;\n}", "function sum2(numArr) {\n return numArr.reduce(function(total, num) {\n return total + num;\n });\n}", "function sum(arr) {\n if (arr.length === 0) {\n return 0;\n }\n\n return arr[0] + sum(arr.slice(1));\n}", "function sumAll(arr) {\r\n return arr.reduce((a, b) => {\r\n return a + b;\r\n });\r\n}", "function sumFunc(arr) {\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n sum += arr[i];\n }\n\n return sum;\n}", "function funcSumArray(numTotal, numElement) {\n return numTotal + numElement;\n}", "function sum(arr) {\n let total = 0;\n for(let i = 0; i < arr.length; i++) {\n total += arr[i];\n }\n return total;\n}", "function simpleArraySum(ar) {\n //reduce function will add all the numbers in the array together. Takes in a function.\n return ar.reduce((total, num) => {\n return total + num\n })\n}", "function sum(arr) {\n let total = 0;\n for (let i = 0; i < arr.length; i++) {\n total += arr[i];\n }\n return total;\n}", "function sumArr(nums) {\n // algorithm here\n}", "function sumArray(arr){\r\n\tvar sum=0;\r\n\tfor(i=0;i<arr.length;i++){\r\n\t\tsum+=arr[i]\r\n\t}\r\n\treturn sum\r\n}", "function sum(arr){\n var suma=0;\n for(var i=0;i<arr.length;++i) {\n suma = suma + arr[i];\n } \n return suma;\n}", "function sumarr(arr)\r\n{\r\nvar sum=0;\r\nfor(var i=0;i<arr.length;i++)\t\r\n{\r\n\tsum =sum+arr[i];\r\n}\r\nconsole.log(\"Sum of values in array\",sum);\r\n}", "function sumArray(arr) {\n let sum = 0;\n arr.forEach((e) => {\n sum += e;\n });\n return sum;\n}", "function sumItUp(arr){\n var total=0;\n for(var i=0; i < arr.length; i++ )\n {\n console.log[i]; \n var subtotal=numArray[0]+[1];\n var numArray=numArray.shift;\n return subtotal; \n }\n}", "function sumItUp(arr){\n var total=0;\n for(var i=0; i < arr.length; i++ )\n {\n console.log[i]; \n var subtotal=numArray[0]+[1];\n var numArray=numArray.shift;\n return subtotal; \n }\n}", "function f(arr) {\n // ==>\n // arr = [2,4]\n // arr[0] = 2\n // arr[1] = 4\n let sum = arr[0] + arr[1];\n // sum = 6\n return sum;\n}", "function sumArray(arr){\n\tvar sum = 0;\n\tarr.forEach(function(data){\n\t\tsum=sum+data;\n\t});\n\treturn sum;\n}", "function sum(arr) {\n let total = 0\n for (let i = 0; i < arr.length; i++) {\n total += arr[i]\n }\n return total\n}", "function sum(numbers) {\n\n console.log(typeof(numbers));\n if (typeof(numbers) != \"object\") {\n return numbers;\n }\n\n let sum = 0;\n for (var k = 0; k < numbers.length; k++) {\n sum += numbers[k];\n }\n return sum;\n}", "function sumArray(arr){\n var tot = 0;\n arr.forEach(num => {\n tot += num;\n });\n return tot;\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 sumRecursive(){\n var num1 = numberCreationRecursive(list1);\n var num2 = numberCreationRecursive(list2);\n\n console.log(num1+num2);\n}", "function print_sum(numbers) {\n console.log(sum(numbers))\n}", "function sumOfArray(arr) {\n var sumOfArr = 0;\n for (var i = 0; i < arr.length; i++) {\n sumOfArr += arr[i];\n }\n return sumOfArr;\n}", "function sum() {\n \n}", "function sumArray(arr) {\n var total = 0;\n arr.forEach(function (element) {\n total += element;\n });\n return total;\n}", "function sum(numbers) {\r\nvar total = 0;\r\nfor (var i = 0; i < numbers.length; i++) {\r\n total += numbers[i];\r\n}\r\nreturn total;\r\n}", "function curriedSum(numArgs) {\n let numbers = [];\n let total = 0;\n\n const _curriedSum = function(num) {\n numbers.push(num);\n if (numbers.length === numArgs) {\n numbers.forEach((n) => {total += n;});\n console.log(total);\n } else {\n return _curriedSum;\n }\n };\n\n return _curriedSum;\n}", "function sumArray(arr) {\n return arr.reduce((total,num) => total + num);\n}", "function sum() {\n var numArr = [...arguments ];\n var sumOfNum = numArr.reduce((acc, curr) => acc + curr, 0);\n return sumOfNum;\n}", "function getSums(arr) {\r\n var newArray = [];\r\n arr.reduce(function(previousValue, currentValue, index, array) {\r\n newArray.push(previousValue + currentValue);\r\n return previousValue + currentValue;\r\n });\r\n return newArray;\r\n}", "function sumArray(numbers) {\n// numbers.reduce((accumulator, currentValue) => accumulator + currentValue)\n// }\nlet sum = 0;\nif (numbers.length==0){\n return 0\n}\nfor (let i = 0; i < numbers.length; i++){\n sum += numbers[i];\n\n}\nreturn sum;\n\n}", "function plusOneSum(arr)\n{\n var result = 0;\n arr.forEach(function (e)\n {\n result += (e + 1);\n });\n return result;\n}", "function sumArray(n, i=0){\n if (typeof(n)==\"number\"){\n return +n\n }else if(typeof(n)==\"object\" && n.length>i){\n return sumArray (n[i])+ sumArray (n, i+1)\n }else{\n return 0;\n}\n}", "function listSum(num) {\n let total = 0;\n for (i = 0; i < num.length; i++) {\n total += num[i]\n }\n return total\n}", "function sumArray(arr) {\r\n var sum = 0;\r\n for (var i = 0; i < arr.length; i++) {\r\n sum = sum + arr[i];\r\n }\r\n return sum;\r\n}", "function sum(numbers){\n\ttotal = 0\n\tfor (var i = 0; i < numbers.length ;i++){\n\t\t total = (numbers[i] += total);\n\t};\n\tconsole.log(total);\n}", "function sumArray(arr){\n var total = 0;\n arr.forEach(function(element){\n total += elemtnl;\n });\n return total;\n}", "function sum(a){\n var sum = 0;\n for (var i = 0;i < a.length; i++){\n sum += a[i];\n }\n return sum;\n}", "function sumArray(arr) {\n var result = 0;\n arr.forEach(function(numb) {\n result += numb;\n \n });\n return result;\n }", "function sumArray(arr){\n var sum = 0;\n for(var z=0;z<arr.length;z++){\n sum+=arr[z];\n }\n return sum;\n}", "function sum(acc, val) {\n return acc + val;\n}", "function sumArr(x) {\n var sum = 0;\n for (let i = 0; i < x.length; i++) {\n sum= sum + x[i];\n \n }\n return sum;\n }", "function sum(arr) {\n var args = Array.prototype.slice.call(arguments)\n return args.reduce(function(a, v) {\n return a + v\n }, 0)\n}", "function addValues(arr) {\n const sum = arr.reduce(function (acc, item, index) {\n return (acc += item);\n });\n return sum;\n}" ]
[ "0.78357565", "0.7548966", "0.7379709", "0.7125858", "0.7030771", "0.6997942", "0.69947743", "0.6906726", "0.68929064", "0.6864391", "0.6862752", "0.6844838", "0.6842339", "0.6802809", "0.67849255", "0.67817044", "0.6756732", "0.6752692", "0.67502666", "0.6745069", "0.67115426", "0.6690857", "0.66826916", "0.66810834", "0.6668105", "0.6664521", "0.665633", "0.6652336", "0.66515064", "0.66428834", "0.66412157", "0.6633773", "0.66317683", "0.6630892", "0.6626355", "0.66196", "0.66051507", "0.66028196", "0.6601524", "0.6598324", "0.6596863", "0.65919256", "0.65918314", "0.65807277", "0.6577585", "0.6565811", "0.65615135", "0.6554081", "0.65532655", "0.65434223", "0.654186", "0.6540682", "0.6539127", "0.6535189", "0.6534658", "0.6532594", "0.65227354", "0.65224236", "0.6516646", "0.651659", "0.6497145", "0.64970005", "0.6489034", "0.64850646", "0.64806956", "0.64762557", "0.6473746", "0.6467477", "0.6458248", "0.64523697", "0.64523697", "0.6451675", "0.6450725", "0.6446087", "0.64458096", "0.6442413", "0.6435082", "0.64347875", "0.6434033", "0.64318794", "0.6429176", "0.6426837", "0.6425315", "0.6420423", "0.64191633", "0.64165443", "0.6415266", "0.6412103", "0.6410692", "0.64094275", "0.6408898", "0.640808", "0.6407524", "0.6405009", "0.64045364", "0.640396", "0.6402744", "0.6402479", "0.6402081", "0.63991827", "0.63990337" ]
0.0
-1
console.log(exp1(3, 2)); console.log(exp1(3, 3)); console.log(exp1(2, 3));
function exp2(base, n) { if (n === 0) { return 1 }; if ( n % 2 === 0 ) { let r = exp2(base, n / 2); return r * r; } else { let r = (exp2(base, (n - 1) / 2)); return base * (r * r); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exp(args){\n return Math.exp(args);\n}", "function power(base1,exp1) {\n if (exp1 === 0){\n return 1\n }\n return base1 * power(base1, exp1-1)\n}", "function executeExponential(x, y) {\r\n if (x != NaN && y != NaN) {\r\n let result = \"\";\r\n let rollingResult = 1;\r\n for (let i = 0; i < y; i++) {\r\n rollingResult *= x;\r\n result += rollingResult + \" \";\r\n }\r\n console.log(result);\r\n } else {\r\n console.log(\"Invalid input\");\r\n }\r\n}", "function exp1(base, n) {\n return n === 0 ? 1 : (base * exp1(base, n - 1));\n}", "function calculateExponent(num, exp) {\n\tconsole.log(Math.pow(num, exp));\n}", "function power(n, exp) {\n if (exp === 0) return 1;\n if (exp === 1) return n;\n return n * power(n, exp - 1);\n}", "function power (base, exp){\n if(exp === 0) return 1;\n return base * power(base, exp-1);\n}", "function createExpFunc(num) {\n\n}", "function exp(value) {\n return (Array.isArray(value)) ? value[0](exp(value[1]), exp(value[2])) : value;\n}", "function power(base, exp) {\n if(exp <=0 ) return 1\n\n return base*power(base, exp-1)\n\n}", "function expF(x, a, b, c) {\n\tc = c ? c : 0;\n\treturn a*b**x + c*x;\n}", "function expm1(x){ // 1401\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; // 1402\n} // 1403", "function power_1(a){return a * a;}", "function exp(value) { // takes first array and takes next 2 as arguments\n return (Array.isArray(value)) ? value[0](value[1], value[2]) : value;\n}", "function funcOne(hgjfjhghjgnf) {\n console.log(hgjfjhghjgnf * 2);\n}", "function exp(n, e) {\n n = n ? n : 0;\n e = e ? e : 1;\n\n return Math.pow(n, e);\n}", "function power(base, exp) {\n if (exp === 0) return 1;\n return base * power(base, exp-1);\n}", "function exponent(number1,number2){\n let result = 1;\n for(i = 0; i < number2; i++){\n result *= number1\n }\n console.log(result);\n}", "function gamma(z)\n{\n return Math.exp(logamma(z));\n}", "function ex1(){\n return 12+20\n }", "function calc(exp) { return \"calc(\" + exp + \")\"; }", "function createExpFunc(num) {\n return function(num2){\n return Math.pow(num2, num);\n }\n}", "function exp(value) {\n return (Array.isArray(value))\n ? value[0](\n exp(value[1]),\n exp(value[2])\n )\n : value;\n}", "function power(base, exp) {\n if( exp < 0) {\n base = 1 / base;\n exp = exp * -1;\n }\n if( exp == 0 ) {\n return 1;\n }\n return base * power(base, exp - 1);\n\n}", "function generateExp(){\n for (var i=0;i<iterations;i++){\n if (a2*a2+b2*b2>=4){\n return i; \n }\n var e=Math.E;\n var tmA=a2;\n a2=e^tmA*Math.cos(b2)-0.65;\n b2=e^tmA*Math.sin(b2);\n }\n return -1;\n}", "function exponent(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp === 1) {\n return base;\n } else if (exp % 2 === 0) {\n return (exponent(base, exp / 2)) ** 2;\n } else {\n // odd exponent\n return base * ((exponent(base, (exp - 1) / 2)) ** 2);\n }\n}", "function multiply(num1, num2) {\r\n console.log(num1 * num2);\r\n}", "function exponent(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp < 0) {\n return 1.0/exponent(base, -exp);\n } else {\n return base * exponent(base, exp - 1);\n }\n}", "function exponent(startNumber, exponentNumber)\n{\n const result = startNumber ** exponentNumber;\n\n // console.log(result);\n return result;\n}", "function power(base, exp){\n var result = 1;\n for(var i=1; i<=exp; i++){\n result = result*base; \n }\n return result;\n }", "function pow(exp) {\n return function(base) {\n return Math.pow (base, exp);\n };\n }", "function geo_expval(prob) {\n return 1/prob;\n}", "get exp() {\n return this._exp();\n }", "function generate_exp( lambda ){\n \n var ex, u = 0;\n \n u = Math.random();\n \n ex = -( 1 / lambda ) * Math.log(1 - u);\n \n return ex;\n}", "function myMathFunction() {\n console.log(2+2);\n console.log(3-2);\n console.log(12/4);\n console.log(2*5);\n}", "function transmogrifier(num1,num2,num3){\n\n var totalfirstsecond = num1 * num2;\n\n var power = Math.pow(totalfirstsecond, num3);\n\n console.log (power);\n\n return power;\n\n}", "function powerCalculator(num, exp) {\n if(exp >= 0) {\n let answer = 1\n for(let i = 1; i <= exp; i++) {\n answer = answer * num\n }\n return answer;\n }\n else {\n return 'exponent should be >= 0'\n }\n }", "function recursiveExponent(base, exp) {\n return recursion(exp, 1);\n\n function recursion(n, res) {\n if (n === 0) return res;\n return recursion(n - 1, res * base);\n }\n}", "function multiply(n1,n2) {\n var result = n1*n2;\n // console.log(result);\n return result;\n}", "function power3(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp === 1) {\n return base;\n }\n\n var result = 1;\n while (exp > 0) {\n result = result * base;\n exp -= 1;\n }\n\n return result;\n}", "function powerCalculator (base, exp) {\n let result = 1;\n for(let i=0; i<exp; i++){\n if(exp < 0) {\n return 'exponent should be >= 0';\n }\n else if(exp === 0){\n return 1;\n } else{\n result *= base;\n }\n }\n return result;\n}", "function multiply(parameter1, parameter2) {\n console.log(parameter1 * parameter2);\n}", "function exponent(base, expo) {\n var result = 1;\n for(var i = 0; i < expo; ++i) {\n result *= base;\n }\n console.log(result);\n return result;\n}", "function mult(num1, num2) {\n\tconsole.log(\"3) \" + num1 * num2);\n}", "function complicated () {\n console.log(multiply(return4(), 8));\n}", "function add1() {\r\n console.log(\"U R in Add1 Function \" + (2 + 2));\r\n}", "function calculateExponent(num, exp) {\n return Math.pow(num, exp);\n}", "function cal(){\n console.log(2+3)\n}", "function powerCalculator(base, exp) {\n if(exp < 0) {\n return 'Exponent must be greater than or equal to 0'\n }\n\n if(exp === 0) {\n return 1;\n }\n\n let result = 1;\n\n for(let i = 0; i < exp; i++) {\n result = result * base;\n }\n\n return result;\n}", "function expValue(x,y){\n let result = [];\n let start = 1;\n\n \n\n if(typeof x === 'number' && typeof y === 'number'){\n console.log('true');\n }else{\n console.log('false');\n }\n\n for (let i = 1; i <= y; i++){\n start *= x;\n result += start + ' ';\n }\n console.log(result);\n \n \n}", "function powerCalculator(base, exp) {\n if (exp === 0) {\n return 1;\n }\n if (exp < 0) {\n return 'exponent has to be >= 0';\n }\n let product = 1;\n for (let i = 0; i < exp; i++) {\n product *= base;\n }\n return product;\n}", "function multiply() {\n return num1 * num2;\n}", "function multiply() {\n return num1 * num2;\n}", "function factorial (x) {\n //code\n}", "function f(x){\n // return Math.pow(x,2);//\n return x*2;\n}", "function powerCalculator(base, exp) {\n if (exp === 1) {\n return base;\n } else if (exp <= 0) {\n return 0;\n }\n\n // 10 * 10 * 1\n return base * powerCalculator(base, exp - 1);\n}", "function Logarithm() {\r\n}", "function BASE_raised_EXP(base, exp) //this function not used at all; kept here for possible future use...\n{\n // for (var j = 1; j <= exp; j++)\n origexp = exp;\n if(exp < 0)\n {\n exp = exp * -1;\n }\n var z = 1;\n for (var k = 1; k <= exp ; k++)\n {\n //alert(\"begin\" + z);\n z = z * base;\n //alert(\"end\" + z);\n }\n //\n if(origexp >=0)\n {\n alert(\"answer = \" + z);\n }\n else\n {\n alert(\"answer = \" + (1/z));\n }\n}", "function pow(x,n) {\n let x = inum;\n let n = itimes\n alert (x**n);\n}", "function multiplicar(a, b) {//parametros dentro de la declaracion de la funcion\n console.log(a * b)\n}", "function exp(b, n) {\n let base = b;\n for(let i = 1; i < n; i++) {\n base *= b;\n }\n return b;\n}", "function calculateExponent(num, exp) {\n\treturn Math.pow(num, exp)\n}", "function calculator(num1, num2) {\n console.log(num1 + num2);\n return num1 + num2; \n}", "function power (base, exponent){\n if (exponent === 0){ \n return 1;\n } \n return base * power(base, exponent-1); \n}", "function multiply(n1,n2){\r\n return n1*n2;\r\n}", "function multiplier2(factor){\n return x => x * factor; \n}", "function factorial(num){\n \n}", "function factorial(num){\n \n}", "function calculateExponent(num, exp) {\n return Math.pow(num, exp);\n }", "function product(num1, num2){\n multiply = num1 * num2;\n console.log(multiply);\n return multiply\n}", "function B(x) {\n console.log(\"B\");\n\n return x ** 2;\n}", "function multiply(x,y){\n console.log(x);\n console.log(y);\n}", "function f1 (x){\n\treturn Math.pow(x,3) - 2 * Math.pow(x,2) + x - 3;\n}//End function f1(x)", "function multiply() {\n var result = 3 * 4;\n console.log(\"3 multiplied by 4 is \", result);\n}", "function multiplier(n1,n2){\n ajouterHistorique(n1 + ' x ' + n2);\n return n1 * n2;\n}", "function expo(){\n var1 = +prompt(\"Enter a base number\");\n var2 = +prompt(\"Enter an exponential number\");\n var power = Math.pow(var1,var2);\n document.write(var2 +\" is the power of \" + var1 +\" = \" +power);\n}", "function pow(number, power) {\n if (power == 1) {\n console.log(\"number\",number)\n return number;\n } else {\n console.log(\"power\",power)\n console.log(\"number\",number)\n return number * pow(number, power - 1)\n }\n}", "function funcTwo(num1, num2, num3) {\n console.log(num1 / num2 / num3);\n}", "function powerCalculator(number, exponent){\n if (exponent < 0) {\n return 'exponent should be >= 0'\n }\n if (exponent === 1) {\n return number\n }\n else {\n return number * powerCalculator(number, exponent-1)\n }\n \n}", "function multiplyBy2(x){\r\n return x * 2;\r\n}", "function f1p(x){\n\treturn 3*Math.pow(x,2) - 4 * x + 1;\n}//End function f1p(x)", "function powerFunction(number) {\n return Math.log(number);\n}", "function multiplyByItself(x){\n return x**2;\n}", "function factorial(num) {\n \n}", "function a(b){\n    console.log(b);\n return b*3;\n}", "function factorial(n) {\n\n}", "function intexp(value)\n{\n\treturn (Math.floor(log2(value)));\n}", "function exponent1 (base, n) {\n if (n === 0) return 1;\n return (base * exponent1(base, n - 1));\n}", "function multiply (x) {\n return x * 2;\n}", "function multiplicacion (numero1, numero2) {\n var resultado = numero1 * numero2\n console.log(resultado)\n}", "function a(b) { // a(3)\n     \n console.log(b); //console.log(3)\n return b * 3; //return 3*3\n}", "function exponent (base, expo) {\n if (expo === 1) {\n return base\n }\n return base * exponent(base, expo - 1)\n}", "function myFuntion(a,b){\r\n return Math.pow(a,b)\r\n}", "function power(a, b) {\n return null; \n}", "function f3(a) {\n return a * 3;\n}", "function power(base){\n var result=1;\n return function(num){\n for(var i=0; i<base; i++){\n result=result*num\n \n }\n \n \n return result\n }\n \n }", "function exponent(num, times) {\n return Math.pow(num, times);\n}", "function multiply(a, b) {\n var result = a * b;\n console.log(result);\n return result;\n}", "function _exp_i(th) {\n return {\n re: Math.cos(th),\n im: Math.sin(th)\n };\n}", "getExp() {\n return this.expCounter;\n }" ]
[ "0.75251865", "0.69320565", "0.6508477", "0.65082073", "0.64467233", "0.644237", "0.64352137", "0.6420615", "0.6409875", "0.6405006", "0.6380284", "0.6370053", "0.6297289", "0.6287081", "0.62302244", "0.62291497", "0.62272763", "0.62026834", "0.6195902", "0.61886585", "0.61820287", "0.6181742", "0.61756516", "0.61479634", "0.61442494", "0.6125909", "0.6123398", "0.60486245", "0.6044008", "0.6041722", "0.6023406", "0.60056514", "0.6000641", "0.5980183", "0.59800667", "0.5979714", "0.5967316", "0.5965704", "0.59610695", "0.5958379", "0.5938241", "0.5919827", "0.5885641", "0.5868502", "0.5860049", "0.5842086", "0.58417034", "0.5835931", "0.5826605", "0.5821086", "0.58103037", "0.579418", "0.579418", "0.57905924", "0.5786584", "0.578325", "0.57800955", "0.57800496", "0.5770806", "0.5754673", "0.57485366", "0.5737437", "0.573663", "0.573483", "0.57307947", "0.5729179", "0.57291365", "0.57291365", "0.5727825", "0.5726991", "0.5724528", "0.57186", "0.5704278", "0.5699859", "0.56939185", "0.5692848", "0.5692792", "0.5687948", "0.5674988", "0.56686765", "0.56674314", "0.5638799", "0.5632479", "0.5623847", "0.5623546", "0.5623084", "0.56221217", "0.56109434", "0.5599883", "0.55976", "0.55938476", "0.55905634", "0.55895054", "0.55884343", "0.55880296", "0.558663", "0.55850065", "0.55841804", "0.55830836", "0.55766106" ]
0.59965193
33
console.log(exp2(3, 2)); console.log(exp2(3, 3)); console.log(exp2(2, 3));
function fibonacci(n) { if (n === 1) { return [1] }; if (n === 2) { return [1, 1] }; let seq = fibonacci(n - 1) seq.push(seq[seq.length - 1] + seq[seq.length - 2]) return seq; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exp(args){\n return Math.exp(args);\n}", "function calculateExponent(num, exp) {\n\tconsole.log(Math.pow(num, exp));\n}", "function exp2(base, n) {\n if (n === 0) { return 1 };\n \n if ( n % 2 === 0 ) {\n let r = exp2(base, n / 2);\n return r * r;\n } else {\n let r = (exp2(base, (n - 1) / 2));\n return base * (r * r);\n }\n}", "function executeExponential(x, y) {\r\n if (x != NaN && y != NaN) {\r\n let result = \"\";\r\n let rollingResult = 1;\r\n for (let i = 0; i < y; i++) {\r\n rollingResult *= x;\r\n result += rollingResult + \" \";\r\n }\r\n console.log(result);\r\n } else {\r\n console.log(\"Invalid input\");\r\n }\r\n}", "function exp(n, e) {\n n = n ? n : 0;\n e = e ? e : 1;\n\n return Math.pow(n, e);\n}", "function createExpFunc(num) {\n return function(num2){\n return Math.pow(num2, num);\n }\n}", "function expF(x, a, b, c) {\n\tc = c ? c : 0;\n\treturn a*b**x + c*x;\n}", "function createExpFunc(num) {\n\n}", "function power(n, exp) {\n if (exp === 0) return 1;\n if (exp === 1) return n;\n return n * power(n, exp - 1);\n}", "function exponent(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp === 1) {\n return base;\n } else if (exp % 2 === 0) {\n return (exponent(base, exp / 2)) ** 2;\n } else {\n // odd exponent\n return base * ((exponent(base, (exp - 1) / 2)) ** 2);\n }\n}", "function generateExp(){\n for (var i=0;i<iterations;i++){\n if (a2*a2+b2*b2>=4){\n return i; \n }\n var e=Math.E;\n var tmA=a2;\n a2=e^tmA*Math.cos(b2)-0.65;\n b2=e^tmA*Math.sin(b2);\n }\n return -1;\n}", "function exp(value) {\n return (Array.isArray(value)) ? value[0](exp(value[1]), exp(value[2])) : value;\n}", "function gamma(z)\n{\n return Math.exp(logamma(z));\n}", "function exp(value) { // takes first array and takes next 2 as arguments\n return (Array.isArray(value)) ? value[0](value[1], value[2]) : value;\n}", "function power(base1,exp1) {\n if (exp1 === 0){\n return 1\n }\n return base1 * power(base1, exp1-1)\n}", "function power (base, exp){\n if(exp === 0) return 1;\n return base * power(base, exp-1);\n}", "function pow(exp) {\n return function(base) {\n return Math.pow (base, exp);\n };\n }", "function power(base, exp) {\n if(exp <=0 ) return 1\n\n return base*power(base, exp-1)\n\n}", "function log2(num) {\n\n}", "function f(x){\n // return Math.pow(x,2);//\n return x*2;\n}", "function calc(exp) { return \"calc(\" + exp + \")\"; }", "get exp() {\n return this._exp();\n }", "function expm1(x){ // 1401\n return (x = +x) == 0 ? x : x > -1e-6 && x < 1e-6 ? x + x * x / 2 : exp(x) - 1; // 1402\n} // 1403", "function multiplyBy2(x){\r\n return x * 2;\r\n}", "function generate_exp( lambda ){\n \n var ex, u = 0;\n \n u = Math.random();\n \n ex = -( 1 / lambda ) * Math.log(1 - u);\n \n return ex;\n}", "function power(base, exp) {\n if (exp === 0) return 1;\n return base * power(base, exp-1);\n}", "function exponent(number1,number2){\n let result = 1;\n for(i = 0; i < number2; i++){\n result *= number1\n }\n console.log(result);\n}", "function exp(value) {\n return (Array.isArray(value))\n ? value[0](\n exp(value[1]),\n exp(value[2])\n )\n : value;\n}", "function multiply(num1, num2) {\r\n console.log(num1 * num2);\r\n}", "function calculateExponent(num, exp) {\n return Math.pow(num, exp);\n}", "function geo_expval(prob) {\n return 1/prob;\n}", "function exp1(base, n) {\n return n === 0 ? 1 : (base * exp1(base, n - 1));\n}", "function intexp(value)\n{\n\treturn (Math.floor(log2(value)));\n}", "function power(base, exp) {\n if( exp < 0) {\n base = 1 / base;\n exp = exp * -1;\n }\n if( exp == 0 ) {\n return 1;\n }\n return base * power(base, exp - 1);\n\n}", "function exponent(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp < 0) {\n return 1.0/exponent(base, -exp);\n } else {\n return base * exponent(base, exp - 1);\n }\n}", "function transmogrifier(num1,num2,num3){\n\n var totalfirstsecond = num1 * num2;\n\n var power = Math.pow(totalfirstsecond, num3);\n\n console.log (power);\n\n return power;\n\n}", "function recursiveExponent(base, exp) {\n return recursion(exp, 1);\n\n function recursion(n, res) {\n if (n === 0) return res;\n return recursion(n - 1, res * base);\n }\n}", "function multiplier2(factor){\n return x => x * factor; \n}", "function exp(b, n) {\n let base = b;\n for(let i = 1; i < n; i++) {\n base *= b;\n }\n return b;\n}", "function exponent(base, expo) {\n var result = 1;\n for(var i = 0; i < expo; ++i) {\n result *= base;\n }\n console.log(result);\n return result;\n}", "function exponent(startNumber, exponentNumber)\n{\n const result = startNumber ** exponentNumber;\n\n // console.log(result);\n return result;\n}", "function calculateExponent(num, exp) {\n\treturn Math.pow(num, exp)\n}", "function _exp_i(th) {\n return {\n re: Math.cos(th),\n im: Math.sin(th)\n };\n}", "function funcOne(hgjfjhghjgnf) {\n console.log(hgjfjhghjgnf * 2);\n}", "function getExp(maxValue){\n\t\treturn exp = maxValue > 1e5 ? 1e5 : maxValue > 1e4 ? 1e4 : maxValue > 1e3 ? 1e3: maxValue > 1e2 ? 1e2: 1e1;\n\t}", "function calculateExponent(num, exp) {\n return Math.pow(num, exp);\n }", "function multiply(n1,n2) {\n var result = n1*n2;\n // console.log(result);\n return result;\n}", "function ex1(){\n return 12+20\n }", "function myMathFunction() {\n console.log(2+2);\n console.log(3-2);\n console.log(12/4);\n console.log(2*5);\n}", "function getLevel2(exp) {\n return exp <= 1 ? 1 : Math.floor(1 + REVERSE_PQ_PREFIX + Math.sqrt(REVERSE_CONST + GROWTH_DIVIDES_2 * exp));\n}", "function power3(base, exp) {\n if (exp === 0) {\n return 1;\n } else if (exp === 1) {\n return base;\n }\n\n var result = 1;\n while (exp > 0) {\n result = result * base;\n exp -= 1;\n }\n\n return result;\n}", "exp () {\n\t\t\tconst ex = Math.exp (this.x); return Complex.C (ex * Math.cos (this.y), ex * Math.sin (this.y));\n\t\t}", "function multiply(parameter1, parameter2) {\n console.log(parameter1 * parameter2);\n}", "function power(base, exp){\n var result = 1;\n for(var i=1; i<=exp; i++){\n result = result*base; \n }\n return result;\n }", "function exponent(num, times) {\n return Math.pow(num, times);\n}", "function Logarithm() {\r\n}", "function powerCalculator(num, exp) {\n if(exp >= 0) {\n let answer = 1\n for(let i = 1; i <= exp; i++) {\n answer = answer * num\n }\n return answer;\n }\n else {\n return 'exponent should be >= 0'\n }\n }", "function expo(){\n var1 = +prompt(\"Enter a base number\");\n var2 = +prompt(\"Enter an exponential number\");\n var power = Math.pow(var1,var2);\n document.write(var2 +\" is the power of \" + var1 +\" = \" +power);\n}", "function squareNumber(num) {\n console.log (num**2);\n}", "function exponent (base, expo) {\n if (expo === 1) {\n return base\n }\n return base * exponent(base, expo - 1)\n}", "function B(x) {\n console.log(\"B\");\n\n return x ** 2;\n}", "function pow(x,n) {\n let x = inum;\n let n = itimes\n alert (x**n);\n}", "function BASE_raised_EXP(base, exp) //this function not used at all; kept here for possible future use...\n{\n // for (var j = 1; j <= exp; j++)\n origexp = exp;\n if(exp < 0)\n {\n exp = exp * -1;\n }\n var z = 1;\n for (var k = 1; k <= exp ; k++)\n {\n //alert(\"begin\" + z);\n z = z * base;\n //alert(\"end\" + z);\n }\n //\n if(origexp >=0)\n {\n alert(\"answer = \" + z);\n }\n else\n {\n alert(\"answer = \" + (1/z));\n }\n}", "function mult(num1, num2) {\n\tconsole.log(\"3) \" + num1 * num2);\n}", "function multiply() {\n return num1 * num2;\n}", "function multiply() {\n return num1 * num2;\n}", "function myFuntion(a,b){\r\n return Math.pow(a,b)\r\n}", "function multiply(x,y){\n console.log(x);\n console.log(y);\n}", "function cal(){\n console.log(2+3)\n}", "function print2(a) {\r\n var i = a*a;\r\n console.log(\"The square of \" + a + \" is \" + i);\r\n return i; \r\n}", "function multiply (x) {\n return x * 2;\n}", "function exponenet(n , b){\n\tif (typeof n !== \"number\" || typeof b !== \"number\"){\n\t\treturn TypeError(\"Enter a number for both n and b\")\n\t} else {\n\t\treturn Math.pow(n, b)\n\t}\n}", "function multiply(n1,n2){\r\n return n1*n2;\r\n}", "function doubleIt(num){\n var result = num*2;\n //console.log(result);\n return result;\n}", "function product(num1, num2){\n multiply = num1 * num2;\n console.log(multiply);\n return multiply\n}", "function double(n){\n return n*2;\n}", "function complicated () {\n console.log(multiply(return4(), 8));\n}", "function multiplyBy2(num) {\n return num * 2\n}", "function fn(input) { return 2*input; }", "function power_1(a){return a * a;}", "function multiplyByItself(x){\n return x**2;\n}", "function log2(x) {\r\n return Math.log(x) / Math.log(2);\r\n}", "getExp() {\n return this.expCounter;\n }", "function powerFunction(number) {\n return Math.log(number);\n}", "function multiplyEm(num1, num2) {\n var product = num1 * num2;\n return product\n}", "function exponent(x, y) {\r\n let finalResult = 1;\r\n for (let i = 0; i < y; i++) {\r\n finalResult *= x;\r\n }\r\n return finalResult;\r\n}", "function potencia2(a,b) {\n return a ** b;\n\n}", "function multiplyBy2(number) {\n return number * 2;\n}", "function multiplica(numero, numero2)\n{\n return numero * numero2;\n}", "function g(a, b) {\n return a * b * 3.5;\n}", "function g(a, b) {\n return a * b * 3.5;\n}", "function expValue(x,y){\n let result = [];\n let start = 1;\n\n \n\n if(typeof x === 'number' && typeof y === 'number'){\n console.log('true');\n }else{\n console.log('false');\n }\n\n for (let i = 1; i <= y; i++){\n start *= x;\n result += start + ' ';\n }\n console.log(result);\n \n \n}", "function multiply() {\n var result = 3 * 4;\n console.log(\"3 multiplied by 4 is \", result);\n}", "function powerCalculator(base, exp) {\n if (exp === 0) {\n return 1;\n }\n if (exp < 0) {\n return 'exponent has to be >= 0';\n }\n let product = 1;\n for (let i = 0; i < exp; i++) {\n product *= base;\n }\n return product;\n}", "function multiplier(n1,n2){\n ajouterHistorique(n1 + ' x ' + n2);\n return n1 * n2;\n}", "function exponent(base, expo) {\n if (expo === 0) {\n return 1;\n }\n\n let result = exponent(base, expo - 1);\n result *= base;\n return result;\n}", "function log2 (x) {\n return Math.log(x) / Math.LN2;\n}", "function multiplicar(a, b) {//parametros dentro de la declaracion de la funcion\n console.log(a * b)\n}", "function g(a, b) {\n return a * b * 3.5;\n}", "function powerCalculator (base, exp) {\n let result = 1;\n for(let i=0; i<exp; i++){\n if(exp < 0) {\n return 'exponent should be >= 0';\n }\n else if(exp === 0){\n return 1;\n } else{\n result *= base;\n }\n }\n return result;\n}", "function multiply(multiplier) {\n return function (num) {\n console.log(num * multiplier)\n }\n}" ]
[ "0.78075117", "0.67616314", "0.66752636", "0.66433984", "0.6614532", "0.65487653", "0.6541627", "0.6509946", "0.6506188", "0.6499359", "0.64813286", "0.6444647", "0.6428656", "0.64080244", "0.6404586", "0.63999236", "0.6363756", "0.63568246", "0.63391805", "0.6336464", "0.6303791", "0.62599874", "0.6255659", "0.62229705", "0.62093616", "0.6201012", "0.6193638", "0.61909723", "0.6179195", "0.6178821", "0.61715513", "0.61556345", "0.6153268", "0.6137456", "0.6130068", "0.6109524", "0.61088353", "0.6096722", "0.6094359", "0.60657036", "0.6064646", "0.60546434", "0.6044663", "0.6036589", "0.60270697", "0.6021192", "0.6009613", "0.6001145", "0.5997919", "0.5987861", "0.5981745", "0.5971486", "0.5967074", "0.59636164", "0.5932842", "0.59210205", "0.59164065", "0.5915922", "0.5900144", "0.5895685", "0.5893724", "0.5890711", "0.5887045", "0.58859587", "0.58608115", "0.58608115", "0.58602786", "0.5856979", "0.58419776", "0.58226854", "0.5821713", "0.58190453", "0.5816279", "0.5815068", "0.58148855", "0.5804906", "0.5804525", "0.5803687", "0.5793442", "0.5792542", "0.57924", "0.57866776", "0.57761693", "0.5773677", "0.5771245", "0.5769792", "0.5769475", "0.5763651", "0.57534415", "0.5753214", "0.5753214", "0.5744953", "0.57391745", "0.5739076", "0.5735426", "0.5734774", "0.5727363", "0.57271034", "0.57261825", "0.57246906", "0.5724087" ]
0.0
-1
console.log(bsearch([1, 2, 3, 4, 5], 4)) console.log(bsearch([1, 2, 3, 4, 5], 6)) console.log(bsearch([1, 2, 3, 4, 5], 2))
function mergesort(arr) { if (arr.length <= 1) return arr; let mid = Math.floor(arr.length / 2); let left = arr.slice(0, mid); let right = arr.slice(mid); let sortedLeft = mergesort(left); let sortedRight = mergesort(right); return merge(sortedLeft, sortedRight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function bSearch(arr, val) {\n let start = 0;\n let end = arr.length - 1;\n\n while (start < end) {\n const mid = Math.floor((end - start) / 2) + start;\n if (arr[mid] === val) {\n return mid;\n }\n if (arr[mid] < val) {\n start = mid + 1;\n } else {\n end = mid - 1;\n }\n }\n\n return start;\n}", "function binarySearch(arr, value) {\n\n}", "function bsearch(arr, target) {\n if (arr.length < 1){\n return -1;\n }\n let middle = Math.floor(arr.length/2);\n\n if (arr[middle] === target){\n return middle;\n } else if (arr[middle] > target){\n let left = arr.slice(0, middle);\n return bsearch(left, target);\n } else {\n let right = arr.slice(middle+1);\n if (bsearch(right, target) !== -1) return bsearch(right, target)+middle+1;\n return bsearch(right, target);\n }\n\n}", "function bsearch(arr, target) {\n if (arr.length === 0) { return -1; }\n\n let midIdx = Math.floor(arr.length / 2);\n\n if (arr[midIdx] === target) {\n return midIdx;\n } else if (arr[midIdx] > target) {\n return bsearch(arr.slice(0, midIdx), target);\n } else {\n let result = bsearch(arr.slice(midIdx + 1), target);\n if (result === -1) {\n return -1;\n } else {\n return midIdx + 1 + result;\n }\n }\n}", "function bsearch(arr, target) {\n let mid = Math.floor(arr.length / 2);\n if (arr[mid] === target) {\n return mid;\n } else if (arr.length <= 1 && arr[mid] !== target) {\n return -1;\n }\n\n let left = arr.slice(0, mid);\n let right = arr.slice(mid, arr.length);\n let val;\n if (target > arr[mid]){\n val = bsearch(right, target);\n if (val === -1) {\n return val;\n } else {\n val += left.length;\n }\n } else {\n val = bsearch(left, target);\n }\n return val;\n\n}", "function binarySearch(arr, val) {\n\n}", "function bsearch(arr, target) {\n if (arr.length === 0) {\n return null;\n }\n\n const mid = Math.floor(arr.length / 2);\n if (arr[mid] === target) {\n return mid;\n } else if (arr[mid] > target) {\n return bsearch(arr.slice(0, mid), target);\n } else if (arr[mid] < target) {\n let result = bsearch(arr.slice(mid + 1), target);\n return result === null ? null : result + mid + 1;\n }\n}", "function bSearch(arr, s, e) {\n if (s > e) return -1;\n const mid = Math.floor((s + e) / 2);\n if (arr[mid] > arr[mid + 1]) return mid + 1;\n else return Math.max(bSearch(arr, s, mid - 1), bSearch(arr, mid + 1, e));\n}", "function bsearch(arr, target) {\n if(!(arr instanceof Array)) {\n return -1;\n }\n \n if (arr[0] === target) {\n return target;\n } else if (arr[0] !== target && arr.length === 1) {\n return -1\n } else {\n let newArr = arr.slice(1, arr.length);\n return bsearch(newArr, target);\n }\n}", "function bSearch(arr, target) {\n if (arr.length === 1) {\n if (arr[0] === target) {\n return target;\n } else {\n return null;\n }\n } else if (arr.length === 0) {\n return null;\n } else {\n let midpoint = Math.floor(arr.length / 2);\n if (arr[midpoint] === target) {\n return target;\n } else if (arr[midpoint] < target) {\n return bSearch(arr.slice(midpoint + 1, arr.length), target);\n } else {\n return bSearch(arr.slice(0, midpoint - 1), target);\n }\n }\n\n}", "function binarySearch( list, target ) {\n\n}", "function bsearch(arr, target) {\n /*\n let middle = Math.floor(arr.length / 2);\n let midP = arr[middle];\n\n if (arr.length === 1 && arr[0] != target) {\n return -1;\n }\n\n if (midP < target) {\n let search = bsearch(arr.slice(middle + 1), target);\n return (search === -1) ? -1 : search + middle + 1;\n\n } else if (midP === target) {\n return middle;\n\n } else if (midP > target) {\n let search2 = bsearch(arr.slice(0, middle), target);\n return (search2 === -1) ? -1 : search2;\n }\n */\n\n //\n // let middle = Math.floor(arr.length / 2);\n // let midP = arr[middle];\n //\n // if (arr.length <= 1 && arr[0] != target) {\n // return -1;\n // }\n //\n // if (midP < target) {\n // let search = bsearch(arr.slice(middle + 1), target)\n // return (search === -1) ? -1 : search + middle + 1;\n //\n // } else if (midP === target) {\n // return middle;\n //\n // } else if (midP > target) {\n // let search = bsearch(arr.slice(0, middle), target);\n // return (search === -1) ? -1 : search;\n // }\n\n //\n // let middle = Math.floor(arr.length / 2)\n // let midP = arr[middle];\n //\n // if (arr.length <= 1 && arr[0] !== target) {\n // return -1\n // }\n //\n // if (midP < target) {\n // let search = bsearch(arr.slice(middle + 1), target);\n // return (search === -1) ? -1 : search + middle + 1;\n // } else if (midP === target) {\n // return middle;\n // } else if (midP > target) {\n // let search = bsearch(arr.slice(0, middle), target);\n // return (search === -1) ? -1 : search;\n // }\n}", "function binarySearch(sortedNums, searchNum) {}", "function binarySearch(list, toFind) {\n let lowIdx = 0;\n let highIdx = list.length;\n let middleIdx,\n guess,\n counter = 0; // counter for demostration\n\n while (lowIdx <= highIdx) {\n counter++;\n middleIdx = Math.floor(highIdx + lowIdx) / 2;\n guess = list[middleIdx];\n if (guess === toFind) break;\n else if (guess > toFind) highIdx = middleIdx -1;\n else lowIdx = middleIdx; // guess > itemToFind\n }\n console.log('iterations: ',counter);\n if (guess === toFind) return middleIdx; // return the index if found\n return -1;\n}", "function binarySearch(searchElement, array) {\n var currentElement;\n var minIndex = 0;\n var maxIndex = array.length - 1;\n while (minIndex <= maxIndex) {\n currentIndex = (minIndex + maxIndex) / 2 | 0;\n currentElement = array[currentIndex];\n \t\tconsole.log(\"currentIndex \" + currentIndex, \"currentElement \" + currentElement);\n if (currentElement < searchElement) {\n minIndex = currentIndex + 1;\n }\n else if (currentElement > searchElement) {\n maxIndex = currentIndex - 1;\n }\n else {\n return currentIndex;\n }\n }\n \n return -1;\n}", "function binarySearchBonus(arr, val) {\r\n var start = 0;\r\n var end = arr.length-1;\r\n var counter = 0;\r\n while (start <= end && counter == 0){\r\n var pointer = Math.floor((end-start)/2)+start;\r\n if (arr[pointer]==val){\r\n counter ++;\r\n break;\r\n }\r\n else if (arr[pointer]<val){\r\n start = pointer+1;\r\n }\r\n else if (arr[pointer]>val){\r\n end = pointer-1;\r\n }\r\n }\r\n if (counter>0){\r\n var x = 1\r\n while (arr[pointer+x]==val){\r\n counter++;\r\n x++;\r\n }\r\n x = 1\r\n while (arr[pointer-x]==val){\r\n counter++;\r\n x++;\r\n }\r\n }\r\n return counter\r\n }", "function binarySearch(ar, el, compare_fn) {\n var m = 0;\n var n = ar.length - 1;\n while (m <= n) {\n var k = (n + m) >> 1;\n var cmp = compare_fn(el, ar[k]);\n if (cmp > 0) {\n m = k + 1;\n } else if(cmp < 0) {\n n = k - 1;\n } else {\n return k;\n }\n }\n return -m - 1;\n}", "function binarySearch(anArray, item) {\n let lowerIndex = 0;\n let upperIndex = anArray.length - 1;\n let middleIndex;\n\n while (lowerIndex <= upperIndex) {\n middleIndex = Math.floor((lowerIndex + upperIndex) / 2);\n\n if (item.localeCompare(anArray[middleIndex]) == 0) {\n return middleIndex;\n } else if (item.localeCompare(anArray[middleIndex]) == -1) {\n upperIndex = middleIndex - 1;\n } else {\n lowerIndex = middleIndex + 1;\n }\n }\n\n return -1;\n}", "function binarySearch(arr, val) {\n if(arr.length == 0){\n return -1\n } else if(arr[arr.length - 1] == val){\n return arr.length - 1;\n }\n return 0 + findIndex(arr.slice(0, arr.length - 1), val);\n}", "function rBinarySearch(array, num ) {\n\n}", "function binarySearch (array, value) {\n var start = 0;\n var end = array.length - 1;\n var middle;\n\n while (start <= end) {\n middle = Math.floor((start + end) / 2);\n\n if (array[middle] === value) {\n return middle;\n }\n if (value < array[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n }\n return -1;\n}", "function binarySearch(arr, searchValue) {\n function find(arr, searchValue, left, right) {\n if (right < left)\n return -1;\n\n /*\n int mid = mid = (left + right) / 2;\n There is a bug in the above line;\n Joshua Bloch suggests the following replacement:\n */\n var mid = Math.floor((left + right) >>> 1);\n if (searchValue > arr[mid])\n return find(arr, searchValue, mid + 1, right);\n\n if (searchValue < arr[mid])\n return find(arr, searchValue, left, mid - 1);\n\n return mid;\n }\n return find(arr, searchValue, 0, arr.length - 1);\n}", "function binarySearch(arr, searchValue) {\n function find(arr, searchValue, left, right) {\n if (right < left)\n return -1;\n\n /*\n int mid = mid = (left + right) / 2;\n There is a bug in the above line;\n Joshua Bloch suggests the following replacement:\n */\n var mid = Math.floor((left + right) >>> 1);\n if (searchValue > arr[mid])\n return find(arr, searchValue, mid + 1, right);\n\n if (searchValue < arr[mid])\n return find(arr, searchValue, left, mid - 1);\n\n return mid;\n };\n\n return find(arr, searchValue, 0, arr.length - 1);\n}", "function binarySearch(array, value) {\n let left = 0;\n let right = array.length - 1;\n let middle = Math.round((left + right) / 2);\n while (array[middle] !== value && left <= right) {\n middle = Math.round((left + right) / 2);\n if (array[middle] > value) {\n right = middle - 1;\n } else {\n left = middle + 1;\n } \n }\n \n if (array[middle] === value) {\n return middle\n }\n\n return -1\n}", "function search(x, a, cmp)\n {\n let lo = 0, hi = a.length - 1;\n while (lo <= hi) {\n let m = Math.floor((lo + hi)/2), r = cmp(x, a[m]);\n if (r < 0) hi = m - 1;\n else if (r > 0) lo = m + 1;\n else return m;\n }\n return -1;\n }", "function BinarySearch(arr, key) {\n let low = 0;\n let high = arr.length - 1;\n\n for (let i = 0; i < arr.length; i++) {\n let mid = Math.floor((low + high) / 2);\n if (key === arr[mid]) {\n console.log(`Found ${key} in ${mid}th index.`);\n console.log(`Number of iterations = ${i + 1}`);\n break;\n }\n\n else if (key > arr[mid]) {\n low = mid + 1;\n mid = Math.floor((low + high / 2));\n }\n\n else if (key < arr[mid]) {\n high = mid - 1;\n mid = Math.floor((low + high / 2));\n }\n\n if (low > high) {\n console.log(`Didn't find ${key} in the list. Process iterated for ${i + 1} times.`);\n break;\n }\n }\n}", "function binarySearch (arr, target) {\n var n = arr.length,\n l = 0, r = n - 1;\n while(l < r) {\n var middle = (l+r) / 2\n if (target === arr[middle]) {\n return middle\n } else if (middle > target) {\n r = middle + 1\n } else {\n l = middle - 1\n }\n }\n return -1\n}", "function binarySearch(array, target){\n return binaryHelper(array, target, 0, array.length -1)\n}", "function binarySearch(array, value, start, end) {\n start = start === undefined ? 0 : start;\n end = end === undefined ? array.length : end;\n\n if (start > end) {\n return -1;\n }\n\n const index = Math.floor((start + end) / 2);\n const item = array[index];\n\n\n if (item === value) {\n return index;\n }\n else if (item < value) {\n return binarySearch(array, value, index + 1, end);\n }\n else if (item > value) {\n return binarySearch(array, value, start, index - 1);\n }\n}", "function binarySearch(arr,val) {\n let start = 0\n let end = arr.length-1\n let mid = Math.floor((start+end)/2)\n\n while (arr[mid] !== val && start <= end) {\n\n if (arr[mid] < val) {\n start = mid + 1\n } else {\n end = mid - 1\n }\n mid = Math.floor((start+end)/2)\n }\n if (arr[mid] === val) {\n return mid\n }\n return -1\n}", "function binary_Search(items, value){\n var firstIndex = 0,\n lastIndex = items.length - 1,\n middleIndex = Math.floor((lastIndex + firstIndex)/2);\n \n while(items[middleIndex] != value && firstIndex < lastIndex)\n {\n if (value < items[middleIndex])\n {\n lastIndex = middleIndex - 1;\n } \n else if (value > items[middleIndex])\n {\n firstIndex = middleIndex + 1;\n }\n middleIndex = Math.floor((lastIndex + firstIndex)/2);\n }\n \n return (items[middleIndex] != value) ? -1 : middleIndex;\n }", "function binarySearch(arr, value) {\n var left = 0;\n var right = arr.length - 1;\n var middle = Math.floor((left + right) / 2);\n\n while (arr[middle] !== value && left <= right) {\n if (value < arr[middle]) right = middle - 1;\n else left = middle + 1;\n middle = Math.floor((left + right) / 2);\n }\n return arr[middle] === value ? middle : -1;\n}", "function BinarySearch(array, search) {\n\tlet arrayToSearch = array;\n\n\t// High and Low are the bondaries of search within the array\n\tlet low = 0;\n\tlet high = array.length;\n\n\tlet found = false;\n\t// Turing the searchInput to all lowercase so capped letters aren't a factor\n\tlet itemToFind = search.toLowerCase();\n\n\twhile (high >= low && found === false) {\n\t\t// Set middle to the middle int value between high and low\n\t\tlet middle = parseInt((low + high) / 2);\n\n\t\t// If the middle value equals the array's length, exit the function\n\t\tif (middle === arrayToSearch.length) {\n\t\t\tbreak;\n\t\t}\n\n\t\t// If the itemToFind is equal to the middle index element...\n\t\tif (FoundItem(arrayToSearch, middle, itemToFind)) {\n\t\t\t// Then...\n\t\t\t// Set if we found the item to true\n\t\t\tfound = true;\n\t\t\t// Exit the while loop\n\t\t\tbreak;\n\t\t}\n\n\t\t// If the itemToFind is alphabetically lower than the middle...\n\t\tif (itemToFind < (arrayToSearch[middle][1][0]).toLowerCase()) {\n\t\t\t// Then...\n\t\t\t// Set the high value to the middle\n\t\t\thigh = middle - 1;\n\t\t} else {\n\t\t\t// Otherwise...\n\t\t\t// Set the low value to the middle\n\t\t\tlow = middle + 1;\n\t\t}\n\t}\n}", "function binarySearch(array, value, start, end) {\n var start = start === undefined ? 0 : start;\n var end = end === undefined ? array.length : end;\n\n if (start > end) {\n return -1;\n }\n\n const index = Math.floor((start + end) / 2);\n const item = array[index];\n\n console.log(start, end);\n if (item == value) {\n return index;\n } else if (item < value) {\n return binarySearch(array, value, index + 1, end);\n } else if (item > value) {\n return binarySearch(array, value, start, index - 1);\n }\n}", "function binarySearch(args) {\n var input = args[0].split('\\n').map(Number),\n\t\tx = input[input.length - 1],\n indexOfX,\n i;\n\n input.shift();\n input.pop();\n input.sort(function (a, b) {\n return a - b;\n });\n\n indexOfX = binSearch(input, x, 0, input.length - 1);\n return indexOfX;\n\n function binSearch(array, number, start, end) {\n if (array[start] > number || number > array[end]) {\n return (-1);\n }\n\n var middle = ((end + start) / 2) | 0;\n if (array[middle] === number) {\n return middle;\n } else {\n if (array[middle] > number) {\n return binSearch(array, number, start, (middle - 1));\n } else {\n return binSearch(array, number, (middle + 1), end);\n }\n }\n }\n}", "function binarySearch(arr, val) {\n var start = 0;\n var end = arr.length-1;\n while (start <= end) {\n var mid = Math.floor((start + end)/2);\n if (arr[mid] === val) {\n return mid;\n }\n else if (arr[mid] > val) {\n end = mid - 1;\n }\n else if (arr[mid] < val) {\n start = mid + 1;\n }\n }\n return -1;\n}", "function binarySearch(arr, value) {\n let middle = 0;\n let left = 0;\n let right = arr.length - 1;\n while (left <= right) {\n if (arr[right] < value || arr[left] > value) return -1;\n middle = Math.ceil((left + right) / 2);\n if (arr[middle] === value) return middle;\n if (arr[middle] > value) {\n right = middle - 1;\n } else if (arr[middle] < value) {\n left = middle + 1;\n }\n }\n return -1;\n}", "binarySearchInteger(arr, search){\n var startIndex = 0,\n stopIndex = arr.length - 1,\n middle = Math.floor((stopIndex + startIndex) / 2);\n\n\n while (arr[middle] != search && startIndex < stopIndex) {\n\n //adjust search area\n if (search < arr[middle]) {\n stopIndex = middle - 1;\n } else if (search > arr[middle]) {\n startIndex = middle + 1;\n }\n\n //recalculate middle\n middle = Math.floor((stopIndex + startIndex) / 2);\n }\n\n //make sure it's the right value\n if(arr[middle]==search){\n return middle;\n }\n else{\n return -1;\n }\n \n }", "function binarySearch(list, value)\r\n{\r\n\tlet start = 0;\r\n\tlet stop = list.length - 1;\r\n\tlet middle = Math.floor((start + stop) / 2);\r\n\t\r\n\twhile (list[middle][0] !== value && start < stop)\r\n\t{\r\n\t\tif (value < list[middle][0])\r\n\t\t{\r\n\t\t\tstop = middle - 1;\r\n\t\t} else\r\n\t\t{\r\n\t\t\tstart = middle + 1;\r\n\t\t}\r\n\t\t\r\n\t\tmiddle = Math.floor((start + stop) / 2);\r\n\t}\r\n\t\r\n\treturn (list[middle][0] !== value) ? -1 : middle;\r\n}", "function search(arr, value) {\n let index = arr.indexOf(value);\n if (index > 0) {\n return console.log(index);\n } else {\n return console.log(-1);\n }\n}", "function binarySearch_2(arr, elem) {\n let start = 0;\n let end = arr.length - 1;\n let middle = Math.floor((start + end) / 2);\n\n while (arr[middle] !== elem && start <= end) {\n if (elem < arr[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n\n middle = Math.floor((start + end) / 2);\n }\n\n if (arr[middle] === elem) {\n return middle;\n }\n\n return -1;\n}", "function binarySearch2(arry, n) {\n start = 0;\n end = arry.length - 1;\n middle = Math.floor(start + end / 2);\n while (arry[middle] !== n && middle < end && middle > start) {\n if (n > arry[middle]) start = middle + 1;\n else end = middle - 1;\n\n middle = Math.floor((start + end) / 2);\n }\n return arry[middle] === n ? middle : -1;\n}", "function binarySearch(array, target) {\n\tvar mid = Math.floor((array.length - 1) / 2);\n\tvar start = 0;\n\tvar end = array.length - 1;\n\twhile (start <= end) {\n\t\tif (array[mid] === target) {\n\t\t\treturn mid;\n\t\t} if (array[mid] < target) {\n\t\t\tstart = mid + 1;\n\t\t} else {\n\t\t\tend = mid - 1;\n\t\t}\n\t\tmid = Math.floor((start + end) / 2);\n\t}\n\treturn -1;\n}", "function binarySearch(arr, value, start=0, end=arr.length) {\n console.log(`${start}, ${end}`);\n if(start > end ) return null; \n \n let index = Math.floor((start + end) /2); \n\n if(arr[index] === value) {\n return index; \n }\n if(arr[index] > value) {\n return binarySearch(arr, value, start, index - 1); \n }\n if(arr[index] < value) {\n return binarySearch(arr, value, index + 1, end);\n }\n}", "function binarySearch(arr, val) {\n if (arr.length === 0) return -1;\n let leftpointer = 0, rightPointer = arr.length - 1, guessIndex = Math.floor((rightPointer) / 2);\n\n while (arr[guessIndex] !== val && leftpointer <= rightPointer) {\n console.log(leftpointer, guessIndex, rightPointer);\n if (arr[guessIndex] < val) leftpointer = guessIndex + 1;\n else rightPointer = guessIndex - 1;\n guessIndex = Math.floor((rightPointer - leftpointer) / 2) + leftpointer;\n }\n\n return arr[guessIndex] === val ? guessIndex : -1;\n}", "function binarySearch(\n array = [3, 5, 6, 8, 11, 12, 14, 15, 17, 18],\n value = 16,\n start,\n end\n) {\n var start = start === undefined ? 0 : start;\n var end = end === undefined ? array.length : end;\n\n if (start > end) {\n return -1;\n }\n\n const index = Math.floor((start + end) / 2);\n const item = array[index];\n\n console.log(start, end);\n if (item == value) {\n return index;\n } else if (item < value) {\n return binarySearch(array, value, index + 1, end);\n } else if (item > value) {\n return binarySearch(array, value, start, index - 1);\n }\n}", "function binarySearch(arr, item) {\n arr = arr.sort((a,b) => a-b);\n let left = 0;\n let right = arr.length - 1;\n let middle = Math.floor((left + right) / 2);\n while (arr[middle] !== item && left <= right) {\n (arr[middle] > item) ? right = middle - 1 : left = middle + 1;\n middle = Math.floor((left + right) / 2);\n }\n\n return arr[middle] === item ? middle : -1;\n}", "function indexOf(arr, searchItem) {\n // code here\n}", "function indexOf(arr, searchItem) {\n // code here\n}", "function binarySearch(array, pred) {\n var lo = -1,\n hi = array.length;\n while (1 + lo < hi) {\n var mi = lo + ((hi - lo) >> 1);\n if (pred(array[mi], array, mi)) {\n hi = mi;\n } else {\n lo = mi;\n }\n }\n return hi;\n}", "function linearSearch(arr, val){\n for(let i=0; i<arr.length; i++){\n if(arr[i] === val){\n return i;\n }\n return -1;\n }\n console.log('Hello World!')\n}", "function bsearchT(t, arr) {\n var first = 0;\n var last = arr.length - 1;\n if (last < 0 || arr[last][0] <= t) {\n return null;\n }\n if (arr[first][0] > t) {\n return first;\n }\n while (first < last) {\n var mid = Math.floor((first + last) / 2);\n if (arr[mid][0] <= t) {\n first = mid + 1;\n if (arr[first][0] > t) {\n return first;\n }\n } else {\n last = mid;\n }\n }\n return first;\n}", "function binarySearch(array, key) {\n var low = 0;\n var high = array.length - 1;\n var mid;\n var element;\n\n while(low <= high) {\n mid = Math.floor((low + high) / 2, 10);\n element = array[mid];\n if (element < key) {\n high = mid - 1;\n }else if (element > key){\n high = mid - 1;\n }else{\n return mid;\n }\n }\n return - 1;\n}", "function binarySearch(A, cmpVal, def, valfn, i, j){\n if(!A.length) return -1; \n var valfn = valfn || function(x){ return x; }\n var def = def || 0;\n if(i === undefined){ i = 0; }\n if(j === undefined){ j = A.length; }\n if(i >= j) {\n\tif(def === -1){\n\t if(i > 0) return i - 1;\n\t else return i;\n\t}\n\telse if(def === 0){\n\t var v0 = 999999999;\n\t var v2 = 999999999;\n\t if(i > 0) v0 = valfn(A[i-1])\n\t if(i + 1 < A.length) v2 = valfn(A[i+1]);\n\t var a = [Math.abs(v0 - cmpVal)\n\t\t ,Math.abs(valfn(A[i]) - cmpVal)\n\t\t ,Math.abs(v2 - cmpVal)]\n\t var closest = a.indexOf(Math.min.apply(Math, a));\n\t if(closest === 0) return i - 1; \n\t else if(closest === 2){ return i + 1; }\n\t else return i; \n\t}\n\telse if(def === 1){\n\t if(i + 1 < A.length) return i + 1;\n\t else return i; \n\t}\n\telse { throw \"Parameter 'def' must be -1, 0, or 1\"; }\n }\n\n var idx = i + Math.floor((j - i)/2);\n if (idx < 0 || idx + 1 > A.length){ throw \"Bad idx: \"+idx+\" not in [0, \"+A.length+\"]\"; }\n var v = valfn(A[idx]);\n\n if(v > cmpVal){ return binarySearch(A, cmpVal, def, valfn, i, idx); }\n if(v === cmpVal){ return idx; }\n if(v < cmpVal){ return binarySearch(A, cmpVal, def, valfn, idx+1, j); }\n}", "function binarySearch(arr, target) {\n let startIdx = 0,\n endIdx = arr.length - 1;\n\n while (startIdx < endIdx) {\n let midIdx = Math.floor((startIdx + endIdx) / 2);\n if (target === arr[midIdx]) {\n return midIdx;\n } else if (target > arr[midIdx]) {\n startIdx = midIdx;\n } else {\n endIdx = midIdx;\n }\n }\n return -1;\n}", "function binarySearch(arr, val){\n var left = 0;\n var right = arr.length - 1;\n var middle = Math.floor((left + right)/2);\n while(arr[middle] !== val) {\n if(val < arr[middle]) {\n right = middle - 1;\n }\n else {\n left = middle + 1;\n }\n middle = Math.floor((left + right) / 2);\n }\n if(arr[middle] === elem){\n return middle;\n }\n return -1;\n}", "function binarySearch(array, value) {\n var low = 0;\n var high = array.length - 1;\n while (low <= high) {\n var middle = low + ((high - low) >> 1);\n var midValue = array[middle];\n if (midValue === value) {\n return middle;\n }\n else if (midValue > value) {\n high = middle - 1;\n }\n else {\n low = middle + 1;\n }\n }\n return ~low;\n }", "function binarySearch(arr, k) {\n //assumption that arr is ordered & comprised of numbers\n // k is desired number\n // returns index of k or -1 if there is no match\n\n var low = 0;\n var high = arr.length-1;\n var mid = Math.floor((high + low)/2);\n\n while(low !== mid ){\n if(arr[mid] === k){\n console.log('FOUND!', mid);\n return mid;\n } else if (arr[mid] > k) {\n high = mid;\n mid = Math.floor((high + low)/2);\n } else if (arr[mid] < k) {\n low = mid;\n mid = Math.floor((high + low)/2);\n }\n }\n console.log('NOT FOUND! ', -1);\n return -1;\n}", "function binarySearch(arr, target, i, j) {\n let s = i, e = j;\n while (s <= e) {\n const mid = Math.floor((s + e) / 2);\n if (arr[mid] === target) return mid;\n else if (arr[mid] < target) s = mid + 1;\n else e = mid - 1;\n }\n return -1;\n}", "function bidirectionalSearchTest(array)\n{\n let counter = 0;\n let endArrayIndex = ARRAY_SIZE - 1;\n let currentIndex = 0;\n while (counter <= (ARRAY_SIZE / 2) - 1)\n {\n currentIndex = endArrayIndex - counter; \n if (array[currentIndex].result == true)\n return array[currentIndex].address;\n currentIndex = counter;\n if (array[currentIndex].result == true)\n return array[currentIndex].address;\n counter++;\n }\n return null;\n}", "function binarySearch(arr, elem) {\n let start = 0;\n let end = arr.length - 1;\n let middle = Math.floor((start + end) / 2);\n while(arr[middle] !== elem && start <= end) {\n if(elem < arr[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n }\n middle = Math.floor((start + end) / 2);\n }\n return arr[middle] === elem ? middle : -1;\n}", "function binarySearch(array, key) {\n var low = 0;\n var high = array.length - 1;\n var mid;\n var element;\n \n while (low <= high) {\n mid = Math.floor((low + high) / 2, 10);\n element = array[mid];\n if (element < key) {\n low = mid + 1;\n } else if (element > key) {\n high = mid - 1;\n } else {\n return mid;\n }\n }\n return -1;\n}", "function binarySearch(arr, elem) {\n var start = 0;\n var end = arr.length - 1;\n var middle = Math.floor((start + end) / 2);\n\n while(arr[middle] !== elem && start <= end) {\n if(elem < arr[middle]) {\n end = middle - 1;\n } else {\n start = middle + 1;\n };\n\n middle = Math.floor((start + end) / 2);\n };\n\n if(arr[middle] === elem) {\n return middle;\n };\n\n return -1;\n}", "function binarySearch(arr, val) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left <= right) {\n const middle = Math.floor((left + right) / 2);\n\n if (arr[middle] === val) return middle;\n\n if (arr[middle] > val) right = middle - 1;\n else left = middle + 1;\n }\n\n return -1;\n}", "function linearSearch(numbers, value) {\n for (let i = 0; i < numbers.length; i++) {\n if (numbers[i] === value) return i;\n }\n return -1;\n}", "function linearSearch(arr, value) {\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] == value) {\n return i;\n }\n }\n return -1;\n}", "function binarySearch(array, pred) {\r\n let lo = -1,\r\n hi = array.length;\r\n while (1 + lo < hi) {\r\n const mi = lo + ((hi - lo) >> 1);\r\n if (pred(array[mi])) {\r\n hi = mi;\r\n } else {\r\n lo = mi;\r\n }\r\n }\r\n return hi;\r\n}", "function binarySearch(a, target) {\n target += 1;\n var start = 0,\n end = a.length - 1;\n\n while (start <= end) {\n var mid = ~~((start + end) >> 1);\n if (a[mid] >= target) end = mid - 1;\n else start = mid + 1;\n }\n\n return start;\n}", "function binarySearch(haystack, needle, compareFn) {\n var min = 0;\n var max = haystack.length - 1;\n var index, delta;\n\n while (min <= max) {\n index = Math.floor((max - min) / 2) + min;\n delta = compareFn(needle, haystack[index]);\n\n if (delta === 0) {\n return index;\n } else if (delta < 0) {\n max = index - 1;\n } else {\n min = index + 1;\n }\n }\n\n return min;\n }", "function binarySearch(arr, element) {\n if (arr.length < 1) return -1\n return binarySearchRecur(arr, 0, arr.length-1, element)\n}", "function binarySearch(arr, elem){\n let start = 0;\n let end = (arr.length - 1); \n let middle = Math.floor((start + end) / 2);\n while (start <= end) {\n if (arr[middle] > elem){\n end = middle - 1\n } else if (arr[middle] < elem) {\n start = middle + 1\n } else {\n return middle\n }\n middle = Math.floor((start + end) / 2);\n }\n return -1\n}", "function binarySearch(arr, value){\n var middle = Math.floor(arr.length/2)\n var li = 0\n var ri = arr.length-1\n if (arr[0]>value || arr[arr.length-1]<value) {\n return false\n }\n while (arr[middle] != value) {\n if (arr[middle] < value) {\n li = middle\n middle = Math.floor(((ri-li)/2)+li)\n }\n if (arr[middle] > value) {\n ri = middle\n middle = Math.floor(((ri-li)/2)+li)\n }\n }\n return true\n}", "function binarySearchIndices( value ) {\r\n\r\n\t\tfunction binarySearch( start, end ) {\r\n\r\n\t\t\t// return closest larger index\r\n\t\t\t// if exact number is not found\r\n\r\n\t\t\tif ( end < start )\r\n\t\t\t\treturn start;\r\n\r\n\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\r\n\r\n\t\t\tif ( cumulativeAreas[ mid ] > value ) {\r\n\r\n\t\t\t\treturn binarySearch( start, mid - 1 );\r\n\r\n\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\r\n\r\n\t\t\t\treturn binarySearch( mid + 1, end );\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\treturn mid;\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\r\n\t\treturn result;\r\n\r\n\t}", "function binarySearch(arr, target) {\n if (!arr.length) {\n return NaN;\n }\n let midIdx = Math.floor(arr.length/2);\n let midItem = arr[midIdx];\n if (midItem === target) {\n return midIdx;\n } else if (midItem > target) {\n return (binarySearch(arr.slice(0, midIdx), target));\n } else {\n return (binarySearch(arr.slice(midIdx + 1), target) + 1 + midIdx);\n }\n}", "function binarySearch(array, item) {\n let min = 0;\n let max = array.length - 1;\n\n\n while(true) {\n let currentMid = Math.floor((min + max) / 2);\n let currentItem = array[currentMid];\n\n if (currentItem === item) {\n return currentMid;\n }\n\n if (currentItem > item) {\n max = currentMid - 1;\n }\n\n if (currentItem < item) {\n min = currentMid + 1;\n }\n\n if(max < min) {\n return null;\n }\n }\n}", "function binarySearch(arr, numToSearch) {\n let min = 0;\n let max = arr.length - 1;\n\n while (min <= max) {\n // everytime keep middle element updated\n let middle = Math.floor((min + max) / 2);\n let currentElement = arr[middle];\n\n if (currentElement < numToSearch) {\n min = middle + 1;\n } else if (currentElement > numToSearch) {\n max = middle - 1;\n } else {\n // When we finally found the search element in the array :)\n return middle;\n }\n }\n return -1;\n}", "function binarySearch(arr, val) {\n let left = 0;\n let right = arr.length - 1;\n let middle = Math.floor((left + right) / 2);\n\n while (arr[middle] !== val && left <= right) {\n if (val < arr[middle]) right = middle - 1\n\n else left = middle + 1;\n\n middle = Math.floor((left + right) / 2);\n }\n\n return arr[middle] === val ? middle: -1;\n}", "function binarySearch(array, value, compare) {\n var index = lowerBound(array, value, compare);\n if (index === array.length) {\n return -1;\n }\n var item = array[index];\n if (compare(item, value) !== 0) {\n return -1;\n }\n return index;\n }", "function binarySearch(arr, elem) {\n if (!Array.isArray(arr)) {\n return -1;\n }\n\n let left = 0;\n let right = arr.length - 1;\n\n while (left <= right) {\n const middle = Math.floor((right + left) / 2);\n\n if (elem === arr[middle]) {\n return middle;\n } else if (elem > arr[middle]) {\n left = middle + 1;\n } else {\n right = middle - 1;\n }\n }\n\n return -1;\n}", "function binarySearch(arr, val) {\n let left = 0;\n let right = arr.length - 1;\n let middle = Math.floor((left + right) / 2);\n\n while(left < right) {\n if(arr[middle] === val) {\n return middle;\n }\n else if(arr[middle] < val) {\n left = middle;\n }\n else if(arr[middle] > val) {\n right = middle;\n };\n\n middle = Math.floor((left + right) / 2);\n };\n\n return -1;\n}", "function binarySearchIndex( list, target, low, high ) {}", "function binarySearch(arr, num) {\n\tvar start = 0;\n\tvar end = arr.length - 1;\n\tvar mid = Math.floor((start + end) / 2);\n\n\twhile (start <= end && arr[mid] !== num) {\n\t\tif (num < arr[mid]) end = mid - 1;\n\t\telse start = mid + 1;\n\t\tmid = Math.floor((start + end) / 2);\n\t}\n\treturn arr[mid] === num ? mid : -1; // ':' acts as the else\n}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\t{ return start; }\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\t{ return start; }\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function linearSearch(arr, value) {\n for (let i = 0; i < arr.length; i++) {\n if(arr[i] === value) {\n return i;\n }\n }\n return null; \n}", "function binarySearchIndices( value ) {\r\n\r\n\t\t\tfunction binarySearch( start, end ) {\r\n\r\n\t\t\t\t// return closest larger index\r\n\t\t\t\t// if exact number is not found\r\n\r\n\t\t\t\tif ( end < start )\r\n\t\t\t\t\treturn start;\r\n\r\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\r\n\r\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\r\n\r\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\r\n\r\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\r\n\r\n\t\t\t\t\treturn binarySearch( mid + 1, end );\r\n\r\n\t\t\t\t} else {\r\n\r\n\t\t\t\t\treturn mid;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\r\n\t\t\treturn result;\r\n\r\n\t\t}", "function binarySearch(arr, num) {\n let end = arr.length - 1;\n let start = 0;\n let middle = Math.floor((start + end) / 2);\n\n while (arr[middle] !== num && start <= end) {\n if (num < arr[middle]) end = middle - 1;\n else start = middle + 1;\n\n middle = Math.floor((start + end) / 2);\n }\n if (arr[middle] === num) return middle;\n return -1;\n}", "function findIndex(arr, val) {\n\n}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 );\n\t\t\treturn result;\n\n\t\t}", "binarySearch(arr, number) {\n console.log(\"in binary search \" + arr)\n var n = arr.length;\n var l = 1\n var tem\n while (tem != number) {\n if (n < l)\n break;\n var m = l + Math.floor((n - l) / 2)\n\n if (arr[m] < number)\n l = m + 1\n else if (arr[m] > number)\n n = m - 1\n else if (arr[m] == number) {\n console.log(\"number is present\")\n tem = number\n return true\n }\n else {\n break;\n return false\n }\n\n\n }\n\n\n}", "function binarySearch(array, target) {\n\treturn binarySearchHelper(array, target, 0, array.length - 1)\n}", "function binarySearchIndices( value ) {\n\n\t\t\tfunction binarySearch( start, end ) {\n\n\t\t\t\t// return closest larger index\n\t\t\t\t// if exact number is not found\n\n\t\t\t\tif ( end < start )\n\t\t\t\t\treturn start;\n\n\t\t\t\tvar mid = start + Math.floor( ( end - start ) / 2 );\n\n\t\t\t\tif ( cumulativeAreas[ mid ] > value ) {\n\n\t\t\t\t\treturn binarySearch( start, mid - 1 );\n\n\t\t\t\t} else if ( cumulativeAreas[ mid ] < value ) {\n\n\t\t\t\t\treturn binarySearch( mid + 1, end );\n\n\t\t\t\t} else {\n\n\t\t\t\t\treturn mid;\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tvar result = binarySearch( 0, cumulativeAreas.length - 1 )\n\t\t\treturn result;\n\n\t\t}", "function binarySearch(arr, val) {\n let idx = -1;\n\n function _binarySearch(high, low) {\n if (low > high) return -1;\n\n let mid = Math.floor((high + low) / 2);\n\n if (val === arr[mid]) {\n return idx = mid;\n } else if (val > arr[mid]) {\n return _binarySearch(high, mid + 1);\n } else if (val < arr[mid]) {\n return _binarySearch(mid - 1, low);\n } \n }\n\n _binarySearch(arr.length, 0);\n return idx;\n}", "function findIndex (x, a) {\n for (var i = 0, l = a.length; i < l; ++i) {\n if (x === a[i]) {\n return i\n }\n }\n return -1\n}", "function binSearch(nums, target){\r\n let first = 0;\r\n let last = nums.length;\r\n while(first < last){\r\n let mid = (first+last)/2;\r\n mid = Math.floor(mid);\r\n if(nums[mid] == target){\r\n //lowest index\r\n if(left == true){\r\n last = mid;\r\n }\r\n //highest index\r\n else{\r\n first = mid + 1;\r\n }\r\n }\r\n else if(nums[mid] < target){\r\n first = mid + 1;\r\n }\r\n else{\r\n last = mid;\r\n }\r\n }\r\n if(left == false){\r\n return first - 1;\r\n }\r\n return first;\r\n }", "function binarySearch(arr, target) {\n\n\tarr = arr.sort(); // sort arr so its always ascending order\n\t// O(n logn)\n\n\tlet start = 0,\n\t\tend = arr.length - 1; \n\n\twhile(start <= end) {\n\n\t\tlet mid = Math.floor(start + (end-start) / 2); \n\n\t\tif(target === arr[mid]) {\n\t\t\treturn mid;\n\t\t}\n\n\t\tif(target < arr[mid]) {\n\t\t\tend = mid - 1; // update ceiling if key is left half\n\t\t} else if (target > arr[mid]) {\n\t\t\tstar = mid + 1; // update floor if key is right half\n\t\t}\n\t}\n\n\treturn -1 // we dont have the ele\n}", "function findIndex(x, a) {\n for (var i = 0, l = a.length; i < l; ++i) {\n if (x === a[i]) {\n return i;\n }\n }\n return -1;\n}", "function binarySearch(list, item) {\n let min = 0;\n let max = list.length - 1;\n let guess = null;\n\n while (min <= max) {\n guess = Math.floor((min + max) / 2);\n\n if (list[guess] === item) {\n return guess;\n } else {\n if (list[guess] < item) {\n min = guess + 1\n // i.e. second half of list\n } else {\n max = guess - 1\n // i.e. first half of list\n }\n }\n }\n\n return -1\n\n}", "search (val) {\n let i = 0;\n while (this.bst[i]) {\n if (this.bst[i] === val) break;\n if (this.bst[i] < val) i = 2 * i + 2;\n else i = 2 * i + 1;\n }\n return !this.bst[i] ? -1 : i;\n }", "function binarySearch(arr, item, start, end) {\n //IF ARRAY IS EMPTY, INSERT ITEM AT INDEX ZERO\n if(arr.length == 0) {\n return 0;\n }\n //IF NEW ITEM IS SMALLLER THAN ALL EXIXTING ELEMENTS THEN INSERT AT INDEX ZERO\n if (item <= arr[start]) { \n return start; \n }\n //IF NEW ITEM IS GREATER THAN ALL EXIXTING ELEMENTS THEN INSERT AT INDEX LAST\n if (arr[end] < item) { \n return end + 1;\n }\n //IF THERE IS ONLY TWO ELEMENT IN ARRAY\n if(end - start == 1){\n return end;\n }\n \n var index = start + Math.floor((end - start + 1) / 2);\n //BINARY SEARCH FOR INDEX AT LEFT SIDE\n if (item <= arr[index]) {\n return binarySearch(arr, item, start, index);\n }\n //BINARY SEARCH FOR INDEX AT RIGHT SIDE\n if (arr[index] < item) {\n return binarySearch(arr, item, index, end);\n }\n}" ]
[ "0.7907474", "0.7720652", "0.7702471", "0.76804096", "0.76533616", "0.7593267", "0.7464498", "0.74288505", "0.73829436", "0.72080445", "0.72036237", "0.7185125", "0.71798307", "0.71623886", "0.7039488", "0.7008269", "0.6988772", "0.69638926", "0.69556665", "0.69336563", "0.69243085", "0.6906232", "0.6904364", "0.6883387", "0.6858872", "0.6854447", "0.6851179", "0.6828813", "0.68245834", "0.68178713", "0.68054473", "0.6796186", "0.67822266", "0.6772281", "0.67652583", "0.6763646", "0.6758152", "0.6756528", "0.6751359", "0.6749633", "0.6749204", "0.67478186", "0.67432606", "0.6738675", "0.67246205", "0.6724278", "0.6722162", "0.67192936", "0.67192936", "0.6704532", "0.6701163", "0.6693794", "0.668636", "0.667699", "0.66741896", "0.6659099", "0.66435677", "0.6641301", "0.6636719", "0.66358507", "0.6632686", "0.6631411", "0.66288877", "0.6628326", "0.6616997", "0.6608608", "0.6598505", "0.65973413", "0.65947276", "0.65943664", "0.65867186", "0.6585101", "0.65804535", "0.6579565", "0.65781605", "0.6577282", "0.6575308", "0.6574322", "0.6566628", "0.6556713", "0.6555699", "0.6553589", "0.6542282", "0.6542282", "0.6541081", "0.6538411", "0.6534414", "0.6529777", "0.6527508", "0.6527508", "0.65228546", "0.65228325", "0.65179837", "0.65157783", "0.6513594", "0.65049535", "0.6504043", "0.64978766", "0.64959073", "0.64880884", "0.64835846" ]
0.0
-1
console.log(mergesort([5, 2, 1, 6, 5, 4]))
function subsets(array) { if (array.length === 0) { return [[]]; } const first = array[0]; const withoutFirst = subsets(array.slice(1)); const withFirst = withoutFirst.map(sub => [first].concat(sub)); return withoutFirst.concat(withFirst); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mergeSort(arr) {\n\n}", "function mergeSort(array) {\n\n}", "function merge_sort(array) {\r\n return merge_aux(array, 0, array.length - 1);\r\n}", "function mergeSort(arr) {\n\tif (arr.length <= 1) return arr;\n\n\tlet mid = Math.floor(arr.length / 2);\n\tlet left = mergeSort(arr.slice(0, mid));\n\tlet right = mergeSort(arr.slice(mid));\n\tconsole.log(left, right);\n\treturn merge(left, right);\n}", "function mergeSort(list) {\n console.log(list)\n\tif (list.length === 1) {\n return list\n }\n let half = Math.floor(list.length / 2)\n let L = list.slice(0, half)\n let R = list.slice(half)\n\tlet Lsorted = mergeSort(L)\n // console.log(Lsorted)\n\tlet Rsorted = mergeSort(R)\n // console.log(Rsorted)\n\treturn merge(Lsorted, Rsorted)\n}", "function mergeSort(arr) {\n if (arr.length <= 1) return arr\n let mid = Math.floor(arr.length / 2)\n let left = mergeSort(arr.slice(0, mid))\n let right = mergeSort(arr.slice(mid))\n return merge(left, right)\n}", "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n var mid = Math.floor(arr.length/2);\n var left = mergeSort(arr.slice(0,mid));\n var right = mergeSort(arr.slice(mid))\n return merge(left, right);\n}", "function mergeSort(numArray){\n\n}", "function mergeSort(arr){\n if (arr.length <= 1) {\n return arr;\n }\n var mid = Math.floor(arr.length/2);\n var left = arr.slice(0, mid);\n var right = arr.slice(mid, arr.length);\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let mid = Math.floor(arr.length/2),\n left = mergeSort(arr.slice(0, mid)),\n right = mergeSort(arr.slice(mid));\n return merge(left, right);\n}", "function mergeSort(arr) {\n if (arr.length <= 1) {\n return arr;\n }\n let mid = Math.floor(arr.length / 2);\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n return merge(left, right);\n}", "function mergeSort(array) {\n if (array.length <= 1) {\n return array;\n }\n const middle = Math.floor(array.length / 2);\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n console.log(left, right);\n left = mergeSort(left);\n right = mergeSort(right);\n return merge(left, right, array);\n}", "function mergeSort(arr){\n if(arr.length <= 1) return arr\n let middle = Math.floor(arr.length/2)\n let left = mergeSort(arr.slice(0,middle))\n let right = mergeSort(arr.slice(middle))\n return merge(left,right)\n}", "function mergeSort (arr) {\n\tvar length = arr.length;\n//\tconsole.log(length);\n\n\tif (length == 1\t)\n\t\treturn arr;\n\t\n\tvar l1 = arr.slice(0,length/2);\n\tvar l2 = arr.slice(length/2,length);\n\tconsole.log(l1);\n\tconsole.log(l2);\n\tvar mergeResult = merge(mergeSort(l1), mergeSort(l2));\n\tshowLog(\"mergeResult=\", mergeResult);\n\treturn mergeResult;\n\t\n//\tshowLog(\"before merge\");\n//\tshowLog(\"l1=\", l1);\n//\tshowLog(\"l2=\", l2);\n//\treturn merge(l1,l2);\n//\t\n}", "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n let middle = Math.floor(arr.length / 2);\n let left = mergeSort(arr.slice(0, middle));\n let right = mergeSort(arr.slice(middle));\n return merge(left, right);\n}", "function mergeSort(arr) {\n function ms(arr) {\n if (arr.length == 1) {\n return arr;\n }\n\n let mid = Math.floor(arr.length / 2);\n\n let s1 = ms(arr.slice(0, mid));\n let s2 = ms(arr.slice(mid));\n\n return merge(s1, s2);\n }\n\n function merge(a, b) {\n let result = [];\n let l = 0,\n r = 0;\n while (l < a.length && r < b.length) {\n if (a[l] > b[r]) {\n result.push(b[r]);\n r++;\n } else {\n result.push(a[l]);\n l++;\n }\n }\n\n return result.concat(a.slice(l), b.slice(r));\n }\n\n return ms(arr);\n}", "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n\n let mid = Math.floor(arr.length / 2);\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n\n return merge(left, right);\n\n //mergeSort()\n}", "function mergeSortTopDown(arr,comp){\r\n return mergeSortRecurse(arr,comp,0,arr.length-1);\r\n}", "function mergeSort(a, cmp) {\n if (a.length < 2) {\n return a.slice();\n }\n function merge(a, b) {\n var r = [], ai = 0, bi = 0, i = 0;\n while (ai < a.length && bi < b.length) {\n if (cmp(a[ai], b[bi]) <= 0) {\n r[i++] = a[ai++];\n } else {\n r[i++] = b[bi++];\n }\n }\n if (ai < a.length) {\n r.push.apply(r, a.slice(ai));\n }\n if (bi < b.length) {\n r.push.apply(r, b.slice(bi));\n }\n return r;\n }\n return (function sort(a) {\n if (a.length <= 1) {\n return a;\n }\n var m = Math.floor(a.length / 2);\n var left = a.slice(0, m);\n var right = a.slice(m);\n left = sort(left);\n right = sort(right);\n return merge(left, right);\n })(a);\n}", "function mergeSort(a, cmp) {\n if (a.length < 2) {\n return a.slice();\n }\n function merge(a, b) {\n var r = [], ai = 0, bi = 0, i = 0;\n while (ai < a.length && bi < b.length) {\n if (cmp(a[ai], b[bi]) <= 0) {\n r[i++] = a[ai++];\n } else {\n r[i++] = b[bi++];\n }\n }\n if (ai < a.length) {\n r.push.apply(r, a.slice(ai));\n }\n if (bi < b.length) {\n r.push.apply(r, b.slice(bi));\n }\n return r;\n }\n return (function sort(a) {\n if (a.length <= 1) {\n return a;\n }\n var m = Math.floor(a.length / 2);\n var left = a.slice(0, m);\n var right = a.slice(m);\n left = sort(left);\n right = sort(right);\n return merge(left, right);\n })(a);\n}", "function mergeSort(a, cmp) {\n if (a.length < 2) {\n return a.slice();\n }\n function merge(a, b) {\n var r = [], ai = 0, bi = 0, i = 0;\n while (ai < a.length && bi < b.length) {\n if (cmp(a[ai], b[bi]) <= 0) {\n r[i++] = a[ai++];\n } else {\n r[i++] = b[bi++];\n }\n }\n if (ai < a.length) {\n r.push.apply(r, a.slice(ai));\n }\n if (bi < b.length) {\n r.push.apply(r, b.slice(bi));\n }\n return r;\n }\n return (function sort(a) {\n if (a.length <= 1) {\n return a;\n }\n var m = Math.floor(a.length / 2);\n var left = a.slice(0, m);\n var right = a.slice(m);\n left = sort(left);\n right = sort(right);\n return merge(left, right);\n })(a);\n}", "function mergeSort(arr) {\n if (arr.length < 2)\n return arr;\n \n var middle = parseInt(arr.length / 2);\n var left = arr.slice(0, middle);\n var right = arr.slice(middle, arr.length);\n \n return merge(mergeSort(left), mergeSort(right));\n }", "function mergesorted(a, b) {\n var r = [];\n while(a.length && b.length){\n if(a[0] < b[0]) r.push(a.shift());\n else r.push(b.shift());\n }\n return r.concat(a).concat(b);\n}", "function mergeSort(a) {\n let arr = [...a];\n // YOUR CODE HERE\n if (arr.length <= 1) {\n return arr;\n } else {\n let middleIndex = Math.floor(arr.length / 2);\n let left = arr.slice(0, middleIndex);\n let right = arr.slice(middleIndex, arr.length);\n\n let leftSorted = mergeSort(left);\n let rightSorted = mergeSort(right);\n\n //\n return merge(leftSorted, rightSorted);\n }\n }", "function mergesort(arr) {\n if (arr.length <= 1) return arr;\n\n let mid = Math.floor(arr.length / 2);\n \n let left = arr.slice(0, mid);\n let right = arr.slice(mid);\n \n let sortedLeft = mergesort(left);\n let sortedRight = mergesort(right);\n\n return merge(sortedLeft, sortedRight);\n}", "function mergeSort(array) {\n if (array.length < 2) {\n return array;\n }\n var mid = Math.floor(array.length / 2);\n var left = array.slice(0, mid);\n var right = array.slice(mid);\n\n return stitch(mergeSort(left), mergeSort(right));\n}", "function mergeSort(arr, start, end) {\n if (start >= end) return;\n let mid = Math.floor((start + end) / 2);\n mergeSort(arr, start, mid);\n mergeSort(arr, mid + 1, end);\n merge(arr, start, end, mid);\n}", "function merge_sort(array, start, end){\n\n if(start < end){\n var mid = Math.floor((start + end) / 2);\n \n console.log(start);\n merge_sort(array, start, mid);\n merge_sort(array, mid + 1, end);\n \n merge(array, start, mid, end);\n }\n}", "function mergesort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n\n let mid = Math.floor(arr.length / 2);\n let left = mergesort(arr.slice(0, mid));\n let right = mergesort(arr.slice(mid, arr.length));\n\n return merge(left, right);\n}", "function mergeSort(arr) {\n let length = arr.length;\n if (length === 1) return;\n\n let mid = length / 2;\n let left = arr.slice(0, mid);\n let right = arr.slice(mid, length);\n\n mergeSort(left);\n mergeSort(right);\n merge(arr, left, right);\n}", "function mergeSort(arr){\n var len = arr.length;\n if(len <2)\n return arr;\n var mid = Math.floor(len/2),\n left = arr.slice(0,mid),\n right =arr.slice(mid);\n //send left and right to the mergeSort to broke it down into pieces\n //then merge those\n return merge(mergeSort(left),mergeSort(right));\n}", "function mergeSort(arr) {\n\tconst length = arr.length\n\tif (length <= 1) return arr\n\n\tconst middle = Math.round(length / 2)\n\tconst left = arr.slice(0, middle)\n\tconst right = arr.slice(middle)\n\n\tconst sortedLeft = mergeSort(left)\n\tconst sortedRight = mergeSort(right)\n\n\treturn merge(sortedLeft, sortedRight)\n}", "function mergeSort(array) {\n if (array.length <= 1) return array;\n const mid = Math.floor(array.length / 2);\n const left = mergeSort(array.slice(0, mid));\n const right = mergeSort(array.slice(mid));\n return merge(left, right);\n}", "function mergeSort(array) {\n if (array.length < 2) return array;\n let middle = Math.floor(array.length/2);\n let left = array.slice(0, middle);\n let right = array.slice(middle);\n return merge(mergeSort(left), mergeSort(right));\n\n}", "function mergeSort(Arr, start, end) {\n\n\tif(start < end) {\n\t\tlet mid = (start + end) / 2;\n\t\tmergeSort(Arr, start, mid);\n\t\tmergeSort(Arr, mid+1, end);\n\t\tmerge(Arr, start, mid, end);\n\t}\n}", "function mergeSort(){\n\t\tvar array = getCommandLineVariables();\t\t\n\t\tvar\tdummyArray = undefined;\t\t\t\t\n\t\t\n\t\t// dividing the array into subarrays\n\t\tdivide(array);\n\t\tsort();\n\t\tconsole.log(\" Divided \",arrayOfArrays);\n\n\t\tdo{\n\t\t\tif(arrayOfArrays.length > 1){\n\t\t\t\tdummyArray = mergeAndSort(arrayOfArrays[0],arrayOfArrays[1]);\t\n\t\t\t\tarrayOfArrays = arrayOfArrays.slice(2,arrayOfArrays.length);\n\t\t\t\tarrayOfArrays.push(dummyArray);\n\t\t\t}\n\t\t\tconsole.log(\" Sorted \",arrayOfArrays);\t\n\t\t}while(arrayOfArrays.length > 1);\t\t\t\t\t\t\n\t}", "function mergeSort (arr) {\n // console.log('in mergesort', arr)\n if (arr.length === 1) {\n return arr;\n }\n // split the array into right and left\n const left = arr.splice(0, arr.length/2);\n const right = arr;\n\n return merge(\n mergeSort(left),\n mergeSort(right)\n );\n}", "function merge_sort(a, p, r){\n if(p<r){\n var q = parseInt((p+r)/2);\n merge_sort(a, p, q);\n merge_sort(a, q+1, r);\n merge(a,p,q,r);\n }\n return a;\n}", "function MergeSort(nums) {\n\tif (nums.length < 2) return nums;\n\n\tvar middle = Math.floor(nums.length / 2);\n\tvar left = nums.slice(0, middle);\n\tvar right = nums.slice(middle, nums.length);\n\n\treturn merge(MergeSort(left), MergeSort(right));\n}", "function mergeSort(array) {\n const sort = (array) => {\n if (array.length === 1) {\n return array\n }\n const middle = Math.floor(array.length / 2)\n const left = array.slice(0, middle)\n const right = array.slice(middle)\n return merge(\n sort(left),\n sort(right)\n )\n }\n const merge = (left, right) => {\n let result = []\n const leftLen = left.length\n const rightLen = right.length\n let l = 0\n let r = 0\n while (l < leftLen && r < rightLen) {\n if (left[l] < right[r]) {\n result.push(left[l])\n l++\n } else {\n result.push(right[r])\n r++\n }\n }\n return result.concat(left.slice(l)).concat(right.slice(r))\n }\n return sort(array)\n}", "function mergeSort(arr) {\n if(arr.length===1){\n return arr;\n }\n\n const center = Math.floor(arr.length/2);\n const left = arr.slice(0,center);\n const right = arr.slice(center,arr.length);\n\n return merge(mergeSort(left),mergeSort(right));\n}", "function mergeSort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n let middle = Math.floor(arr.length/2);\n let left = arr.slice(0, middle);\n let right = arr.slice(middle, arr.length);\n\n return merged(mergeSort(left), mergeSort(right));\n\n}", "function mergeSort(array) {\n //console.log(array)\n if (array.length <= 1) {\n return array;\n }\n \n const middle = Math.floor(array.length / 2);\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n \n left = mergeSort(left);\n right = mergeSort(right);\n \n return merge(left, right, array);\n }", "function mergeSort(A, left, right) {\n if (left >= right)\n return;\n\n let middle = Math.floor((left + right) / 2);\n\n mergeSort(A, left, middle);\n mergeSort(A, middle + 1, right);\n merge(A, left, middle, right);\n}", "function mergeSort (array) {\n if (array.length === 1) {\n return array\n }\n // Split Array in into right and left\n const length = array.length;\n const middle = Math.floor(length / 2)\n const left = array.slice(0, middle) \n const right = array.slice(middle)\n // console.log('left:', left);\n // console.log('right:', right);\n\n\n return merge( mergeSort(left), mergeSort(right) );\n}", "function sort(arr) {\n var aux = new Array(arr.length);\n mergeSort(arr, aux, 0, arr.length - 1);\n}", "function mergeSort(arr){\n let counter = 0;\n \n if(arr.length <= 1){\n return arr; \n }\n\n let middle = Math.floor(arr.length/2); \n let leftArr = arr.slice(0, middle); \n let rightArr = arr.slice(middle,arr.length); \n counter+=1; \n leftArr = mergeSort(leftArr); \n rightArr = mergeSort(rightArr); \n\n return merge(leftArr, rightArr, arr, counter); \n\n}", "function mergeSort(array) {\n if (array.length <= 1) {\n return array;\n }\n\n const middle = Math.floor(array.length / 2);\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n\n left = mergeSort(left);\n right = mergeSort(right);\n return merge(left, right, array);\n}", "function mergeSort (arr) {\n if (arr.length < 2) {\n // return once we hit an array with a single item\n return arr;\n }\n \n const middle = Math.floor(arr.length / 2) // get the middle item of the array rounded down\n const left = arr.slice(0, middle) // items on the left side\n const right = arr.slice(middle) // items on the right side\n \n return merge(\n mergeSort(left),\n mergeSort(right)\n )\n}", "sort() {\n\t}", "sort() {\n\t}", "function mergeSort(arr) {\n if ( arr.length < 2) {\n return arr;\n }\n\n const middle = Math.floor(arr.length / 2);\n const left = arr.slice(0, middle);\n const right = arr.slice(middle);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort(data)\n{\n if(data.length == 1 ) return data;\n\n var mid = data.length / 2;\n var left = data.slice(0, mid);\n var right = data.slice(mid);\n\n left = mergeSort(left);\n right = mergeSort(right);\n\n return merge(left, right);\n}", "function mergeSort(array) {\n if (array.length <= 1) {\n return array;\n }\n\n const middle = Math.floor(array.length / 2);\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n\n left = mergeSort(left);\n right = mergeSort(right);\n return merge(left, right, array);\n}", "function mergeSort(nums) {\n\n var length = nums.length,\n m,\n left,\n right;\n\n if (length < 2) {\n return nums;\n }\n\n m = Math.ceil(length / 2);\n left = nums.slice(0, m);\n right = nums.slice(m, length);\n\n return mergeLists(mergeSort(left), mergeSort(right));\n }", "mergeSort(arr, l, r) { \n if (l < r){\n let m = Math.floor(l + (r - l) / 2)\n \n // # Sort first and second halves \n this.mergeSort(arr, l, m); \n this.mergeSort(arr, m + 1, r);\n l = 0 \n tStack.add([...arr])\n this.merge(arr, l, m, r); \n }\n }", "function mergeSort(array) { // divides the array into a subset of arrays with 1 el each, then calls merge\n if (array.length <= 1) {\n return array;\n }\n\n const middle = Math.floor(array.length / 2);\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n \n left = mergeSort(left);\n right = mergeSort(right);\n return merge(left, right, array);\n}", "function mergeSort(arr) {\n if(arr.length <= 1) {\n return arr;\n }\n // Find the mid point (so we can split the given array into two parts)\n let mid = Math.floor(arr.length / 2);\n // Split the array into two parts\n let left = mergeSort(arr.slice(0, mid));\n let right = mergeSort(arr.slice(mid));\n // Compare each element in the two arrays and merge them in sorted order (by calling our merge() helper function)\n return merge(left, right);\n}", "function mergeSort(arr, start, end, result) {\n if(start == end) return;\n const mid = (start + end) / 2 | 0;\n mergeSort(arr, start, mid, result);\n mergeSort(arr, mid + 1, end, result);\n merge(arr, start, end, result);\n}", "function mergeSort (arr, descending=false) {\n if (arr.length == 1) return arr;\n //if there's only two value around we can't return 0 to the divider, that produce a 0 which aren't really hekoting \n let divider = arr.length >> 1 | 0;\n if (divider == 0) divider++;\n //dividing the array to two parts\n let left = mergeSort(arr.splice(0, divider), descending);\n arr = mergeSort(arr, descending);\n //using recursion to continously dividing the array\n return merge (left, arr, descending);\n}", "function mergeSort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n\n const center = Math.floor(arr.length / 2);\n const left = arr.slice(0, center);\n const right = arr.slice(center);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort(array) {\n // 배열 길이가 0 또는 1이면, 배열 자체를 반환해 재귀호출을 끝낸다.\n if (array.length <= 1) {\n return array;\n } \n\n const middle = Math.floor(array.length / 2);\n // 왼쪽, 오른쪽 절반에 대해 mergeSort를 재귀호출한다. - O(logN)\n const left = mergeSort(array.slice(0, middle)); \n const right = mergeSort(array.slice(middle));\n\n // merge를 호출해 부분 배열을 정렬하며 합병한다.\n return merge(left, right);\n}", "function mergeSort(list) {\n if (!Array.isArray(list)) {\n throw new TypeError('You can only sort an Array!');\n }\n\n // If our list holds only one item (or none), then it's already sorted\n // This is also our base case\n if (list.length < 2) {\n return list;\n }\n\n // Now we can choose the pivot element and split the list into\n // the left half and the right half\n let pivotIdx = Math.floor(list.length / 2);\n let left = list.slice(0, pivotIdx);\n let right = list.slice(pivotIdx);\n\n // At this point, we need to merge the two lists\n // while sorting the items in each\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort(arr) {\n // check if array length is less than 2\n if (arr.length < 2) {\n console.log('in merge sort if', arr)\n return arr;\n }\n // get mid point and call merge sort on each sub array\n let mid = Math.floor(arr.length/2);\n let left = arr.slice(0, mid);\n let right = arr.slice(mid);\n console.log('left', left)\n console.log('right', right)\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort (arr) {\n if (arr.length === 1) {\n // return once we hit an array with a single item\n return arr\n }\n\n var middle = Math.floor(arr.length / 2) // get the middle item of the array rounded down\n var left = arr.slice(0, middle) // items on the left side\n var right = arr.slice(middle) // items on the right side\n\n return merge(\n mergeSort(left),\n mergeSort(right)\n )\n}", "function mergeSort(a, cmp) {\n\t if (a.length < 2) {\n\t return a.slice();\n\t }\n\t function merge(a, b) {\n\t var r = [], ai = 0, bi = 0, i = 0;\n\t while (ai < a.length && bi < b.length) {\n\t if (cmp(a[ai], b[bi]) <= 0) {\n\t r[i++] = a[ai++];\n\t } else {\n\t r[i++] = b[bi++];\n\t }\n\t }\n\t if (ai < a.length) {\n\t r.push.apply(r, a.slice(ai));\n\t }\n\t if (bi < b.length) {\n\t r.push.apply(r, b.slice(bi));\n\t }\n\t return r;\n\t }\n\t return (function sort(a) {\n\t if (a.length <= 1) {\n\t return a;\n\t }\n\t var m = Math.floor(a.length / 2);\n\t var left = a.slice(0, m);\n\t var right = a.slice(m);\n\t left = sort(left);\n\t right = sort(right);\n\t return merge(left, right);\n\t })(a);\n\t}", "function mergeSort(nums, lo, hi) {\r\n if (lo >= hi) return;\r\n let mid = Math.floor((lo + hi) / 2);\r\n mergeSort(nums, lo, mid);\r\n mergeSort(nums, mid + 1, hi);\r\n merge(nums, lo, mid, hi);\r\n}", "function mergeSort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n let middle = Math.floor(arr.length / 2);\n let leftArr = arr.slice(0, middle);\n let rightArr = arr.slice(middle, arr.length);\n console.log(\"middle: \", middle);\n console.log(\"leftArr: \", leftArr);\n console.log(\"rightArr: \", rightArr);\n return merge(mergeSort(leftArr), mergeSort(rightArr));\n}", "function mergeSort(arr){\n if(arr.length <= 1){\n return arr;\n }else{\n let firstHalf = arr.slice(0, Math.floor(arr.length/2));\n let secondHalf = arr.slice(Math.floor(arr.length/2),arr.length);\n return merge(mergeSort(firstHalf),mergeSort(secondHalf));\n }\n\n\n}", "function mergeSort(array){\n if(array.length < 2){\n return array;\n }\n var middle = Math.floor(array.length/2);\n var left = mergeSort(array.slice(0,middle));\n var right = mergeSort(array.slice(middle, array.length));\n var i = 0;\n var j = 0;\n var output = [];\n while(i < left.length && j < right.length){\n if(left[i] <= right[j]){\n output.push(left[i]);\n i++;\n } else {\n output.push(right[j]);\n j++;\n }\n }\n if(i >= left.length){\n output = output.concat(right.slice(j));\n } else if (j >= right.length) {\n output = output.concat(left.slice(i));\n }\n return output;\n }", "sort(){\n\n }", "function jsMergeSort(arr) {\n console.log('arr.length: ', arr.length)\n if (arr.length <= 1) {\n return arr\n } else {\n // compute midpoint: \n let midpoint = Math.floor(arr.length/ 2);\n let leftHalf = jsMergeSort(arr.slice(0,midpoint));\n let rightHalf = jsMergeSort(arr.slice(midpoint));\n\n let newList = mergeSortedLists(leftHalf, rightHalf);\n console.log('newList: ', newList)\n return newList\n }\n}", "function mergeSort(array) {\n\n //base case\n if (array.length <= 1) {\n return array;\n }\n\n const middle = Math.floor(array.length /2);\n //middle is included in the left side\n let left = array.slice(0, middle);\n let right = array.slice(middle, array.length);\n\n left = mergeSort(left);\n right = mergeSort(right);\n return merge(left, right, array);\n}", "function merge(a, b) {\n var sorted = [], indexA = 0, indexB = 0;\n while (indexA < a.length && indexB < b.length) {\n if (sortFn(a[indexA], b[indexB]) > 0) {\n sorted.push(b[indexB++]);\n } else {\n sorted.push(a[indexA++]);\n }\n }\n if (indexB < b.length) {\n sorted = sorted.concat(b.slice(indexB));\n } else {\n sorted = sorted.concat(a.slice(indexA));\n }\n return sorted;\n}", "function mergeSort(array) {\n if (array.length === 1) {\n // Return once we hit an array with a single item\n return array;\n }\n\n // Get the middle item of the array rounded down by creating a variable\n const middle = Math.floor(array.length / 2);\n // Create a variable for the items on the left side\n const left = array.slice(0, middle);\n // Create a variable for the items on the right side\n const right = array.slice(middle);\n\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort(seq) {\n let n = seq.length;\n let tmpArray = new Array(n);\n recMergeSort(seq, 0, n-1, tmpArray);\n\n return seq\n}", "function mergeSort (array) {\n if (array.length <= 1) {\n return array\n }\n let middle = (Math.floor(array.length/2))\n let leftSide = array.slice(0, middle)\n let rightSide = array.slice(middle)\n\n return merge(mergeSort(leftSide), mergeSort(rightSide))\n}", "function cheaterMerge(arr1, arr2){\n let merged = arr1.concat(arr2)\n return merged.sort(function(a, b){return a-b});\n}", "mergeSort(){\n if(this.length() > 1){\n let mid = traverseIndex(this.length()/2);\n let L = arr.slice(0,mid-1);\n let R = arr.slice(mid);\n\n this.mergeSort(L);\n this.mergeSort(R);\n\n i = j = k = 0;\n\n while( i < ){\n\n }\n }\n }", "function msort(l){\r\n return mergesort(compare, l);\r\n}", "function merge(arr1, arr2) {\n let merged = [...arr1, ...arr2];\n return merged.sort((a, b) => a - b);\n}", "function mergeSort(node1, node2) {\n // write your code here\n \n let n= node1.concat(node2);\n n.sort(function(a, b){return a - b});\n return n\n \n }", "function merge(arr1, arr2) {\n for (let i=0; i<arr2.length; i++) {\n arr1.push(arr2[i])\n }\n return arr1.sort((a,b) => a - b)\n}", "function mergeSort(a, aux, lo, hi) {\n if (hi <= lo) return;\n var mid = Math.floor(lo + (hi - lo) / 2);\n mergeSort(a, aux, lo, mid);\n mergeSort(a, aux, mid + 1, hi);\n merge(a, aux, lo, mid, hi);\n}", "function mergeSortArray(arr1, arr2) {\n return arr1.concat(arr2).sort((x, z) => x- z);\n}", "function mergeSort(arr) {\n if (arr.length <= 1) return arr;\n\n const halfArrLen = Math.floor(arr.length / 2);\n const sortedHalf1 = mergeSort(arr.slice(0, halfArrLen));\n const sortedHalf2 = mergeSort(arr.slice(halfArrLen));\n console.log(sortedHalf1, sortedHalf2);\n\n return mergeTwoSortedArrays(sortedHalf1, sortedHalf2);\n}", "function mergeSort(start, end, input) {\n if (start === end) {\n return [input[start]];\n }\n\n let middleElement = Math.floor((start + end) / 2);\n let left = mergeSort(start, middleElement, input);\n let right = mergeSort(middleElement + 1, end, input);\n let mergedList = merge(left, start, right, end);\n return mergedList;\n}", "function mergeSort(array) {\n if (array.length <= 1) {\n return array;\n }\n let i = Math.floor(array.length / 2);\n let lHalf = array.slice(0, i);\n let rHalf = array.slice(i);\n return merge(mergeSort(lHalf), mergeSort(rHalf));\n}", "function mergeSort(arr){\n if(arr.length <= 1) return arr; // return a single element or no element depending on odd or even length\n let mid = Math.floor(arr.length/2); // cut the arr in half\n let left = mergeSort(arr.slice(0,mid)); // slice array from 0 to mid exclusive by second parameter, this will recursively call itself and slice itself even more\n let right = mergeSort(arr.slice(mid)); // sort right side of sliced array\n return merge(left, right); // sort the sliced arrays and return results until the very first stack frame\n}", "function mergeSort(arr) {\n if (arr.length < 2) return arr;\n var middleIndex = Math.floor(arr.length / 2);\n var firstHalf = arr.slice(0, middleIndex);\n var secondHalf = arr.slice(middleIndex);\n return merge(mergeSort(firstHalf), mergeSort(secondHalf));\n}", "function mergeSort(arr){\n if (arr.length<2) return arr\n var middleIndex = Math.floor(arr.length/2)\n var firstHalf = arr.slice(0, middleIndex)\n var secondHalf = arr.slice(middleIndex)\n\n return merge(mergeSort(firstHalf), mergeSort(secondHalf))\n}", "function mergeSort(array, copy, low, hi) {\n if(hi <= low) { return }\n var mid = Math.floor(low + (hi - low) / 2)\n mergeSort(array, copy, low, mid)\n mergeSort(array, copy, mid+1, hi)\n merge(array, copy, low, mid, hi)\n}", "function mergeSort(items){\n\t\tif (items.length < 2) {\n\t\t\treturn items;\n\t\t}\n\n\t\tvar middle = Math.floor(items.length / 2),\n\t\t\tleft = items.slice(0, middle),\n\t\t\tright = items.slice(middle);\n\n\t\treturn merge(mergeSort(left), mergeSort(right));\n\t}", "function merge(left, right) {\n if (left[0] < right[0]) {\n mergeArr.push(left[0])\n left.shift()\n }else {\n mergeArr.push(right[0])\n right.shift()\n }\n}", "function Sort() {}", "function mergeSort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n const middleIdx = Math.trunc(arr.length / 2);\n const leftHalf = mergeSort(arr.slice(0, middleIdx));\n const rightHalf = mergeSort(arr.slice(middleIdx));\n return merge(leftHalf, rightHalf);\n}", "function mergeSort(arr) {\n let result = [];\n ///base case\n if (arr.length === 1 || arr.length === 0) {\n return arr;\n }\n\n for (let i = 0; i < arr.length; i++) {\n let e = arr[i];\n\n if (Array.isArray(e)) {\n result = merge(result, e);\n } else {\n result.push(e);\n }\n console.log(result);\n }\n}", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function mergeSort(arr) {\n if (arr.length === 1) {\n return arr;\n }\n // divided arr into two\n const center = Math.floor(arr.length / 2); // mergeSort1 [9, 5, 3, 10] // mergeSort1 [9, 5] [3, 10]\n const left = arr.slice(0, center); // Left1 [9, 5] // left2 [9] [3]\n const right = arr.slice(center); // right1 [3, 10] // right2 [5] [10]\n // recursion \n // passing Left1 && Right1 then recurse\n // pasing Left2 && Right2 then recurse then length === 1\n // call merge function\n return merge(mergeSort(left), mergeSort(right));\n}", "function mergeSort(left, right) {\n // get a empty array for sorting purposes\n // starting left index variable\n // starting right index variable\n \n // while left index is less than left array length &&\n // right index is less than right array length \n \n // if left index value is lesser than right index, push left index value and increase left index \n \n // else push right index value and increase right index \n \n // combine sorted array with left over of left array and right array\n // return sortedArr;\n }", "function mergeSort(array, result = []) {\r\n if (array.length === 1) {\r\n if (array[0] > result[0]) {\r\n result.push(array[0]);\r\n } else result.unshift(array[0]);\r\n return result;\r\n }\r\n\r\n if (result.length === 0) {\r\n result.push(array[0]);\r\n }\r\n if (array[0] > result[0]) {\r\n //this if statement always runs for some reason\r\n result.push(array[0]);\r\n }\r\n if (result[0] > array[0]) {\r\n result.unshift(array[0]);\r\n }\r\n\r\n return mergeSort(array.slice(1), result);\r\n}" ]
[ "0.7887811", "0.78599733", "0.7670436", "0.7489469", "0.7483916", "0.73698163", "0.73154885", "0.7314436", "0.73112303", "0.72838956", "0.72726995", "0.7258133", "0.72579366", "0.7239169", "0.72365785", "0.72273886", "0.7225877", "0.7216468", "0.72042763", "0.72042763", "0.72042763", "0.7182062", "0.71556914", "0.71532166", "0.7142458", "0.7140019", "0.71329856", "0.7131208", "0.712838", "0.7111039", "0.7110955", "0.71102446", "0.7106808", "0.7106072", "0.7101458", "0.7091032", "0.7089082", "0.70858204", "0.7061969", "0.7061213", "0.70515615", "0.7039317", "0.70175666", "0.70158625", "0.70054114", "0.6990041", "0.69765466", "0.6971542", "0.6970581", "0.69655454", "0.69655454", "0.69483525", "0.6941855", "0.6936265", "0.693478", "0.69213504", "0.69183403", "0.6909367", "0.68974864", "0.68917626", "0.6891609", "0.6890338", "0.68884957", "0.6878242", "0.68772095", "0.686932", "0.68661386", "0.6855601", "0.6855546", "0.6853134", "0.68480885", "0.6835558", "0.68256295", "0.68062794", "0.6805626", "0.68025064", "0.6778915", "0.67731756", "0.6772788", "0.677131", "0.6765816", "0.67588115", "0.67564446", "0.6754665", "0.6748991", "0.67473865", "0.6746099", "0.674323", "0.6733131", "0.6719195", "0.67170405", "0.6714311", "0.6713601", "0.6703352", "0.66996664", "0.66961825", "0.66718215", "0.66631144", "0.6660592", "0.6660011", "0.665434" ]
0.0
-1
Complete the digitSum function below.
function superDigit(n, k) { if (n.length == 1 && k == 1) { return parseInt(n); } let sum = 0; for (let i = 0; i < n.length; i++) { sum += parseInt(n[i]) * k; } return superDigit(sum.toString(), 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumAllDigits(numberList) {\n if (!Array.isArray(numberList) || numberList.length === 0) return 0;\n let sum = 0;\n // numberList.forEach((x) => {\n // for (let index = 0; index < x.toString().length; index++) {\n // sum += +x.toString()[index];\n // }\n // });\n return numberList.reduce((acc, x) => {\n for (let i = 0; i < x.toString().length; i++) {\n acc += +x.toString()[i];\n }\n return acc;\n }, 0);\n // return sum;\n}", "function digitSum(num1) {\n\tvar num = 42;\n\treturn num1 * num;\n}", "function digitalSum(n) {\n if (Math.floor(n / 10) == 0) {\n return n;\n }\n \n return n%10+digitalSum(Math.floor(n/10))\n}", "function digitEater(num) {\n \n //the global var numString gets assigned to a string of argument (644 in this case) \n numString = num.toString();\n numArr = [];\n //iterate through the string numString & push each value into the global var numArr\n for (var i = 0; i < numString.length; i++) {\n numArr.push(numString[i]);\n }\n //console.log(\"before: \" + numArr);\n\n //iterate through numArr & turn each index [6,4,4] from a string back into an integer\n for (var i = 0; i < numArr.length; i++) {\n numArr[i] = parseInt(numArr[i]);\n }\n //console.log(\"after: \" + numArr);\n \n //assign global variable sum equal to zero so that if we pass this\n sum = 0;\n for (var i = 0; i < numArr.length; i++) {\n sum += numArr[i]; \n };\n //console.log(\"Sum: \" + sum);\n numString = sum.toString();\n //console.log(\"numString length: \" + numString.length);\n //console.log(\"NumString: \" + numString);\n if (numString.length > 1) {\n digitEater(sum); \n }\n \n else {\n console.log(sum); \n }\n}", "function sumDigits(num)\n{\n// declaring variable for array and setting it equal to and array of the letters\n var arr = num.toString().split(\"\");\n\n// initialize the sum\n var sum = 0;\n// for loop that adds the digits\n for(var i = 0; i<arr.length; i++) {\n // add each digit to the sum of previous digits\n\t sum = sum + parseInt(arr[i]);\n }\nreturn sum;\n}", "function digitalSum(n) {\n var total = \" \"\n if (n === 0) {\n return \"Done!\";\n } else {\n console.log(n);\n //return n - digitalSum(n % 10);\n }\n}", "function sumDigits(n) {\n let l = n.length,\n sum = 0;\n for (let i = 0; i < l; i++) {\n const c = n.charCodeAt(i);\n if (c < 58) {\n sum += +n[i];\n continue;\n }\n if (c < 91) {\n sum += c - 55;\n continue;\n }\n sum += c - 87;\n }\n return sum;\n}", "function sumDigits(n) {\n return n.split(\"\").reduce((prev, curr) => {\n const c = curr.charCodeAt(0);\n return prev + (c < 58 ? +curr : c < 91 ? c - 55 : c - 87);\n }, 0);\n}", "function sumDigits(num) {\n\n var total = 0;\n var str = num.toString();\n\n for(i = 0; i < str.length; i = i + 1) {\n\n console.log(str.substring(i,i+1))\n total = total + parseInt(str.substring(i,i+1));\n\n }\n\n\n console.log(total);\n return total;\n\n}", "function digitSum(st)\n {\n let sum = 0;\n for(let i = 0; i<st.length; i++)\n {\n sum+=Number(st.charAt(i));\n }\n return sum.toString();\n\n }", "function summation(num) {}", "function digitSum (str) {\n if (str.length === 1) { return str; }\n else {\n let out = str;\n do {\n out = (out+'').split('').map(el => +el).reduce((a, b) => a + b);\n } while ((out+'').length > 1);\n return out+'';\n }\n}", "function plainSum(num){\n return num;\n}", "function calcSumOfDigit(num){\r\n if (num < 10) \r\n return num;\r\n\r\n return Math.floor(calcSumOfDigit(num % 10 + calcSumOfDigit(num / 10))); \r\n}", "function digital_root(n) {\n let digit1 = n,\n root=0;\n\n for(let i=0;i<digit1.length;i++){\n root+=digit1[i]\n }\n if(digit1.length>1){\n }\n return root\n // add upthe digits of n\n // if length of the sum is greater than 1, add the digits of that\n}", "function missingNumberSum(numbers) {}", "function sumDigits(num) {\n let sum = 0;\n let numHolder = num.toString().split('').map((i) => { return Number(i); });\n for (let i = 0; i < numHolder.length; i++) {\n sum += numHolder[i];\n }\n return sum;\n}", "function calculate_sum(num, res) {\n if (res !== undefined && res.toString().length === 1) {\n return res;\n }\n let tmp = num.toString();\n let sum = 0;\n for (let i = 0; i < tmp.length; i++) {\n sum += +tmp[i];\n }\n if (sum >= 10) {\n return calculate_sum(sum);\n }\n return calculate_sum(num, sum);\n}", "function sum_digits(number){\n sum = 0;\n let num_to_str = number.toString();\n for(var char of num_to_str){\n sum += parseInt(char)\n }\n console.log(sum)\n}", "function sumDigits(digitosASumar) {\n let sumaDigitos\n // se convierte el numero a string\n numeroAString = digitosASumar.toString() \n // se convierte el string a array\n sumaDigitos = numeroAString.split(\"\") \n let cajaTemporal = 0\n for (i = 0 ; i < sumaDigitos.length ; i++) {\n // se convierte cada elementos del array a numero\n digitoQueSeSuma = Number(sumaDigitos[i])\n cajaTemporal += digitoQueSeSuma\n }\n sumaDigitos = cajaTemporal\n return sumaDigitos\n}", "function factorialDigitSum(n) {\n\n function sum(a, b) {\n return parseInt(a) + parseInt(b);\n }\n\n return commons\n .factorial(n)\n .toString()\n .split('')\n .reduce(sum, 0);\n}", "function powerDigitSum(exponent) {\n // // ------------------------------------------------------------------------------------------------------------\n // // ------ a cheat for FCC... xD ---- (FCC always tells me that my code isn't fast and efficient enough...) ----\n // // ------------------------------------------------------------------------------------------------------------\n // if (exponent == 128){ // the reason for this cheat is the rounding errors described in the comments above\n // return 166\n // }\n // if (exponent == 1000){\n // return 1366\n // }\n // // ------------------------------------------------------------------------------------------------------------\n // // --------- end of FCC cheat ---------------------------------------------------------------------------------\n // // ------------------------------------------------------------------------------------------------------------\n let digitsArray = [];\n\n let twoToExponent = 2**exponent // first calculate the power of two\n\n let sumOfDigits = 0;\n let i = 1;\n console.log(\"Starting with \" + twoToExponent);\n\n while (2**exponent > 10**(i-1)){\n\n let currentDigit = Math.floor((2**exponent % 10**i)/10**(i-1))\n // console.log(\"With i=\"+i+\"\\tWe got digit \" + currentDigit);\n\n sumOfDigits = sumOfDigits + currentDigit;\n // console.log(\"\\t\\tSo far the sum is \" + sumOfDigits)\n\n digitsArray.unshift(currentDigit);\n // console.log(\"\\t\\t\"+digitsArray)\n i++;\n }\n\n console.log(\"The sum of digits in 2^\" + exponent + \" (which equals \" + 2**exponent + \") is \" + sumOfDigits + \"\\n\");\n return sumOfDigits;\n}", "function sumDigits1(n){\n if(n < 10)\n return n;\n if(n > 1)\n let n1 = n % 10;\n let n2 = Math.floor(n/ 10);\n return n1 + sumDigits1(n2);\n}", "function sumOfDigits(num){\n var sum = 0;\n var newString = num.toString();\n for(i = 0; i <= newString.length - 1; i++){\n sum += parseInt(newString[i]);\n }\n \n return sum;\n}", "function sumOfDigits(n) {\n var digit = 0,\n sum = 0;\n while (n != 0) {\n digit = n % 10;\n sum += digit;\n n = parseInt(n / 10);\n }\n return sum;\n}", "function passANumber(digit) {\n\n\tlet idButton='num'+digit;\n\tanimateButtons(idButton);\n\n\tif(resText=='ans'){\n\t\tresText=\"\";\n\t\tresNum=0;\n\t\tans=numberInstMemo;\n\t\tnumberInstMemo=0;\n\t\tv='f';\n\t\tdocument.getElementById(\"resNum\").innerHTML = 0;\n\t\tprevTypeOperator='sum';\n\n\t}\n\n\t\n\tif(v=='v'){\n\t\tdv=dv/10;\n\t\tnumberInstMemo=numberInstMemo;\n\t\tnumberInstMemo=digit*dv+numberInstMemo;\n\n\t\tresText=resText+\"\"+digit;\n\t\td=1;\n\t}else{\n\t\tnumberInstMemo=numberInstMemo*10;\n\t\tnumberInstMemo=digit+numberInstMemo;\n\n\t\tresText=resText+\"\"+digit;\n\t\td=1;\n\t}\n\n\tdocument.getElementById(\"resText\").innerHTML = resText;\n\t\n\n}", "function sumOfDigits(n) {\n var sum = 0;\n\n while (n > 0) {\n var digit = n % 10;\n sum = sum + digit;\n n = parseInt(n / 10);\n }\n \n return sum;\n}", "function sumofDigit(num) {\n let sum = 0;\n\n while (num) {\n let digit = num % 10;\n\n sum = sum + digit;\n\n num = (num - digit) / 10;\n }\n\n return sum;\n}", "function sumNumbers(sumArray) {\n\n}", "function factorialDigitSum(n) {\n var num = (\"\" + n).split(\"\").map((numStr) => +numStr);\n\n function multiply(x) {\n var carry = 0;\n for (let i = num.length - 1; i >= 0; i--) {\n var newDigit = num[i] * x + carry;\n num[i] = newDigit % 10;\n carry = Math.floor(newDigit / 10);\n }\n while (carry > 0) {\n num.unshift(carry % 10);\n carry = Math.floor(carry / 10);\n }\n }\n\n for (let i = n - 1; i > 0; i--) {\n multiply(i);\n }\n return num.reduce((sum, digit) => sum + digit);\n}", "function sumToOneDigit(num) {\r\n if (isNaN(num) == true) {\r\n return NaN\r\n }\r\n if (num < 10) {\r\n return num\r\n }\r\n\r\n var newStr = num.toString();\r\n var newList = newStr.split('');\r\n var sum = 0\r\n\r\n for (value of newList) {\r\n sum = sum + parseInt(value);\r\n }\r\n return sumToOneDigit(sum);\r\n}", "function sumNumbers() {\n let all = 0;\n for (let i = 0; i < arguments.length; ++i) {\n all += arguments[i];\n }\n return all;\n}", "function addDigits(num1) {\n\n var holder;\n var sum;\n\n //check that number is positive, two digits, and integer\n if (((num1 < 0) || (num1 > 99)) || (num1 % 1 !== 0)) {\n console.log(\"Requirements are not met. Function stops here.\")\n } else {\n stringNum = num1.toString()\n firstNum = stringNum[0]\n lastNum = stringNum[1]\n sum = Number(firstNum) + Number(lastNum)\n console.log(num1 + \" can be reduced to \" + sum)\n\n \n }\n}", "function sumArr(nums) {\n // algorithm here\n}", "function factorialDigitSum(n) {\n var result = bigInteger(1);\n var sum, i;\n for (i = 2; i <= n; i++) {\n result.multiply(i);\n }\n result.finish();\n return result.sum();\n}", "function digitsfunc(num, func){\n\tnumnum = parseInt(num)\n\tnumlength = Math.floor(Math.log10(numnum))+1;\n\n\tvar digits = num.toString().split('');\n\tvar realDigits = digits.map(Number)\n\n\tfor(var i=1; i < numlength; i++){\n\t\tif(func == `+`)\n\t\tdigits[0] = parseInt(digits[0]) + parseInt(digits[i])\n\t\tif(func == `-`)\n\t\tdigits[0] = parseInt(digits[0]) - parseInt(digits[i])\n\t\tif(func == `*`)\n\t\tdigits[0] = parseInt(digits[0]) * parseInt(digits[i])\n\t\tif(func == `/`)\n\t\tdigits[0] = parseInt(digits[0]) / parseInt(digits[i])\t\n\t}\n\tconsole.log(\"Sum of digits: \" + digits[0])\n}", "function reduce(n) {\n var str = n.toString();\n let digitList = [];\n let sum;\n for (var i = 0; i <= str.length - 1; i++) {\n digitList.push(parseInt(str[i]));\n }\n sum = digitList.reduce((a, c) => a + c);\n str = sum.toString();\n do {\n digitList.length = 0;\n for (var i = 0; i <= str.length - 1; i++) {\n digitList.push(parseInt(str[i]));\n }\n sum = digitList.reduce((a, c) => a + c);\n str = sum.toString();\n } while (sum >= 10);\n return sum;\n}", "function sum() {\n // FILL THIS IN\n var n = 0;\n for(i = 0; i < arguments.length; i++){\n n += arguments[i];\n }\n\n return n;\n }", "function addAll(...num){\n\n let total = 0;\n\n\n num.forEach(digit => total += digit\n )\n\n return total\n\n\n}", "function sumDigitsFactorial(n) {\n let currentDigit = 3\n let currentFactorial = [2]\n while (currentDigit < n + 1) {\n multiplier = Array.from(currentDigit.toString()).map(i => parseInt(i))\n currentFactorial = multiplyTwoBigNumbers(currentFactorial, multiplier)\n currentDigit++\n }\n return sumDigits(currentFactorial)\n}", "function summing(d)\n {\n var carry = 0;\n for (var i = 0; i < Sum.length; i++)\n {\n var sum = (Sum[i] & 0xff) + (d[i] & 0xff) + carry;\n\n Sum[i] = sum;\n\n carry = sum >>> 8;\n }\n }", "function sumOfDigits(num) {\n var sum = 0;\n var numArray = num.toString().split('');\n\n for (var i = 0; i < numArray.length; i++) {\n var number = Number(numArray[i]);\n sum += number;\n }\n\n return sum;\n}", "function randomOne(){\n\tvar rdmNum = (Math.floor(Math.random() * (9999 - 1000)) + 1000).toString();\n\tconsole.log(rdmNum)\n\tvar rdmNumDigits = rdmNum.split(\"\");\n\tconsole.log(rdmNumDigits)\n\tvar sum=0;\n for (var i=0; i<rdmNumDigits.length; i++) {\n sum = Number(sum) + Number(rdmNumDigits[i]);\n console.log(rdmNumDigits[i])\n console.log(sum)\n } \n sum = sum.toString()\n rdmNumDigits = sum.split(\"\");\n console.log(rdmNumDigits)\n sum2=0;\n if (rdmNumDigits.length>1){\n \tfor (var i=0; i<rdmNumDigits.length; i++) {\n sum2 = Number(sum2) + Number(rdmNumDigits[i]);\n console.log(rdmNumDigits[i])\n console.log(sum2)\n console.log(\"suma final \" + sum2)\n }\n}return sum2\n}", "function increaseDigits(digitString, targetSum) {\n let numbers = '0123456789';\n let digitArray = digitString.split('');\n let currentSum = sum(digitString);\n let difference = targetSum - currentSum; //'118 -> '127' -> '136' -> '145' -> '226' -> '235' -> 244' -> '334'\n let last = digitArray.length - 1;\n while (last > 0) {\n if (!difference) {\n if (digitArray[last] >= digitArray[last - 1] + 2 && digitArray[last - 1] < 9) {\n digitArray[last] -= 1;\n digitArray[last - 1] = numbers[numbers.indexOf(digitArray[last - 1]) + 1];\n last -= 1;\n }\n }\n if (difference < 10 - digitArray[last]) {\n digitArray[last] = numbers[numbers.indexOf(digitArray[last]) + difference];\n }\n }\n \n return digitArray.join(''); //returns a string\n}", "function superDigit(n, k) {\n let numSplit = n.toString().split(\"\")\n // let adder = n.toString().split(\"\")\n // let repeat = k * numSplit.length\n // while (numSplit.length < repeat ) {\n // numSplit = numSplit.concat(adder)\n // }\n let val = numSplit.reduce((a, b) => parseInt(a) + parseInt(b))\n val = val * k\n return (val.toString().length === 1 ? val : superDigit(val, 1))\n\n}", "function sumOfDigits(num) {\n\tvar numTotal = 0;\n\t\n\twhile(num > 0) {\n\t\tnumTotal += num % 10; \n\t\tnum = Math.floor(num/10); // get rid of the modulo each time the number loops\n\t}\n\treturn numTotal; \n}", "function sum() {\n return mid + final;\n}", "function sum() {\n\n if(arguments.length == 0 ) return '0';\n\n var maxlen = 0;\n\n for(var i = 0; i < arguments.length; i++ ) {\n if(arguments[i].toString().length > maxlen)\n maxlen = arguments[i].toString().length;\n }\n\n var arr = new Array(maxlen+1).fill(0);\n\n for(var i = 0; i < arguments.length; i++ ) {\n var reversed = arguments[i].toString().split('').reverse();\n for( var j = 0; j < reversed.length; j++) {\n var sum = arr[j] + Number(reversed[j]);\n arr[j] = sum % 10;\n if( sum >= 10 )\n arr[j+1] += 1;\n }\n\n }\n\n var result = arr.reverse().join('');\n if( Number(result) != 0 ) {\n result = result.replace(/^0+/, '');\n }\n else {\n result = '0';\n }\n\n return result;\n}", "function sumDigits(n) {\n var sum = 0;\n var absNumber = Math.abs(n);\n var numberArr = String(absNumber).split('').map(function(t) {\n return Number(t);\n });\n\n for (var i = 0; i < numberArr.length; i++) {\n sum += numberArr[i];\n }\n\n return sum;\n}", "function totalDigitRekursif(angka) {\n var numstr = angka.toString();\n\n if (numstr.length < 1) {\n return 0;\n }\n\n var a = Number(numstr.slice(0,1)) // this is to get the first digit;\n numstr = numstr.slice(1); // this is to reduce the 'string' minus first digit\n return a + totalDigitRekursif(numstr); // this is the loop;\n\n}", "sum() {}", "function sum() {\n // FILL THIS IN\n var sumValue = 0;\n for (var i = 0; i < arguments.length; i++) {\n sumValue += arguments[i];\n }\n }", "function powerDigitSum(n) {\n var result = bigInteger(1);\n var i, sum;\n for (i = 1; i <= n; i++) {\n result.multiply(2);\n }\n result.finish();\n return result.sum();\n}", "function sum() {\r\n\t\tvar result = 0;\r\n\t\tfor(var i = 0, iLen = arguments.length; i < iLen; i++) {\r\n\t\t\tresult += arguments[i];\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "function powerfulDigitSum(n) {\n var maxSum = 0;\n var a, b, sum;\n var bigInt;\n for (i = 2; i < n; i++) {\n bigInt = bigInteger(i);\n for (j = 1; j < n; j++) {\n sum = bigInt.sum();\n if (sum > maxSum) {\n maxSum = sum;\n }\n bigInt.multiply(i);\n }\n }\n return maxSum;\n}", "findSum(operand1, operand2) {\n let result = '';\n let op1 = operand1; let\n op2 = operand2;\n // Swap if first string is larger than second one\n if (op1.length > op2.length) {\n [op1, op2] = [op2, op1];\n }\n\n const n1 = op1.length;\n const n2 = op2.length;\n const diff = n2 - n1;\n\n // Initially take carry zero\n let carry = 0;\n\n // Traverse from end of both Strings\n for (let i = n1 - 1; i >= 0; i--) {\n // Do school mathematics, compute sum of\n // current digits and carry\n const sum = parseInt(op1[i]) + parseInt(op2[i + diff]) + carry;\n result = (sum % 10) + result;\n carry = Math.floor(sum / 10);\n // console.log(sum + \" \" + result+\" \"+carry);\n }\n\n // Add remaining digits of op2[]\n for (let i = n2 - n1 - 1; i >= 0; i--) {\n const sum = parseInt(op2[i]) + carry;\n result = (sum % 10) + result;\n carry = Math.floor(sum / 10);\n // console.log(sum + \" \" + result+\" \"+carry);\n }\n\n // Add remaining carry\n if (carry > 0) result = carry + result;\n\n return result;\n }", "function sumOfDigits(n) {\n let splitN = n\n .toString()\n .split(\"\")\n .map((num) => parseInt(num));\n\n return splitN.length > 1\n ? sumOfDigits(splitN.reduce((acc, val) => acc + val, 0))\n : n;\n}", "function sumOfTwoNumbers() {}", "add() {\n let result = 0;\n let digit;\n\n for (let i = 0; i < arguments.length; i++) \n \n if(arguments[i]===\"LAST\"){\n \n result += parseInt(this.last());\n \n }else \n if(arguments[i]!==\"LAST\" && typeof(arguments[i])=='string'){\n digit = arguments[i].match(this.regex)\n result += this.memory[parseInt(digit)-1]\n }else{\n result += arguments[i];\n }\n this.total = result;\n \n return parseInt(this.total);\n }", "function sumDigits(n){\n if (n.toString().length !== 3) return -1;\n \n const ones = n % 10;\n const tens = Math.trunc(n / 10) % 10;\n const hundreds = Math.trunc(n / 100);\n\n return ones + tens + hundreds;\n}", "function reverseMultiplyAndSum(digits, base) {\n var total = 0;\n for(var i = 0; i < digits.length; i++)total += digits[i] * (base - i);\n return total;\n}", "function totSum(num) {\n let rest = 0;\n for (let i = 0; i < num; i++) rest += i;\n return rest;\n}", "function digital_root(n) {\n let numString = n.toString();\n let sum = 0\n for (let i = 0; i<numString.length; i++) {\n sum += Number(numString[i])\n }\n \n while (sum >= 10) {\n sum = digital_root(sum)\n }\n\n return sum\n\n }", "function sumNums(a, b, c) {\n return c(a, b)\n }", "function superDigit(n, k) {\n if (n < 10) {\n return n;\n }\n \n return superDigit(\n n\n .toString()\n .split('')\n .reduce((sum, num) => sum + (num | 0), 0) * k,\n 1);\n }", "calcSimpleSum(data) {\n\t\tlet sum = 0;\n\t\tfor (let i = 0; i < (data.length >> 2) - 1; i++) {\n\t\t\tsum += Number(utils.bin2dec(data.slice(i * 4, (i + 1) * 4).reverse().join('')));\n\t\t}\n\t\treturn sum & 0xf;\n\t}", "function totalDigitRekursif(angka) {\n // you can only write your code here!\n let result = 0\n if(angka < 10) {\n return angka;\n }\n else {\n let temp = '' + angka\n if (temp.length == 2) {\n result += Number(temp[0]) + totalDigitRekursif(Number(angka - (temp[0]*10) ))\n return result\n }\n if (temp.length == 3) {\n result += Number(temp[0]) + totalDigitRekursif(Number(angka - (temp[0]*100) ))\n return result\n }\n if (temp.length == 4) {\n result += Number(temp[0]) + totalDigitRekursif(Number(angka - (temp[0]*1000) ))\n return result\n }\n if (temp.length == 5) {\n result += Number(temp[0]) + totalDigitRekursif(Number(angka - (temp[0]*10000) ))\n return result\n }\n }\n}", "function sumDigits(number) {\n if (number < 10) {\n return number % 10;\n } else {\n\n return (number % 10) + sumDigits(Math.floor(number / 10))\n\n }\n\n}", "function sum(numbers) {\n\t//your code is here \n\treturn numbers.reduce((acc,item) => acc+item);\n\n}", "function sum (numbers) {\n\treturn numbers.reduce(function(r,i) {\n\t\treturn r+i;\n\t},0);\n}", "function sum (numbers) {\n \"use strict\";\n \n return numbers.reduce( \n (acumulator, initialValue) => acumulator + initialValue, 0\n )\n \n \n \n \n}", "function sunOfDigits() {\n var a = 998;\n var sum = 0;\n while (a > 0) {\n sum += a % 10;\n a = Math.floor(a / 10);\n }\n console.log(sum);\n}", "function calculateSumOfAll()\n{\n var totalSum = 0;\n var numAsArray = numInString.split('');\n for (var i=0; i<numAsArray.length; i++ )\n {\n totalSum += parseInt(numAsArray[i]);\n }\n return totalSum;\n}", "function sumDigits(number) {\n digits = (\"\"+number).split(\"\")\n total = 0\n for (numString of digits) {\n if (!isNaN(numString)) {\n total += Number(numString)\n }\n }\n return total\n}", "function helper(n) {\n let curSum = 0;\n\n while (n !== 0) {\n curSum += (n % 10) * (n % 10);\n n = Math.floor(n / 10);\n }\n\n return curSum;\n}", "function summationFunc() {\n let sumNumb = 0;\n for (let i = 0; diceContainer.children.length > i; i++) {\n sumNumb += Number(\n diceContainer.children[i].children[0].children[0].innerHTML\n );\n }\n return sumNumb;\n}", "function digital_root(n) {\n let digits = [...n + ''].map(Number);\n let finalNumber = digits.reduce(function(accumulator, currentValue) { \n return accumulator + currentValue;\n }, 0);\n return finalNumber >= 10 ? digital_root(finalNumber) : finalNumber; \n }", "function digital_root(test) {\r\n let count =0;\r\n let arrOfNumbers = test.toString().split('').map(function(a){\r\n return parseInt(a);\r\n });\r\n \r\n while(arrOfNumbers.length > 1){\r\n count = arrOfNumbers.reduce(function(a,b){\r\n return a+b;\r\n });\r\n \r\n arrOfNumbers = count.toString().split('').map(function(a){\r\n // '1' '5'\r\n return parseInt(a);\r\n });\r\n }\r\n return count;\r\n }", "function reverseMultiplyAndSum(digits, base) {\n var total = 0;\n\n for (var i = 0; i < digits.length; i++) {\n total += digits[i] * (base - i);\n }\n\n return total;\n}", "function displaySum(num){\r\n console.log(num);}", "function added (num) {\n //cara looping\n let total = 0;\n for (let i=0; i< num.length; i++) {\n total += parseInt(num[i]);\n }\n return total;\n}", "function solve(args){\n let n=args[0].length;\n let sum=0;\n let ind=1;\n let digit;\n for(let i=n-1;i>=0;i-=1){\n digit=args[0][i];\n switch(digit){\n case 'A':digit=10;\n break;\n case 'B':digit=11;\n break;\n case 'C':digit=12;\n break;\n case 'D':digit=13;\n break;\n case 'E':digit=14;\n break;\n case 'F':digit=15;\n break;\n default:digit=+args[0][i];\n\n }\n sum=sum+digit*ind;\n ind=ind*16;\n }\n console.log(sum);\n\n}", "function aVeryBigSum(ar) {\n \n}", "function largeSum(numbers) {\n var total = bigInt();\n\n numbers.forEach(function (number) {\n total = bigInt(number).add(total);\n });\n\n return total.toString().substring(0, 10);\n}", "function digits(num){\n var final = []\n var tableau = String(num).split('')\n var data = tableau.map(element => parseInt(element));\n for ( var i = 0; i < data.length ; i++ ) {\n for ( var j = 1 ; j < data.length ; j++ ) {\n final.push(data[i] + data[j]);\n } \n data.splice(0,1);\n i = -1;\n }\n return final\n }", "function getSum(total, num) {\n return parseInt(total) + parseInt(num);\n }", "function sumUp(num) {\n var userNumber = (typeof num !== \"number\") ? Number(num) : num;\n var userNumberDigits = userNumber.toString().split(\"\");\n document.querySelector(\".sumUpNumber\").innerHTML = \"numbers to sum up = \" + num + \"\\n\" + \" = \" +userNumberDigits.reduce((a, b) => Number(a) + Number(b), 0);\n}", "function sum() {\n return [...arguments].reduce((total, el) => {\n total += Number.isInteger(el) ? el : 0;\n return total;\n }, 0);\n}", "function findSum() {\r\n var result = 0;\r\n for (var i = 0; i < arguments.length; i++) {\r\n result += arguments[i];\r\n }\r\n return result;\r\n}", "function addsum(n) {\n let sum = 0;\n let parts = n.split('+');\n console.log(parts.length);\n \n for (let i = 0; i < parts.length; i++) {\n \n let num= parseInt(parts[i]);\n sum += num;\n }\n return sum\n}", "function process ( n )\n{\n \n var number = new BigInteger ( 2 ).pow ( n );\n var numberString = number.toString ();\n var digitSum = 0;\n for ( var i = 0; i < numberString.length; ++i )\n digitSum += parseInt ( numberString [i] );\n \n return digitSum;\n}", "function sumDigits2(n) {\n var absNumStr = Math.abs(n).toString();\n return absNumStr.split('').reduce(function(a, b) { return +a + +b; }, 0);\n}", "function sum(number) {\n var digits = String(number).match(/./g);\n \n return digits.reduce(function(total, char) {\n return total += Number(char);\n }, 0);\n \n}", "function AdditivePersistence(num){\n var total = 0;\n var singleDigit = false;\n var addP = 0;\n \n // Turns integer num into array of strings\n var numArray = num.toString().split(\"\");\n \n // Turns each string in num array back into integers\n for (i = 0; i <numArray.length; i++) { // switch to i= thing\n numArray[i] = parseInt(numArray[i]);\n }\n \n if (numArray.length === 1) {\n return 0;\n }\n \n while (singleDigit === false) {\n \n for (i=0; i < numArray.length; i++) {\n total = total + numArray[i];\n \n }\n\n \n \n if (total > 10) {\n numArray = total.toString().split(\"\");\n for (i = 0; i <numArray.length; i++) {\n numArray[i] = parseInt(numArray[i]);\n }\n total = 0;\n addP++;\n }\n \n else if (total <= 9) {\n singleDigit = true;\n addP++;\n }\n \n }\n\n return addP;\n\n}", "function rowSum(){\r\n\r\n var s=0,r=0\r\n for(var i=0;i<9;i++){\r\n s=0\r\n for(var j=0;j<9;j++){\r\n s+=Number(finalArray[i][j])\r\n }\r\n console.log(s);\r\n if(s===45)\r\n r++\r\n }\r\n if(r===9)\r\n return true\r\n else\r\n return false\r\n \r\n}", "function sumNumbers(num) {\n let arr = `${num}`.split(\"\");\n let sum = arr.reduce((a, b) => +a + +b);\n if (sum < 10) {\n return sum;\n } else {\n return sumNumbers(sum);\n }\n}", "function getSumOfDigits(integer) {\n var sum = 0;\n var arr = integer.toString().split('');\n console.log(arr);\n for (var x in arr){\n sum += parseInt(arr[x], 10);\n }\n return sum;\n}", "function sumDigits(number) {\n return String(number).split('').filter(e => +e).reduce((acc, curr) => +acc + +curr, 0);\n}", "countSumOfRange() {\n \twhile (this.rangeStart <= this.rangeFinish) {\n this.sum = this.sum + this.rangeStart;\n this.rangeStart++;\n }\n this.resultSum.textContent = this.sum;\n }", "function numberSum(n) {\n let total = 0;\n for(var i = 1; i <= n; i++){\n total += i;\n }\n return total;\n}" ]
[ "0.702406", "0.6883595", "0.67919976", "0.66406155", "0.6639472", "0.65274787", "0.6510125", "0.6458426", "0.6386224", "0.6359574", "0.63417566", "0.63101995", "0.6310179", "0.63088745", "0.63049054", "0.6295773", "0.62824184", "0.6263402", "0.6259214", "0.6241843", "0.6211523", "0.6189214", "0.61807436", "0.6133106", "0.6107582", "0.6093503", "0.60618824", "0.6057884", "0.60550934", "0.6053762", "0.6044744", "0.6041289", "0.6040801", "0.60302985", "0.60251504", "0.60202277", "0.60039353", "0.60026765", "0.5998587", "0.5983602", "0.5980393", "0.5971489", "0.5970288", "0.59514946", "0.59510857", "0.5945878", "0.59309465", "0.59256417", "0.591974", "0.59143007", "0.59062093", "0.5896951", "0.5887323", "0.5884652", "0.5880115", "0.5873459", "0.58717537", "0.5870653", "0.5870638", "0.5869827", "0.5866711", "0.58661395", "0.5862834", "0.5860868", "0.58576804", "0.5844611", "0.5842722", "0.58412206", "0.58382064", "0.58305657", "0.58276916", "0.58276016", "0.58270967", "0.58168644", "0.5810091", "0.5804081", "0.5803008", "0.5800982", "0.57871836", "0.57871366", "0.57865167", "0.5773412", "0.57693464", "0.5766822", "0.5763286", "0.57616055", "0.57463944", "0.5742368", "0.5742341", "0.5741008", "0.5730645", "0.5721795", "0.5720134", "0.57192546", "0.57139295", "0.570366", "0.5697995", "0.5696125", "0.5690083", "0.56900257" ]
0.5825914
73
if user has input a start time, then use the user input to display, otherwise, display "Start Time"
renderStartTime() { if(this.state.startTime === "") { return("Start Time*"); } else { return(this.state.startTime.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startTime() {\r\n var delta = Date.now() - start_time; // in milliseconds\r\n time.seconds = Math.floor((delta % (1000 * 60)) / 1000);\r\n time.minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\r\n time.hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n\r\n if(time.seconds < 10) {\r\n seconds_display.textContent = '0' + time.seconds; \r\n }\r\n else {\r\n seconds_display.textContent = time.seconds; \r\n }\r\n\r\n if(time.minutes < 10) {\r\n minutes_display.textContent = '0' + time.minutes;\r\n }\r\n else {\r\n minutes_display.textContent = time.minutes;\r\n }\r\n\r\n if(time.hours < 10) {\r\n hours_display.textContent = '0' + time.hours;\r\n }\r\n else {\r\n hours_display.textContent = time.hours;\r\n }\r\n}", "function countdownstart(startTime) {\n const countdownStartTime = new Date(startTime);\n let hours = countdownStartTime.getHours();\n let minutes = countdownStartTime.getMinutes();\n let dayNight = \"AM\";\n\n if (hours == 0) {\n hours = 12\n }\n if (hours > 12) {\n hours = hours - 12;\n dayNight = 'PM';\n }\n\n hours = (hours < 10) ? '0' + hours : hours;\n minutes = (minutes < 10) ? '0' + minutes : minutes;\n\n displayCountdownStart.textContent = `Time has been starting ${hours} : ${minutes} : ${dayNight}`\n}", "function setTimeDisplay(time) {\n if (time <= 12) {\n toDoHour = time + \"am\";\n } else {\n toDoHour = (time - 12) + \"pm\";\n }\n}", "function readingTime() {\n const wpm = 250;\n const words = inputVal.trim().split(/\\s+/).length;\n const time = Math.ceil(words / wpm);\n\n if (inputValLen == \"\" && inputValLen == \"0\") {\n timeContainer.innerHTML = \"Type to Calculate Time\";\n } else if (inputValLen < 250) {\n timeContainer.innerHTML =\n \"< <span class = 'colored-cap'>\" + time + \"</span> Minute to Read\";\n } else {\n timeContainer.innerHTML = time + \" Minutes to Read\";\n }\n }", "function elementSelectedStartTime(){\r\n\tvar choice,filler,hour,minute,timeDate;\r\n\tchoice = document.form.startTime.value;\r\n\tif (!(choice == \"\")) filler = \"12/12/2000 \";\r\n\t//Date portion of Date object is thrown away, only the hours and minutes are used\r\n\ttimeDate=new Date(filler + choice);\r\n\tif(isNaN(timeDate.getHours())) \r\n\thour = \"<Var>StartHour</Var>\\n \"; else hour = \"<Ind type=\\\"integer\\\">\"+ timeDate.getHours() + \"</Ind>\\n \";\r\n\tif(isNaN(timeDate.getMinutes())) \r\n\tminute = \"<Var>StartMinute</Var>\\n \"; else minute = \"<Ind type=\\\"integer\\\">\"+ timeDate.getMinutes() + \"</Ind>\\n \";\r\n\tif (choice == \"\") englishStartTime = \"any time\";\t\r\n\telse englishStartTime = choice;\r\n\tstartTime = hour + minute + \"</Expr>\\n \";\r\n\telementErrorDateTimeCheck();\r\n\tcreateRuleML();\r\n}", "function displayTime() {\n //Calculate the number of minutes and seconds based on the current time\n var min = Math.floor(currentTime / 60);\n var sec = Math.floor(currentTime % 60);\n \n //Add a 0 to the front of the second when appropriate\n if (sec < 10) {\n sec = \"0\" + sec;\n }\n \n $(\"#time-text\").text(min + \":\" + sec);\n }", "function formatDisplayTime()\n{\t\n\tvar displayTime = document.getElementById('displaytime').value;\n\t\n\tif(!displayTime){\n\t\t\n\t\tvar currentTime = new Date(),\n\t\thours = currentTime.getHours(),\n\t\tminutes = currentTime.getMinutes(),\n\t\tformatedTime = '';\n\t\t\n\t\tif (minutes < 10)\n\t\t{\n\t\t\tminutes = \"0\" + minutes\n\t\t}\n\t\tformatedTime = hours + \":\" + minutes;\n\t\t\n\t\tdocument.getElementById('displaytime').value = formatedTime;\n\t}\n}", "function startTime() {\n\ttime = setInterval(() => {\n\t\tseconds = seconds + 1;\n\t\tif (seconds == 59) {\n\t\t\tseconds = 0;\n\t\t\tmin = min + 1;\n\t\t}\n\t\tif (min == 60) {\n\t\t\tmin = 0;\n\t\t\thour = hour + 1;\n\t\t}\n\t\ttimeSpace.innerHTML = \"h\" + hour + \":\" + min + \"m : \" + seconds + \"s\";\n\t\t// to Show time\n\t}, 1000)\n}", "function onTimeForTheExam(input = []) {\n let [examHour, examMinutes, arrivalHour, arrivalMinutes] = [...input].map(Number);\n let examMins = (examHour * 60) + examMinutes;\n let arrivalMins = (arrivalHour * 60) + arrivalMinutes;\n let timeDiffMins = examMins - arrivalMins;\n\n let output = [];\n if (timeDiffMins > 30) {\n output.push('Early');\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours before the start`);\n } else {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else if (timeDiffMins >= 0) {\n output.push('On time');\n if (timeDiffMins !== 0) {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else {\n output.push('Late');\n timeDiffMins = Math.abs(timeDiffMins);\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours after the start`);\n } else {\n output.push(`${timeDiffMins} minutes after the start`);\n }\n }\n return output.join('\\n');\n}", "function formatresults(){\nif (this.timesup==false){//if target date/time not yet met\nvar displaystring=\"<span style='background-color: #CFEAFE'>\"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds</span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"Launch time!\"\n}\nreturn displaystring\n}", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('txt').innerHTML =\n h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "function startTime() {\n let today = new Date(),\n hrs = today.getHours(),\n mins = today.getMinutes(),\n secs = today.getSeconds(),\n hh = hrs;\n\n if (hrs > 12) {\n hrs = hh - 12;\n }\n if (hrs == 0) {\n hrs = 12;\n }\n \n mins = checkTime(mins);\n document.getElementById('time').innerHTML = `${hrs}:${mins}`;\n\n var t = setTimeout(startTime, 500);\n}", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('txt').innerHTML =\n h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "function formatresults2(){\nif (this.timesup==false){ //if target date/time not yet met\nvar displaystring=\"<span>\"+arguments[0]+\" <sup>days</sup> \"+arguments[1]+\" <sup>hours</sup> \"+arguments[2]+\" <sup>minutes</sup> \"+arguments[3]+\" <sup>seconds</sup></span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"\" //Don't display any text\nalert(\"Launch time!\") //Instead, perform a custom alert\n}\nreturn displaystring\n}", "function printTimeInWords() {\n var msg;\n if (minNow === 0) {\n return '<span class=\"its\">It\\'s</span><br>' + '<span class=\"hour\">' + setHours() + '</span><br>' + ' <span class=\"min\">o\\'clock</span>.';\n } \n else if (minNow === 30) {\n return '<span class=\"its\">It\\'s</span> <br> <span class=\"min\">half past</span> <br>' + '<span class=\"hour\">' + setHours() + '</span>' + '.';\n }\n else {\n\t \n msg = '<span class=\"its\">It\\'s</span> <br >' + '<span class=\"min\">' + setMinutes() + '</span>' + '<span class=\"pos\">' + setPos() + '</span> <br>' + '<span class=\"hour\">' + setHours() + '</span>' + '.';\n return msg;\n }\n}", "function startTime() {\n var m_name = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];\n var today = new Date();\n var date = today.getDate();\n var month = m_name[today.getMonth()];\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n var year = today.getFullYear();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').value =\n date + \"-\" + month + \"-\" + year + \" \" + h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n}", "function verifyTime(input)\n{\n if (input.value) {\n var timeStr = input.value.toUpperCase();\n\n var hrsmin = timeStr.split(\":\");\n if (hrsmin.length > 1) {\n if (hrsmin[0] < 0 || hrsmin[0] > 99 || hrsmin[1] < 0 || hrsmin[1] > 59) {\n input.value = \"\";\n input.focus();\n } else\n input.value = ((parseInt(hrsmin[0], 10) * 60) + parseInt(hrsmin[1], 10)).toFixed();\n } else {\n var time = parseInt(timeStr, 10);\n if (isNaN(time) || time < 0 || time > 24*60) {\n input.value = \"\";\n input.focus();\n }\n }\n gasUse();\n }\n return;\n}", "function CheckTimes(){\n if (Date.getMinutes() == \"00\"){\n var TimeText = [\"Hey darling\", \"It's \" + Time, \"I love you so very much,\", \"mwahhhhh\", \"\\u2661\"];\n OutputText(TimeText); \n }\n else{\n var NotTimeText = [\"Hey\", \"It is not time\", \"Still love you tho\", \"mwah\", \"\\u2661\"];\n OutputText(NotTimeText);\n }\n}", "function checkTimeInput () {\n var val = document.getElementById('work-time').value;\n document.getElementById('work-time').value = val >= MIN_WORK_PERIOD ? val : MIN_WORK_PERIOD;\n}", "function startTime(autostart) {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n $('#startClock').html(\"@\" + h + \":\" + m + \":\" + s + \" Uhr\");\n var t = setTimeout(startTime, 1000);\n\n}", "function startTime() {\n var currentTime = new Date();\n var h = currentTime.getHours();\t\n var m = currentTime.getMinutes();\n var s = currentTime.getSeconds();\n var mar = \"no maridain time determined\"\n \n //change military time to standard time\n if (h > 12) {\n h -= 12;\n } else if (h === 0) {\n h = 12;\n }\n\n // add a zero in front of numbers < 10\n function checkTime(i) {\n\t if (i < 10) {\n\t i = \"0\" + i;\n\t }\n\t return i;\n\t}\n m = checkTime(m);\n s = checkTime(s);\n\n // confirm variable value before running function\n console.log(mar)\n mar = maridian(mar)\n \n //display the clock on the screen\n document.getElementById('time').innerHTML = h + \":\" + m + \":\" + s + \" \"+ mar;\n\n //iterate throught the time, 1 second at a time\n setTimeout(function () {\n startTime()\n }, 1000);\n}", "function startTime() {\n s = (s+1) % 60;\n if (s == 0)\n m = (m+1) % 60;\n var ms=checkTime(m);\n var ss=checkTime(s);\n document.getElementById('time').innerHTML=ms+\":\"+ss;\n t=setTimeout(function(){startTime()},1000);\n }", "function showTime() {\n // get the time\n let tdy = new Date();\n let hrs = tdy.getHours();\n let min = tdy.getMinutes();\n let sec = tdy.getSeconds();\n\n // display AM or PM\n const amPm = hrs > 12 ? \"PM\" : \"AM\";\n\n // set 12 hr format\n hrs = hrs % 12 || 12;\n\n // add Zero in min and sec\n function addZero(e) {\n return (parseInt(e, 10) < 10 ? \"0\" : \"\") + e;\n }\n time.innerHTML = `${hrs}<span>:</span>${addZero(min)}<span>:</span>${addZero(sec)}<span> </span>${amPm}`;\n setTimeout(showTime, 1000);\n}", "function setSunshineStartTime() {\r\n\tvar newSunshineStartTime = prompt('When does Sunshine begin? (24 hour format -> hh:mm)', SunshineStartTime);\r\n\tif (newSunshineStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newSunshineStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Sunshine Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setSunshineStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"SunshineStartTime\", newSunshineStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Sunshine Start Time", "function inputTimeCheck()\n{\n var element_hh = eval(this.element_hh);\n var element_mi = eval(this.element_mi);\n var element_am = eval(this.element_am);\n\n if ( typeof element_hh != 'undefined' && element_mi !='undefined' && element_am !='undefined' )\n {\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [this.element_hh.name]);\n\n if ( element_hh.selectedIndex == -1 || element_mi.selectedIndex == -1 || element_am == -1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.time.required', [this.ref_label]));\n\n if ( element_hh.selectedIndex == -1 )\n {\n element_hh.focus();\n }\n else if ( element_mi.selectedIndex == -1 )\n {\n element_mi.focus();\n }\n else\n {\n element_am.focus();\n }\n return false;\n }\n }\n\n return true;\n}", "function main() {\n var time = readLine();\n\n hour = time.substring(0,2);\n mins = time.substring(3,5);\n minimins = time.substring(6,8);\n if ( time.indexOf(\"PM\") > 0) {\n if (hour != 12) {\n hour = (Number(hour) + 12).toString();\n }\n }else {\n if(hour == 12) {\n hour = \"00\";\n }\n }\n console.log(hour + time.substring(2,8));\n return;\n}", "function setSunriseStartTime() {\r\n\tvar newSunriseStartTime = prompt('When does Sunrise begin? (24 hour format -> hh:mm)', SunriseStartTime);\r\n\tif (newSunriseStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newSunriseStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Sunrise Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setSunriseStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"SunriseStartTime\", newSunriseStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Sunrise Start Time", "function startTime() {\n\tvar now = new Date();\n\tvar hour = ('0' + now.getHours()).slice(-2);\n\tvar mins = now.getMinutes();\n\tvar secs = now.getSeconds();\n\tvar ampm = hour >= 12 ? 'PM' : 'AM';\n\tvar day = ('0' + now.getDate()).slice(-2);\n\tvar month = ('0' + (now.getMonth()+1)).slice(-2);\n\tvar year = now.getFullYear();\n \thour = hour ? hour : 12;\n\tmins = mins < 10 ? '0' + mins : mins;\n\tsecs = secs < 10 ? '0' + secs : secs;\n\tvar timeString = hour + ':' + mins;\n\tvar dateString = month + '/' + day + '/' + year;\n\tdocument.getElementById('time').innerHTML = timeString;\n\tdocument.getElementById('date').innerHTML = dateString;\n\tvar t = setTimeout(startTime, 500);\n}", "function getStartDateTimeFromInput() {\n\t\n\tvar startDateTimeArray = document.getElementById(\"start_date_time_input\").value.split(\":\");\n\t\n\tif (startDateTimeArray.length != 2) {\n\t\treturn;\n\t}\n\n\tvar startDateTime = new Date(currentDate());\n\tstartDateTime.setHours(parseInt(startDateTimeArray[0]));\n\tstartDateTime.setMinutes(parseInt(startDateTimeArray[1]));\n\t\n\treturn startDateTime;\n}", "function formatresults(){\r\n if (this.timesup==false){//if target date/time not yet met\r\n var displaystring=arguments[0]+\" days \"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds left until Scott & Javaneh's Wedding\"\r\n }\r\n else{ //else if target date/time met\r\n var displaystring=\"Future date is here!\"\r\n }\r\n return displaystring\r\n}", "function showTime() {\n\t\ttry {\n\t\t\tvar hours = time.getUTCHours();\n\t\t\tvar minutes = time.getUTCMinutes();\n\t\t\tvar seconds = time.getUTCSeconds();\n\t\n\t\t\t// build the human-readable format\n\t\t\tvar timeValue = \"\" + ((hours > 12) ? hours - 12 : hours);\n\t\t\ttimeValue += ((minutes < 10) ? \":0\" : \":\") + minutes;\n\t\t\ttimeValue += ((seconds < 10) ? \":0\" : \":\") + seconds;\n\t\t\ttimeValue += (hours >= 12) ? \" pm\" : \" am\";\n\t\n\t\t\tvar clockElement;\n\t\t\tif ((piratequesting.sidebar) && (clockElement = sidebar.contentDocument.getElementById('servertime'))) {\n\t\t\t\tclockElement.setAttribute(\"value\", timeValue);\n\t\t\t}\n\t\t} \n\t\tcatch (e) {\n\t\t\tdumpError(e);\n\t\t}\t\n\t}", "function displayTime() {\n var today = new Date();\n \n //gathers information about current hour, min and sec. \n //Add zero at the head if it is a single digit number.\n var currentHour = addZero(today.getHours());\n var currentMin = addZero(today.getMinutes());\n var currentSec = addZero(today.getSeconds());\n \n // for formatting the display.\n hourElement.innerHTML = currentHour + \":\";\n minElement.innerHTML = currentMin + \":\";\n secElement.innerHTML = currentSec;\n }", "function initialTimeValidate() {\n var initialTimeInput = document.getElementById(\"add_initial_time\");\n if (initialTimeInput.value == \"\") {\n document.getElementById(\"initialDateStatus\").innerHTML =\n \"Please enter the initial time for the event\";\n document.getElementById(\"initialDateStatus\").style.display = \"block\";\n return false;\n } else {\n document.getElementById(\"initialDateStatus\").style.display = \"none\";\n newEvent.initialTime = document.getElementById(\"add_initial_time\").value;\n return true;\n }\n }", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function startTime() {\n\tvar today = new Date();\n\tvar hours = today.getHours();\n\tvar minutes = today.getMinutes();\n\tminutes = minutes < 10 ? '0'+minutes : minutes;\n\tvar ampm = hours >= 12 ? 'PM' : 'AM';\n\thours = hours % 12;\n\thours = hours ? hours :12;\n\tvar day = today.getDate();\n\tvar days = [\"Sun\",\"Mon\",\"Tue\",\"Wed\",\"Thu\",\"Fri\",\"Sat\"];\n\tvar weekday = days[today.getDay()];\n\tvar months = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n\tvar month = months[today.getMonth()];\n\tvar year = today.getFullYear();\n\t//Display time in hh:ss AM-PM format \n\tdocument.getElementById('HoursMinutes').innerHTML = hours + ':' + minutes + ' ' + ampm; \n\t//Display date in \"Day #, Month Year\" format\n\tdocument.getElementById('DayMonth').innerHTML = weekday + ' ' + day + ', ' + month + ' ' + year;\n\t//Restart 60 seconds later\n\tvar restartTime = setTimeout(startTime, 60000);\n}", "function startTime()\n{\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n\n d = today.getDate();\n day = today.getDay();\n month = today.getMonth();\n year = today.getFullYear();\n\n months = new Array('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec');\n weekday = new Array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');\n\n // add a zero in front of numbers<10\n h = checkTime(h);\n m = checkTime(m);\n s = checkTime(s);\n \n //Check for PM and AM\n var day_or_night = (h > 11) ? \"PM\" : \"AM\";\n\n //Convert to 12 hours system\n if (h > 12)\n h -= 12;\n\n var enable = '';\n if( $('#time').length ) {\n enable = 'time';\n clock = h+\":\"+m+\":\"+s+\" \"+day_or_night;\n }\n if( $('#datetime').length ) {\n enable = 'datetime';\n clock = checkTime(d)+\" \"+months[month]+\", \"+year+\" <br/>\"+h+\":\"+m+\":\"+s+\" \"+day_or_night;\n }\n\n //Add time/datetime to the headline and update every 500 milliseconds\n if ($('#'+enable).length) {\n $('#'+enable).html(clock);\n }\n setTimeout(function() {\n startTime()\n }, 500);\n}", "displayTime() {\n if(app === 1){\n this.d1.value = this.twoDigitNum(stopwatch.t1);\n this.d2.value = this.twoDigitNum(stopwatch.t2);\n this.d3.value = this.twoDigitNum(stopwatch.t3);\n }\n else{\n this.d1.value = this.twoDigitNum(timer.t1);\n this.d2.value = this.twoDigitNum(timer.t2);\n this.d3.value = this.twoDigitNum(timer.t3);\n }\n }", "function setNightStartTime() {\r\n\tvar newNightStartTime = prompt('When does Night begin? (24 hour format -> hh:mm)', NightStartTime);\r\n\tif (newNightStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newNightStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Night Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setNightStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"NightStartTime\", newNightStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Night Start Time", "function setTimeDisplay() {\n timeDisplay.textContent = formattedFocusTime;\n}", "function showTime() {\n var datime = new Date();\n var dahour = datime.getHours();\n var damin = datime.getMinutes();\n // conditional to insert a 0 for minutes under 10\n if (damin>9) {\n $(\".time\").html(\"The schedule below is based on current time of: \" + dahour + \":\" + damin);\n }\n else {\n $(\".time\").html(\"The schedule below is based on current time of: \" + dahour + \":0\" + damin);\n\n }\n}", "function showTime(){\r\n\tvar p = document.getElementById(\"clock\");\r\n\tvar time = new Date();\r\n\t\r\n\t// This will ensure that the minute value displays as two digits\r\n\tvar min = time.getMinutes();\r\n\tif(min < 10){\r\n\t\tmin = \"0\" + min\r\n\t}\r\n\t\r\n\t// This will ensure that the second value displays as two digits\r\n\tvar sec = time.getSeconds();\r\n\tif(sec < 10){\r\n\t\tsec = \"0\" + sec;\r\n\t}\r\n\t\r\n\t// This will update the 'clock' p element with a String representing the time\r\n\tp.innerHTML = getCurrentDate() + \" \" + time.getHours() + \":\" + min + \" \" + sec + \"<br />\";\r\n}", "function displayTime() {\n const timer = document.querySelector('.timer');\n const min = Math.floor(time / 60);\n const sec = time % 60;\n\n if (sec < 10) {\n timer.innerHTML = `${min}:0${sec}`;\n } else {\n timer.innerHTML = `${min}:${sec}`;\n }\n}", "function showTime() {\n\n let date = new Date();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n\n //AM/PM format\n let formatHours = convertFormat(hours);\n\n //!2400HR format\n hours = checkTime(hours);\n\n //addZero before single numbers\n hours = addZero(hours);\n minutes = addZero(minutes);\n secondss = addZero(seconds);\n\n document.getElementById('clock').innerHTML = `${hours} : ${minutes} : ${seconds} ${formatHours}`;\n}", "function startTime(){\n clearInterval(timer);\n timer = setInterval(displayTime, 1000);\n }", "function setStartDateString(dateStr, timeStr)\n{\n try\n {\n if (DEBUG) log(\"setStartDateString\\tdateStr: '\" + dateStr + \"'\\ttime: '\" + timeStr);\n var dts = document.getElementById(\"dts\");\n if (dts)\n dts.value = dateStr;\n else throw (\"Attempting to set start date with no $('dts')\");\n\n if (timeStr)\n {\n if ($(\"tts\"))\n {\n $(\"tts\").value = timeStr;\n if (DEBUG) log(\"set tts to '\" + timeStr + \"'\");\n } \n else\n {\n throw(\"Failed to set time '\" + timeStr + \"' for task. Most likely your preferences are set to not display 'start time'\");\n }\n }\n else if ($(\"tts\"))\n {\n $(\"tts\").value = \"\"; // User wants a time, and we don't have one to give\n }\n jsobj.saveStartDateTime();\n }\n catch (e)\n {\n showMessage(e);\n throw e;\n }\n}", "function showTime() {\n let today = new Date(),\n hour = today.getHours(),\n min = today.getMinutes(),\n seconds = today.getSeconds();\n\n //Set AM or PM\n const amOrPm = hour >= 12 ? \"PM\" : \"AM\";\n\n //Format to 12 hours\n hour = hour % 12 || 12;\n console.log(time);\n //Outputting time\n time.innerHTML = `${hour} <span>:</span> ${min} <span>:</span> ${seconds}`;\n\n setTimeout(showTime, 1000);\n}", "function startTime() {\n var today = new Date();\n var hourNow = today.getHours();\n var h = formatHour(hourNow);\n var m = today.getMinutes();\n var ap = formatAmPm(hourNow);\n if(m==0) {\n writeDate();\n }\n m = checkTime(m);\n document.getElementById('clock').innerHTML = h + ':' + m + ap;\n var t = setTimeout(startTime, 10000);\n}", "function displayTime() {\n var str = \"\";\n\n var currentTime = new Date()\n var hours = currentTime.getHours()\n var minutes = currentTime.getMinutes()\n var seconds = currentTime.getSeconds()\n\n if (minutes < 10) {\n minutes = \"0\" + minutes\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds\n }\n str += hours + \":\" + minutes + \":\" + seconds + \" \";\n if(hours > 11){\n str += \"PM\"\n } else {\n str += \"AM\"\n }\n return str;\n}", "function checkTime(field) {\n\t\tFeld = eval('document.poform.'+field);\n\t\tFeldLength = Feld.value.length;\n\t\tFeldValue = Feld.value;\n\t\tif (FeldLength == 1) {\n\t\tFeld.value = \"0\"+FeldValue;\n\t\t}\n\t\tif (FeldLength == 0) {\n\t\tFeld.value = \"00\";\n\t\t}\n\t\tvar t1 = document.poform.start_hour.value+':'+document.poform.start_min.value;\n\t\tvar t2 = document.poform.end_hour.value+':'+document.poform.end_min.value;\n\t\tvar m = ((t2.substring(0,t2.indexOf(':'))-0) * 60 +\n\t\t\t\t(t2.substring(t2.indexOf(':')+1,t2.length)-0)) - \n\t\t\t\t((t1.substring(0,t1.indexOf(':'))-0) * 60 +\n\t\t\t\t(t1.substring(t1.indexOf(':')+1,t1.length)-0));\n\t\tvar h = Math.floor(m / 60);\n\t\tdocument.poform.length.value = h + ':' + (m - (h * 60));\n}", "function startTime() {\n const today = new Date();\n let hour = today.getHours();\n let minute = today.getMinutes();\n let second = today.getSeconds();\n hour = formatTime(hour);\n minute = formatTime(minute);\n second = formatTime(second);\n\n document.querySelector(\"#current-time\").innerHTML = hour + \":\" + minute + \":\" + second;\n setTimeout(function () {\n startTime();\n }, 500);\n}", "function timerDisplay(startNum){\n let totalTime = -1\n let min = 0\n let sec = 0\n let displayMin = startNum\n let displaySec = startNum\n let displayTime = document.querySelector('.time')\n \n //Do the following every second:\n timer = setInterval(function() {\n totalTime++\n sec = totalTime\n displaySec = sec\n\n //Every 60 sec, add 1 to min\n if (totalTime % 60 === 0 && totalTime > 0) {\n min++\n }\n\n //when second hits 60, reset counter back to 0\n if (totalTime >= 60) {\n sec = totalTime - (60 * min)\n }\n\n //display seconds with 2 digi-padding\n if (sec < 10) {\n displaySec = \"0\" + sec\n } else if (sec >= 10 && sec < 60) {\n displaySec = sec\n } \n\n //display minutes with 2 digi-padding\n if (min > 0 && min < 10) {\n displayMin = '0' + min\n } else if (min > 10 && min < 60) {\n displayMin = min\n }\n\n //final screen display format to counter-up timer\n displayTime.innerHTML = displayMin + ':' + displaySec\n \n //End game after 30 minutes\n if (min === 30) {\n clearInterval(timer)\n displayPopUp('timesUp')\n }\n }, 1000)\n}", "function checkTime() {\n if (time.isBefore(nineStart)) {\n $('#inputNine').addClass('future')\n } else if (time.isBetween(nineStart, nineEnd)) {\n $('#inputNine').addClass('present')\n } else if (time.isAfter(nineEnd)) {\n $('#inputNine').addClass('past')\n }\n\n if (time.isBefore(tenStart)) {\n $('#inputTen').addClass('future')\n } else if (time.isBetween(tenStart, tenEnd)) {\n $('#inputTen').addClass('present')\n } else if (time.isAfter(tenEnd)) {\n $('#inputTen').addClass('past')\n }\n\n if (time.isBefore(elevenStart)) {\n $('#inputEleven').addClass('future')\n } else if (time.isBetween(elevenStart, elevenEnd)) {\n $('#inputEleven').addClass('present')\n } else if (time.isAfter(elevenEnd)) {\n $('#inputEleven').addClass('past')\n }\n\n if (time.isBefore(twelveStart)) {\n $('#inputTwelve').addClass('future')\n } else if (time.isBetween(twelveStart, twelveEnd)) {\n $('#inputTwelve').addClass('present')\n } else if (time.isAfter(twelveEnd)) {\n $('#inputTwelve').addClass('past')\n }\n\n if (time.isBefore(oneStart)) {\n $('#inputOne').addClass('future')\n } else if (time.isBetween(oneStart, oneEnd)) {\n $('#inputOne').addClass('present')\n } else if (time.isAfter(oneEnd)) {\n $('#inputOne').addClass('past')\n }\n\n if (time.isBefore(twoStart)) {\n $('#inputTwo').addClass('future')\n } else if (time.isBetween(twoStart, twoEnd)) {\n $('#inputTwo').addClass('present')\n } else if (time.isAfter(twoEnd)) {\n $('#inputTwo').addClass('past')\n }\n\n if (time.isBefore(threeStart)) {\n $('#inputThree').addClass('future')\n } else if (time.isBetween(threeStart, threeEnd)) {\n $('#inputThree').addClass('present')\n } else if (time.isAfter(threeEnd)) {\n $('#inputThree').addClass('past')\n }\n\n if (time.isBefore(fourStart)) {\n $('#inputFour').addClass('future')\n } else if (time.isBetween(fourStart, fourEnd)) {\n $('#inputFour').addClass('present')\n } else if (time.isAfter(fourEnd)) {\n $('#inputFour').addClass('past')\n }\n\n if (time.isBefore(fiveStart)) {\n $('#inputFive').addClass('future')\n } else if (time.isBetween(fiveStart, fiveEnd)) {\n $('#inputFive').addClass('present')\n } else if (time.isAfter(fiveEnd)) {\n $('#inputFive').addClass('past')\n } \n }", "function handleInputTimeChange(event) {\n const { name, value } = event.target;\n setStartTime({ ...starttime, [name]: value });\n }", "function timeOfDay(num1){\nlet timeMsg = ['morning.', 'lunch.', 'the afternoon.', 'time to code.', 'time to sleep.' ];\nlet currentTime = \"It's \";\nlet defaultMsg = \"NUMBER EXCEEDS 24 HOURS\";\n//if conditional chain to determine what to say back to the user depending on the number that is \n//supplied in the function arguments.\n\tif(num1 < 7){\n\t\tconsole.log(currentTime + timeMsg[4]); // => \"It's time to sleep.\"\n\t}\n else if(num1 >= 7 && num1 < 12){\n console.log(currentTime + timeMsg[0]); // => \"It's morning.\"\n }\n else if(num1 >= 12 && num1 < 15){\n console.log(currentTime + timeMsg); // => \"It's lunch.\"\n }\n else if(num1 >= 15 && num1 < 17){\n console.log(currentTime + timeMsg[2]); // => \"It's the afternoon.\"\n }\n else if(num1 >= 17 && num1 < 22){\n console.log(currentTime + timeMsg[3]); // => \"It's time to code.\"\n }\n else if(num1 >= 22 && num1 <= 24){\n console.log(currentTime + timeMsg[4]); // => \"It's time to sleep.\"\n }\n /**\n * The else statement acts as a default state that will trigger if all previous checks fail.\n * in this case, the default state will tell the user when their input number is greater\n * than a 24 hour day.\n */\n else{\n console.log(defaultMsg); //prints the variable defaultMsg to the console\n }\n}", "function displayTime(typeOfTime, h, m, hourFormat) {\n // typeOfTime is like 'Server', 'Unit', 'User'\n if (hourFormat === 24) {\n // Display hours in 24\n\n if (h < 24) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + h + ':0' + m)\n } else\n // If minutes flow over\n if (m > 59) {\n if (h > 22) {\n message.channel.send(typeOfTime + ' time: ' + (h+1-24) + ':' + (m-60))\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h+1) + ':' + (m-60))\n }\n \n } else {\n message.channel.send(typeOfTime + ' time: ' + h + ':' + m)\n }\n } else {\n // Wrap around if hour > 24\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':0' + m)\n } else\n if (m > 59) {\n message.channel.send(typeOfTime + ' time: ' + (h+1-24) + ':' + (m-60))\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':' + m)\n }\n }\n\n } else\n if (hourFormat === 12) {\n // Display hours as am/pm\n // am (morning)\n if (h < 12) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + h + ':0' + m + ' am')\n } else\n // If minutes flow over\n if (m > 59) {\n if (h === 11) {\n message.channel.send(typeOfTime + ' time: ' + (h+1) + ':' + (m-60) + ' pm')\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h+1) + ':' + (m-60) + ' am')\n }\n } else {\n message.channel.send(typeOfTime + ' time: ' + h + ':' + m + ' am')\n }\n\n } else\n // am (after midnight)\n if (h > 23) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':0' + m + ' am')\n } else\n // If minutes flow over\n if (m > 59) {\n message.channel.send(typeOfTime + ' time: ' + (h-24+1) + ':' + (m-60) + ' am')\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':' + m + ' am')\n }\n\n } else\n // pm (at noon)\n if (h === 12) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + h + ':0' + m + ' pm')\n } else\n // If minutes flow over\n if (m > 59) {\n message.channel.send(typeOfTime + ' time: ' + (h-12+1) + ':' + (m-60) + ' pm')\n } else {\n message.channel.send(typeOfTime + ' time: ' + h + ':' + m + ' pm')\n }\n\n }\n // pm (any other time)\n else {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + (h-12) + ':0' + m + ' pm')\n } else\n // If minutes flow over\n if (m > 59) {\n if (h === 23) {\n message.channel.send(typeOfTime + ' time: ' + (h+1-24) + ':' + (m-60) + ' am')\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-12+1) + ':' + (m-60) + ' pm')\n }\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-12) + ':' + m + ' pm')\n }\n }\n\n\n }\n }", "displayTime(time) {\n\n // let minutes = parseInt(this.state.currentTime / 60);\n // let seconds = parseInt(this.state.currentTime % 60);\n let minutes = Math.floor(time / 60);\n let seconds = Math.floor(time % 60);\n //need to make it 0:00\n if (seconds < 10) {\n seconds = '0' + seconds;\n }\n return `${minutes}:${seconds}`\n }", "function start() {\r\n let answer = document.getElementById(\"textInput\").value;\r\n console.log(\"Type OK to start\");\r\n if (\r\n answer === \"ok\" ||\r\n answer === \"OK\" ||\r\n answer === \"Ok\" ||\r\n answer === \"oK\"\r\n ) {\r\n document.getElementById(\"firstInput\").style.display = \"none\";\r\n document.getElementById(\"secondInput\").style.display = \"\";\r\n document.getElementById(\"textbox\").innerHTML =\r\n \"Pick Your Class: Barbarian, Rogue, Knight\";\r\n console.log(answer);\r\n } else {\r\n document.getElementById(\"textbox\").innerHTML = \"How did you fail? Type OK\";\r\n console.log(\"How did you fail? Type OK\");\r\n console.log(answer);\r\n }\r\n}", "function timeStart()\n{\n var ds = new Date();\n var hs = addZero(ds.getHours());\n var ms = addZero(ds.getMinutes());\n var ss = addZero(ds.getSeconds());\n return hs + \":\" + ms + \":\" + ss;\n}", "function timer(times) {\n // grab the hours, minutes, and seconds\n let hour = times.hour;\n let minute = times.minute;\n let second = times.second;\n let hourChoice = times.hourChoice;\n\n let timeDiv = document.getElementById(\"time\");\n let hourDiv = document.getElementById(\"hour\");\n // have the minutes and seconds always contain two digits\n minute = ticker(minute);\n second = ticker(second);\n\n // display the time on the application\n if (parseInt(hourChoice) === 24) {\n timeDiv.children[0].innerHTML = hour + \":\" + minute + \":\" + second;\n } else {\n if (hour > 12) {\n hour = hour - 12;\n document.getElementById(\"number\").innerHTML = hour + \":\" + minute + \":\" + second;\n hourDiv.innerHTML = \"PM\";\n } else if (hour === 12) {\n document.getElementById(\"number\").innerHTML = hour + \":\" + minute + \":\" + second;\n hourDiv.innerHTML = \"PM\";\n } else if (hour === 0) {\n hour = hour + 12;\n document.getElementById(\"number\").innerHTML = hour + \":\" + minute + \":\" + second;\n hourDiv.innerHTML = \"AM\";\n } else {\n document.getElementById(\"number\").innerHTML = hour + \":\" + minute + \":\" + second;\n hourDiv.innerHTML = \"AM\";\n };\n };\n}", "function displayTime() {\n var str = \"\";\n\t//What this does is pretty straight forward:\n\t//Grab a Date object\n var currentTime = new Date()\n\t//Extract hours, minutes and seconds out of it\n var hours = currentTime.getHours()\n var minutes = currentTime.getMinutes()\n var seconds = currentTime.getSeconds()\n\t//If we have less than 10 minutes on the clock, prefix it with a zero to have a \n\t//handy dandy standard format\n if (minutes < 10) {\n minutes = \"0\" + minutes\n }\n\t//Same for seconds\n if (seconds < 10) {\n seconds = \"0\" + seconds\n }\n\t//It uses A.M. and P.M. Time format for the hours, so we need to add this\n str += hours + \":\" + minutes + \":\" + seconds + \" \";\n if(hours > 11){\n str += \"PM\"\n } else {\n str += \"AM\"\n }\n\t//and aaawwaaaaayyyyy we go!\n return str+\"\";\n}", "function stopwatch() {\n sec += 1;\n if (sec / 60 == 1) {\n min += 1;\n sec = 0;\n }\n if (min / 60 == 1) {\n min = 0;\n hour += 1;\n }\n \n // For adding adding zero to when sec/min/hour is one digit number\n \n if (sec < 10) {\n displaysec = \"0\" + sec.toString();\n } else {\n displaysec = sec;\n }\n if (min < 10) {\n displaymin = \"0\" + min.toString();\n } else {\n displaymin = min;\n }\n if (hour < 10) {\n displayhour = \"0\" + hour.toString();\n } else {\n displayhour = hour;\n }\n\n\n document.getElementById(\"output\").innerHTML = \"Stop Watch- \" + displayhour + \":\" + displaymin + \":\" + displaysec; // display updated time\n }", "function stopwatch(){\r\n\r\n seconds++;\r\n\r\n if(seconds / 60 === 1){\r\n seconds = 0; \r\n minutes ++;\r\n\r\n if(minutes /60 ===1){\r\n minutes = 0;\r\n hours++;\r\n }\r\n }\r\n\r\n //adding 0 before one digit charachters\r\n if (seconds <10) {\r\n displaySeconds = \"0\" + seconds.toString();\r\n }\r\n else{\r\n displaySeconds = seconds;\r\n }\r\n\r\n if(minutes <10) {\r\n displayMinutes = \"0\" + minutes.toString();\r\n }\r\n else{\r\n displayMinutes = minutes;\r\n }\r\n\r\n if(hours <10){\r\n displayHours = \"0\" +hours.toString();\r\n }\r\n else{\r\n displayHours = hours;\r\n }\r\n\r\n //display\r\n document.getElementById(\"display\").innerHTML = displayHours + \":\" + displayMinutes + \":\" + displaySeconds;\r\n}", "function Greetings(){\n var datetime = new Date(); \n var hour = datetime.getHours(); \n var min = datetime.getMinutes(); \n var sec = datetime.getSeconds(); \n var strgreet = \"\";\n strtime = hour + \":\" + min + \":\" + sec + \" \"; \n if(hour >= 0 && hour < 5){\n strgreet =\"Good Morning, \";\n }\n if(hour >= 5 && hour < 8){\n strgreet =\"Good Morning, \";\n }\n if(hour >= 8 && hour < 13){ \n strgreet =\"Good Day, \";\n }\n\n if(hour >= 13 && hour < 17){ \n strgreet =\"Good Afternoon, \";\n }\n if(hour >= 17 && hour < 21){\n strgreet =\"Good Evening, \";\n }\n if(hour >= 21 && hour < 24){\n strgreet =\"Good Night, \";\n }\n\n window.setTimeout(\"ShowTime()\",1000); \n document.getElementById(\"greet\").innerText=strgreet;\n }", "function displayTime (){\n\tif(mins<10){\n\t\tmins=\"0\"+mins;\n\t}\n\tif(secs<10){\n\t\tsecs=\"0\"+secs;\n\t}\n\t$('#mins').html(mins);\n\t$('#secs').html(secs);\n}", "function displayTimer() {\n let seconds = timer % 60;\n let minutes = Math.floor(timer / 60);\n\n let display = \"Stop\";\n\n if(minutes !== 0 || seconds !== 0) {\n display = (minutes !== 0) ? \"\" + minutes + \":\" : \"\"; // check if minutes are present\n display = (seconds < 10) ? display + \"0\" + seconds : display + seconds; // format seconds to the output\n }\n\n time_display.innerHTML = display;\n}", "function printTime()\n\t{\n\t\tvar time = getTime();\n\n\t\t// Print time\n\t\ttaskline.obj.time_timeday.innerHTML = time.hour + ':' + time.min;\n\t}", "function checkTime(i) { // this function is a helper for StartTime function to wrap 0's on minutes and seconds. \n if (i < 10) { i = \"0\" + i };\n return i;\n}", "function setSunsetStartTime() {\r\n\tvar newSunsetStartTime = prompt('When does Sunset begin? (24 hour format -> hh:mm)', SunsetStartTime);\r\n\tif (newSunsetStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newSunsetStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Sunset Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setSunsetStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"SunsetStartTime\", newSunsetStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Sunset Start Time", "function windowStart(num) {\n if (num < 12) {\n timeStart = num + \":00 AM\"; //Morning\n } else if (num == 12) {\n timeStart = num + \":00 PM\"; //Midday\n } else if (num > 12) {\n num = num - 12;\n timeStart = num + \":00 PM\"; //afternoon\n }\n return timeStart;\n}", "function displayTime() {\n\tconst clock = document.querySelector('.clock');\n\tclock.innerHTML = time;\n\n\tconst minutes = Math.floor(time / 60);\n\tconst seconds = time % 60;\n\n\tif (seconds < 10) {\n\t\tclock.innerHTML = `${minutes}:0${seconds}`;\n\t} else {\n\t\tclock.innerHTML = `${minutes}:${seconds}`;\n\t}\n}", "function inputWhat(){\n var stuff = $('#tb10').val();\n\n document.querySelector('#time').innerHTML = meal + dat;\n}", "function getInputTimeString(dateString) {\n\tvar fullDate = new Date(dateString);\n\tvar hour = fullDate.getHours();\n\tvar minute = fullDate.getMinutes();\n\n\tif(hour < 10) {\n\t\thour = \"0\" + hour;\n\t}\n\tif(minute < 10) {\n\t\tminute = \"0\" + minute;\n\t}\n\t\n\t// Set seconds to :00\n\treturn hour + \":\" + minute + \":00\";\n}", "function loadTheTime() {\n const date = new Date(),\n hours = date.getHours(),\n minutes = date.getMinutes(),\n seconds = date.getSeconds();\n h1.innerText = `${hours < 10 ? `0${hours}` : hours}:${\n minutes < 10 ? `0${minutes}` : minutes\n }:${seconds < 10 ? `0${seconds}` : seconds}`;\n}", "function setStartTime(newStart) {\n if (newStart < 0 || newStart < (snipWin / 2)) {\n songStart = 0;\n songEnd = snipWin;\n } else {\n songStart = parseFloat(newStart) - (snipWin / 2);\n songEnd = Math.abs(songStart) + snipWin\n }\n}", "function showTime() {\n let today = new Date(),\n hour = today.getHours(),\n min = today.getMinutes(),\n sec = today.getSeconds();\n weekDay = today.getDay();\n day = today.getDate();\n month = today.getMonth();\n\n\n // Set AM or PM\n //const amPm = hour >= 12 ? 'PM' : 'AM';\n\n // 12hr Format\n // hour = hour % 12 || 12;\n\n // Output Time\n time.innerHTML = `${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(\n sec\n )}`;\n date.innerHTML = `${DAYS[weekDay]}<span> </span>${day}<span> </span>${MONTHS[month]}`;\n //${showAmPm ? amPm : ''}`;\n\n setTimeout(showTime, 1000);\n}", "function onTimeEnter() {\n // get get-train-time HH:mm\n let _strTime = inputElements.time.value;\n // split will return array index [0] will be hour\n data.time.firstTime.hour = parseInt(_strTime.split(':')[0]);\n // and index [1] will be minutes\n data.time.firstTime.minute = parseInt(_strTime.split(':')[1]);\n //console.dir(trainInfo);\n}", "function startTime()\n{\n //get how long does it take for the smallest unit to elapse to set timeouts\n var timeout = time.units[time.units.length-1];\n\n //put the name into the text\n $(\"[class^=timeName]\").html(time.name);\n\n //clocks\n localTime();\n currentFictional(timeout);\n countdownToBegin(timeout);\n\n //converters\n $(\"#eyToTimeY\").submit(function(event){\n event.preventDefault();\n $(\"#eyToTimeYResult\").text( earthYearsToTimeYears($(\"#eyToTimeYInput\").val()) );\n });\n\n //SUT year to Earth year\n $(\"#timeToEY\").submit(function(event){\n event.preventDefault();\n $(\"#timeToEYResult\").text( timeYearsToEarthYears($(\"#timeToEYInput\").val()) );\n });\n\n //setup date picker for Earth year\n $(\"#eDToTimeInput\").fdatepicker({format:\"yyyy-mm-dd\"});\n //Earth date to SUT\n $(\"#eDToTime\").submit(function(event){\n event.preventDefault();\n $(\"#eDToTimeResult\").text( earthDateToTime($(\"#eDToTimeInput\").val()) );\n });\n\n}", "function timeFunction() {\n var time, message;\n time = document.getElementById(\"time\").value;\n if (time < 12) {\n \tmessage = \"good morning\";\n }\n else if (time < 17) {\n \tmessage = \"good afternoon\";\n }\n else if (time < 20) {\n \tmessage = \"good evening\";\n } \n else if (time < 24) {\n \tmessage = \"good night\";\n } \n else {\n \tmessage = \"not a valid time\";\n } \n document.getElementById(\"conditionalParagraph\").innerHTML = message;\n}", "showTime(time) {\n const current = new Date(time.time);\n\n const currentMonth = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][current.getMonth()];\n const currentDay = current.getDate();\n const currentYear = current.getFullYear();\n\n const curTime = ui.formatTime(current);\n\n\n this.sunrise.innerHTML = ui.formatTime(new Date(time.sunrise));\n this.sunset.innerHTML = ui.formatTime(new Date(time.sunset));\n this.currentTime.innerHTML = `${curTime}, ${currentMonth} ${currentDay}, ${currentYear}`;\n }", "function showTime() {\n var date = new Date();\n var h = date.getHours();\n var m = date.getMinutes();\n var s = date.getSeconds();\n var session = \"AM\";\n\n // if (h == 0) {\n // h = 12;\n // }\n\n if (h > 12) {\n h = h - 12;\n session = \"PM\";\n }\n\n h = h < 10 ? \"0\" + h : h;\n m = m < 10 ? \"0\" + m : m;\n s = s < 10 ? \"0\" + s : s;\n\n var time = h + \":\" + m + \":\" + s + \"\" + session;\n document.getElementById(\"time\").innerHTML = time;\n // document.getElementById(\"time\").textContent = time;\n\n setTimeout(showTime, 1000);\n}", "function getMilliSec() { \n milliSec = new Date() - today;\n if( numOfStops == 0 ) { displayUp = milliSec; display = milliSec;}\n if( numOfStops > 0 ) { displayUp = milliSec + display; } \n showUp = formatTime( displayUp ); // ------- getting format to string - \"00:00:00.000\"\n document.time.stopwatch.value = showUp; \n }", "function showTime() {\n var currentDate = new Date();\n var currentHour = currentDate.getHours();\n var currentMinute = currentDate.getMinutes();\n var meridian;\n\n if (currentHour >= 12 && currentHour < 24) {//if its betweeen 12pm and 12am, the meridian changes\n currentHour = currentHour - 12;\n if (currentHour == 0) {//if it is noon the hour changes to 12pm\n currentHour = '12';\n }\n meridian = 'pm';\n } else {\n meridian = 'am';\n }\n\n //console.log(currentMinute);\n\n if (currentMinute < 10) { //if the seconds is less than 10, it adds 0 at the begining of the minute value\n currentMinute = '0' + currentMinute;//addition of 0, check for error later \n\n }\n var Totaltime = currentHour + ' : ' + currentMinute + ' ' + meridian;\n String(Totaltime); //Converts the time to a String\n\n document.getElementById(AllIdNames.time_id).innerHTML = '<b>' + Totaltime + '</b>';\n\n setTimeout(function () {\n showTime();\n }, 15000); //update after every 15 seconds\n\n}", "function displayTime(time) {\n let minutes = Math.floor(time / 60);\n let seconds = Math.floor(time % 60);\n minutes = minutes > 9 ? minutes : `0${minutes}`;\n seconds = seconds > 9 ? seconds : `0${seconds}`;\n return `${minutes}:${seconds}`;\n}", "function main() {\n var time = readLine();\n\n length = time.length;\n dateCode = time.substr(-2);\n timeNoCodeAsAry = time.substr(0, length-2).split(\":\");\n hour = timeNoCodeAsAry[0];\n minute = timeNoCodeAsAry[1];\n second = timeNoCodeAsAry[2];\n \n if (dateCode == \"PM\" && hour != \"12\") {\n hour = parseInt(hour) + 12;\n } \n \n if (dateCode == \"AM\" && hour == \"12\" || hour == 24) {\n hour = \"00\";\n }\n \n console.log(hour + \":\" + minute + \":\" + second);\n}", "function startTime() {\r\n var today=new Date();\r\n var h=today.getHours();\r\n var m=today.getMinutes();\r\n var s=today.getSeconds();\r\n m = checkTime(m);\r\n s = checkTime(s);\r\n document.getElementById('currentTime').innerHTML = h+\":\"+m+\":\"+s;\r\n var t = setTimeout(function(){startTime()},500);\r\n}", "function whatTime() {\n var time = new Date().getHours();\n console.log(time)\n\n if (time < 6) {\n document.getElementById(\"time\").innerHTML = \"It's night!\";\n }\n else if (time < 12) {\n document.getElementById(\"time\").innerHTML = \"It's morning!\";\n }\n else if (time < 17) {\n document.getElementById(\"time\").innerHTML = \"It's afternoon!\";\n } \n else if (time < 20) {\n document.getElementById(\"time\").innerHTML = \"It's evening!\";\n } \n else {\n document.getElementById(\"time\").innerHTML = \"It's night!\";\n }\n}", "function startTimer() {\n seconds++;\n if (seconds === 60) {\n minutes++;\n seconds = 0;\n }\n\n // Displays time in 00:00 format by checking if minutes and seconds are < 10\n timerDisplay.innerHTML = (((minutes < 10) ? `0${minutes}` : minutes) + \":\" + ((seconds < 10) ? (`0${seconds}`) : seconds));\n}", "function displayTime(time) {\n const minutes = Math.floor(time / 60);\n let seconds = Math.floor(time % 60);\n seconds = seconds < 10 ? `0${seconds}` : seconds;\n return `${minutes}:${seconds}`;\n}", "function showTime(){\n // let today=new Date(2020,06,10,08,33,30);{Testing purpose}\n let today=new Date(),\n date=today.getDate(),\n hour=today.getHours(),\n min=today.getMinutes(),\n sec=today.getSeconds();\n\n //Set AM or PM using ternanary operator(Shortend)\n const amPm=hour >= 12 ? 'PM' :'AM' ;\n\n //12 hour format\n hour = hour % 12 || 12;\n time.innerHTML=`${hour}<span>:</span>${addZero(min)}<span>:</span>${addZero(sec)} ${showAmPm ? amPm :''}`;\n setTimeout(showTime,1000); \n\n }", "function Time_Function() {\r\n var Time = new Date().getHours();\r\n var Reply;\r\n if (Time < 12 == Time > 0) {\r\n Reply = \"It is morning time!\";\r\n }\r\n else if (Time > 12 == Time < 18) {\r\n Reply = \"It is the afternoon.\";\r\n }\r\n else {\r\n Reply = \"It is evening time.\";\r\n }\r\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\r\n}", "function displayTime(time) {\n\tconst clock = document.querySelector('.clock');\n\tconst minutes = Math.floor(time / 60);\n\tconst seconds = time % 60;\n\tif (seconds < 10) {\n\tclock.innerHTML = `${minutes}:0${seconds}`;\t\t\n\t} else {\n\tclock.innerHTML = `${minutes}:${seconds}`;\t\t\n\t}\n\t//console.log(time);\n\t//clock.innerHTML = time;\n}", "function displayTime(){\n let seconds = time % 60;\n let minutes = Math.floor(time/60);\n timeDisplay = (seconds < 10)? `${minutes}:0${seconds}`: `${minutes}:${seconds}`;\n $('.clock').html(timeDisplay);\n}", "function currentTime(type,showSeconds) {\r\n\tvar d = new Date();\r\n\tvar curr_hour = d.getHours();\r\n\tif (curr_hour < 10) curr_hour = '0'+curr_hour;\r\n\tvar curr_min = d.getMinutes();\r\n\tif (curr_min < 10) curr_min = '0'+curr_min;\r\n\tvar curr_sec = d.getSeconds();\r\n\tif (curr_sec < 10) curr_sec = '0'+curr_sec;\r\n\tif (type=='m') return curr_min;\r\n\telse if (type=='h') return curr_hour;\r\n\telse if (type=='s') return curr_sec;\r\n\telse return curr_hour+':'+curr_min+(showSeconds ? ':'+curr_sec : '');\r\n}", "function printTime(){\n\tvar now = new Date();\n\tvar hours = now.getHours();\n\tvar mins = now.getMinutes();\n\tvar seconds = now.getSeconds();\n\tvar amPm=\"\";\n\tif(hours>12) {\n\t\thours=hours-12;\n\t\tamPm = \"PM\";\n\t}else {\n\t\tamPm=\"AM\";\n\t}\n\tif (hours<10) hours=\"0\"+hours;\n\tif (mins<10) mins=\"0\"+mins;\n\tif (seconds<10) seconds=\"0\"+seconds;\n\tvar time=document.getElementById(\"time\");\n\ttime.innerHTML= \"\"+hours+\":\"+mins+\":\"+seconds+\" \"+amPm;\n}", "function showTime(){\r\n var date = new Date();\r\n var h = date.getHours(); // 0 - 23\r\n var m = date.getMinutes(); // 0 - 59\r\n var s = date.getSeconds(); // 0 - 59\r\n var session = \"AM\";\r\n\r\n if(h == 0){\r\n h = 12;\r\n }\r\n\r\n if(h > 12){\r\n h = h - 12;\r\n session = \"PM\";\r\n }\r\n\r\n h = (h < 10) ? \"0\" + h : h;\r\n m = (m < 10) ? \"0\" + m : m;\r\n s = (s < 10) ? \"0\" + s : s;\r\n\r\n var time = h + \":\" + m + \":\" + s + \" \" + session;\r\n document.getElementById(\"time\").innerText = time;\r\n document.getElementById(\"time\").textContent = time;\r\n\r\n setTimeout(showTime, 1000);\r\n }", "_displayTime(time) {\n const minutes = Math.floor(time / 60);\n let seconds = Math.floor(time % 60);\n seconds = seconds > 9 ? seconds : `0${seconds}`;\n return `${minutes}:${seconds}`;\n }", "function displayTimer() {\n\tif(sec < 10)\n\t\tsecHTML.innerHTML = '0' + sec;\n\telse\n\t\tsecHTML.innerHTML = sec;\n\n\tif(min < 10)\n\t\tminHTML.innerHTML = '0' + min;\n\telse\n\t\tminHTML.innerHTML = min;\n}", "function startTime()\n{\t\n\tvar today=new Date();\n\tvar h=today.getUTCHours();\n\tvar m=today.getUTCMinutes();\n\tvar s=today.getUTCSeconds();\n\tvar day=today.getUTCDate();\n\tvar month=today.getUTCMonth()+1;\n\tvar year=today.getUTCFullYear()\n\t\n\t// add a zero in front of numbers<10\n\tm=if0(m);\n\ts=if0(s);\n\th=if0(h);\n\tday=if0(day);\n\tmonth=if0(month);\n\t$('.showUTCTime').text(day+\".\"+month+\".\"+year+\" \"+h+\":\"+m+\":\"+s);\n\tsetTimeout(\"startTime()\",1000);\n}", "function startTime(){\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds(); \n//====================\t \n m = AddZero(m);\n s = AddZero(s);\n h = AddZero(h);\n //==================\n var weekday = new Array(7);\n weekday[0] = \"Sunday\";\n weekday[1] = \"Monday\";\n weekday[2] = \"Tuesday\";\n weekday[3] = \"Wednesday\";\n weekday[4] = \"Thursday\";\n weekday[5] = \"Friday\";\n weekday[6] = \"Saturday\";\n\tvar nday = weekday[today.getDay()];\n\tvar dDt= today.getUTCDate();\n\t //===========\n var Perid;\n if (h === \"00\") {Perid= \"It is a new Day !\";} \n else if (h < \"12\") {Perid= \"Good Morning !\";} \t \n else if (h >= \"12\" && h < \"17\") {Perid= \"Good Afternoon !\";} \n else if (h >= \"17\" && h < \"21\") {Perid= \"Good Evening !\";} \n else if (h >= \"21\") {Perid= \"We are in late night !\"; }\n var TimeStake=document.getElementById(\"momenT\"); \n var AdatesNtime=\"<span>It&acute;s \"+nday+\" \"+dDt+\" @ \"+ h + \":\" + m + \":\" + s+ \" \"+Perid+\"</span>\";\n TimeStake.innerHTML =AdatesNtime;\t \n setTimeout(startTime, 500);\n}" ]
[ "0.72733974", "0.67191815", "0.6596169", "0.65809697", "0.6580765", "0.65429753", "0.65032536", "0.6488679", "0.64264697", "0.64244735", "0.64218986", "0.6412044", "0.63770914", "0.63741523", "0.6348156", "0.6334134", "0.63304025", "0.632782", "0.6320008", "0.62985444", "0.62867403", "0.627474", "0.62692565", "0.6237439", "0.6236365", "0.6236291", "0.62351775", "0.62305284", "0.6227782", "0.6191023", "0.6190587", "0.61901754", "0.6185181", "0.618412", "0.618412", "0.61761993", "0.61754286", "0.61603206", "0.61461157", "0.61356336", "0.6128481", "0.60932684", "0.608663", "0.6070815", "0.6069712", "0.60692173", "0.60677826", "0.60622597", "0.60601103", "0.60571533", "0.60561544", "0.60560477", "0.6055499", "0.60551065", "0.6055048", "0.60503155", "0.60382307", "0.60358614", "0.6035115", "0.6028385", "0.6027347", "0.6025629", "0.6023199", "0.6020924", "0.6013557", "0.60009605", "0.59939057", "0.5979425", "0.596865", "0.59649533", "0.5962682", "0.59625936", "0.59620625", "0.5955353", "0.59526014", "0.5948384", "0.5943977", "0.59430397", "0.59425735", "0.5942334", "0.59335715", "0.5926892", "0.592446", "0.592347", "0.59221566", "0.5913697", "0.5908087", "0.5906703", "0.5906252", "0.5905009", "0.58992326", "0.58950657", "0.5887604", "0.5885811", "0.58806837", "0.586553", "0.586514", "0.5864003", "0.58628386", "0.58600545" ]
0.6762123
1
if user has input a end time, then use the user input to display, otherwise, display "end Time"
renderEndTime() { if(this.state.endTime === "") { return("End Time*"); } else { return(this.state.endTime.toString()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function elementSelectedEndTime(){\r\n\tvar choice, throwAwayDate, hour, minute,timeDate;\r\n\tchoice = document.form.endTime.value;\r\n\tif (!(choice == \"\")) throwAwayDate = \"12/12/2000 \";\r\n\t//Date portion of Date object is not used, only the hours and minutes are used. Date object parses time fairly well.\r\n\ttimeDate=new Date(throwAwayDate + choice);\r\n\tif(isNaN(timeDate.getHours())) hour = \"<Var>EndHour</Var>\\n \"; else hour = \"<Ind type=\\\"integer\\\">\"+ timeDate.getHours() + \"</Ind>\\n \";\r\n\tif(isNaN(timeDate.getMinutes())) minute = \"<Var>EndMinute</Var>\\n \"; else minute = \"<Ind type=\\\"integer\\\">\"+ timeDate.getMinutes() + \"</Ind>\\n \";\r\n\tendTime = hour + minute + \" \" + \"</Expr>\\n \";\r\n\tif (choice == \"\") englishEndTime = \"any time\";\t\r\n\telse englishEndTime = choice;\r\n\telementErrorDateTimeCheck();\r\n\tcreateRuleML();\r\n}", "function displayEndTime(timestamp) {\n\t// create new Date, hours, mins based on passed argument\n\tconst end = new Date(timestamp);\n\tconst hour = end.getHours();\n\t// adjust hour from military time (values = 0 or > 12);\n\tconst adjustedHour = hour > 12 ? hour - 12 : hour === 0 ? 12 : hour;\n\tconst minutes = end.getMinutes();\n\tconst adjustedMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\t// Set text to adjusted time\n\tendTime.textContent = `Return at ${adjustedHour}:${adjustedMinutes}`;\n}", "function verifyTime(input)\n{\n if (input.value) {\n var timeStr = input.value.toUpperCase();\n\n var hrsmin = timeStr.split(\":\");\n if (hrsmin.length > 1) {\n if (hrsmin[0] < 0 || hrsmin[0] > 99 || hrsmin[1] < 0 || hrsmin[1] > 59) {\n input.value = \"\";\n input.focus();\n } else\n input.value = ((parseInt(hrsmin[0], 10) * 60) + parseInt(hrsmin[1], 10)).toFixed();\n } else {\n var time = parseInt(timeStr, 10);\n if (isNaN(time) || time < 0 || time > 24*60) {\n input.value = \"\";\n input.focus();\n }\n }\n gasUse();\n }\n return;\n}", "function displayEndTime(endTimestamp) {\n // Turn it into date\n const end = new Date(endTimestamp);\n const hour = end.getHours();\n const adjustedHour = hour > 12 ? hour - 12 : hour;\n const minutes = end.getMinutes();\n endTime.style.display = 'block';\n endTime.textContent = `${endsOrEnded} at ${adjustedHour}:${\n minutes < 10 ? '0' : ''\n }${minutes}`;\n}", "function displayEndTime(timestamp) {\n const end = new Date() // used new date method to get current time \n\n const hour = end.getHours() // get the hours using new Date() method\n\n const minutes = end.getMinutes() // get the minutes using minutes \n\n const adjustedHourTo24h = hour > 12 ? hour - 12 : hour; // adjusting hour to 24h format\n\n // displaying conntent to user using textContent\n\n endTime.textContent = `Be back at ${adjustedHourTo24h}:${minutes < 10 ? '0': ''}${minutes}`;\n}", "function setTimeDisplay(time) {\n if (time <= 12) {\n toDoHour = time + \"am\";\n } else {\n toDoHour = (time - 12) + \"pm\";\n }\n}", "function displayEndTime(timestamp) {\n\tconst end = new Date(timestamp); //grab and convert calc-ed end time\n\tconst hour = end.getHours();\n\tconst adjustedHour = hour > 12 ? hour - 12 : hour; //change to 12-hour system\n\tconst minutes = end.getMinutes();\n\n\t//display end time on page and add leading '0' if less than 10mins left\n\tendTime.textContent = `Be Back At ${adjustedHour}:${minutes < 10 ? '0' : ''}${minutes}`; \n}", "function handleTime() {\r\n // times\r\n const minutes = parseInt(this.dataset.time) * 60;\r\n const today = Date.now();\r\n console.log(minutes);\r\n // converting\r\n const ms = minutes * 1000;\r\n // calculation\r\n const together = today + ms;\r\n const newTime = new Date(together);\r\n //displaying\r\n const displayUno = newTime.getHours();\r\n const displayTwo = newTime.getMinutes();\r\n endTime.textContent = `U should be back at ${displayUno < 10 ? '0': ''}${displayUno}:${displayTwo < 10 ? '0':''}${displayTwo}`\r\n}", "function endTimeDate(starttime, endtime) {\n\tvar result = \"\";\n\tvar endtimeDate = new Date(parseInt(endtime));\n\tvar starttimeDate = new Date(parseInt(starttime));\n\n\tvar formattedDate = endtimeDate.getDate() + \"-\" + (endtimeDate.getMonth() + 1) + \"-\" + endtimeDate.getFullYear();\n\n\tvar hours = (endtimeDate.getHours() < 10) ? \"0\" + endtimeDate.getHours() : endtimeDate.getHours();\n\tvar minutes = (endtimeDate.getMinutes() < 10) ? \"0\" + endtimeDate.getMinutes() : endtimeDate.getMinutes();\n\tvar formattedTime = hours + \":\" + minutes;\n\n\tif (endtimeDate.getDate() == starttimeDate.getDate()) {\n\t\tresult = \" til \" + formattedTime;\n\t} else if (endtimeDate.getDate() > starttimeDate.getDate()) {\n\t\tformattedDate = \"<br> Slut \" + formattedDate + \", kl. \" + formattedTime;\n\t\tresult = formattedDate;\n\t} else {\n\t\tresult = \"Wrong date object\";\n\t}\n\treturn result;\n}", "function displayEndTime(timestamp) {\n \n // Pass in the timestamp, which has all of the info below built in. This is a default JS method\n const end = new Date(timestamp);\n\n // Extract hours and minutes from the timestamp\n const hour = end.getHours();\n const minutes = end.getMinutes();\n\n // Display the time.\n // Check if past 12 noon, subtract 12 hours (not military time)\n // Check if less than 10 minutes. '9' becomes '09'\n endTime.textContent = `Be Back at ${hour > 12 ? hour - 12 : hour}:${minutes < 10 ? '0' : ''}${minutes}`;\n}", "function formatDisplayTime()\n{\t\n\tvar displayTime = document.getElementById('displaytime').value;\n\t\n\tif(!displayTime){\n\t\t\n\t\tvar currentTime = new Date(),\n\t\thours = currentTime.getHours(),\n\t\tminutes = currentTime.getMinutes(),\n\t\tformatedTime = '';\n\t\t\n\t\tif (minutes < 10)\n\t\t{\n\t\t\tminutes = \"0\" + minutes\n\t\t}\n\t\tformatedTime = hours + \":\" + minutes;\n\t\t\n\t\tdocument.getElementById('displaytime').value = formatedTime;\n\t}\n}", "function displayEndTime(timestamp) {\n const end = new Date(timestamp);\n // how does timestamp work\n // so you have date.now WHICH is simply the number of milliseconds since January 1st 1970\n // January 1st 1970 is the date when the time started for unix computers\n // BTW: is you put new Date(the number of milliseconds you get from date.now)\n // you get the weekday, month, day, and time\n // you can even put it in a var x = new date(blabla)\n // then start getting the dates you want like\n // x.getDate() you get the day of the month, you have x.getday, x.getmonth, x.gettime...etc\n\n const hour = end.getHours();\n const minutes = end.getMinutes();\n //endTime.textContent = `Be back at ${hour}:${minutes}`; // go to the timer function and add the displayEndTime fnction please\n // so everything is cool is you're european... you understand the 13 hours but some \"people\" don't so let's fix that for those babies\n // plus we also need to fix the minutes you know the zero if it's less than 10\n endTime.textContent = `Be back at ${hour > 12 ? hour - 12 : hour}:${minutes < 10 ? '0' : '' }${minutes}`;\n}", "function onTimeForTheExam(input = []) {\n let [examHour, examMinutes, arrivalHour, arrivalMinutes] = [...input].map(Number);\n let examMins = (examHour * 60) + examMinutes;\n let arrivalMins = (arrivalHour * 60) + arrivalMinutes;\n let timeDiffMins = examMins - arrivalMins;\n\n let output = [];\n if (timeDiffMins > 30) {\n output.push('Early');\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours before the start`);\n } else {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else if (timeDiffMins >= 0) {\n output.push('On time');\n if (timeDiffMins !== 0) {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else {\n output.push('Late');\n timeDiffMins = Math.abs(timeDiffMins);\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours after the start`);\n } else {\n output.push(`${timeDiffMins} minutes after the start`);\n }\n }\n return output.join('\\n');\n}", "function validatetime()\r\n{\r\n if(form.payrate.value == \"select\")\r\n {\r\n alert(\"Please select pay rate\");\r\n form.payrate.focus();\r\n return false;\r\n }\r\n\r\n // regular expression to match required time format\r\n re = /^\\d{1,2}:\\d{2}$/;\r\n\r\n // check start time\r\n if(form.starttime.value == '') \r\n {\r\n alert(\"Please enter shift start time\");\r\n form.starttime.focus();\r\n return false;\r\n }\r\n else if(!form.starttime.value.match(re))\r\n {\r\n alert(\"Invalid time format: \" + form.starttime.value);\r\n form.starttime.focus();\r\n return false;\r\n }\r\n // check end time\r\n else if(form.endtime.value == '')\r\n {\r\n alert(\"Please enter shift end time\");\r\n form.endtime.focus();\r\n return false;\r\n }\r\n else if(!form.endtime.value.match(re)) \r\n {\r\n alert(\"Invalid time format: \" + form.endtime.value);\r\n form.endtime.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function setNightStartTime() {\r\n\tvar newNightStartTime = prompt('When does Night begin? (24 hour format -> hh:mm)', NightStartTime);\r\n\tif (newNightStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newNightStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Night Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setNightStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"NightStartTime\", newNightStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Night Start Time", "function windowEnd(num) {\n num = num + 1;\n if (num < 12) {\n timeEnd = num + \":00 AM\"; //Morning\n } else if (num == 12) {\n timeEnd = num + \":00 PM\"; //Midday\n } else if (num > 12) {\n num = num - 12;\n timeEnd = num + \":00 PM\"; //Afternoon\n }\n return timeEnd;\n}", "function displayEndTime(timestamp) {\n // Create new Date object from time stamp\n const end = new Date(timestamp);\n\n let hour = end.getHours(); // get hours\n const minutes = end.getMinutes(); // get minutes\n let adjustedHour = hour === 0 ? '12' : hour;\n\n endTime.textContent = `Timer ends at ${\n hour > 12 ? hour - 12 : adjustedHour\n }:${minutes < 10 ? '0' : ''}${minutes} ${hour >= 12 ? 'PM' : 'AM'}`;\n}", "function readingTime() {\n const wpm = 250;\n const words = inputVal.trim().split(/\\s+/).length;\n const time = Math.ceil(words / wpm);\n\n if (inputValLen == \"\" && inputValLen == \"0\") {\n timeContainer.innerHTML = \"Type to Calculate Time\";\n } else if (inputValLen < 250) {\n timeContainer.innerHTML =\n \"< <span class = 'colored-cap'>\" + time + \"</span> Minute to Read\";\n } else {\n timeContainer.innerHTML = time + \" Minutes to Read\";\n }\n }", "function formatresults(){\r\n if (this.timesup==false){//if target date/time not yet met\r\n var displaystring=arguments[0]+\" days \"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds left until Scott & Javaneh's Wedding\"\r\n }\r\n else{ //else if target date/time met\r\n var displaystring=\"Future date is here!\"\r\n }\r\n return displaystring\r\n}", "function getDataFromInputs() {\n time = document.getElementById(\"timeEndOfTask\").value;\n if (time == \"\") { //if time is empty put this default\n time = \"20:00\";\n }\n date = document.getElementById(\"dateEndOfTask\").value;\n userEndTime = date + \" \" + time;\n noteText = document.getElementById(\"enterNoteText\").value;\n return date, userEndTime, noteText;\n}", "function getDataFromInputs() {\n time = document.getElementById(\"timeEndOfTask\").value;\n if (time == \"\") { //if time is empty put this default\n time = \"20:00\";\n }\n date = document.getElementById(\"dateEndOfTask\").value;\n userEndTime = date + \" \" + time;\n noteText = document.getElementById(\"enterNoteText\").value;\n return date, userEndTime, noteText;\n}", "function checkconditionlate(timeStart, timeEnd) {\n\n var txt = '';\n\n if (Number(timeStart) < Number(timeEnd)) {\n txt = 'L';\n }\n\n return txt;\n\n }", "function end_format(obj,counter){\n var end = find_time(([obj.end.hour,obj.end.min,0]).toString())\n if(check_time(end._milliseconds) == true){\n dom_format('end',counter,end,true)\n }else if(check_time(end._milliseconds) == false){\n dom_format('end',counter,end,false,\"Ended\")\n }else{\n console.log(\"Luke, I am your father.\")\n }\n }", "function checkTime() {\n if (time.isBefore(nineStart)) {\n $('#inputNine').addClass('future')\n } else if (time.isBetween(nineStart, nineEnd)) {\n $('#inputNine').addClass('present')\n } else if (time.isAfter(nineEnd)) {\n $('#inputNine').addClass('past')\n }\n\n if (time.isBefore(tenStart)) {\n $('#inputTen').addClass('future')\n } else if (time.isBetween(tenStart, tenEnd)) {\n $('#inputTen').addClass('present')\n } else if (time.isAfter(tenEnd)) {\n $('#inputTen').addClass('past')\n }\n\n if (time.isBefore(elevenStart)) {\n $('#inputEleven').addClass('future')\n } else if (time.isBetween(elevenStart, elevenEnd)) {\n $('#inputEleven').addClass('present')\n } else if (time.isAfter(elevenEnd)) {\n $('#inputEleven').addClass('past')\n }\n\n if (time.isBefore(twelveStart)) {\n $('#inputTwelve').addClass('future')\n } else if (time.isBetween(twelveStart, twelveEnd)) {\n $('#inputTwelve').addClass('present')\n } else if (time.isAfter(twelveEnd)) {\n $('#inputTwelve').addClass('past')\n }\n\n if (time.isBefore(oneStart)) {\n $('#inputOne').addClass('future')\n } else if (time.isBetween(oneStart, oneEnd)) {\n $('#inputOne').addClass('present')\n } else if (time.isAfter(oneEnd)) {\n $('#inputOne').addClass('past')\n }\n\n if (time.isBefore(twoStart)) {\n $('#inputTwo').addClass('future')\n } else if (time.isBetween(twoStart, twoEnd)) {\n $('#inputTwo').addClass('present')\n } else if (time.isAfter(twoEnd)) {\n $('#inputTwo').addClass('past')\n }\n\n if (time.isBefore(threeStart)) {\n $('#inputThree').addClass('future')\n } else if (time.isBetween(threeStart, threeEnd)) {\n $('#inputThree').addClass('present')\n } else if (time.isAfter(threeEnd)) {\n $('#inputThree').addClass('past')\n }\n\n if (time.isBefore(fourStart)) {\n $('#inputFour').addClass('future')\n } else if (time.isBetween(fourStart, fourEnd)) {\n $('#inputFour').addClass('present')\n } else if (time.isAfter(fourEnd)) {\n $('#inputFour').addClass('past')\n }\n\n if (time.isBefore(fiveStart)) {\n $('#inputFive').addClass('future')\n } else if (time.isBetween(fiveStart, fiveEnd)) {\n $('#inputFive').addClass('present')\n } else if (time.isAfter(fiveEnd)) {\n $('#inputFive').addClass('past')\n } \n }", "function showtimer() {\n var now = new Date();\n var remain = end - now; // Get The Difference Between Current and entered date time\n if(remain < 0) \n {\n clearInterval(timer);\n document.getElementById(\"timer_value\").innerHTML = 'Reached!';\n return;\n }\n var days = Math.floor(remain / day); // Get Remaining Days\n var hours = Math.floor((remain % day) / hour); // Get Remaining Hours\n var minutes = Math.floor((remain % hour) / minute); // Get Remaining Min\n var seconds = Math.floor((remain % minute) / second); // Get Remaining Sec\n \n document.getElementById(\"timer_value\").innerHTML = days + 'Days ';\n document.getElementById(\"timer_value\").innerHTML += hours + 'Hrs ';\n document.getElementById(\"timer_value\").innerHTML += minutes + 'Mins ';\n document.getElementById(\"timer_value\").innerHTML += seconds + 'Secs';\n }", "function inputTime(e, objText){\r\n\tvar keynum = e.keyCode;\r\n\tif(inputNum(e)){\r\n\t\tif((objText.value.length==2 && keynum!=8) || keynum==37 || keynum==39){\r\n\t\t\tobjText.value += ':';\r\n\t\t}\r\n\t\treturn true;\r\n\t}else{\r\n\t\treturn false;\r\n\t}\r\n}", "function countdownEnd(totalSecond) {\n const endTime = new Date(totalSecond);\n let hours = endTime.getHours();\n let minutes = endTime.getMinutes();\n let dayNight = \"AM\";\n\n if (hours == 0) {\n hours = 12;\n }\n if (hours > 12) {\n hours = hours - 12;\n dayNight = \"PM\";\n }\n minutes = (minutes < 10) ? '0' + minutes : minutes;\n hours = (hours < 10) ? '0' + hours : hours;\n\n\n displayCountdownEnd.textContent = `Be back at ${hours} : ${minutes} : ${dayNight}`\n}", "function formatresults2(){\nif (this.timesup==false){ //if target date/time not yet met\nvar displaystring=\"<span>\"+arguments[0]+\" <sup>days</sup> \"+arguments[1]+\" <sup>hours</sup> \"+arguments[2]+\" <sup>minutes</sup> \"+arguments[3]+\" <sup>seconds</sup></span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"\" //Don't display any text\nalert(\"Launch time!\") //Instead, perform a custom alert\n}\nreturn displaystring\n}", "function endGame(){\n var end = new Date();\n endTime = end.getTime();\n startTime = start.getTime();\n console.log(\"start Time: \" + startTime + \" End Time \" + endTime);\n var finalTime = (end.getTime() - start.getTime())/1000;\n $(\"#timing\").show();\n document.getElementById(\"timing\").innerHTML = \"It took you \" + finalTime + \" seconds! Tell your friends.\";\n\n }", "function autoEndtime() {\n\n var OTFRAC = document.getElementById('ctl00_ContentPlaceHolder1_hfOTFRAC').value;\n\n shift = document.getElementById('ctl00_ContentPlaceHolder1_txtShift').value;\n\n var breakStartTime = shift.substring(16, 21);\n var breakStartHour = breakStartTime.substring(0, 2);\n var breakStartMin = breakStartTime.substring(3, 5);\n\n\n var breakEndTime = shift.substring(23, 28);\n var breakEndHour = breakEndTime.substring(0, 2);\n var breakEndMin = breakEndTime.substring(3, 5);\n\n //Convert hour in minutes\n breakStartHour = parseInt(breakStartHour, 10) * 60;\n breakStartMin = parseInt(breakStartMin, 10) + parseInt(breakStartHour, 10);\n\n breakEndHour = parseInt(breakEndHour, 10) * 60;\n breakEndMin = parseInt(breakEndMin, 10) + parseInt(breakEndHour, 10);\n\n var breakMin = breakEndMin - breakStartMin;\n\n var table = document.getElementById('tst');\n var tbody = table.getElementsByTagName('TBODY')[0];\n var oRow = table.rows[position];\n\n oRow.getElementsByTagName('INPUT')[1].value = formatTime(oRow.getElementsByTagName('INPUT')[1].value, OTFRAC);\n var start = oRow.getElementsByTagName('INPUT')[1].value;\n\n if (start.length == '5') \n {\n \n var startHourInMin = parseInt(start.substring(0, 2), 10) * 60;\n var startMin = parseInt(start.substring(3, 5), 10);\n\n var workHoursInMin = parseFloat(oRow.getElementsByTagName('INPUT')[3].value, 10) * 60;\n\n var startTimeInMin = startHourInMin + startMin;\n\n var endTimeInMin = startTimeInMin + workHoursInMin;\n\n if (startTimeInMin >= breakStartMin && startTimeInMin < breakEndMin) \n {\n// var hour = ((startTimeInMin + breakMin) / 60).toString();\n// if (hour.indexOf(\".\", 0) > 0) // convert hour into a whole number\n// hour = hour.substring(0, hour.indexOf(\".\", 0));\n// var min = startTimeInMin % 60;\n\n// if (hour < 10)\n// hour = '0' + hour;\n\n// if (min < 10)\n// min = '0' + min;\n\n oRow.getElementsByTagName('INPUT')[1].value = breakEndTime;\n }\n \n\n if (endTimeInMin > breakStartMin && startHourInMin <= breakStartMin)\n endTimeInMin += breakMin;\n\n //convert minutes back to hour\n var hour = (endTimeInMin / 60).toString();\n if (hour.indexOf(\".\", 0) > 0) // convert hour into a whole number\n hour = hour.substring(0, hour.indexOf(\".\", 0));\n var min = endTimeInMin % 60;\n\n\n if (hour < 10)\n hour = '0' + hour;\n\n if (min < 10)\n min = '0' + min;\n\n oRow.getElementsByTagName('INPUT')[2].value = hour + ':' + min;\n \n\n var nRow = table.rows[position + 1];\n if (nRow != undefined) \n {\n nRow.getElementsByTagName('INPUT')[1].value = hour + ':' + min;\n\n// var start = nRow.getElementsByTagName('INPUT')[1].value;\n// var end = nRow.getElementsByTagName('INPUT')[2].value;\n\n// var startHour = parseInt(start.substring(0, 2), 10) * 60;\n// var startMin = parseInt(start.substring(3, 5), 10);\n// start = startHour + startMin;\n\n// var endHour = parseInt(end.substring(0, 2), 10) * 60;\n// var endMin = parseInt(end.substring(3, 5), 10);\n// end = endHour + endMin;\n\n// var workHours = (end - start) / 60;\n\n// nRow.getElementsByTagName('INPUT')[3].value = workHours;\n\n// if (workHours <= 0) {\n nRow.getElementsByTagName('INPUT')[2].value = '';\n nRow.getElementsByTagName('INPUT')[3].value = '';\n// }\n }\n }\n}", "function checkClipEnd() {\n if (!continueProcessing) {\n var clipEnd = getTimefieldTimeEnd();\n var duration = getDuration();\n if (isNaN(clipEnd) || (clipEnd > duration)) {\n displayMsg(\"The outpoint is too high or the format is not correct. Correct format: hh:MM:ss.mm. Please check.\",\n \"Check outpoint\");\n return false;\n }\n return true;\n }\n}", "function displayTime(typeOfTime, h, m, hourFormat) {\n // typeOfTime is like 'Server', 'Unit', 'User'\n if (hourFormat === 24) {\n // Display hours in 24\n\n if (h < 24) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + h + ':0' + m)\n } else\n // If minutes flow over\n if (m > 59) {\n if (h > 22) {\n message.channel.send(typeOfTime + ' time: ' + (h+1-24) + ':' + (m-60))\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h+1) + ':' + (m-60))\n }\n \n } else {\n message.channel.send(typeOfTime + ' time: ' + h + ':' + m)\n }\n } else {\n // Wrap around if hour > 24\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':0' + m)\n } else\n if (m > 59) {\n message.channel.send(typeOfTime + ' time: ' + (h+1-24) + ':' + (m-60))\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':' + m)\n }\n }\n\n } else\n if (hourFormat === 12) {\n // Display hours as am/pm\n // am (morning)\n if (h < 12) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + h + ':0' + m + ' am')\n } else\n // If minutes flow over\n if (m > 59) {\n if (h === 11) {\n message.channel.send(typeOfTime + ' time: ' + (h+1) + ':' + (m-60) + ' pm')\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h+1) + ':' + (m-60) + ' am')\n }\n } else {\n message.channel.send(typeOfTime + ' time: ' + h + ':' + m + ' am')\n }\n\n } else\n // am (after midnight)\n if (h > 23) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':0' + m + ' am')\n } else\n // If minutes flow over\n if (m > 59) {\n message.channel.send(typeOfTime + ' time: ' + (h-24+1) + ':' + (m-60) + ' am')\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-24) + ':' + m + ' am')\n }\n\n } else\n // pm (at noon)\n if (h === 12) {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + h + ':0' + m + ' pm')\n } else\n // If minutes flow over\n if (m > 59) {\n message.channel.send(typeOfTime + ' time: ' + (h-12+1) + ':' + (m-60) + ' pm')\n } else {\n message.channel.send(typeOfTime + ' time: ' + h + ':' + m + ' pm')\n }\n\n }\n // pm (any other time)\n else {\n if (m < 10) {\n message.channel.send(typeOfTime + ' time: ' + (h-12) + ':0' + m + ' pm')\n } else\n // If minutes flow over\n if (m > 59) {\n if (h === 23) {\n message.channel.send(typeOfTime + ' time: ' + (h+1-24) + ':' + (m-60) + ' am')\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-12+1) + ':' + (m-60) + ' pm')\n }\n } else {\n message.channel.send(typeOfTime + ' time: ' + (h-12) + ':' + m + ' pm')\n }\n }\n\n\n }\n }", "function CheckTimes(){\n if (Date.getMinutes() == \"00\"){\n var TimeText = [\"Hey darling\", \"It's \" + Time, \"I love you so very much,\", \"mwahhhhh\", \"\\u2661\"];\n OutputText(TimeText); \n }\n else{\n var NotTimeText = [\"Hey\", \"It is not time\", \"Still love you tho\", \"mwah\", \"\\u2661\"];\n OutputText(NotTimeText);\n }\n}", "checkEndValue(value) {\n // if end label smaller start label (14:00 < 18:00)\n if (this.state.endValue <= value) {\n // reset end label\n this.setState({ endValue: '' });\n this.setState({ expandedSec: false });\n // if end time exists ... reset the return timer\n if (this.state.endThis !== null) {\n this.state.endThis.resetTime();\n }\n } else {\n this.checkTimeS(value);\n }\n }", "function inputTimeCheck()\n{\n var element_hh = eval(this.element_hh);\n var element_mi = eval(this.element_mi);\n var element_am = eval(this.element_am);\n\n if ( typeof element_hh != 'undefined' && element_mi !='undefined' && element_am !='undefined' )\n {\n this.custom_alert = (typeof this.custom_alert != 'undefined') ? this.custom_alert : '';\n\n this.ref_label = (typeof this.ref_label != 'undefined') ? this.ref_label\n : JS_RESOURCES.getFormattedString('field_name.substitute', [this.element_hh.name]);\n\n if ( element_hh.selectedIndex == -1 || element_mi.selectedIndex == -1 || element_am == -1 )\n {\n alert(this.custom_alert ? this.custom_alert\n : JS_RESOURCES.getFormattedString('validation.time.required', [this.ref_label]));\n\n if ( element_hh.selectedIndex == -1 )\n {\n element_hh.focus();\n }\n else if ( element_mi.selectedIndex == -1 )\n {\n element_mi.focus();\n }\n else\n {\n element_am.focus();\n }\n return false;\n }\n }\n\n return true;\n}", "function getEndTime(request){\r\n request.endTime = new Date(request.date);\r\n switch (request.duration){\r\n case \"30 minutes\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 30);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"45 minutes\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 45);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"1 hour\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 60);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"2 hours\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 120);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n }\r\n}", "function tpEndSelect( time, startTimePickerInst ) {\n $('#eventStartTime').timepicker('option', {\n maxTime: {\n hour: startTimePickerInst.hours,\n minute: startTimePickerInst.minutes\n }\n });\n}", "function greet(timeStr) {\n /* To throw an error if an incorrect time is submitted, read about Error() below:\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error#Throwing_a_generic_error\n *\n */\n const hour = parseInt(timeStr, 10);\n if ( hour < 12) return \"Good Morning\"\n if ( hour > 17) return \"Good Evening\"\n return \"Good Afternoon\"\n}", "function timeFunction() {\n var time, message;\n time = document.getElementById(\"time\").value;\n if (time < 12) {\n \tmessage = \"good morning\";\n }\n else if (time < 17) {\n \tmessage = \"good afternoon\";\n }\n else if (time < 20) {\n \tmessage = \"good evening\";\n } \n else if (time < 24) {\n \tmessage = \"good night\";\n } \n else {\n \tmessage = \"not a valid time\";\n } \n document.getElementById(\"conditionalParagraph\").innerHTML = message;\n}", "function main() {\n var time = readLine();\n\n hour = time.substring(0,2);\n mins = time.substring(3,5);\n minimins = time.substring(6,8);\n if ( time.indexOf(\"PM\") > 0) {\n if (hour != 12) {\n hour = (Number(hour) + 12).toString();\n }\n }else {\n if(hour == 12) {\n hour = \"00\";\n }\n }\n console.log(hour + time.substring(2,8));\n return;\n}", "function checkTime(field) {\n\t\tFeld = eval('document.poform.'+field);\n\t\tFeldLength = Feld.value.length;\n\t\tFeldValue = Feld.value;\n\t\tif (FeldLength == 1) {\n\t\tFeld.value = \"0\"+FeldValue;\n\t\t}\n\t\tif (FeldLength == 0) {\n\t\tFeld.value = \"00\";\n\t\t}\n\t\tvar t1 = document.poform.start_hour.value+':'+document.poform.start_min.value;\n\t\tvar t2 = document.poform.end_hour.value+':'+document.poform.end_min.value;\n\t\tvar m = ((t2.substring(0,t2.indexOf(':'))-0) * 60 +\n\t\t\t\t(t2.substring(t2.indexOf(':')+1,t2.length)-0)) - \n\t\t\t\t((t1.substring(0,t1.indexOf(':'))-0) * 60 +\n\t\t\t\t(t1.substring(t1.indexOf(':')+1,t1.length)-0));\n\t\tvar h = Math.floor(m / 60);\n\t\tdocument.poform.length.value = h + ':' + (m - (h * 60));\n}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply; \n if (Time < 12 == Time > 0) {\n Reply = \"It is morning time!\";\n }\n else if (Time >= 12 == Time < 18) {\n Reply = \"It is the afternoon.\";\n }\n else {\n Reply = \"It is the evening\"; \n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function timeOfDay(num1){\nlet timeMsg = ['morning.', 'lunch.', 'the afternoon.', 'time to code.', 'time to sleep.' ];\nlet currentTime = \"It's \";\nlet defaultMsg = \"NUMBER EXCEEDS 24 HOURS\";\n//if conditional chain to determine what to say back to the user depending on the number that is \n//supplied in the function arguments.\n\tif(num1 < 7){\n\t\tconsole.log(currentTime + timeMsg[4]); // => \"It's time to sleep.\"\n\t}\n else if(num1 >= 7 && num1 < 12){\n console.log(currentTime + timeMsg[0]); // => \"It's morning.\"\n }\n else if(num1 >= 12 && num1 < 15){\n console.log(currentTime + timeMsg); // => \"It's lunch.\"\n }\n else if(num1 >= 15 && num1 < 17){\n console.log(currentTime + timeMsg[2]); // => \"It's the afternoon.\"\n }\n else if(num1 >= 17 && num1 < 22){\n console.log(currentTime + timeMsg[3]); // => \"It's time to code.\"\n }\n else if(num1 >= 22 && num1 <= 24){\n console.log(currentTime + timeMsg[4]); // => \"It's time to sleep.\"\n }\n /**\n * The else statement acts as a default state that will trigger if all previous checks fail.\n * in this case, the default state will tell the user when their input number is greater\n * than a 24 hour day.\n */\n else{\n console.log(defaultMsg); //prints the variable defaultMsg to the console\n }\n}", "function onTimeChange() {\n if (time >= 0) {\n updateTimeDisplay(time - 1);\n }\n else { \n wrong++;\n outOfTime();\n }\n\n}", "function formatresults(){\nif (this.timesup==false){//if target date/time not yet met\nvar displaystring=\"<span style='background-color: #CFEAFE'>\"+arguments[1]+\" hours \"+arguments[2]+\" minutes \"+arguments[3]+\" seconds</span> left until launch time\"\n}\nelse{ //else if target date/time met\nvar displaystring=\"Launch time!\"\n}\nreturn displaystring\n}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = \"It is morning time.\";\n }\n else if (Time > 12 == Time < 18) {\n Reply = \"It is the afternoon.\";\n }\n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function formatTimeDuration(startTime, endTime) {\n if (typeof startTime !== 'undefined' && typeof endTime !== 'undefined' &&\n startTime !== null && endTime !== null &&\n !isNaN(startTime) && !isNaN(endTime)) {\n if (startTime === endTime) {\n return \"0.0\";\n } else {\n let diff = roundMinutes((endTime - startTime) / 60000);\n return diff + (diff % 1 === 0 ? \".0 \" : \"\");\n }\n } else {\n return \"-\";\n }\n}", "function setTimefieldTimeEnd(time) {\n if (!continueProcessing) {\n $('#clipEnd').timefield('option', 'value', time);\n }\n}", "function Time_Function() {\r\n var Time = new Date().getHours();\r\n var Reply;\r\n if (Time < 12 == Time > 0) {\r\n Reply = \"It is morning time!\";\r\n }\r\n else if (Time > 12 == Time < 18) {\r\n Reply = \"It is the afternoon.\";\r\n }\r\n else {\r\n Reply = \"It is evening time.\";\r\n }\r\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\r\n}", "function Time_Function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = \"It is morning time!\";\n }\n else if (Time > 12 == Time < 18) {\n Reply = \"It is the afternoon.\";\n }\n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML= Reply;\n}", "function checkTimeInput () {\n var val = document.getElementById('work-time').value;\n document.getElementById('work-time').value = val >= MIN_WORK_PERIOD ? val : MIN_WORK_PERIOD;\n}", "function endGame(){\n\n console.log(\"Game complete\")\n\n // Stop the clock\n clearInterval(clockTicks)\n\n // Get the current time on the clock\n var currentTime = clock.currentTime // Time on the stopped clock (date object I think)\n var startTime = new Date(2020,7,1,12,0,0,0) // Time of start (also a date object)\n var eDate = new Date(currentTime - startTime) // Might be unecessary\n var eTime = Math.round(eDate.getTime()/1000) // Convert to seconds and round\n var eHours = eDate.getHours() - 1\n var eMins = eDate.getMinutes()\n var eSecs = eDate.getSeconds()\n\n // Compare the current time to 8pm.\n var cutOff = new Date(2020,7,1,20,0,0,0) \n if (currentTime <= cutOff) {\n var endText = \"Congratulations!\" \n var endText1 = \"You found the artefact in time. The villagers will take you to back to the mainland. \"\n var endText2 = \"Your time was \" + eHours + \"h \" + eMins + \"m \" + eSecs + \"s.\"\n } else {\n var endText = \"Bad luck!\" \n var endText1 = \"You found the artefact but the boat has gone and you're stuck here forever... \"\n var endText2 = \"Your time was \" + eHours + \"h \" + eMins + \"m \" + eSecs + \"s.\"\n }\n var endText3 = \"Please enter a team name:\"\n\n // Put together a dialogue to show completion\n $('#dialogue-modal').find('.modal-title').text(endText)\n $('#dialogue-modal').find('.modal-title').append($('<span class=\"endText endText1\">'+endText1+'</span>'))\n .append($('<span class=\"endText endText2\">'+endText2+'</span>'))\n .append($('<span class=\"endText endText3\">'+endText3+'</span>'))\n .append($('<span contenteditable=\"true\" class=\"endText endText4\"></span>'))\n $('#dialogue-modal').find('.modal-footer').find('.btn')\n .text('Submit Time')\n // On click method to show the leaderboard\n .on(\"click\",function(){\n $('#dialogue-modal').modal('hide')\n $('#minigame-modal').modal('hide')\n\n // Submit the time to the database (as a string)\n var playerName = $('.endText4').text()\n var travelTime = runningTravelTime // Which is in seconds\n var puzzleTime = eTime - runningTravelTime // Also in seconds\n submitTime(playerName,Math.round(travelTime),Math.round(puzzleTime),Math.round(eTime)) // Everything in seconds\n\n })\n // Show the modal and focus on the text box\n $('#dialogue-modal').modal('show')\n $('.endText4').focus()\n\n}", "function setNighthalt(trip_duration,start_actual_time,end_actual_time)\n\t{\n\t\tvar _time = trip_duration.split('-');\n\t\n\t\n\t\tif(_time[1] < 8){//hour less than 8 no night halt\n\t\t\treturn false;\n\t\t}else if(_time[1] > 24){\n\t\t\treturn true;\n\t\t}else if($('.startdt').val() != $('.enddt').val()){\n\t\t\treturn true;\n\t\t}else{\n\n\t\t\tvar start_hr = start_actual_time.getHours();\n\t\t\tvar start_min = start_actual_time.getMinutes();\n\t\t\tvar end_hr = end_actual_time.getHours();\n\t\t\tvar end_min = end_actual_time.getMinutes();\n\t\t\tif(end_hr > 23 || end_hr == 0 || (end_hr == 23 && end_min >= 30)){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t//alert(end_hr);\n\t\t\t/*if((start_hr > 15) || (start_hr == 15 && start_min >= 30) || (start_hr < 15 && (end_hr == 23 && end_min >= 30)) || (start_hr < 15 && end_hr == 0)){\n\t\t\t\treturn true;\n\t\t\t\n\t\t\t}else if((end_hr > 23) || (end_hr > 0) || (end_hr == 23 && end_min >= 30)){\n\t\t\t\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}*/\n\t\t}\n\t\n\n\t}", "function Time_function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = 'It is morning time!';\n }\n else if (Time >= 12 == Time < 18) {\n Reply = 'It is afternoon.';\n }\n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function timeGo(){\n\t\t\tvar dateNow=new Date();\n\t\t\tvar arr=adddate(dateNow,dateEnd);\n\t\t\tfor (var i=0;i<arr.length;i++) {\n\t\t\t\tarr[i] = arr[i] < 10 ? '0'+arr[i]:arr[i];\n\t\t\t}\n\t\t\t\n\t\t\tvar txt=arr[0]+\"天\"+arr[1]+\"小时\"+arr[2]+\"分\"+arr[3]+\"秒\";\n\t\t\t$('.timeRest b').text(txt);\n\t\t\t\n\t\t\tif(dateNow.getTime() >= dateEnd.getTime()){\n\t\t\t\tclearInterval(iCount);\n\t\t\t\tarr = [00,00,00,00];\n\t\t\t\t$('.timeRest').html(\"<p>众筹已结束</p><p>十月遵义不见不散</p>\").css(\"color\",\"red\").css(\"font-weight\",\"bolder\");\n\t\t\t}\n\t\t}", "function main() {\n var time = readLine();\n\n length = time.length;\n dateCode = time.substr(-2);\n timeNoCodeAsAry = time.substr(0, length-2).split(\":\");\n hour = timeNoCodeAsAry[0];\n minute = timeNoCodeAsAry[1];\n second = timeNoCodeAsAry[2];\n \n if (dateCode == \"PM\" && hour != \"12\") {\n hour = parseInt(hour) + 12;\n } \n \n if (dateCode == \"AM\" && hour == \"12\" || hour == 24) {\n hour = \"00\";\n }\n \n console.log(hour + \":\" + minute + \":\" + second);\n}", "function startTime() {\r\n var delta = Date.now() - start_time; // in milliseconds\r\n time.seconds = Math.floor((delta % (1000 * 60)) / 1000);\r\n time.minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\r\n time.hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n\r\n if(time.seconds < 10) {\r\n seconds_display.textContent = '0' + time.seconds; \r\n }\r\n else {\r\n seconds_display.textContent = time.seconds; \r\n }\r\n\r\n if(time.minutes < 10) {\r\n minutes_display.textContent = '0' + time.minutes;\r\n }\r\n else {\r\n minutes_display.textContent = time.minutes;\r\n }\r\n\r\n if(time.hours < 10) {\r\n hours_display.textContent = '0' + time.hours;\r\n }\r\n else {\r\n hours_display.textContent = time.hours;\r\n }\r\n}", "timeSelector(startDate, endDate) {\n const isValid = startDate.isSameOrBefore(endDate)\n // if validation is failed, show caveat\n if (!isValid) {\n showCaveat(Lang.CAVEAT_TIMEPICER_START_TIME_IS_AFTER_END_TIME)\n }\n return isValid\n }", "function displayTime() {\n //Calculate the number of minutes and seconds based on the current time\n var min = Math.floor(currentTime / 60);\n var sec = Math.floor(currentTime % 60);\n \n //Add a 0 to the front of the second when appropriate\n if (sec < 10) {\n sec = \"0\" + sec;\n }\n \n $(\"#time-text\").text(min + \":\" + sec);\n }", "function Time_function() {\n var Time = new Date().getHours();\n var Reply;\n if (Time < 12 == Time > 0) {\n Reply = \"It is moring time!\";\n }\n else if(Time >=12 == Time > 18) {\n Reply = \"It is afternoon.\";\n } \n else {\n Reply = \"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML = Reply;\n}", "function viewtime(e) {\n const eventID = e.target.value;\n for(let i = 0; i < eventclass.length; i ++) {\n let apm = \"AM\";\n if(eventclass[i].apm == 0) {\n apm = \"AM\";\n } else {\n apm = \"PM\";\n }\n \n let endapm = \"AM\";\n if(eventclass[i].end_apm == 0) {\n endapm = \"AM\";\n } else {\n endapm = \"PM\";\n }\n let tag = eventclass[i].tag;\n if(tag == null) {\n tag = \"None\";\n }\n if(eventclass[i].id == eventID) {\n alert(\"Name: \" + eventclass[i].name +\"\\n Date: \" + eventclass[i].month + \"/\" + eventclass[i].day + \"/\" + eventclass[i].year + \"\\n Time: \"+ eventclass[i].hour + \":\" + eventclass[i].minute + \" \" + apm + \" - \" + eventclass[i].end_hour + \":\" + eventclass[i].end_minute + \" \" + endapm + \"\\n Tag: \" + tag);\n }\n }\n}", "function Greetings(){\n var datetime = new Date(); \n var hour = datetime.getHours(); \n var min = datetime.getMinutes(); \n var sec = datetime.getSeconds(); \n var strgreet = \"\";\n strtime = hour + \":\" + min + \":\" + sec + \" \"; \n if(hour >= 0 && hour < 5){\n strgreet =\"Good Morning, \";\n }\n if(hour >= 5 && hour < 8){\n strgreet =\"Good Morning, \";\n }\n if(hour >= 8 && hour < 13){ \n strgreet =\"Good Day, \";\n }\n\n if(hour >= 13 && hour < 17){ \n strgreet =\"Good Afternoon, \";\n }\n if(hour >= 17 && hour < 21){\n strgreet =\"Good Evening, \";\n }\n if(hour >= 21 && hour < 24){\n strgreet =\"Good Night, \";\n }\n\n window.setTimeout(\"ShowTime()\",1000); \n document.getElementById(\"greet\").innerText=strgreet;\n }", "function displayTime() {\n time--;\n $(\"#timer-holder\").html(\"Time remaining: \" + time);\n \n if (time <= 0) {\n hideGameContainers();\n stopTime();\n $(\"#answer-holder\").show();\n $(\"#answer-holder\").html(\"Time is up! The answer is: \" + answer[count]);\n unanswered++;\n count++;\n endGame();\n }\n \n }", "function getTimefieldTimeEnd() {\n return parseFloat($('#clipEnd').timefield('option', 'value'));\n}", "function Time_function() {\n var Time=new Date().getHours();\n var Reply;\n if (Time<12==Time>0) {\n Reply=\"It is morning time!\";\n }\n else if (Time>=12==Time<18) {\n Reply=\"It is afternoon.\";\n }\n else {\n Reply=\"It is evening time.\";\n }\n document.getElementById(\"Time_of_day\").innerHTML=Reply;\n}", "function setMinEnd() {\n var startInput = $('#startTime').val();\n var minEndHoursI = parseInt(startInput.substr(0,2)) + 1;\n var minEndHours = minEndHoursI.toString();\n var minEnd = minEndHours + ':00';\n\n if(minEndHoursI < 10) {\n minEnd = '0' + minEnd;\n }\n\n $('#endTime').attr('min', minEnd);\n}", "function time_handle(time) { //time in seconds\r\n var day = 60*60*24;\r\n var hour = 60*60;\r\n var minute = 60;\r\n if (time <= 0) {\r\n return \"No time remaining.\";\r\n }\r\n var timedays = parseInt(time/day, 10);\r\n var timehours = (parseInt(time/hour, 10))%24;\r\n var timemins = (parseInt(time/minute, 10))%60;\r\n var timesecs = (parseInt(time, 10))%60;\r\n var output = \"\";\r\n if (timedays >= 1) {\r\n if (timedays == 1) {\r\n output = timedays + \" day\";\r\n }\r\n else {\r\n output = timedays + \" days\";\r\n }\r\n if (timehours >=1 || timemins >=1 || timesecs >=1) {\r\n output = output + \", \";\r\n }\r\n }\r\n if (timehours >= 1) {\r\n if (timehours == 1) {\r\n output = output + timehours + \" hour\";\r\n }\r\n else {\r\n output = output + timehours + \" hours\";\r\n }\r\n if (timemins >=1 || timesecs >=1) {\r\n output = output + \", \";\r\n }\r\n }\r\n if (timemins >= 1) {\r\n if (timemins == 1) {\r\n output = output + timemins + \" minute\";\r\n }\r\n else {\r\n output = output + timemins + \" minutes\";\r\n }\r\n if (timesecs >=1) {\r\n output = output + \", \";\r\n }\r\n }\r\n if (timesecs >= 1) {\r\n if (timesecs == 1) {\r\n output = output + timesecs + \" second\";\r\n }\r\n else {\r\n output = output + timesecs + \" seconds\";\r\n }\r\n }\r\n return output;\r\n}", "function greet(timeString) {\n const time = timeString.split(':')\n const inputTime = parseInt(time)\n if (inputTime < 12) return 'Good Morning'\n if (inputTime > 17) return 'Good Evening'\n return 'Good Afternoon'\n}", "function getTimeOfDay(time) {\r\n let timeOfDay = '';\r\n\r\n // these statements are read from top to bottom\r\n // going to pick the FIRST true statement\r\n // you can have as many else if()'s as you want. there is no limit\r\n if (time < 12) {\r\n timeOfDay = 'good morning';\r\n } else if (time < 17) {\r\n timeOfDay = 'good afternoon';\r\n }\r\n // final else is a \"catch all\"\r\n else {\r\n timeOfDay = 'good evening';\r\n }\r\n\r\n return timeOfDay;\r\n\r\n}", "function setSunsetStartTime() {\r\n\tvar newSunsetStartTime = prompt('When does Sunset begin? (24 hour format -> hh:mm)', SunsetStartTime);\r\n\tif (newSunsetStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newSunsetStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Sunset Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setSunsetStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"SunsetStartTime\", newSunsetStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Sunset Start Time", "function endScore() {\n // splits the time into an array and gets the time in seconds.\n let finishedTimeArray = finishedTime_p.textContent.split(\":\");\n let finishedTimeSeconds = (+finishedTimeArray[0]) * 60 * 60 + (+finishedTimeArray[1]) * 60 + (+finishedTimeArray[2]);\n // get the end timer and put it on to the game over screen\n finishedTime_p.textContent = timer_p.textContent; \n /* \n if finished time seconds are greater than 180 seconds then end message is You're slower than Frosty on a sunny day.\n if finished time seconds are greater than 120 seconds then end message is Come on you can match faster. Think of the cookies you will get if you win!\n if finished time seconds are greater than 60 seconds then end message is Not the fastest but still pretty good.\n if finished time seconds are less than 30 seconds then end message is Wow you're really good at this!\n */\n if( finishedTimeSeconds >= 180){\n endMessage_p.textContent = \"You're slower than Frosty on a sunny day.\";\n } else if (finishedTimeSeconds >= 120){\n endMessage_p.textContent = \"Come on you can match faster. Think of the cookies you will get if you win!\";\n }else if (finishedTimeSeconds >= 60) {\n endMessage_p.textContent = \"Not the fastest but still pretty good.\";\n } else if (finishedTimeSeconds < 30) {\n endMessage_p.textContent = \"Wow you're really good at this!\";\n }\n}", "function greet(string){\n if (string < \"12:00\") {\n return \"Good Morning\"\n } else if (string > \"12:00\" && string < \"17:00\") {\n return \"Good Afternoon\"\n } else if (string > \"17:00\" && string < \"00:00\") { //\n return \"Good Evening\"\n } else {\n return \"I don't know how to respond to this time.\"\n };\n}", "function showTime() {\n // get the time\n let tdy = new Date();\n let hrs = tdy.getHours();\n let min = tdy.getMinutes();\n let sec = tdy.getSeconds();\n\n // display AM or PM\n const amPm = hrs > 12 ? \"PM\" : \"AM\";\n\n // set 12 hr format\n hrs = hrs % 12 || 12;\n\n // add Zero in min and sec\n function addZero(e) {\n return (parseInt(e, 10) < 10 ? \"0\" : \"\") + e;\n }\n time.innerHTML = `${hrs}<span>:</span>${addZero(min)}<span>:</span>${addZero(sec)}<span> </span>${amPm}`;\n setTimeout(showTime, 1000);\n}", "function setSunshineStartTime() {\r\n\tvar newSunshineStartTime = prompt('When does Sunshine begin? (24 hour format -> hh:mm)', SunshineStartTime);\r\n\tif (newSunshineStartTime == null) {\r\n\t\treturn false;\r\n\t} else if (!newSunshineStartTime.match(/^[0-9]{2}\\:[0-9]{2}$/)) {\r\n\t\talert(\"Sunshine Start Time is an invalid format (24 hour format -> hh:mm)\");\r\n\t\treturn setSunshineStartTime();\r\n\t} else {\r\n\t\tGM_setValue(\"SunshineStartTime\", newSunshineStartTime);\r\n\t\treturn true;\r\n\t}\r\n} //End Sunshine Start Time", "displayTime() {\n if(app === 1){\n this.d1.value = this.twoDigitNum(stopwatch.t1);\n this.d2.value = this.twoDigitNum(stopwatch.t2);\n this.d3.value = this.twoDigitNum(stopwatch.t3);\n }\n else{\n this.d1.value = this.twoDigitNum(timer.t1);\n this.d2.value = this.twoDigitNum(timer.t2);\n this.d3.value = this.twoDigitNum(timer.t3);\n }\n }", "function showTime() {\n\t\ttry {\n\t\t\tvar hours = time.getUTCHours();\n\t\t\tvar minutes = time.getUTCMinutes();\n\t\t\tvar seconds = time.getUTCSeconds();\n\t\n\t\t\t// build the human-readable format\n\t\t\tvar timeValue = \"\" + ((hours > 12) ? hours - 12 : hours);\n\t\t\ttimeValue += ((minutes < 10) ? \":0\" : \":\") + minutes;\n\t\t\ttimeValue += ((seconds < 10) ? \":0\" : \":\") + seconds;\n\t\t\ttimeValue += (hours >= 12) ? \" pm\" : \" am\";\n\t\n\t\t\tvar clockElement;\n\t\t\tif ((piratequesting.sidebar) && (clockElement = sidebar.contentDocument.getElementById('servertime'))) {\n\t\t\t\tclockElement.setAttribute(\"value\", timeValue);\n\t\t\t}\n\t\t} \n\t\tcatch (e) {\n\t\t\tdumpError(e);\n\t\t}\t\n\t}", "function displayTime() {\n var str = \"\";\n\n var currentTime = new Date()\n var hours = currentTime.getHours()\n var minutes = currentTime.getMinutes()\n var seconds = currentTime.getSeconds()\n\n if (minutes < 10) {\n minutes = \"0\" + minutes\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds\n }\n str += hours + \":\" + minutes + \":\" + seconds + \" \";\n if(hours > 11){\n str += \"PM\"\n } else {\n str += \"AM\"\n }\n return str;\n}", "function whatTime() {\n var time = new Date().getHours();\n console.log(time)\n\n if (time < 6) {\n document.getElementById(\"time\").innerHTML = \"It's night!\";\n }\n else if (time < 12) {\n document.getElementById(\"time\").innerHTML = \"It's morning!\";\n }\n else if (time < 17) {\n document.getElementById(\"time\").innerHTML = \"It's afternoon!\";\n } \n else if (time < 20) {\n document.getElementById(\"time\").innerHTML = \"It's evening!\";\n } \n else {\n document.getElementById(\"time\").innerHTML = \"It's night!\";\n }\n}", "function printTimeInWords() {\n var msg;\n if (minNow === 0) {\n return '<span class=\"its\">It\\'s</span><br>' + '<span class=\"hour\">' + setHours() + '</span><br>' + ' <span class=\"min\">o\\'clock</span>.';\n } \n else if (minNow === 30) {\n return '<span class=\"its\">It\\'s</span> <br> <span class=\"min\">half past</span> <br>' + '<span class=\"hour\">' + setHours() + '</span>' + '.';\n }\n else {\n\t \n msg = '<span class=\"its\">It\\'s</span> <br >' + '<span class=\"min\">' + setMinutes() + '</span>' + '<span class=\"pos\">' + setPos() + '</span> <br>' + '<span class=\"hour\">' + setHours() + '</span>' + '.';\n return msg;\n }\n}", "function initialTimeValidate() {\n var initialTimeInput = document.getElementById(\"add_initial_time\");\n if (initialTimeInput.value == \"\") {\n document.getElementById(\"initialDateStatus\").innerHTML =\n \"Please enter the initial time for the event\";\n document.getElementById(\"initialDateStatus\").style.display = \"block\";\n return false;\n } else {\n document.getElementById(\"initialDateStatus\").style.display = \"none\";\n newEvent.initialTime = document.getElementById(\"add_initial_time\").value;\n return true;\n }\n }", "function check_time()\n{\n var time = prompt(\"Enter time:\");\n //time pattern regular expression\n var regexp = /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/;\n\n if (regexp.test(time))\n {\n alert(\"Right time format\")\n }\n else\n {\n alert(\"Wrong time format\")\n }\n}", "function endCondition_outOfTime() {\n outOfTime_count++;\n let headingText = \"Out of Time\";\n let giveDetails = \"The correct answer was:\";\n callModal(headingText, giveDetails);\n }", "function end(task_id, time) {\n if (TIME_ID == \"\") {\n alert(\"You haven't started the task yet.\");\n }\n\n else {\n let text = JSON.stringify({\n time_block: {\n start: START_TIME,\n end: time,\n convert: true\n },\n });\n\n $.ajax(time_block_path + \"/\" + TIME_ID, {\n method: \"put\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => { set_time_link(task_id, \"End\"); },\n error: (resp) => { console.log(resp); }\n });\n }\n}", "function test12HourTime(time12input,time24input){\n\t var time12 = $(time12input);\n\t var time24 = $(time24input);\n\t var value12 = time12.val();\n\t\n var timeMatch = /^(\\d{1,2}):*(\\d{2})*([ap]m)?$/i\n \n if(value12.match(timeMatch) != null){\n time12.removeClass(\"stop\");\n \n var hours = RegExp.$1;\n var mins = RegExp.$2;\n var ampm = RegExp.$3; \n if(Number(hours) > 0 && Number(hours) < 13 && Number(mins) < 60 && Number(mins) > -1){\n time12.addClass(\"go\");\n time24.val(format24HourTimeFrom12HourPieces(hours,mins,ampm));\n time24.change();\n //do nothing right now for blanks\n } else {\n time12.addClass(\"stop\");\n } \n } else if( $.trim(value12) == '' ) {\n time12.addClass(\"yield\");\n } else {\n time12.addClass(\"stop\");\n }\n}", "function InputTime(obj) {\r\n if ((window.event.keyCode != 8) && (window.event.keyCode != 46)) {\r\n if (!(((window.event.keyCode >= 48) && (window.event.keyCode <= 57)) ||\r\n\t\t\t\t((window.event.keyCode >= 96) && (window.event.keyCode <= 105)))) {\r\n obj.value = obj.value.substring(0, obj.value.length - 1);\r\n return false;\r\n }\r\n else {\r\n if (obj.value.length == 2)\r\n obj.value += \":\";\r\n }\r\n\r\n if (obj.value.length == 5)\r\n obj.value = obj.value.substring(0, 2) + \":\" + obj.value.substring(3, 5);\r\n }\r\n}", "function timeGreetingText() {\n const timeCheck = moment().hours() \n if(timeCheck < 12) {\n $(\"#timeGreeting\").text(\"Good Morning!\");\n } \n else if(timeCheck > 12 && timeCheck < 17) {\n $(\"#timeGreeting\").text(\"Good Afternoon!\"); \n }\n else if(timeCheck > 17 && timeCheck < 21) {\n $(\"#timeGreeting\").text(\"Good Evening!\"); \n }\n else {\n $(\"#timeGreeting\").text(\"Have a Wonderful Night!\"); \n }\n }", "function greet(timeString) {\n const timeSplit = timeString.split(\":\", 1);\n const parsed = parseInt(timeSplit, 10)\n if (parsed >= 6 && parsed < 12 ) {\n return \"Good Morning\";\n } else if (parsed >= 12 && parsed < 17){\n return \"Good Afternoon\";\n } else {\n return \"Good Evening\";\n }\n}", "function greet(time){\n const timeSplit = time.split(':')\n const timeHourMin = parseInt(timeSplit[0] + timeSplit[1])\n if (timeHourMin < 1200) {\n return \"Good Morning\"\n } else if (timeHourMin >= 1200 && timeHourMin <= 1700) {\n return \"Good Afternoon\"\n } else {\n return \"Good Evening\"\n } \n}", "function greet(time){\n if ((time.match(/^([0-9]?|1[0-1]):[0-5][0-9]/)) != null ){\n return \"Good Morning\"\n } else if ((time.match(/^1[2-6]:[0-5][0-9]/)) != null){\n return \"Good Afternoon\"\n } else if ((time.match(/^1([7-9]|2[0-2]):[0-5][0-9]/)) != null){\n return \"Good Evening\"\n } else {\n return time\n }\n}", "function currentTime() {\n var time = today.format(\"H\");\n console.log(time);\n\n if (time == 9) {\n input9am.setAttribute(\"id\", \"present\");\n } else if (time > 9) {\n input9am.setAttribute(\"id\", \"past\");\n }\n\n if (time == 10) {\n input10am.setAttribute(\"id\", \"present\");\n } else if (time >= 11) {\n input10am.setAttribute(\"id\", \"past\");\n } else if (time < 10) {\n input10am.setAttribute(\"id\", \"future\");\n }\n\n if (time == 11) {\n input11am.setAttribute(\"id\", \"present\");\n } else if (time >= 12) {\n input11am.setAttribute(\"id\", \"past\");\n } else if (time < 11) {\n input11am.setAttribute(\"id\", \"future\");\n }\n\n if (time == 12) {\n input12pm.setAttribute(\"id\", \"present\");\n } else if (time >= 13) {\n input12pm.setAttribute(\"id\", \"past\");\n } else if (time < 12) {\n input12pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 13) {\n input1pm.setAttribute(\"id\", \"present\");\n } else if (time >= 14) {\n input1pm.setAttribute(\"id\", \"past\");\n } else if (time < 13) {\n input1pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 14) {\n input2pm.setAttribute(\"id\", \"present\");\n } else if (time >= 15) {\n input2pm.setAttribute(\"id\", \"past\");\n } else if (time < 14) {\n input2pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 15) {\n input3pm.setAttribute(\"id\", \"present\");\n } else if (time >= 16) {\n input3pm.setAttribute(\"id\", \"past\");\n } else if (time < 15) {\n input3pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 16) {\n input4pm.setAttribute(\"id\", \"present\");\n } else if (time >= 17) {\n input4pm.setAttribute(\"id\", \"past\");\n } else if (time < 16) {\n input4pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 17) {\n input5pm.setAttribute(\"id\", \"present\");\n } else if (time >= 18) {\n input5pm.setAttribute(\"id\", \"past\");\n } else if (time < 17) {\n input5pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 18) {\n input6pm.setAttribute(\"id\", \"present\");\n } else if (time >= 19) {\n input6pm.setAttribute(\"id\", \"past\");\n } else if (time < 18) {\n input6pm.setAttribute(\"id\", \"future\");\n }\n\n if (time == 19) {\n input7pm.setAttribute(\"id\", \"present\");\n } else if (time >= 20) {\n input7pm.setAttribute(\"id\", \"past\");\n } else if (time < 19) {\n input7pm.setAttribute(\"id\", \"future\");\n }\n}", "function parseEndTime(query, params, wide) {\n if (query.end) {\n params.tmEnd = thyme.parseTimeRelaxed(query.end);\n if (!params.tmEnd) {\n return \"bad end time\";\n }\n } else if (typeof query.ndays === 'string') {\n const nDays = parseInt(query.ndays);\n if (!nDays || nDays < 0) {\n return \"bad ndays\";\n }\n params.tmEnd = params.tmStart.clone().addDays(nDays-1);\n } else if (wide) {\n params.tmEnd = db.findLastDay();\n if (!params.tmEnd) {\n return \"no last day\";\n }\n } else {\n params.tmEnd = params.tmStart;\n }\n // success\n return null;\n}", "function solveConflicts(time){\n\t\n\t// get data from ddl's\n\tvar beginHour = $(\"#beginHour\").val();\n\tvar beginMin = $(\"#beginMin\").val();\n\t\t\t\n\tvar endHour = $(\"#endHour\").val();\n\tvar endMin = $(\"#endMin\").val();\n\t\n\tswitch(time){\n\t\tcase 'begin':\n\t\t\t// set begin and end time in one var (eg 12:30 -> 1230)\n\t\t\tvar beginTime = \"\" + beginHour + beginMin;\n\t\t\tvar beginTime = parseInt(beginTime);\n\t\t\tvar endTime = \"\" + endHour + endMin;\n\t\t\tvar endTime = parseInt(endTime);\n\t\t\t\n\t\t\t// sets endhour always +15 minutes compared to beginhour-input by user\n\t\t\tif(beginTime >= endTime){\n\t\t\t\tbeginMin = parseInt(beginMin);\n\t\t\t\tif(beginMin < 45){\n\t\t\t\t\tbeginMin += 15;\n\t\t\t\t\t$(\"#endHour\").val(beginHour);\n\t\t\t\t\t$(\"#endMin\").val(\"\"+beginMin);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbeginHour = parseInt(beginHour) + 1;\n\t\t\t\t\t$(\"#endHour\").val(beginHour);\n\t\t\t\t\t$(\"#endMin\").val(\"00\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t\t\n\t\tcase 'end':\n\t\t\t// set begin and end time in one var (eg 12:30 -> 1230)\n\t\t\tvar beginTime = \"\" + beginHour + beginMin;\n\t\t\tvar beginTime = parseInt(beginTime);\n\t\t\tvar endTime = \"\" + endHour + endMin;\n\t\t\tvar endTime = parseInt(endTime);\n\t\t\t// makes sure user doesnt select an endhour-value before the beginvalue\n\t\t\tif(beginTime > endTime){\n\t\t\t\tbeginMin = parseInt(beginMin);\n\t\t\t\tif(beginMin < 45){\n\t\t\t\t\tbeginMin += 15;\n\t\t\t\t\t$(\"#endHour\").val(beginHour);\n\t\t\t\t\t$(\"#endMin\").val(\"\"+beginMin);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tbeginHour = parseInt(beginHour) + 1;\n\t\t\t\t\t$(\"#endHour\").val(beginHour);\n\t\t\t\t\t$(\"#endMin\").val(\"00\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t}\n\t\n\tfilterResults();\n}", "function checkTime()\r\n { \r\n var pass = false;\r\n var ids = [\"#time_mon\", \"#time_tue\", \"#time_wed\", \"#time_thu\", \"#time_fri\", \"#time_sat\", \"#time_sun\"]; \r\n for(i in ids){\r\n if($(ids[i]).val()){ //the user input something here\r\n pass = true; //set true for now. To flag that at least a day is available\r\n //check if the entered format is correct\r\n var reg = new RegExp(/^\\d{4}$/);\r\n var arr = $(ids[i]).val().split(' '); //split into time frame chunks \r\n for(j in arr){ \r\n var temp = arr[j].split('-'); //get a specific time\r\n if(reg.test(temp[0]) && reg.test(temp[1])){ //if the tokens are true\r\n //check if the timeslots are within 24 hours \r\n if(temp[0] <= 2400 && temp[1] <= 2400){\r\n pass = true; \r\n// alert(temp[0]);\r\n// alert(temp[1]);\r\n }\r\n else{\r\n pass = false;\r\n }\r\n }\r\n else{\r\n var day = ids[i].split('_')[1];\r\n// alert(day); \r\n if(day == \"wed\"){\r\n day += \"nesday\";\r\n }\r\n else if(day == \"thu\"){\r\n day += \"rsday\";\r\n }\r\n else if(day == \"tue\"){\r\n day += \"sday\";\r\n }\r\n else if(day == \"sat\"){\r\n day += \"urday\";\r\n }\r\n else{\r\n day += \"day\";\r\n } \r\n day = \"Please fix your availability on \" + day;\r\n alert(day); //alert user as to what is wrong \r\n $(ids[i]).focus();\r\n pass = false;\r\n return pass;\r\n }\r\n }\r\n } \r\n } \r\n if(pass == false){\r\n alert(\"Something went wrong with your availability.\");\r\n $(\"#time_mon\").focus(); \r\n }\r\n return pass;\r\n }", "function timeInputIsCorrect(input) {\r\n\r\n var time, hours, mins, correct = true,\r\n patt = new RegExp(\"^[0-9]?[0-9]:[0-9]{2}$\");\r\n\r\n /* Check input is in the format \"00:00\" */\r\n\r\n if (!patt.test(input.value)) {\r\n\r\n correct = false;\r\n\r\n } else {\r\n\r\n time = input.value.split(\":\");\r\n if (time.length !== 2) {\r\n\r\n correct = false;\r\n\r\n } else {\r\n\r\n hours = parseInt(time[0], 10);\r\n mins = parseInt(time[1], 10);\r\n\r\n if (hours < 0 || isNaN(hours)) {\r\n\r\n correct = false;\r\n\r\n } else if (mins > 59) {\r\n\r\n correct = false;\r\n\r\n } else if (mins < 0 || isNaN(mins)) {\r\n\r\n correct = false;\r\n\r\n }\r\n\r\n }\r\n\r\n }\r\n\r\n if (!correct) {\r\n\r\n input.style.border = \"1px solid #ff0000\";\r\n input.style.padding = \"2px 1px\";\r\n input.style.color = \"red\";\r\n\r\n setTimeout(function () {\r\n\r\n input.style.border = \"\";\r\n input.style.padding = \"\";\r\n input.style.color = \"\";\r\n\r\n }, 2500);\r\n\r\n }\r\n\r\n return correct;\r\n}", "function mainTime() {\n var previousTime = $('#timeR').text();\n var newTime = previousTime - 1;\n\n if (newTime < 1) {\n clearInterval(gameTimer);\n displayResults();\n return;\n\n }\n\n $('#timeR').text(newTime);\n}", "function hourChange(){\n\tif((userInputHour.length === 2) && (userInput < 10)){\n\t\thourNew = userInputHour.slice(1, 2);\n\t} else if(userInputHour > 25) {\n\t\talert('Please insert a proper hour figure')\n\t}\n}", "onChange(startTime, endTime, breakTime) {\n\t\tlet workHours = 0;\n\t\tif (endTime && startTime) {\n\t\t\tlet gap = 0;\n\t\t\tlet startDate = new Date(\"2019-07-09T\" + startTime + \"Z\");\n\t\t\tlet endDate = new Date(\"2019-07-09T\" + endTime + \"Z\");\n\t\t\tgap = endDate - startDate;\n\t\t\tworkHours = (gap / 1000 / 60 / 60).toFixed(2);\n\t\t}\n\t\tif (breakTime) {\n\t\t\tworkHours = (workHours - breakTime / 60).toFixed(2);\n\t\t}\n\t\treturn workHours;\n\t}", "function timeTeller(hour, minute, ampm){\n var ampmVal;\n if(ampm === \"AM\"){\n ampmVal = \" in the morning\"\n } else {\n ampmVal = \" in the evening\"\n }\n\n if(minute % 15 == 0){\n if(minute === 15){\n console.log(\"It's a quarter after \" + hour + ampmVal);\n return;\n } else if(minute === 30){\n console.log(\"It's half past \" + hour + ampmVal);\n return;\n } else if(minute === 45){\n console.log(\"It's a quarter till \" + (hour + 1) + ampmVal);\n return;\n }\n }\n\n if(minute < 30){\n console.log(\"It's just after \" + hour + ampmVal);\n } else if(minute > 30){\n console.log(\"It's almost \" + (hour + 1) + ampmVal);\n }\n}", "function findEndTime(string) {\n\t\tconst endTimeRegex = /-T(0[0-9]|1[0-9]|2[0-3]|[0-9]):([0-5][0-9]):([0-5][0-9])$/;\n\t\tif (endTimeRegex.test(string)) {\n\t\t\treturn string.match(endTimeRegex);\n\t\t}\n\t\treturn null;\n\t}", "function greet(time){\n let a= Number((time.split(\":\")[0]));\n if(a<12){\n return \"Good Morning\"\n }\n else if(a>=12&&a<=17){\n return \"Good Afternoon\"\n }\n else if(a>17){\n return \"Good Evening\"\n }\n}" ]
[ "0.667933", "0.6667509", "0.6523096", "0.6487509", "0.6477516", "0.64736855", "0.64731383", "0.6409878", "0.6348529", "0.6298164", "0.6287669", "0.62502676", "0.62301624", "0.61882377", "0.6176649", "0.6166275", "0.6158592", "0.61551034", "0.6151506", "0.61425334", "0.61425334", "0.61380917", "0.61364233", "0.61246663", "0.61235493", "0.6091783", "0.6072944", "0.60504836", "0.6042675", "0.6041703", "0.6037874", "0.60176456", "0.6014746", "0.6014654", "0.6005403", "0.600285", "0.5982924", "0.59788215", "0.5976801", "0.59506875", "0.59406096", "0.59323925", "0.59256715", "0.592472", "0.592373", "0.59076756", "0.59008753", "0.5889653", "0.58888835", "0.5884379", "0.588198", "0.58802", "0.58761406", "0.5865682", "0.5864156", "0.5851873", "0.58485484", "0.5848084", "0.58458287", "0.58439636", "0.5843949", "0.5836252", "0.5832775", "0.583084", "0.5824285", "0.5814398", "0.58013606", "0.5776799", "0.5770498", "0.57699686", "0.5765215", "0.57635194", "0.5760657", "0.5760159", "0.57579386", "0.5751334", "0.5747311", "0.57426775", "0.574137", "0.5730251", "0.5727022", "0.57254726", "0.5715687", "0.57012135", "0.56969005", "0.5689735", "0.56883186", "0.5685463", "0.5683622", "0.5682991", "0.567957", "0.56791174", "0.5676047", "0.56600237", "0.5657625", "0.565751", "0.56549656", "0.56468004", "0.56458527", "0.56453264" ]
0.64368427
7
Append transformations to modelView
function multMatrix(m) { modelView = mult(modelView, m); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function transformFunction(model) {\n\t// Need to convert the model to a JSON object\n\tvar transform = model.toJSON();\n\ttransform.title = '' + transform.titulo;\n\ttransform.subtitle = \"Puesto: \" + transform.imagen + \" Salario: \" + transform.cuerpo;\n\treturn transform;\n}", "calculateModelView() {\n this.modelViewMatrix = this.camera.getViewTransform();\n }", "function AddTransformer() {}", "function makeModelTransform(currModel) {\n var zAxis = vec3.create(), sumRotation = mat4.create(), temp = mat4.create(), negCenter = vec3.create();\n\n vec3.normalize(zAxis,vec3.cross(zAxis,currModel.xAxis,currModel.yAxis)); // get the new model z axis\n mat4.set(sumRotation, // get the composite rotation\n currModel.xAxis[0], currModel.yAxis[0], zAxis[0], 0,\n currModel.xAxis[1], currModel.yAxis[1], zAxis[1], 0,\n currModel.xAxis[2], currModel.yAxis[2], zAxis[2], 0,\n 0, 0, 0, 1);\n vec3.negate(negCenter,currModel.center);\n mat4.multiply(sumRotation,sumRotation,mat4.fromTranslation(temp,negCenter)); // rotate * -translate\n mat4.multiply(sumRotation,mat4.fromTranslation(temp,currModel.center),sumRotation); // translate * rotate * -translate\n mat4.fromTranslation(mMatrix,currModel.translation); // translate in model matrix\n mat4.multiply(mMatrix,mMatrix,sumRotation); // rotate in model matrix\n } // end make model transform", "function makeModelTransform(currModel) {\n var zAxis = vec3.create(), sumRotation = mat4.create(), temp = mat4.create(), negCenter = vec3.create();\n\n vec3.normalize(zAxis,vec3.cross(zAxis,currModel.xAxis,currModel.yAxis)); // get the new model z axis\n mat4.set(sumRotation, // get the composite rotation\n currModel.xAxis[0], currModel.xAxis[1], currModel.xAxis[2], 0,\n currModel.yAxis[0], currModel.yAxis[1], currModel.yAxis[2], 0,\n zAxis[0], zAxis[1], zAxis[2], 0,\n 0, 0, 0, 1);\n vec3.negate(negCenter,currModel.center);\n mat4.multiply(sumRotation,sumRotation,mat4.fromTranslation(temp,negCenter)); // rotate * -translate\n mat4.multiply(sumRotation,mat4.fromTranslation(temp,currModel.center),sumRotation); // translate * rotate * -translate\n mat4.fromTranslation(mMatrix,currModel.translation); // translate in model matrix\n mat4.multiply(mMatrix,mMatrix,sumRotation); // rotate in model matrix\n } // end make model transform", "function makeModelTransform(currModel) {\n var zAxis = vec3.create(), sumRotation = mat4.create(), temp = mat4.create(), negCtr = vec3.create();\n\n // move the model to the origin\n mat4.fromTranslation(mMatrix,vec3.negate(negCtr,currModel.center)); \n \n // scale for highlighting if needed\n if (currModel.on)\n mat4.multiply(mMatrix,mat4.fromScaling(temp,vec3.fromValues(1.2,1.2,1.2)),mMatrix); // S(1.2) * T(-ctr)\n \n // rotate the model to current interactive orientation\n vec3.normalize(zAxis,vec3.cross(zAxis,currModel.xAxis,currModel.yAxis)); // get the new model z axis\n mat4.set(sumRotation, // get the composite rotation\n currModel.xAxis[0], currModel.yAxis[0], zAxis[0], 0,\n currModel.xAxis[1], currModel.yAxis[1], zAxis[1], 0,\n currModel.xAxis[2], currModel.yAxis[2], zAxis[2], 0,\n 0, 0, 0, 1);\n mat4.multiply(mMatrix,sumRotation,mMatrix); // R(ax) * S(1.2) * T(-ctr)\n \n // translate back to model center\n mat4.multiply(mMatrix,mat4.fromTranslation(temp,currModel.center),mMatrix); // T(ctr) * R(ax) * S(1.2) * T(-ctr)\n\n // translate model to current interactive orientation\n mat4.multiply(mMatrix,mat4.fromTranslation(temp,currModel.translation),mMatrix); // T(pos)*T(ctr)*R(ax)*S(1.2)*T(-ctr)\n \n } // end make model transform", "transformModel(sourcemodel) {\n this._transformModel(sourcemodel);\n return;\n }", "function update_model_view() {\r\n\tlet mv = mult(rotateZ(thetas[2]), mult(rotateY(thetas[1]), rotateX(thetas[0])));\r\n\tmv = mult(translate(position[0], position[1], position[2]), mv);\r\n\tmv = mult(scalem(cur_scale, cur_scale, cur_scale), mv);\r\n\tgl.uniformMatrix4fv(model_view_loc, false, flatten(mv));\r\n}", "transform (model) {\n return {\n // add your transformation object here\n id: model.id,\n first_name: model.first_name,\n last_name: model.last_name,\n email: model.email,\n birth_date: moment(model.birth_date).format(\"DD/MM/YYYY\"),\n gender: model.gender,\n document: model.document,\n phone: model.phone,\n zip_code: model.zip_code,\n address_street: model.address_street,\n address_number: model.address_number,\n address_neighborhood: model.address_neighborhood,\n address_complement: model.address_complement,\n address_reference: model.address_reference,\n address_city: model.address_city,\n address_state: model.address_state,\n status: model.status,\n picture: model.picture ? `${Helpers.publicPath('uploads')}\\\\${model.picture}` : null\n }\n }", "getTransform(){return this.__transform}", "function updateData(){\n angle += 0.01 ;\n\n modelView.rotateX(0.1);\n}", "function transformModel(options,data){var prop=options.model&&options.model.prop||'value';var event=options.model&&options.model.event||'input';(data.props||(data.props={}))[prop]=data.model.value;var on=data.on||(data.on={});if(isDef(on[event])){on[event]=[data.model.callback].concat(on[event]);}else{on[event]=data.model.callback;}}", "function transformModel(options,data){var prop=options.model&&options.model.prop||'value';var event=options.model&&options.model.event||'input';(data.props||(data.props={}))[prop]=data.model.value;var on=data.on||(data.on={});if(isDef(on[event])){on[event]=[data.model.callback].concat(on[event]);}else{on[event]=data.model.callback;}}", "function updateModelViewMatrix() {\r\n let mv = glMatrix.mat4.fromRotationTranslationScale(glMatrix.mat4.create(),\r\n glMatrix.quat.fromEuler(glMatrix.quat.create(), ...rotation), position, scale);\r\n gl.uniformMatrix4fv(gl.program.uModelViewMatrix, false, mv);\r\n}", "get transform() {}", "get transform() {}", "get transform() {}", "get transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "function Transform() {}", "apply() {\n this.scene.multMatrix(this.transfMatrix);\n }", "function makeModelTransform(whichTriSet) {\n var zAxis = vec3.create(), sumRotation = mat4.create(), temp = mat4.create(), negCtr = vec3.create();\n\n // move the model to the origin\n mat4.fromTranslation(mMatrix,vec3.negate(negCtr,centerArray[whichTriSet])); \n \n // rotate the model to current interactive orientation\n vec3.normalize(zAxis,vec3.cross(zAxis,xAxisArray[whichTriSet],yAxisArray[whichTriSet])); // get the new model z axis\n mat4.set(sumRotation, // get the composite rotation\n xAxisArray[whichTriSet][0], yAxisArray[whichTriSet][0], zAxis[0], 0,\n xAxisArray[whichTriSet][1], yAxisArray[whichTriSet][1], zAxis[1], 0,\n xAxisArray[whichTriSet][2], yAxisArray[whichTriSet][2], zAxis[2], 0,\n 0, 0, 0, 1);\n mat4.multiply(mMatrix,sumRotation,mMatrix); // R(ax) * S(1.2) * T(-ctr)\n \n // translate back to model center\n mat4.multiply(mMatrix,mat4.fromTranslation(temp,centerArray[whichTriSet]),mMatrix); // T(ctr) * R(ax) * S(1.2) * T(-ctr)\n\n // translate model to current interactive orientation\n mat4.multiply(mMatrix,mat4.fromTranslation(temp,transArray[whichTriSet]),mMatrix); // T(pos)*T(ctr)*R(ax)*S(1.2)*T(-ctr)\n \n } // end make model transform", "get modelViewMatrix() { return this._modelViewMatrix; }", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "set transform(value) {}", "transform(model) {\n model = model.toJSON()\n return {\n id: model.id,\n url: model.url,\n size: model.size,\n original_name: model.original_name,\n extension: model.extension\n }\n }", "updateAnimation() {\n\n this.modelMatrix.rotate(1,0,1,0)\n }", "function Transformation() {\r\n\t\tvar fn = {\r\n\t\t\ttranslate: new TransformFunction('translate({x}px,{y}px)', {x:0, y:0}),\r\n\t\t\tscale: new TransformFunction('scale({x},{y})', {x:1, y:1}),\r\n\t\t\trotate: new TransformFunction('rotate({deg}deg)', {deg:0})\r\n\t\t};\r\n\t\t\r\n\t\tif (supports3d) {\r\n\t\t\t// Use 3D transforms for better performance\r\n\t\t\tfn.translate = new TransformFunction('translate3d({x}px,{y}px,0px)', {x:0, y:0});\r\n\t\t\tfn.scale = new TransformFunction('scale3d({x},{y},1)', {x:1, y:1});\r\n\t\t}\t\r\n\t\t\r\n\t\tvar commands = {\r\n\t\t\trotate: function(deg) {\r\n\t\t\t\tfn.rotate.deg = deg;\r\n\t\t\t},\r\n\t\t\trotateBy: function(deg) {\r\n\t\t\t\tfn.rotate.deg += deg;\r\n\t\t\t},\r\n\t\t\tscale: function(s) {\r\n\t\t\t\tif (typeof s == 'number') {\r\n\t\t\t\t\ts = {x: s, y: s};\r\n\t\t\t\t}\r\n\t\t\t\tfn.scale.x = s.x;\r\n\t\t\t\tfn.scale.y = s.y;\r\n\t\t\t},\r\n\t\t\tscaleBy: function(s) {\r\n\t\t\t\tif (typeof s == 'number') {\r\n\t\t\t\t\ts = {x: s, y: s};\r\n\t\t\t\t}\r\n\t\t\t\tfn.scale.x *= s.x;\r\n\t\t\t\tfn.scale.y *= s.y;\r\n\t\t\t},\r\n\t\t\ttranslate: function(s) {\r\n\t\t\t\tvar t = fn.translate;\r\n\t\t\t\tif (!s) {\r\n\t\t\t\t\ts = {x: 0, y: 0};\r\n\t\t\t\t}\r\n\t\t\t\tt.x = (s.x !== undefined) ? parseInt(s.x, 10) : t.x;\r\n\t\t\t\tt.y = (s.y !== undefined) ? parseInt(s.y, 10) : t.y;\r\n\t\t\t},\r\n\t\t\ttranslateBy: function(s) {\r\n\t\t\t\tvar t = fn.translate;\r\n\t\t\t\tt.x += parseInt(s.x, 10) || 0;\r\n\t\t\t\tt.y += parseInt(s.y, 10) || 0;\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.fn = fn;\r\n\t\tthis.exec = function(cmd) {\r\n\t\t\tfor (var n in cmd) {\r\n\t\t\t\tif (commands[n]) {\r\n\t\t\t\t\tcommands[n](cmd[n]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t};\r\n\t\tthis.reset = function() {\r\n\t\t\t$.each(fn, function() {\r\n\t\t\t\tthis.reset();\r\n\t\t\t});\r\n\t\t};\r\n\t\tthis.format = function() {\r\n\t\t\tvar s = '';\r\n\t\t\t$.each(fn, function(k, v) {\r\n\t\t\t\ts += v.format() + ' ';\r\n\t\t\t});\r\n\t\t\treturn s;\r\n\t\t};\r\n\t}", "update () {\n \tthis.modelMatrix.set();\n this.modelMatrix.scale(this.scale);\n this.modelMatrix.rotate(this.orientation);\n this.modelMatrix.translate(this.position);\n\n this.modelMatrixInverse = this.modelMatrix.clone().invert();\n }", "_setTransform(transform){\n this._element.setAttribute('transform',transform);\n }", "transform(e3v) {\nreturn (this._r.rotate(e3v)).setAdd(this._t);\n}", "updateAnimation() {\n var translateToOrigin = new Matrix4 ();\n var rotateInPlace = new Matrix4 ();\n var translateBack = new Matrix4 ();\n\n translateToOrigin.setTranslate(-this.x[0], -this.y[0], 0);\n rotateInPlace.setRotate(4, 0, 0, 1);\n translateBack.setTranslate(this.x[0], this.y[0], 0);\n\n this.modelMatrix = translateToOrigin.multiply(this.modelMatrix);\n this.modelMatrix = rotateInPlace.multiply(this.modelMatrix);\n this.modelMatrix = translateBack.multiply(this.modelMatrix);\n \n //this.modelMatrix.setLookAt(0, -1, 1, 0, 0, 0, 0, 0, 1.903);\n }", "setTransform(valueNew){let t=e.ValueConverter.toObject(valueNew);if(null===t&&(t=this.getAttributeDefaultValueInternal(\"Transform\")),t&&!Array.isArray(t))return void(TCHMI_CONSOLE_LOG_LEVEL>=1&&e.Log.error(\"[Source=Control, Module=TcHmi.Controls.System.TcHmiControl, Id=\"+this.getId()+\", Attribute=Transform] Non array values are not supported.\"));let r=this.__objectResolvers.get(\"transform\");r&&(r.watchDestroyer&&r.watchDestroyer(),r.resolver.destroy());let s=new e.Symbol.ObjectResolver(t);this.__objectResolvers.set(\"transform\",{resolver:s,watchCallback:this.__onResolverForTransformWatchCallback,watchDestroyer:s.watch(this.__onResolverForTransformWatchCallback)})}", "function transformFunction(_model) {\n // Need to convert the model to a JSON object\n var transform = _model.toJSON();\n if (['iphone', 'android', 'blackberry', 'windows', 'mobile'].indexOf(transform.url) > -1) {\n\t\tif (OS_ANDROID) {\n\t\t\ttransform.image = \"/images/ic_handles_mobile.png\";\n\t\t} else if (OS_IOS) {\n\t\t\ttransform.image = \"images/ic_handles_mobile.png\";\n\t\t}\n\t} else {\n\t\tif (OS_ANDROID) {\n\t\t\ttransform.image = \"/images/ic_handles_\"+transform.url+\".png\";\n\t\t} else if (OS_IOS) {\n\t\t\ttransform.image = \"images/ic_handles_\"+transform.url+\".png\";\n\t\t}\n\t}\n return transform;\n}", "function vxlTransforms(vw){\r\n\tthis._stack = [];\r\n\tthis.view = vw;\r\n\tthis.mvMatrix = mat4.create(); // The Model-View matrix\r\n\tthis.pMatrix = mat4.create(); // The projection matrix\r\n\tthis.nMatrix = mat4.create(); // The normal matrix\r\n\tthis.cMatrix = mat4.create(); // The camera matrix\r\n\tthis.mvpMatrix = mat4.create();\t\r\n}", "_updateTransform() {\n this._applyTransform(this._transform)\n this.redraw()\n if (this.callbacks.didUpdateTransform) {\n this.callbacks.didUpdateTransform(this._transform)\n }\n }", "set modelViewMatrix(mvMat) { this._modelViewMatrix = mvMat; }", "_updateModel () {\n mat4.identity(this._modelMatrix);\n\n mat4.fromQuat(this._modelMatrix, this.rotation);\n mat4.scale(this._modelMatrix, this._modelMatrix, this.scale);\n mat4.translate(this._modelMatrix, this._modelMatrix, this.position);\n\n mat4.invert(this._inverseModelMatrix, this._modelMatrix);\n }", "apply() {\n this.scene.multMatrix(this.animTransform);\n }", "function vxlTransforms(vw){\r\n\tthis.stack = [];\r\n\tthis.view = vw;\r\n\tthis.mvMatrix = new vxlMatrix4x4(); // The Model-View matrix\r\n\tthis.pMatrix = new vxlMatrix4x4(); // The projection matrix\r\n\tthis.nMatrix = new vxlMatrix4x4(); // The normal matrix\r\n\tthis.cMatrix = new vxlMatrix4x4(); // The camera matrix\t\r\n}", "function applyModelTransform(el, state) {\n if (el.directives) {\n for (var i = 0; i < el.directives.length; i++) {\n var dir = el.directives[i];\n if (dir.name === \"model\") {\n state.directives.model(el, dir, state.warn);\n // remove value for textarea as its converted to text\n if (el.tag === \"textarea\" && el.props) {\n el.props = el.props.filter(function (p) {\n return p.name !== \"value\";\n });\n }\n break;\n }\n }\n }\n }", "function transformModel (options, data) {\n\t var prop = (options.model && options.model.prop) || 'value';\n\t var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (on[event]) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "function transformModel (options, data) {\n\t var prop = (options.model && options.model.prop) || 'value';\n\t var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (on[event]) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "function transformModel (options, data) {\n\t var prop = (options.model && options.model.prop) || 'value';\n\t var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (on[event]) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "function updateModelview() {\n\t\t// update LocalModelview() {\n\t\tif(!this.localModelviewUpToDate) {\n\n\t\t\t// Calculate local modelview.\n\t\t\tmat4.identity(this.localModelview);\n\n\t\t\t// Translate last, thus include the code first.\n\t\t\tmat4.translate(this.localModelview, this.transformation.translate);\n\n\t\t\t// Calculate and store the rotation separately, because it is used for normals.\n\t\t\t// Mind the this is not commutative, thus only the rotation applied last (x)\n\t\t\t// will work as expected. Rotation around z will always turn the original (not rotated) model.\n\t\t\tmat4.identity(this.localRotation);\n\t\t\tmat4.rotateX(this.localRotation, this.transformation.rotate[0]);\n\t\t\tmat4.rotateY(this.localRotation, this.transformation.rotate[1]);\n\t\t\tmat4.rotateZ(this.localRotation, this.transformation.rotate[2]);\n\t\t\t// Include rotation.\n\t\t\tmat4.multiply(this.localModelview, this.localRotation, this.localModelview);\n\n\t\t\t// Include scaling.\n\t\t\tmat4.scale(this.localModelview, this.transformation.scale);\n\n\t\t\t// BEGIN exercise Shear\n\t\t\t// Include shearing.\n\t\t\t// Modify the matrix this.localShear (see mat4.translate for matrix data structure).\n\n\t\t\t// END exercise Shear\n\n\t\t\t// Locally we are up to date, but we have to adjust world MV.\n\t\t\tthis.localModelviewUpToDate = true;\n\t\t\tthis.worldModelviewUpToDate = false;\n\t\t}\n\t\t// Update WorldModelview and worldRotation.\n\t\tif(!this.worldModelviewUpToDate) {\n\t\t\tmat4.identity(this.worldModelview);\n\t\t\tmat4.identity(this.worldRotation);\n\t\t\t// Include transformation of parent node.\n\t\t\tif(this.parent !== null) {\n\t\t\t\tvar PWMV = this.parent.updateModelview();\n\t\t\t\tvar PWR = this.parent.updateRotation();\n\t\t\t\tmat4.multiply(this.worldModelview, PWMV, this.worldModelview);\n\t\t\t\tmat4.multiply(this.worldRotation, PWR, this.worldRotation);\n\t\t\t}\n\t\t\t// Combine world of parents with local to this world.\n\t\t\tmat4.multiply(this.worldModelview, this.localModelview, this.worldModelview);\n\t\t\tmat4.multiply(this.worldRotation, this.localRotation, this.worldRotation);\n\t\t\tthis.worldModelviewUpToDate = true;\n\t\t}\n\t\treturn this.worldModelview;\n\t}", "function setModelTransforms( FBXTree, model, modelNode ) {\n \n // http://help.autodesk.com/view/FBX/2017/ENU/?guid=__cpp_ref_class_fbx_euler_html\n if ( 'RotationOrder' in modelNode ) {\n \n var enums = [\n 'XYZ', // default\n 'XZY',\n 'YZX',\n 'ZXY',\n 'YXZ',\n 'ZYX',\n 'SphericXYZ',\n ];\n \n var value = parseInt( modelNode.RotationOrder.value, 10 );\n \n if ( value > 0 && value < 6 ) {\n \n // model.rotation.order = enums[ value ];\n \n // Note: Euler order other than XYZ is currently not supported, so just display a warning for now\n console.warn( 'THREE.FBXLoader: unsupported Euler Order: %s. Currently only XYZ order is supported. Animations and rotations may be incorrect.', enums[ value ] );\n \n } else if ( value === 6 ) {\n \n console.warn( 'THREE.FBXLoader: unsupported Euler Order: Spherical XYZ. Animations and rotations may be incorrect.' );\n \n }\n \n }\n \n if ( 'Lcl_Translation' in modelNode ) {\n \n model.position.fromArray( modelNode.Lcl_Translation.value );\n \n }\n \n if ( 'Lcl_Rotation' in modelNode ) {\n \n var rotation = modelNode.Lcl_Rotation.value.map( THREE.Math.degToRad );\n rotation.push( 'ZYX' );\n model.rotation.fromArray( rotation );\n \n }\n \n if ( 'Lcl_Scaling' in modelNode ) {\n \n model.scale.fromArray( modelNode.Lcl_Scaling.value );\n \n }\n \n if ( 'PreRotation' in modelNode ) {\n \n var array = modelNode.PreRotation.value.map( THREE.Math.degToRad );\n array[ 3 ] = 'ZYX';\n \n var preRotations = new THREE.Euler().fromArray( array );\n \n preRotations = new THREE.Quaternion().setFromEuler( preRotations );\n var currentRotation = new THREE.Quaternion().setFromEuler( model.rotation );\n preRotations.multiply( currentRotation );\n model.rotation.setFromQuaternion( preRotations, 'ZYX' );\n \n }\n \n }", "transform (model) {\n return {\n id: model.id,\n name: model.name\n }\n }", "function transformModel (options, data) {\n\t var prop = (options.model && options.model.prop) || 'value';\n\t var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (isDef(on[event])) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "function transformModel (options, data) {\n\t var prop = (options.model && options.model.prop) || 'value';\n\t var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (isDef(on[event])) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "_generateViewModel() {\n let content = renders.renderViewModel(this._config);\n this._writer.writeViewModel(content);\n }", "function transformModel(options, data) {\n\t var prop = options.model && options.model.prop || 'value';\n\t var event = options.model && options.model.event || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (isDef(on[event])) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "function transformModel(options, data) {\n\t var prop = options.model && options.model.prop || 'value';\n\t var event = options.model && options.model.event || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n\t var on = data.on || (data.on = {});\n\t if (isDef(on[event])) {\n\t on[event] = [data.model.callback].concat(on[event]);\n\t } else {\n\t on[event] = data.model.callback;\n\t }\n\t}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (on[event]) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (on[event]) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (on[event]) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function updateModelView(modelView) {\n gl.uniformMatrix4fv(locations.modelView, false, flatten(modelView));\n gl.uniformMatrix4fv(locations.normalLocation, false, flatten(modelView));\n}", "function applyModelTransform (el, state) {\n if (el.directives) {\n for (var i = 0; i < el.directives.length; i++) {\n var dir = el.directives[i];\n if (dir.name === 'model') {\n state.directives.model(el, dir, state.warn);\n // remove value for textarea as its converted to text\n if (el.tag === 'textarea' && el.props) {\n el.props = el.props.filter(function (p) { return p.name !== 'value'; });\n }\n break\n }\n }\n }\n}", "function createModel(modelData, xtraTranslate) {\n var model = {};\n model.coordsBuffer = gl.createBuffer();\n model.normalBuffer = gl.createBuffer();\n model.indexBuffer = gl.createBuffer();\n model.count = modelData.indices.length;\n if (xtraTranslate)\n model.xtraTranslate = xtraTranslate;\n else\n model.xtraTranslate = null;\n gl.bindBuffer(gl.ARRAY_BUFFER, model.coordsBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, modelData.vertexPositions, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ARRAY_BUFFER, model.normalBuffer);\n gl.bufferData(gl.ARRAY_BUFFER, modelData.vertexNormals, gl.STATIC_DRAW);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, model.indexBuffer);\n gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, modelData.indices, gl.STATIC_DRAW);\n model.render = function() { \n gl.bindBuffer(gl.ARRAY_BUFFER, this.coordsBuffer);\n gl.vertexAttribPointer(a_coords_loc, 3, gl.FLOAT, false, 0, 0);\n gl.bindBuffer(gl.ARRAY_BUFFER, this.normalBuffer);\n gl.vertexAttribPointer(a_normal_loc, 3, gl.FLOAT, false, 0, 0);\n gl.uniform4fv(u_material.diffuseColor, currentColor);\n if (this.xtraTranslate) {\n pushMatrix();\n mat4.translate(modelview,modelview,this.xtraTranslate);\n }\n gl.uniformMatrix4fv(u_modelview, false, modelview );\n mat3.normalFromMat4(normalMatrix, modelview);\n gl.uniformMatrix3fv(u_normalMatrix, false, normalMatrix);\n gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n gl.drawElements(gl.TRIANGLES, this.count, gl.UNSIGNED_SHORT, 0);\n if (this.xtraTranslate) {\n popMatrix();\n }\n }\n return model;\n}", "applyCurrentTransform () {\n this.tempPosition.set(this.position);\n this.tempOrientation = this.orientation;\n this.tempScale.set(this.scale);\n }", "function transformModel (options, data) {\r\n var prop = (options.model && options.model.prop) || 'value';\r\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\r\n var on = data.on || (data.on = {});\r\n if (isDef(on[event])) {\r\n on[event] = [data.model.callback].concat(on[event]);\r\n } else {\r\n on[event] = data.model.callback;\r\n }\r\n}", "function transformModel(options, data) {\n var prop = options.model && options.model.prop || 'value';\n var event = options.model && options.model.event || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n }", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}", "function transformModel (options, data) {\n var prop = (options.model && options.model.prop) || 'value';\n var event = (options.model && options.model.event) || 'input';(data.props || (data.props = {}))[prop] = data.model.value;\n var on = data.on || (data.on = {});\n if (isDef(on[event])) {\n on[event] = [data.model.callback].concat(on[event]);\n } else {\n on[event] = data.model.callback;\n }\n}" ]
[ "0.66571635", "0.635604", "0.6310226", "0.6130369", "0.6126833", "0.6086492", "0.6048927", "0.59227204", "0.58230454", "0.57894844", "0.5758964", "0.5709075", "0.5709075", "0.5579622", "0.55339485", "0.55339485", "0.55339485", "0.55339485", "0.5532243", "0.5532243", "0.5532243", "0.5532243", "0.5532243", "0.55189115", "0.55141956", "0.5511064", "0.5496508", "0.5496508", "0.5496508", "0.5496508", "0.54946274", "0.5483566", "0.54609853", "0.5432107", "0.54207", "0.5418186", "0.5406501", "0.53773916", "0.5372201", "0.53623563", "0.53603107", "0.5351888", "0.53448594", "0.53348726", "0.5322813", "0.53193074", "0.53149045", "0.53149045", "0.53149045", "0.5303112", "0.5288561", "0.52839196", "0.526288", "0.526288", "0.5260631", "0.52579856", "0.52579856", "0.5257374", "0.5257374", "0.5257374", "0.52568495", "0.5255406", "0.52450174", "0.5241087", "0.523338", "0.5233114", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314", "0.5217314" ]
0.0
-1
key: sourceName + sourceUnit
async sGetTxt ({ sourceName, sourceUnit }) { const key = `${sourceName}|||${sourceUnit}` let value = await txtController.getTxt(key) if (!value) { value = { key, sourceName, sourceUnit, name: sourceName.split('(')[0].trim(), unit: sourceUnit, ratio: 1, choose: true } await txtController.setTxt(key, value) } return value }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "keyForSourceFile(srcDir, relativeFilename, options) {\n let absolutePath = path.join(srcDir, relativeFilename);\n let hash = this.hashForFile(absolutePath);\n return relativeFilename + \"@\" + hash.digest(\"hex\");\n }", "_generateSourceMap(baseDir, code, units){\n const sections = [];\n for (let unit of Array.from(units)) {\n const unitDir = path.dirname(unit.fpath);\n if (unit.sm) {\n // TODO: should support http, https, etc...\n var i, s, sm, sp;\n const url = path.resolve(unitDir, unit.sm.url);\n try {\n sm = JSON.parse(fs.readFileSync(url));\n } catch (e) {\n log(`Skipped invalid source map file ${path.relative(baseDir,url)}`);\n continue;\n }\n\n // if sm itself consists of concatenated sections, merge them\n if (sm.sections) {\n const iterable = sm.sections || [];\n for (i = 0; i < iterable.length; i++) {\n const sec = iterable[i];\n sec.offset.line += unit.smline;\n for (i = 0; i < sec.map.sources.length; i++) {\n s = sec.map.sources[i];\n sp = path.resolve(unitDir, s);\n sec.map.sources[i] = path.relative(baseDir, sp);\n }\n }\n sections.push(...Array.from(sm.sections || []));\n } else {\n // concatenate sources into sections, with path resolved\n for (i = 0; i < sm.sources.length; i++) {\n s = sm.sources[i];\n sp = path.resolve(unitDir, s);\n sm.sources[i] = path.relative(baseDir, sp);\n }\n sections.push({\n offset: {line : unit.smline, column : 0},\n map : sm\n });\n }\n } else { // js file has no matching source map file, generate it\n var line;\n const { SourceMapGenerator } = sourceMap;\n const srcfile = path.relative(baseDir, unit.fpath);\n const map = new SourceMapGenerator({file:srcfile});\n const lc = fuse._lc(unit.src);\n if (lc > 0) {\n for (line = 1, end = lc, asc = 1 <= end; asc ? line <= end : line >= end; asc ? line++ : line--) { // 1 to 1 mapping for each line\n var asc, end;\n map.addMapping({\n source: srcfile,\n original : {line, column:0},\n generated : {line, column:0}\n });\n }\n }\n sections.push({\n offset: {line: unit.smline, column: 0},\n map: map.toJSON()\n });\n }\n }\n return sections.length === 0 ? null : {\n version : 3,\n file : '',\n sections\n };\n }", "get key() { return `${this.v}:${this.hi}/${this.lo}`; }", "function keyForTest(type: string, details: TestType) {\n switch (type) {\n case 'component':\n return details.name;\n case 'scene':\n default:\n return details.title ? `${details.name}_${details.title}` : details.name;\n }\n}", "function generateSourceStringHash(translationKey) {\n return crypto.createHash(\"md5\").update(translationKey + \":\").digest(\"hex\");\n }", "get name () { return Metadata.getClassMetaValue(Object.getPrototypeOf(this), 'source', 'name'); }", "function propKeys(sourceKey) {\n return {\n error: sourceKey + 'Error',\n fetchedAt: sourceKey + 'FetchedAt',\n loading: sourceKey + 'Loading',\n ready: sourceKey + 'Ready'\n };\n}", "addSource(details){\n //if the source already exists then delete it\n if (this.map.getSource(details.id)) this.removeSource(details.id);\n this.map.addSource(details.id, details.source);\n }", "function newSource(source) {\n return {\n type: constants.ADD_SOURCE,\n source: source\n };\n}", "sourcePropertyName (propertyName) {\n return propertyName;\n }", "getSourceId(source) {\n let sourceId = this.sourceIds.get(source);\n if (sourceId === undefined) {\n sourceId = `${this.sourceIds.size}`;\n this.sourceIds.set(source, sourceId);\n }\n return sourceId;\n }", "buildSourceString(data, prefix) {\n prefix = prefix || ''\n\n const sorter = function (a, b) {\n console.log(`firstItem: ${a} | secondItem: ${b}`)\n\n let a_len = a.length\n let b_len = b.length\n\n let result = this.strcasecmp(a, b)\n\n if (result === 0) {\n result = b_len - a_len\n }\n\n return result\n }\n\n // const sorter = (secondItem, firstItem) => {\n // console.log(`firstItem: ${firstItem} | secondItem: ${secondItem}`)\n\n // let key_1 = firstItem[0]\n // let key_2 = firstItem[1]\n\n // let key_1_len = key_1.length\n // let key_2_len = key_2.length\n\n // let result = this.strcasecmp(key_1, key_2)\n\n // if (result === 0) {\n // result = key_2_len - key_1_len\n // }\n\n // return result\n // }\n\n this.uksort(data, sorter)\n\n let processed = []\n\n for (const [key, value] of Object.entries(data)) {\n if (key == 'x_signature') continue;\n\n if (Array.isArray(value)) {\n processed.push(this.buildSourceString(value, key))\n } else {\n processed.push(prefix + key + value)\n }\n }\n\n return processed.join(\"|\")\n }", "fileKeyMaker(fileObj) {\n return `${fileObj._id}.tar.gz`;\n }", "function extendSourceKeys(sourceKeys, source, regexp) {\n for (var key in source) {\n if (!regexp || regexp.test(key)) {\n sourceKeys[key] = key;\n }\n }\n}", "function key(kind, key) {\n \n}", "dependenciesKey(key) {\n return \"[[[dependencies of \" + key + \"]]]\";\n }", "get source(){\n return this.orderInfo.source.name;\n }", "get source() {\n return this.getStringAttribute('source');\n }", "function genKey(edge) {\n return `${edge.source}:${edge.target}`;\n}", "set source(source) {\n this._source = source;\n this._shortsrc = Lua_1.Lua.oChunkid(source);\n }", "function getUnitKeyWithType(unitType) {\n return Object.keys(UnitKey)[unitType] || 'None'; // If unitType = 0, it gets first item in the UnitKeys\n}", "function getJoinByKey(dest, destKey, src, srcKey) {\n if (!dest) {\n stop('Target layer is missing an attribute table');\n }\n if (!src) {\n stop('Source layer is missing an attribute table');\n }\n var destRecords = dest.getRecords();\n var srcRecords = src.getRecords();\n var index = createTableIndex(srcRecords, srcKey);\n var srcType, destType;\n if (srcRecords.length == 0) {\n // allow empty external tables\n return function(i) {return [];};\n }\n requireDataField(src, srcKey, 'External table is missing a field named:');\n requireDataField(dest, destKey, 'Target layer is missing key field:');\n srcType = getColumnType(srcKey, src.getRecords());\n destType = getColumnType(destKey, destRecords);\n validateJoinFieldType(srcKey, srcType);\n validateJoinFieldType(destKey, destType);\n if (srcType != destType) {\n stop(\"Join keys have mismatched data types:\", destType, \"and\", srcType);\n }\n return function(i) {\n var destRec = destRecords[i],\n val = destRec ? destRec[destKey] : null,\n retn = null;\n if (destRec && val in index) {\n retn = index[val];\n if (!Array.isArray(retn)) retn = [retn];\n }\n return retn;\n };\n }", "bind(source) {\n source[this.propertyName] = this.target;\n }", "get(target, key) {\n console.info(key);\n return target[key].replace('2017', '2018');\n }", "function clueMapKey(x, y) {\n return x + '_' + y;\n}", "onChangeSource(newSourceName) {\n\t\tvar sources = this.props.sources;\n\n\t\tfor(let source in sources) {\n\n\t\t\tlet sourceName = sources[source].sourceName;\n\n\t\t\tif(sourceName === newSourceName) {\n\n\t\t\t\tthis.setState({\n\t\t\t\t\tcurrentSource: sources[source],\n\t\t\t\t\tcurrentCategory: sources[source].categories[0]\n\t\t\t\t});\n\n\t\t\t}\n\n\t\t}\n\t}", "resolveId ( source, importer ) {\n return source;\n }", "function getNameFromMember(member, sourceCode) {\n if (member.key.type === utils_1.AST_NODE_TYPES.Identifier) {\n return {\n type: MemberNameType.Normal,\n name: member.key.name,\n };\n }\n if (member.key.type === utils_1.AST_NODE_TYPES.PrivateIdentifier) {\n return {\n type: MemberNameType.Private,\n name: `#${member.key.name}`,\n };\n }\n if (member.key.type === utils_1.AST_NODE_TYPES.Literal) {\n const name = `${member.key.value}`;\n if ((0, type_utils_1.requiresQuoting)(name)) {\n return {\n type: MemberNameType.Quoted,\n name: `\"${name}\"`,\n };\n }\n else {\n return {\n type: MemberNameType.Normal,\n name,\n };\n }\n }\n return {\n type: MemberNameType.Expression,\n name: sourceCode.text.slice(...member.key.range),\n };\n}", "handleSwitchSourceState(source_key) {\n\t\tconst active_sources_keys = this.state.active_sources_keys;\n\t\t// If source was in enabled sources, remove it. If it was in disabled\n\t\t// sources, add it.\n\t\tconst source_key_position = active_sources_keys.indexOf(source_key);\n\t\tif (source_key_position !== -1) {\n\t\t\tthis.setState({\n\t\t\t\tactive_sources_keys: active_sources_keys\n\t\t\t\t.slice(0,source_key_position)\n\t\t\t\t.concat(active_sources_keys.slice(source_key_position + 1))\n\t\t\t});\n\t\t} else {\n\t\t\tthis.setState({\n\t\t\t\tactive_sources_keys: [...active_sources_keys, source_key].sort()\n\t\t\t});\n\t\t}\n\t}", "changeSource(source) {\n\t\tthis.info.source = source\n\t\tthis.config.source = source\n\t}", "function sourceTest(assert) {\n if (assert.source === 'text') return 'text()).';\n let result;\n if (assert.modifier === '.length') {\n return `props().${assert.property}.length).`;\n }\n if (assert.modifier[0] === '[') {\n return `props().${assert.property}${assert.modifier}).`;\n }\n return `props().${assert.property}).`;\n}", "get sourceId() {\n\t\treturn this.__sourceId;\n\t}", "imageSourceSelected(key)\n {\n this.articleImages[key].source = this.articleImages[key].selectedSource;\n }", "key(...args) {\n return args.join(':');\n }", "function keyFunction(d, i) {\n\t return d.source + i;\n\t }", "transfer(destUnit, resourceType, amount) {\n let destID = typeof destUnit === \"string\" ? destUnit : destUnit.id;\n return `t ${this.id} ${destID} ${resourceType} ${amount}`;\n }", "getSrcTypes() {\n return [\n {\n name: 'mainSrc',\n keyEnding: `i${this.keyCounter}`,\n },\n {\n name: 'mainSrcThumbnail',\n keyEnding: `t${this.keyCounter}`,\n },\n {\n name: 'nextSrc',\n keyEnding: `i${this.keyCounter + 1}`,\n },\n {\n name: 'nextSrcThumbnail',\n keyEnding: `t${this.keyCounter + 1}`,\n },\n {\n name: 'prevSrc',\n keyEnding: `i${this.keyCounter - 1}`,\n },\n {\n name: 'prevSrcThumbnail',\n keyEnding: `t${this.keyCounter - 1}`,\n },\n ];\n }", "_requestKey(subscription) {\n return [`${subscription.base}_${subscription.currency}_${String(subscription.type)}`, subscription.base, subscription.currency];\n }", "function getMemberName(node, sourceCode) {\n switch (node.type) {\n case utils_1.AST_NODE_TYPES.TSPropertySignature:\n case utils_1.AST_NODE_TYPES.TSMethodSignature:\n case utils_1.AST_NODE_TYPES.TSAbstractPropertyDefinition:\n case utils_1.AST_NODE_TYPES.PropertyDefinition:\n return getMemberRawName(node, sourceCode);\n case utils_1.AST_NODE_TYPES.TSAbstractMethodDefinition:\n case utils_1.AST_NODE_TYPES.MethodDefinition:\n return node.kind === 'constructor'\n ? 'constructor'\n : getMemberRawName(node, sourceCode);\n case utils_1.AST_NODE_TYPES.TSConstructSignatureDeclaration:\n return 'new';\n case utils_1.AST_NODE_TYPES.TSCallSignatureDeclaration:\n return 'call';\n case utils_1.AST_NODE_TYPES.TSIndexSignature:\n return util.getNameFromIndexSignature(node);\n case utils_1.AST_NODE_TYPES.StaticBlock:\n return 'static block';\n default:\n return null;\n }\n}", "function getKeyValue(sourceCode){\n\tif(sourceCode == null)\n\t\tsourceCode = window.event.keyCode;\n\t\n\tvar code = getKeyCode(sourceCode);\n\tvar actualkey = code;\n\t\n\tif(isNumber(code))\n\t// try to look up the key now\n\t\tactualkey=String.fromCharCode(code);\n\n\tif(actualkey == null)\n\t\treturn null;\n\n\treturn actualkey.toLowerCase();\n}", "createResourceKey(requestArgs: Object): string {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return `${RESOURCE_CACHE_PREFIX}${resourceKey}`;\n }", "_getUniqueIdentifier(sourceFile, baseName) {\n if (this.isUniqueIdentifierName(sourceFile, baseName)) {\n this._recordUsedIdentifier(sourceFile, baseName);\n return ts.createIdentifier(baseName);\n }\n let name = null;\n let counter = 1;\n do {\n name = `${baseName}_${counter++}`;\n } while (!this.isUniqueIdentifierName(sourceFile, name));\n this._recordUsedIdentifier(sourceFile, name);\n return ts.createIdentifier(name);\n }", "name(module, chunks, cacheGroupKey) {\n const moduleFileName = module.identifier().split('/').reduceRight(item => item);\n const allChunksNames = chunks.map((item) => item.name).join('~');\n return `${cacheGroupKey}-${allChunksNames}-${moduleFileName}`;\n }", "function makeTimeKey(key) {\n return key+\"_time\";\n}", "buildSelCtxKey(): string {\r\n let key = \"\";\r\n\r\n key += this.layerset.active.id;\r\n return key;\r\n }", "function createWebStorageQueryTargetMetadataKey(persistenceKey, targetId) {\r\n return QUERY_TARGET_KEY_PREFIX + \"_\" + persistenceKey + \"_\" + targetId;\r\n}", "function get_unique_key(src, deponly = false) {\n if (src instanceof Stream) {\n if (deponly && src.root) src = src.root;\n return src.indicator && (src.indicator.id || (src.indicator.jsnc && (src.indicator.jsnc.id || src.indicator.jsnc)));\n } else if (jt.instance_of(src, '$Collection.$Timestep.SrcType')) {\n return src.id || src;\n } else if (_.isString(src)) {\n return deponly ? strip_non_dep(src.split('.')).join('.') : src;\n } else {\n throw new Error('Unsupported object provided for use as key: ' + _.isObject(src) ? JSON.stringify(src) : src.toString());\n }\n\n // return only the root source object without subpaths\n function strip_non_dep(full_path) {\n for (let i = 0; i <= full_path.length - 1; i++) {\n let src_path = full_path.slice(0, i + 1);\n let src = _.get(jsnc.indicators, src_path.join('.'));\n if (!_.isObject(src)) throw new Error(`Unrecognized source path or wrong type: ${src_path.join('.')}`);\n if (jt.instance_of(src, '$Collection.$Timestep.SrcType')) {\n return src_path;\n }\n }\n }\n }", "withScopePrefix(key) {\n return ['MLflowLocalStorage', LocalStorageUtils.version, this.scope, key].join('-');\n }", "function whatIsInAName(collection, source) {\n let sourceKeys = Object.keys(source); // Returns an array of source keys [\"apple\", \"bat\"]\n return collection.filter(obj => { // Remember that filter returns true or false\n for(let i = 0; i < sourceKeys.length; i++){\n if(!obj.hasOwnProperty(sourceKeys[i]) || obj[sourceKeys[i]] !== source[sourceKeys[i]]){\n return false; // test failed\n }\n }\n return true; // test passed\n }); \n}", "constructor(name, targetOrPhase, type, handler, sourceSpan, \n // TODO(FW-2095): keySpan should be required but was made optional to avoid changing VE\n handlerSpan, keySpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n this.keySpan = keySpan;\n }", "constructor(name, targetOrPhase, type, handler, sourceSpan, \n // TODO(FW-2095): keySpan should be required but was made optional to avoid changing VE\n handlerSpan, keySpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n this.keySpan = keySpan;\n }", "updateSource(source) {\n this.set('source', source);\n }", "constructor(source)\n\t{\n\t}", "function $n(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}", "objectKeyHandler (key, parentObject, parentKey, parentObjectArrayBool, iterCt) {\n return '\"' + key.replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"') + '\":';\n }", "getSrcTypes () {\n return [\n { name: 'mainSrc'\n , keyEnding: `i${this.keyCounter}`\n }\n , { name: 'mainSrcThumbnail'\n , keyEnding: `t${this.keyCounter}`\n }\n , { name: 'nextSrc'\n , keyEnding: `i${this.keyCounter + 1}`\n }\n , { name: 'nextSrcThumbnail'\n , keyEnding: `t${this.keyCounter + 1}`\n }\n , { name: 'prevSrc'\n , keyEnding: `i${this.keyCounter - 1}`\n }\n , { name: 'prevSrcThumbnail'\n , keyEnding: `t${this.keyCounter - 1}`\n }\n ]\n }", "function getKey(){\n return keyPrefix + document.querySelector('[name=' + keyName + ']').value;\n}", "function getFullyQualifiedName(sourceName, contractName) {\n return `${sourceName}:${contractName}`;\n}", "_$name() {\n super._$name();\n this._value.name = this._node.key.name;\n }", "createResourceKey(requestArgs: Object): string {\n let resourceKey = requestArgs.url;\n\n if (requestArgs.params) {\n resourceKey += `|${requestArgs.params}`;\n }\n\n if (requestArgs.locale) {\n resourceKey += `|${requestArgs.locale}`;\n }\n\n return resourceKey;\n }", "locationKey(locationKey) {\n return `${locationKey.x},${locationKey.y}`;\n }", "function mapper_make_key(feature) {\n\tvar key = feature[\"lat\"] + \":\" + feature[\"lon\"] + \":\" + feature[\"title\"];\n\treturn key;\n}", "get targetName() {\n return this.originalTargetName;\n }", "setSource(source){\n \n if(source === undefined)\n return;\n \n this.source = source;\n \n }", "function ho(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}", "addSource(source) {\n this._data.source = source;\n }", "function whatIsInAName(collection, source) {\n \n var srcKeys = Object.keys(source);\n\n // filter the collection\n return collection.filter(function(obj) {\n for (var i = 0; i < srcKeys.length; i++) {\n if (\n !obj.hasOwnProperty(srcKeys[i]) ||\n obj[srcKeys[i]] !== source[srcKeys[i]]\n ) {\n return false;\n }\n }\n return true;\n });\n}", "priorityForSource(source) {\n switch (source) {\n case this.mainSource:\n return 1000;\n case this.projectFile:\n return 2000;\n default:\n return 0;\n }\n }", "function KeyValue() {}", "function KeyValue() {}", "function KeyValue() {}", "outputKey(key) {\n return \"[[[output of \" + key + \"]]]\";\n }", "function xo(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}", "function whatIsInAName2(collection, source) {\n\n var srcKeys = Object.keys(source);\n\n return collection.filter(function(obj) {\n return srcKeys.every(function(key) {\n return obj.hasOwnProperty(key) && obj[key] === source[key];\n });\n });\n}", "static get properties(){return{source:{name:\"source\",type:\"String\",reflectToAttributes:!0,observer:\"_sourceChanged\"},caption:{name:\"caption\",type:\"String\",reflectToAttributes:!0}}}", "function fo(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}", "function zr(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}", "function vo(t, e) {\n return \"firestore_targets_\" + t + \"_\" + e;\n}", "function _u(t) {\n t.createObjectStore(bu.store, {\n keyPath: bu.keyPath\n }).createIndex(bu.documentTargetsIndex, bu.documentTargetsKeyPath, {\n unique: !0\n }), \n // NOTE: This is unique only because the TargetId is the suffix.\n t.createObjectStore(pu.store, {\n keyPath: pu.keyPath\n }).createIndex(pu.queryTargetsIndexName, pu.queryTargetsKeyPath, {\n unique: !0\n }), t.createObjectStore(gu.store);\n}", "function nextKey () {\n return (uniqueId++) + dataStoreKeyExpandoPropertyName\n }", "formatSource(source) {\r\n const charDict = this.cache.characterDictionary;\r\n \r\n const formattedSource = source.split(\"\")\r\n .map(char => `(?:${char}${\r\n /\\w/.test(char) && charDict.has(char)\r\n ? `|${charDict.get(char).join(\"|\")}`\r\n : \"\"\r\n })+`)\r\n .join(CENSOR_BYPASS);\r\n \r\n return formattedSource;\r\n }", "setSourceOwner(aSourceOwner) {\n this.source_owner = aSourceOwner;\n }", "function getSource(name) {\r\n var sources = localStorage.getObject('sources');\r\n var selected_name = name.split('::');\r\n var category = selected_name[0], source_name = selected_name[1];\r\n\r\n for (var i in sources) {\r\n if (i == category) {\r\n for (var j in sources[i]) {\r\n if (j == source_name) {\r\n sources[i][j].category = i;\r\n sources[i][j].name = j;\r\n return sources[i][j];\r\n }\r\n }\r\n }\r\n }\r\n\r\n return null;\r\n}", "getValue(source) {\n Observable.track(source, this.name);\n return source[this.fieldName];\n }", "gsi1key() {\n return{\n 'GSI1PK': 'OrderMail',\n 'GSI1SK': `OrderMail#${this.id}`\n }\n }", "getSourceOwner() {\n return this.source_owner;\n }", "function _createDataKey(key) {\n\t\treturn key + \"_data\";\n\t}", "get source () {\n\t\treturn this._source;\n\t}", "get source () {\n\t\treturn this._source;\n\t}", "function buildCacheKey(id) {\n \n var className = globalFunctions.filenameNoExtension(__filename);\n return className + id;\n}", "function sourcesText(sources) {\n if (sources == 1) {\n sources = \"1 source\";\n }\n else if (sources < 20) {\n sources = sources + \" sources\";\n }\n else {\n sources = \"20+ sources\";\n }\n return sources;\n}", "function _key(field, attribute)\n\t{\n\t\tif (field.originals)\n\t\t{\n\t\t\treturn field.originals.scope + '-' + field.originals.id + '-' + attribute;\n\t\t}\n\n\t\treturn field.scope + '-' + field.id + '-' + attribute;\n\t}", "function uufix(source) { // @param String: source\r\n // @return String:\r\n return uufix._db[source] || source;\r\n}", "function SourceFileRenamer(context)\n{\n this.renamedSourceFiles = [];\n this.context = context;\n this.bps = [];\n}", "static nodeKey(layer, nodeIndex) {\n return layer.name + '_ib-' + nodeIndex.toString();\n }", "get source() {\n\t\treturn this._source;\n\t}", "function addSendSourcePropertiesName(active, parent, src) {\n const clientListId = 'export-clientlist-sourcename';\n const mtype = 'table.load.votable';\n\n // What is being exported?\n //\n const whatEl = document.createElement('span');\n addText(whatEl, 'All master-source properties');\n\n // What information is tracked?\n //\n const selected = {target: wwtsamp.TARGET_CLIPBOARD};\n\n const els = createSAMPExport(active, mtype, 'export-samp-sourcename',\n\t\t\t\t clientListId, whatEl, selected);\n\n if (active) {\n els.button.addEventListener('click', (event) => {\n\twwt.trace(`Chosen target: ${selected.target}`);\n\twwtsamp.sendSourcePropertiesName(event, selected.target, src.name);\n }, false);\n }\n\n parent.appendChild(els.container);\n }", "function settingsKey (module, key) {\n return `${prefixes.SETTINGS_KEY_PREFIX}/${module}/${key}`\n}", "function yi(t, n) {\n return \"firestore_targets_\" + t + \"_\" + n;\n}", "function getLookupKey(fhcEvent) {\n let key = fhcEvent.type + \"|\" + fhcEvent.name;\n\n if (\"input\" === fhcEvent.type) {\n // prepend with empty host, input values are universal and not bound to a host\n key = \"|\" + key + \"|\" + fhcEvent.value;\n } else {\n // bind multiline fields to a specific host\n // do not add the value but the lastUsed date, we want to store one or more versions per host\n key = fhcEvent.host + \"|\" + key + \"|\" + fhcEvent.last;\n }\n return key;\n}" ]
[ "0.60280675", "0.566911", "0.5557074", "0.545335", "0.54494727", "0.5419924", "0.5396565", "0.53360385", "0.5331258", "0.52896374", "0.52795964", "0.5269703", "0.52488506", "0.5195081", "0.518896", "0.5184284", "0.51729786", "0.51406914", "0.5090437", "0.50810796", "0.50121695", "0.5009695", "0.5008409", "0.49855658", "0.4983997", "0.49707103", "0.49643803", "0.4944429", "0.49303877", "0.49197", "0.48920354", "0.4890327", "0.48587495", "0.4857012", "0.485547", "0.48110655", "0.4808198", "0.48075867", "0.48007596", "0.47976223", "0.4796877", "0.476495", "0.47621337", "0.4758782", "0.47535095", "0.47502506", "0.47445148", "0.4739632", "0.47320908", "0.47289896", "0.47289896", "0.47240445", "0.47214004", "0.47136128", "0.47111997", "0.47104898", "0.47074482", "0.47063625", "0.4703464", "0.46967587", "0.46932697", "0.46927154", "0.46810025", "0.4673669", "0.4667123", "0.46664268", "0.466208", "0.46606657", "0.4657998", "0.4657998", "0.4657998", "0.46554822", "0.4650017", "0.4649361", "0.46452975", "0.46359354", "0.46303967", "0.4628026", "0.4624254", "0.46208856", "0.46193072", "0.46173882", "0.46145228", "0.4614131", "0.46139085", "0.46134388", "0.46028447", "0.4601119", "0.4601119", "0.45991868", "0.4584075", "0.45781437", "0.45754987", "0.4573211", "0.4570979", "0.45692655", "0.4568431", "0.45657608", "0.45654115", "0.45537207" ]
0.48730025
32
Pushes email to DB and also validates the customer input.
function subscribe(event) { event.preventDefault(); if ($email.val() === "") { $('#errorModal').modal({ show: true, }); $('#error').text("Please Enter An E-mail 😐"); } else { var emails = { email: $email.val(), }; $.post("/api/emails", emails); $('#errorModal').modal({ show: true, }); $('#error').text("Thank you for subscribing! 👍"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function postsValidatedEmail() {\r\n if ($(\"#email\").val().length === 0) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[0]);\r\n } else if (!validateEmail($(\"#email\").val())) {\r\n //sets the background\r\n sendState(on, \"email\");\r\n\r\n //adds the data to the array\r\n addDataAllErrors(allErrorMess[1]);\r\n\r\n //resets the email field\r\n $(\"#email\").val(\"\");\r\n } else {\r\n //Value validated put an element like a \"tick\"\r\n //image next to the element\r\n\r\n //sends the state and the object source\r\n sendState(off, \"email\");\r\n //clears the element\r\n $(\"#lblEmailError\").html(\"\");\r\n console.log(`the email element entered is correct!`);\r\n }\r\n }", "sendEmail() {\n email([EMAIL], null, null, null, null);\n }", "function buttonPressed() \n{\n\tvar f = document.getElementById('inputform');\n\tvar e = document.getElementById('useremail');\n\n\t// Let the input E-Mail field validate the input. Upon successful validation\n\t// subscribe the e-mail address and alert the user. Had to check if the input field\n\t// is blank as using required parameter caused the validation message to appear after\n\t// resetting the form.\n\tif(f.checkValidity() && e.value != '') {\n\t\tpostEmailtoDatabase(e.value);\n\t\tf.reset();\n\t\talert(\"Thank you for subscribing to our newsletter!\");\n\t} else {\n\t\talert(\"Please enter your E-Mail Address.\")\n\t}\n}", "function submitEmailToFirebase() {\n const userEmail = email.value;\n\n users.add({\n email: `${userEmail}`,\n });\n\n email.value = \"\";\n\n if (!email.value) {\n title.textContent = \"Thank you for subscribing! 👏\";\n }\n}", "function subscribe() {\n\n // get the entered email address\n let emailAdress = document.getElementById(\"email\").value;\n\n // check if the entered email address is valid\n if (!validateEmailAddress(emailAdress)) {\n alert(\"Please provide a valid email address!\");\n return;\n }\n\n showElement(formConfirm);\n hideElement(mainContent);\n\n // all done, reset input text for email address\n email.value = \"\";\n}", "function checkEmail() {}", "sendEmail() {\n this.validationController.validate().then(errors => {\n if (errors.length === 0) {\n var email = this;\n\n this.api.email.sendToStaff(this.subject, this.message)\n .then(function() {\n log.debug('Email sent succesfully. Rerouting to program page.');\n email.router.navigateToRoute('program');\n });\n }\n });\n }", "function handleEmail(e) {\n e.preventDefault();\n const emailSent = e.target.elements[0].value;\n if (emailIsValid(emailSent)) {\n alert('Thanks for your subscription! :D');\n } else {\n alert('Your e-mail is incorrect. Try again :(');\n }\n }", "function postEmail() {\n var email = document.getElementById(\"emailInput\").value\n \n axios.post(`${API_URL}:8080/api/${SITE_ID}/customer`, {\"customer\": {\"email\": email}} )\n .then(res => {\n document.getElementById(\"newsletterUNSubmitted\").style.display = \"none\";\n document.getElementById(\"newsletterSubmitted\").style.display = \"flex\";\n })\n .catch(err => {\n console.log(\"error posting newsletter email\",err);\n });\n }", "_onCustomerCreated() {\n this.myProcessDependency();\n\n this.trigger(new Test.SendWelcomeEmail({\n targetId: this.customerId,\n customerId: this.customerId,\n customerName: this.customerName\n }));\n\n this.record(new Test.WelcomeEmailTriggered({\n sourceId: this.getId(),\n customerId: this.customerId\n }));\n }", "function userInfo(custId){\n\t\n $(document).ready(function(){\n $.ajax({\n url: currentUrl+\"/users/adduser\",\n type: \"POST\",\n data: {\n \tusername: $(\"#username\").val(),\n \tpassword: $(\"#password\").val(),\n \temail: $(\"#email\").val(),\n \tcustomerId: custId\n },\n success: function(data){\n // If insert is successful redirect to dead end page which asks to confirm email \n // in this case 'data' is returned string ProvidedEmail\n alert('Success! Email was sent. Email is - '+data);\n location.href =currentUrl+'/emailconfirmation?email='+data;\n },\n error: function(){\n alert('Sorry, something went wrong with our server. Users');\n }\n });\n });\n}", "function submitCustomer(customerModel){\n if(validateCustomer(customerModel)){\n saveCustomer(customerModel)\n return true\n }else{\n displayCustomerErrors()\n }\n}", "function run() {\n const customerId = prompt('get user id');\n const newEmail = prompt('enter a new email');\n\n validateEmail(newEmail)\n .then(() => getCustomerData(customerId))\n .then(({ name, email }) => {\n return updateCustomerData(customerId, { name, email: newEmail });\n })\n .then(() => console.log('updated successfully'))\n .catch(err => console.log(err));\n }", "function addVendor(){\n let mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(($('#vendorName').val()).toString() === ''){\n alert(\"Please enter vendor name...!\");\n }\n if(!($('#vendorEmail').val()).match(mailformat)){\n alert(\"Please enter valid vendor email...!\");\n }\n else{\n $.post('/vendors',\n {\n vendorName: $('#vendorName').val().toLowerCase(),\n vendorEmail: $('#vendorEmail').val().toLowerCase(),\n qty:''\n },\n (data) => {\n if (data.success) {\n refreshList()\n } else {\n alert('Some error occurred....!!')\n }\n }\n )\n }\n}", "sendEmail({ commit, dispatch }, payload) {\n serverAPI.post('send', payload.email).then(res => {\n commit('emailSuccess', payload.id)\n })\n }", "async function handleSubmit() {\n if (sendSelf && !addressee.includes(userEmail)) {\n addressee.push(userEmail);\n }\n \n if (sendTenant && !addressee.includes(tenantEmail)) {\n addressee.push(tenantEmail);\n }\n console.log(remarks);\n sendEmail();\n close();\n }", "function sendMessage(id_email){\r\n if(validateEmail(id_email)){\r\n alert(\"Message sent succesfully\");\r\n\r\n }else{\r\n alert(\"Message not sent. Be sure to have typed an email address\");\r\n\r\n }\r\n}", "function emailContact() {\n\n\t/**\n\t * Appcelerator Analytics Call\n\t */\n\tTi.Analytics.featureEvent(Ti.Platform.osname+\".profile.emailButton.clicked\");\n\t\n\t/**\n\t * Account for if the user is on iOS and using a simulator - iOS Simulator no \n\t * longer supports sending email as of iOS 8\n\t */\n\tif(OS_IOS && Ti.Platform.model === \"Simulator\"){\n\t\talert(\"Simulator does not support sending emails. Use a device instead\");\n\t\treturn;\n\t}\n\t/**\n\t * Create an Email Dialog\n\t * DOCS: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.EmailDialog\n\t */\n\tvar emailDialog = Ti.UI.createEmailDialog();\n\t\n\t/**\n\t * Setup the Email Dialog information, in this case just the recipients field\n\t */\n\temailDialog.toRecipients = [_args.email];\n\t\n\t/**\n\t * Once we have created and setup the Email Dialog, lets open the view\n\t */\n\temailDialog.open();\n}", "function attemptContact() {\n \"use strict\";\n var variables = getVariables();\n if (variables) {\n sendEmail(variables);\n }\n}", "function enqueueEmail(params){\n\n}", "function ordersCustEmailValid(cp_str) {\n\tvar result = true;\n\t//alert(cp_str);\n\tif (isEmpty(cp_str))\n\t{\n\t\talert(\"Please enter a customer email for the order.\");\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\t// Following code based on SIT104 prac6 exercise code\n\t\t// Locate @ in customer email field\n\t\tat=cp_str.indexOf(\"@\")\n\n\t\t// if @ not in customer email field\n\t\tif (at == -1)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, missing @. You entered \" + cp_str )\n\t\t\treturn false\n\t\t}\n\n\t\t// if @ is the first character in customer email field\n\t\tif (at == 0)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, @ can't be first character.\")\n\t\t\treturn false\n\t\t}\n\n\t\t//if @ is the last character in customer email field\n\t\tif (at == (cp_str.length))\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, @ can't be last character.\")\n\t\t\treturn false\n\t\t}\n\t\t\n\t\t// Locate . in customer email field\n\t\tdot=cp_str.indexOf(\".\")\n\n\t\t// if . not in customer email field\n\t\tif (dot == -1)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, missing '.'. You entered \" + cp_str )\n\t\t\treturn false\n\t\t}\n\n\t\t// if . is the first character in customer email field\n\t\tif (dot == 0)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, '.' can't be first character.\")\n\t\t\treturn false\n\t\t}\n\n\t\t//if . is the last character in customer email field\n\t\tif (dot == (cp_str.length1))\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, '.' can't be last character.\")\n\t\t\treturn false\n\t\t}\n\t}\n\treturn result;\n}", "function submitAccount(){\n let customerInfo = {\n \"first_name\" : $(\"#firstName_input\").val(),\n \"middle_name\" : $(\"#middleName_input\").val(),\n \"last_name\" : $(\"#lastName_input\").val(),\n \"email\" : $(\"#email_input\").val(),\n \"phone\" : $(\"#phone_input\").val(),\n \"address_line1\" : $(\"#address1_input\").val(),\n \"address_line2\" : $(\"#address2_input\").val(),\n \"city\" : $(\"#city_input\").val(),\n \"state\" : $(\"#state_input\").val(),\n \"zip\" : $(\"#zip_input\").val(),\n \"notes\" : $(\"#customerNotes_input\").val()\n }\n\n createCustomer(customerInfo);\n}", "function emailSuccess() {}", "function sendEmailToUser(address, firstName, lastName, email, phoneNumber, zestimate) {\n const emailText = `Hi ${firstName}!, thank you for signing up! Here are your account details: \n \\n Name: ${firstName}\n \\n Last name: ${lastName}\n \\n Phone: ${phoneNumber !== 'null' ? phoneNumber : ''}\n \\n\\n And here is the zestimate we found for the address: ${address}\n \\n ${zestimate} $ (per month)\n \\n Thank you, \n \\n The Rent-With-Me team :)`;\n const mailOptions = {\n from: companyEmail,\n to: email,\n subject: 'Congrats for joining Rent-With-Me!',\n text: emailText\n };\n transporter.sendMail(mailOptions, function(error, info){\n if (error) {\n console.log(error);\n } else {\n console.log('Email sent: ' + info.response);\n }\n });\n}", "function userEmail() {\n return (req, res, next) => {\n const { email } = req.body;\n //if no email, please enter one\n if (!email) {\n return res.json({ no_email_provided: \"please enter an email\" });\n }\n //send email back to user\n req.email = email;\n //next stack\n next();\n };\n}", "function emailOnChange() {\n const pattern = \"^[_a-zA-Z0-9-\\\\+-]+(\\\\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]+(\\\\.[a-zA-Z0-9-]+)*(\\\\.[a-zA-Z]{2,20})$\";\n validate(this, pattern);\n}", "sendTextEmail() {\n email([EMAIL], null, null, null, this.state.text);\n }", "function submit() {\n let req = {\n method: 'POST',\n url: Endpoints.SUBSCRIBE,\n data: {\n mail: vm.email\n }\n };\n\n $http(req).then((res) => {\n if (res.data.success) {\n NotificationService.success(res.data.data.message);\n } else {\n NotificationService.error(res.data.data.message);\n }\n });\n }", "function faqEnroll() {\n if ( $('#mce-EMAIL').val() == \"\" ) {\n\t handleLoginFailure({code: \"NOLOGIN_NOEMAIL\"});\n\t return;\n };\n register( $('#mc-embedded-subscribe-form') );\n }", "function sendMail(){ \n\tlogincontroller.logincheck(name,password,(err,data)=>{\n \tif(err) throw err;\n \telse{\n \t\tconsole.log(\"\\n------------------------------Compose Mail---------------------------------\\n\\n\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tconsole.log(\"Sender Name=> \"+data[0].name+\" ---------Sender Email ID => \"+data[0].emailid);\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar reciever = readline.question(\"Reciever Email Id => \");\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar subject = readline.question(\"Subject => \");\n \t\tconsole.log(\"------------------------------------------------------------------------------\")\n \t\tvar message = readline.question(\"Message = >\")\n \t\tconsole.log(\"------------------------------------------------------------------------------\\n\")\n\t\tmailcontroller.sendmail(data[0].emailid,reciever,subject,message,(err)=>{\n\t\t\tif(err) throw err;\n\t\t\telse{\n\t\t\t\tconsole.log(\"\\n---------Mail Sent Successfully---------\");\n\t\t\t\tconsole.log(\"\\n---------------------------Welcome \"+data[0].name+\"------------------------\");\n\t\t\t\thomeUI();\n\t\t\t}\n\t\t});\t\n\t\n \t}\n\n });\n\n}", "sendContactUsEmail(emailRequest)\n {\n return this.post(urls.IntegrationApiAdmin + urls.NotifyAssistance, emailRequest); \n }", "sendEmailToAdmin(callback) {\n if (!options.emailAddresses || !options.emailTemplate ||\n !sails.config.email[options.emailTemplate])\n return callback(null, null)\n\n EmailService.sendEmailAsync(\n // Generate the email template using the supplied arguments.\n sails.config.email[options.emailTemplate].apply(\n null, options.templateArgs\n )\n ).then(function (info) {\n return callback(null, true)\n }).catch(function (err) {\n sails.log.error(err)\n err.errType = 'EmailSendFailiure'\n return callback(err, null)\n })\n }", "function vendorEmailUpdateAPI(event) {\n event.preventDefault();\n for (var key in customSmtp) {\n var selector = getElement(customSmtp[key]);\n if (key === \"email\" && (required(selector) || emailFormat(selector))) {\n // validators failed\n return;\n } else if (key !== \"email\" && required(selector)) {\n // validator failed\n return;\n }\n }\n if (!$(\".form-error-msg\").is(\":visible\")) {\n // set the Custom SMTP value inside the preview div and hidding the all error message\n document.getElementById(\n \"setSenderName\"\n ).innerHTML = document.getElementById(\"getSenderName\").value;\n document.getElementById(\n \"setEmailAddress\"\n ).innerHTML = document.getElementById(\"getEmailAddress\").value;\n document.getElementById(\n \"setSmtpServer\"\n ).innerHTML = document.getElementById(\"getSmtpServer\").value;\n document.getElementById(\n \"setSmtpUsername\"\n ).innerHTML = document.getElementById(\"getSmtpUsername\").value;\n document.getElementById(\"setPort\").innerHTML = document.getElementById(\n \"getPort\"\n ).value;\n document.getElementById(\"setEnableSsl\").innerHTML = document.getElementById(\n \"getEnableSsl\"\n ).value;\n getElement(\".emailEditedValue\").style.display = \"block\";\n document.getElementById(\"myBtn\").innerHTML = \"Edit Details For Custom SMTP\";\n document.getElementById(\"error-msg\").style.display = \"none\";\n $(function () {\n // created Customer SMTP object details for Post API\n const object = {\n VendorType: \"Email\",\n VendorName: document.getElementById(\"smtpSelect\").value,\n IsBulkVendor: false,\n VendorDetails: {},\n };\n var object1 = $(\"#submitForm\").serializeObject();\n object.VendorDetails = Object.assign(object.VendorDetails, object1);\n var settings = {\n // post the created Customer SMTP object to the vendor API\n async: true,\n crossDomain: true,\n url: config.baseURL + \"/api/config/vendor\",\n method: \"POST\",\n\n headers: {\n \"Content-Type\": \"application/json\",\n Authorization: \"Bearer \" + auth_token,\n },\n data: JSON.stringify(object),\n error: function (xhr, error) {\n alert(\"value is not posted\");\n },\n };\n $.ajax(settings).done(function (data) {\n // post Success message\n if (data) {\n alert(\"Vendor details saved successfully.\");\n }\n });\n return false;\n });\n\n // Used to enable the scroll and close the SMTP POP-up and enable the save changes button in bottom.\n var modal = document.getElementById(\"customSmtpOpenPopup\");\n modal.style.display = \"none\";\n enableDisableSaveButton();\n $(\"body\").css({\n overflow: \"auto\",\n });\n }\n}", "function notifyOnSubmission() {\r\n \r\n var form = FormApp.openById(\"Redacted\");\r\n \r\n // get response that was just submitted.\r\n var mostRecentResponse = form.getResponses().pop();\r\n \r\n // access the boxes the user filled out - They're indexed in the order they appear\r\n var itemResponses = mostRecentResponse.getItemResponses(); // -> ItemResponse[]\r\n \r\n var responseObject = {\r\n name : itemResponses[0].getResponse(),\r\n email : itemResponses[1].getResponse(),\r\n platform : itemResponses[2].getResponse(),\r\n issue : itemResponses[3].getResponse(),\r\n };\r\n \r\n Logger.log(responseObject); \r\n \r\n var memberAssigned = getMemberToSendTo(responseObject);\r\n var emailBody = \r\n `\r\n New Support Ticket From ${responseObject.name} \\n\r\n Platform: ${responseObject.platform}\\n\r\n Issue: ${responseObject.issue}\r\n `;\r\n GmailApp.sendEmail(memberAssigned.email, `New Support Ticket From ${responseObject.name}`, emailBody);\r\n Logger.log(\"Sent to \" + memberAssigned.email);\r\n var admin_email = \"\";\r\n GmailApp.sendEmail(admin_email, `New Support Ticket From ${responseObject.name}`, emailBody);\r\n Logger.log(\"Sent to Admin\");\r\n }", "function clickRegSubmit ( e ) {\n console.groupCollapsed(\"Sending Registration\");\n var name = $('#register-name').val();\n var email = $('#register-email').val();\n\n console.debug(\"register name: %s\", name);\n console.debug(\"register email: %s\", email);\n\n /* client side validation */\n var regAlphaNum = /^(?=[A-Za-z0-9 \\.]+[A-Za-z])[A-Za-z0-9 \\.]{4,20}$/; //regex to verify valid name\n var regEmail = /^[\\w\\.-]+@[\\w\\.-]+\\.[a-z]{2,4}$/; // regex to verify valid email\n\n if (!regAlphaNum.test(name)) {\n alert(\"You Have Entered Invalid Characters In the 'Name' Field\");\n return;\n }\n\n if (!regEmail.test(email)) {\n alert(\"You Have Entered An Invalid Email Address\");\n return;\n }\n\n var batchId = parseInt($('#btn-register').attr('data-target'));\n\n /* all is well. send info to server */\n sendRegistration({\n username : name,\n useremail : email,\n batch : batchId\n });\n\n console.groupEnd();\n}", "function emailChecker(storedEmail, reqEmail, callback){\n if (storedEmail === reqEmail){\n callback();\n };\n}", "async send ({ commit, rootGetters }, email) {\n const invited = await invitations.create({\n email,\n group: rootGetters['groups/activeGroupId'],\n })\n commit(types.APPEND, { invited })\n }", "function sendContactForm() {\n let sCustomerName = contactFormName.value;\n let sCustomerEmail = customerFormEmail.value;\n let sCustomerMessage = customerFormMessage.value;\n\n //check if input fields has been filled out\n if (sCustomerName == \"\" || sCustomerEmail == \"\" || sCustomerMessage == \"\") {\n showMessage(\"Please fill out all the fields\", true);\n } else {\n let sEmailRegEx =\n /^[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~](\\.?[-!#$%&'*+\\/0-9=?A-Z^_a-z`{|}~])*@[a-zA-Z0-9](-*\\.?[a-zA-Z0-9])*\\.[a-zA-Z](-?[a-zA-Z0-9])+$/;\n\n //check that the email is a valid email\n if (!sEmailRegEx.test(sCustomerEmail)) {\n customerFormEmail.classList.add(\"invalid\");\n setTimeout(() => {\n customerFormEmail.classList.remove(\"invalid\");\n }, 5000);\n //lets user know their email was invalid\n showMessage(\"Please provide a valid email address\", true);\n } else {\n document.body.style.cursor = \"wait\";\n document.querySelector(\".contact-form__button\").style.backgroundColor =\n \"grey\";\n customerFormEmail.classList.remove(\"invalid\");\n //post the filled out data to the mailing api\n postData(\"MAILER/send-contact-message-email.php\", {\n customerName: sCustomerName,\n customerEmail: sCustomerEmail,\n customerMessage: sCustomerMessage,\n }).then((jResponse) => {\n console.log(jResponse);\n if (!jResponse.mailSent) {\n showMessage(\"An error occurred\", true);\n } else {\n showMessage(\n \"Thank you, Your message has been sent to Mirtual\",\n false\n );\n document.body.style.cursor = \"default\";\n document.querySelector(\".contact-form__button\").style = \"\";\n\n contactFormName.value = \"\";\n customerFormEmail.value = \"\";\n customerFormMessage.value = \"\";\n }\n });\n }\n }\n}", "function mailConfirmation(user, info, form, mail, callback) {\n var msg = \"Dear \" + form.firstName + \" \" + form.lastName + \"\\n\\n\";\n msg += \"Thank you for your purchase of \" + form.shares + \" shares on Pool Play.\\n\";\n msg += \"You've been charged $\" + info.price + \".00 for this purchase.\\n\";\n msg += \"If you have any questions, don't hesitate to contact us!\\n\\n\";\n msg += \"Thanks,\\n\";\n msg += \" The Pool Play team\";\n console.log(\"mailto: \" + form.email);\n var mailInfo = {\n from: \"Pool Play <gtechpoolplay@gmail.com>\",\n to: form.email,\n subject: \"Confirmation of your Pool Play purchase\",\n text: msg\n };\n \n var smtpTransport = mail.createTransport(\"SMTP\", {\n service: \"Gmail\",\n auth: {\n user: \"gtechpoolplay@gmail.com\",\n pass: \"165198795\"\n }\n });\n smtpTransport.sendMail(mailInfo, function(error, response) {\n if (error) {\n console.log(error);\n } else {\n console.log(\"Message sent: \" + response.message);\n }\n callback();\n });\n}", "function AddCustomer()\n{\n if(ValidateEmail(document.querySelector('#newemail').value)){\n let customer = {};\n customer.firstName = document.querySelector('#firstName').value;\n customer.lastName = document.querySelector('#lastName').value;\n customer.email = document.querySelector('#newemail').value;\n\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(){\n if(this.readyState == 4 && this.status > 199 && this.status < 300)\n {\n document.querySelector('#firstName').value = '';\n document.querySelector('#lastName').value = '';\n document.querySelector('#newemail').value = '';\n }\n };\n xhr.open(\"POST\", 'https://localhost:5001/MainMenu/add', false);\n xhr.setRequestHeader('Content-Type', 'application/json');\n xhr.send(JSON.stringify(customer));\n \n let url = 'https://localhost:5001/MainMenu/get/' + customer.email;\n fetch(url)\n .then(response => response.json())\n .then(result => CustomerLocal(result));\n\n}\n}", "function addCustomer(email, password) {\r\n return new Promise((resolve, reject) => {\r\n validator(password) // First validate that password has special character or not\r\n .then(() => { return isEmailExist(email); }) // If password is ok then check user's email exist or not\r\n .catch((e) => { console.log(e) });\r\n pool.query(\"INSERT INTO Account(email,password) values($1,$2)\", [email, password], (err, res) => {\r\n if (err) {\r\n reject(err);\r\n } else resolve(\"Your have successfully added!\");\r\n });\r\n\r\n });\r\n\r\n}", "function suscribeEmail(req, res) {\n const email = req.params.email;\n //creamos una nueva instancia de nuestro modelo\n const newsletter = new Newsletter();\n\n if (!email) {\n res.status(404).send({ code: 404, message: \"El email es obligatorio.\" })\n } else {\n //formateamos el email a minsculas\n newsletter.email = email.toLowerCase();\n newsletter.save((err, newsletterStored) => {\n if (err) {\n res.status(500).send({ coe: 500, message: \"El email ya existe.\" })\n }\n else {\n if (!newsletterStored) {\n res.status(404).send({ code: 404, message: \"Error al registrar en la newsletter.\" })\n }\n else {\n res.status(200).send({ code: 200, message: \"Email registrado correctamente.\" })\n }\n }\n\n })\n }\n\n\n\n}", "function simpleEmailValidation(emailAddress) {\n\n}", "function subscribe(){\n let subBtn = document.getElementById(\"subscribe-btn\");\n subBtn.addEventListener(\"click\", validateEmail);\n\nfunction validateEmail() {\n let email = document.getElementById(\"inputEmail\").value;\n let reg = /\\S+@\\S+\\.\\S+/; \n if(email.match(reg)) {\n alert(\"Thank you for Subscribing! Our fresh new blog posts will be waiting for you at: \"+ email) \n }\n else {\n alert(\"Please enter valid e-mail format: name@email.com\")\n }\n}\n}", "function addEmail() {\n\t\n\t// Retrieve information from user when the e-mail has been added to the correct form field\n\tvar email = document.forms[\"signup\"][\"email\"].value\n\n\t// Using regex, affirm that the e-mail given is a valid one \n\tif (/^[^\\s@]+@[^\\s\\.@]+\\.[^\\s\\.@]+$/.test(email)) {\n\t\treturn true;\n\t} else {\n\t// If the input is not a valid email\n\talert(\"Please ensure you have added a correct e-mail before resubmitting form.\");\n\treturn false;\n\t};\n}", "function validateEmailAddress(customerForm)\n{\n var isValid = true;\n var emailAddr = customerForm.emailaddress.value;\n\n // first make sure an at-sign is found\n var atPos = emailAddr.indexOf(\"@\");\n if (atPos == -1)\n {\n isValid = false;\n }\n else\n {\n // next, make sure there is at least one domain separator\n // following the at-sign\n var dotPos = emailAddr.indexOf(\".\", atPos + 1);\n if (dotPos == -1)\n {\n isValid = false;\n }\n }\n\n if (!isValid)\n {\n window.alert(\"Your e-mail address must be in the format of username@domain.name\");\n }\n return isValid;\n}", "function editor_tools_handle_email()\n{\n var email = prompt(editor_tools_translate(\"enter email\"), '');\n if (email == null) return;\n email = editor_tools_strip_whitespace(email);\n\n var subject = prompt(editor_tools_translate(\"enter subject\"), '');\n if (subject == null) return;\n subject = editor_tools_strip_whitespace(subject);\n if (subject != '') {\n subject = ' subject=' + quote_bbcode_argument(subject);\n }\n\n if (email == '') {\n editor_tools_add_tags('[email'+subject+']', '[/email]');\n } else {\n editor_tools_add_tags('[email'+subject+']'+email+'[/email]', '');\n }\n\n editor_tools_focus_textarea();\n}", "function handleEmail() {\r\n\twindow.onmouseup = null;\r\n\tvar form = document.createElement(\"form\");\r\n\tvar params;\r\n\t\r\n\tswitch(emailType) {\r\n\t\tcase 'version':\r\n\t\t\temailType = '0';\r\n\t\t\tbreak;\r\n\t\tcase 'title':\r\n\t\t\temailType = '1';\r\n\t\t\tbreak;\t\t\t\r\n\t}\r\n\t\r\n\tparams = {'email' : emailAddress, 'id' : emailId, 'type' : emailType };\r\n form.setAttribute(\"method\", \"post\");\r\n\r\n for(var key in params) {\r\n var hiddenField = document.createElement(\"input\");\r\n hiddenField.setAttribute(\"type\", \"hidden\");\r\n hiddenField.setAttribute(\"name\", key);\r\n hiddenField.setAttribute(\"value\", params[key]);\r\n\r\n form.appendChild(hiddenField);\r\n }\r\n\r\n\t// Add email to cookies for easier notifications\r\n\tcookieWrite('email', emailAddress);\r\n document.body.appendChild(form);\r\n form.submit();\r\n}", "function registeredmail(req, res, next) {\n sendEmailWithTemplate(req.body.reservationId, req, res, 'registeredmail');\n}", "function addEmail(email, callback) {\n var id = generateEmailID();\n conn.query('INSERT INTO Emails (email_id, recipient, date_to_send , entry_id , collection_id, subject, content, status, entry_edition)' + \n 'VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9);',\n [\n id,\n email.recipient,\n email.date_to_send,\n email.entry_id,\n email.collection_id,\n email.subject,\n email.content,\n email.status,\n email.entry_edition\n ]).on('error', console.error)\n .on('end', function() {\n console.log('email successfully added');\n callback(id);\n });\n}", "function changeEmailandTransfer(source, destination, update) {\n destination.email = source.email;\n destination.update = update;\n\n\n DP.execute({type:\"apiCustomer\", method:\"updateEmail\", params: destination}).then(function(response) {\n if (response.message === 'Successful') {\n Notification.success({title: tr(\"widgetChangeEmailSuccess\"), message: tr(\"widgetChangeEmailSuccess\")});\n transfer(destination);\n } else {\n Notification.error({title: tr(\"widgetChangeEmailError\"), message: tr(\"widgetChangeEmailError\")});\n }\n\n });\n\n }", "sendEmail() {\r\n emailService.sendEmail(\r\n ['tehilaj97@gmail.com'],\r\n null,\r\n null,\r\n 'A new organization is awaiting your approval',\r\n 'organization name: '+ this.state.org.org_name +\r\n '\\norganizaion description: ' + this.state.org.description +\r\n '\\nusername asking to create organization: ' + this.state.org.admin_name,\r\n null,\r\n )\r\n }", "async action() {\n let result = await this.userServiceDI.checkMailInDb({\n email: this.model.email\n });\n if (result != null) {\n let model = {\n body: {\n email: this.model.email,\n uid: result.uid,\n href: (new URL(this.referer)).origin,//this.referer,//CONFIG.FRONT_END_URL,\n name: result.name\n }\n };\n this.mailSenderDI.mailSend({\n xslt_file: EMAIL_TEMPLATE.forgot_password_step_1,\n model,\n email_to: this.model.email,\n language: result.language,\n mail_title: new CodeDictionary().get_trans(\n \"FORGOT_PASSWORD_FIRST_MAIL\",\n \"EMAIL\",\n result.language\n )\n });\n }\n }", "function isEmailAddressProvided(customerForm)\n{\n var provided = true;\n\n if (customerForm.emailaddress.value == \"\")\n {\n provided = false;\n }\n\n return provided;\n}", "function testEmail(doSort, AddAnn, AddComic) {\r\n\r\nvar subject = \"Test Newsletter Week \" + getWeek();\r\nvar body = createEmail(AddAnn, AddComic, doSort);\r\nvar recipient = userEmail;\r\n\r\nsendAndSaveEmail(subject, recipient, body, false);\r\n}", "function weeklyperspectivesendmail(emailcontroll) {\n var pattern = /^([a-zA-Z0-9_.-])+@([a-zA-Z0-9_.-])+\\.([a-zA-Z])+([a-zA-Z])+/;\n var email = $(\"#\" + emailcontroll).val();\n if (email == null || $.trim(email) == \"\" || $.trim(typeof email) == \"undefined\") { alert(\"Please enter email address\"); }\n else if (!pattern.test(email)) { alert('Please enter valid email address'); }\n else {\n $.ajax({\n url: \"http://\" + DomainName + \"/Weeklyperspective/EmailSend\",\n type: \"GET\",\n data: { Emailadd: email },\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n error: function (xhr) { alert(\"You have failed registeration\"); },\n success: function (result) {\n if (result == 1) { alert(\"You have sucessfully registered\"); }\n else { alert(\"You have failed registeration\"); }\n },\n error: function (ex) {\n ExceptionHandling(ex);\n }\n });\n }\n}", "function emailQualifies(){\n\t\t\n\t\t// Get the ID of the email holder and store it in emailOption.\n\t\tvar emailOption = document.getElementById(\"email\").value;\n\t\t\n\t\t// Store the email regex checker in a var.\n\t\tvar emailRegex = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n\t\t\n\t\t// Test if the email entered passes the regex test.\n\t\tvar emailValid = emailRegex.test(emailOption);\n\t\t\n\t\t// If its a valid email.. continue,\n\t\tif(emailValid){\n\t\t\treturn true;\n\t\t}\n\t\t// else return an error.\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t} // End emailQualifies.", "function addUserToCustomerIO(){\n if (hasSignedUp()) return;\n\n var email = $(\"#cio-email\").val();\n var firstName = $(\"#cio-firstname\").val();\n var source = $(\"#cio-source\").val();\n var id = email.replace('@', '_');\n id = id.replace('.', '_');\n\n _cio.identify({\n // Required Items\n id: id,\n email: email,\n created_at: Math.round( new Date().getTime()/1000), // seconds since the epoch\n\n // Optional (these are examples. You can name attributes what you wish)\n type: 'lead',\n first_name: firstName,\n source: 'leads',\n referrer: document.referrer\n });\n\n setSignedUp();\n }", "function emailValid() {\n\tvar domain = new RegExp(/^[A-z0-9.]{1,}@(?=(my.bcit.ca$|bcit.ca$|gmail.com$))/i); //checks email for single occurrence of @ and valid domain containing only valid characters.\n\tvar email = document.getElementById(\"email\").value;\n\tif (domain.test(email))\n\t{\n\t\t/*if (email exists in database) {\n\t\t\tdocument.getElementById(\"email\").value = \"Email already exists\"\n\t\t} else {whatever value to let form submit}*/\n\t\tdocument.getElementById(\"emailErrorField\").innerHTML = \"Email valid\"\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(\"emailErrorField\").innerHTML = \"Email invalid.\"\n\t\treturn false;\n\t}\n}", "function pushToDatabase(name, email, message) {\n var date = getDate();\n var document = {\n to: \"gsw2@lehigh.edu\",\n message: {\n subject: \"New CSB Capstone Request\",\n html:\n \"<div class=”body”><b>Name:</b> \" +\n name +\n \"<br><b>Email:</b> \" +\n email +\n \"<br><b>Message:</b> \" +\n message +\n \"<br><b>Date:</b> \" +\n date +\n \"</div>\",\n },\n };\n db.collection(\"requests\")\n .add(document)\n .then(function (docRef) {\n console.log(\"Document written with ID: \", docRef.id);\n })\n .catch(function (error) {\n console.error(\"Error adding document: \", error);\n });\n // console.log(\"Successfully updated database.\");\n}", "async function main () {\n // send mail with defined transport object\n transporter.sendMail({\n from: email, // sender address\n to: 'melphelps@live.co.uk', // list of receivers\n subject: 'Client Enquiry', // Subject line\n html: message\n }, function (err) {\n if (err) {\n console.log(err)\n res.render('error')\n } else {\n console.log('Message sent successfully:')\n res.render('confirmation')\n }\n })\n }", "function validateEmail (email) {\n var requested;\n var emailEntryGood = 'Thanks for signing up! You’ll recieve an email with your invitation.';\n var emailEntryBad = 'There was a problem with your Request: Valid email address not provided.';\n\n // If user inputs a good email\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email)) {\n\n // Send the email address to the emailSave function to send to the database\n emailSave(email, submitTime);\n\n $('#js-message-endpoint').html(emailEntryGood);\n\n // Remove display-none on checkbox\n $('.checkbox').removeClass('display-none');\n\n // Switch over to email--sent\n $('.invite__request').removeClass('email--unsent');\n $('.invite__request').addClass('email--sent');\n\n // Change submit button text\n requested = 'REQUESTED';\n $('#buttontext').html(requested);\n\n }\n \n // If user enters a forbidden email\n else {\n\n $('#js-message-endpoint').html(emailEntryBad);\n\n // Hide checkbox\n $('.checkbox').addClass('display-none');\n\n // Switch over to email--unsent\n $('.invite__request').removeClass('email--sent');\n $('.invite__request').addClass('email--unsent');\n\n // Change submit button text\n requested = 'REQUEST INVITE';\n $('#buttontext').html(requested);\n\n }\n }", "function sendEmailVerification() {\r\n // [START sendemailverification]\r\n console.log(\"sendEmailVerification \" + firebase.auth().currentUser );\r\n firebase.auth().currentUser.sendEmailVerification().then(function() {\r\n // Email Verification sent!\r\n // [START_EXCLUDE]\r\n alert('Email Verification Sent!');\r\n // [END_EXCLUDE]\r\n });\r\n // [END sendemailverification]\r\n }", "function email(){\n var emailReg =/[a-z].*(@)[a-z]*(.)[a-z]{2,}$/;\n var validEmail = document.getElementById('email').value;\n if (emailReg.test(validEmail) === false)\n {\n throw \"invalid email address\";\n }\n }", "function sendVerification () {\n //var emailIn = document.getElementById(\"emailInput\").value;\n var user = firebase.auth().currentUser;\n var emailIn = document.getElementById(\"emailInput\").value;\n user.sendEmailVerification().then(function() {\n //console.log(\"verification sent\");\n // Email sent.\n }).catch(function(error) {\n var errorMessage = error.message;\n window.alert(errorMessage);\n });\n}", "function sendMail(e){\n\te.preventDefault()\n\tconst receiver = document.querySelector(\"#receiverName\").value\n\tconst content = document.querySelector(\"#inputContent\").value\n\t//const appendMail = new Mail(receiver.value, content)\n\t//auser.send.push(newMail)\n\n const newMail = {\n \"receiver\":receiver,\n \"content\":content\n }\n RequestModule.sendmail(newMail, function(newmail){\n sent.insertBefore(mailHTML(newmail), sent.children[1])\n if(receiver === currentUser){\n inbox.insertBefore(mailHTML(newmail), inbox.children[1])\n }\n })\n\n // Server side funtions will be added below in phase2.\n}", "function handleEmail(event) {\n // Prevent the form submitting and refreshing the page\n event.preventDefault();\n\n // Select the input field\n const inputField = document.querySelector(\".inputs__input\");\n\n // Select the input field label (will be used to display the error message)\n const inputFieldLabel = document.querySelector(\"label[for='text-input']\");\n\n // Hide the error message and reset its color\n inputFieldLabel.style.display = \"none\";\n inputFieldLabel.style.color = \"red\";\n\n // Extract the input from inputField\n const userInput = inputField.value;\n\n // Create a regex to test for a valid email\n const regex = /[a-zA-z0-9_\\.]+@[a-zA-Z0-9_\\.\\-]+[.][a-z]{3}/i;\n\n // Check if field is empty\n if (!userInput) {\n inputFieldLabel.style.display = \"inline\";\n inputFieldLabel.innerText = \"Oops! Please add your email\";\n }\n // Check if the email is valid\n else if (!regex.test(userInput)) {\n inputFieldLabel.style.display = \"inline\";\n inputFieldLabel.innerText = \"Oops! Please check your email\";\n }\n // Otherwise, let the user in\n else {\n inputFieldLabel.style.display = \"inline\";\n inputFieldLabel.style.color = \"green\";\n inputFieldLabel.innerText = \"You're in!\";\n }\n }", "function validate_email() {\n if (!valid_email(vm.email_address)) {\n vm.error_message = 'Please enter a valid email address';\n return;\n }\n reset_password();\n }", "send(){\n const recipients = this.refs.recipients.refs;\n let data = {\n to:recipients.to.value,\n cc:recipients.cc.value,\n bcc:recipients.bcc.value,\n from:this.refs.from.value,\n subject:this.refs.subject.value,\n body:this.refs.body.value,\n }\n /* TODO call backend API with data */\n fakeAPI.send(data, () => { window.alert ('email sent successfully!');})\n }", "static create(contactEmailAddress) {\n return __awaiter(this, void 0, void 0, function* () {\n try {\n const newContactEmailAddress = (yield db_1.db.write.table('ContactEmailAddresses').insert(contactEmailAddress).execute()).rowCount;\n return (newContactEmailAddress == 1) ? { message: 'Contact email address created successfully', result: true } : { message: 'Failed to create contact email address', result: false };\n }\n catch (err) {\n throw new Error(err);\n }\n });\n }", "function saveEmailToQuote(email = \"\", firstName = \"\", lastName = \"\") {\n if (!email || email === \"\") {\n email = $('form.form-login input[name=username]').val();\n }\n\n if (!firstName || firstName === \"\") {\n firstName = $('form.form input[name=firstname]').val();\n }\n\n if (!lastName) {\n lastName = $('form.form input[name=lastname]').val();\n }\n\n console.log(email + \" - \" + firstName + \" - \" + lastName);\n\n // save to database\n $.ajax({\n url: \"/onestepcheckout/index/savequote\",\n data: {\n customerEmail: email,\n firstName: firstName,\n lastName: lastName\n },\n type: 'POST',\n dataType: 'json',\n beforeSend: function () {\n // show some loading icon\n },\n success: function (data, status) {\n console.log(status);\n console.log(data);\n },\n error: function (xhr, status, errorThrown) {\n console.log('Error happens. Try again.');\n console.log(errorThrown);\n }\n });\n\n // push into api\n let postURL = 'https://checkoutcarteventregistration-qa.azurewebsites.net/api/v1/eventregistration'; // QA\n if (window.location.href.indexOf('infinityscrubs.com') > -1) {\n postURL = 'https://checkoutcarteventregistration.azurewebsites.net/api/v1/eventregistration'; // production\n }\n // Production https://checkoutcarteventregistration.azurewebsites.net/api/v1/eventregistration\n // QA https://checkoutcarteventregistration-qa.azurewebsites.net/api/v1/eventregistration\n\n let quoteCartId = $('#checkout').attr('data-quote-id');\n console.log(quoteCartId);\n if (quoteCartId && quoteCartId > 0) {\n let ajaxData = {\n cartId: quoteCartId,\n emailAddress: email,\n source: 'infinityscrubs' // \"infinityscrubs\" or \"heartsoulscrubs\"\n };\n\n $.ajax({\n url: postURL,\n data: JSON.stringify(ajaxData),\n type: 'POST',\n contentType: \"application/json; charset=UTF-8\",\n dataType: 'json',\n beforeSend: function (xhr) {\n console.log(\"abadoncart infinityscrubs api\");\n },\n success: function (data) {\n console.log(data);\n },\n error: function (xhr, status, errorThrown) {\n console.log('Error happens. Try again.');\n console.log(errorThrown);\n }\n });\n }\n }", "function email_checker() {\n const email_value = email.value;\n\n if (validateEmail(email_value)) {\n errorMessageEmail.innerText = \"\";\n register.removeAttribute(\"disabled\");\n\n } else {\n errorMessageEmail.innerText = \"Invalid Email address.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}", "verification({ commit }) {\n var user = firebase.auth().currentUser;\n user.sendEmailVerification().then(function () {\n commit('setAlertMessage', 'Se envio correo de confirmacion ${user.email}');\n alert('Se Envio Correo De Confirmacion');\n }).catch(function (error) {\n alert('Se produjo un error);', error);\n });\n\n }", "function doPost() {\n send({operation:\"getVerifiedEmail\"});\n }", "function zm_validate_email( myObj ){\n $this = myObj;\n\n if ( $.trim( $this.val() ) == '' ) return;\n\n $.ajax({\n data: \"action=validEmail&email=\" + $this.val(),\n dataType: 'json',\n global: false,\n success: function( msg ){\n showMessage( msg );\n }\n });\n }", "function validateEditForm() {\n if(validateEmail(document.querySelector('#store-contact').value)){\n if(document.querySelector('#store-heading').value != '' && document.querySelector('#item-name').value != '' && document.querySelector('#edit-textarea').value != '' && document.querySelector('#store-price').value != ''){\n document.querySelector('.edit-form').submit();\n }\n }\n else{\n document.querySelector('.contact-email-error').style.display = 'block';\n }\n}", "getEmail() {}", "function handleSignup(email, password) {\n // Check if the email exists\n\n // Save the user to the database\n db.saveUser({email, password}); // simple user object\n\n // Send the welcome email\n}", "function validateEmail(req, res, next) {\n knex('users').where('email', req.body.email).first().then(email => {\n //if email exists already, exits with 400 and a message\n if (email) {\n res.set('Content-Type', 'text/plain');\n res.status(400).send('Email already exists');\n return;\n }\n req.email = email;\n next();\n });\n }", "function reservmail(req, res, next) {\n sendEmailWithTemplate(req.body.reservationId, req, res, 'reservmail');\n}", "function postEmail(req, res, next) {\n var to = req.params.to;\n var subject = req.params.subject;\n var message = req.params.message;\n mail.sendMail(to, subject, message, false);\n return next();\n }", "function sendMail(){\n\t\n\terror = false;\t\t// Reset error to assume there's no errors\n\t\n\t// Fetch user's information\n\tvar name = document.getElementById('name').value;\n\tvar email = document.getElementById('email').value;\n\tvar subject = document.getElementById('subject').value;\n\tvar message = document.getElementById('message').value;\n\t\n\t//-----------------------------//\n\t// Validate user's information //\n\t//-----------------------------//\n\t\n\t// Did user input their name?\n\tif (name == ''){\n\t\tvalidateActions(\"nameVal\", \"nameGroup\", \"Name field is empty\", true);\n\t}\n\telse{\n\t\tvalidateActions(\"nameVal\", \"nameGroup\", \"\", false);\n\t}\n\t\n\t\n\t// Did user input their email?\n\tif (email == ''){\n\t\tvalidateActions(\"emailVal\", \"emailGroup\", \"Email field is empty\", true);\n\t}\n\telse{\n\t\t// Email Regex\n\t\tvar re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\n\t\t// Is the email invalid?\n\t\tif (!re.test(email)){\n\t\t\tvalidateActions(\"emailVal\", \"emailGroup\", \"Given email is invalid\", true);\n\t\t}\n\t\telse{\n\t\t\tvalidateActions(\"emailVal\", \"emailGroup\", \"\", false);\n\t\t}\n\n\t}\n\t\n\t// Did user input an email subject?\n\tif (subject == ''){\n\t\tvalidateActions(\"subjectVal\", \"subjectGroup\", \"Subject field is empty\", true);\n\t}\n\telse{\n\t\t// Is the email subject ridiculously long?\n\t\tif (subject.length > 100){\n\t\t\tvalidateActions(\"subjectVal\", \"subjectGroup\", \"We appreciate the long subject title but please shorten it to 100 words or less.\", true);\n\t\t}\n\t\telse{\n\t\t\tvalidateActions(\"subjectVal\", \"subjectGroup\", \"\", false);\n\t\t}\n\t}\n\t\n\t\n\t// Did user input their email message?\n\tif (message == ''){\n\t\tvalidateActions(\"messageVal\", \"messageGroup\", \"Message field is empty\", true);\n\t}\n\telse{\n\t\t// Is the email message ridiculously long?\n\t\tif (message.length > 2000){\n\t\t\tvalidateActions(\"messageVal\", \"messageGroup\", \"We appreciate the long message but please shorten it to 2000 words or less.\", true);\n\t\t}\n\t\telse{\n\t\t\tvalidateActions(\"messageVal\", \"messageGroup\", \"\", false);\n\t\t}\n\t}\n\t\n\t// Did we have an error?\n\tif (error){\n\t\t$(\"#errormessage\").addClass(\"show\");\n\t\t$(\"#sendmessage\").removeClass(\"show\");\n\t\treturn false;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Prevent form from sending\n\t}\n\telse{\n\t\t// Empty each field (to prevent submit button spam)\n\t\tdocument.getElementById('name').value = \"\";\n\t\tdocument.getElementById('email').value = \"\";\n\t\tdocument.getElementById('subject').value = \"\";\n\t\tdocument.getElementById('message').value = \"\";\n\t\t\n\t\t$(\"#errormessage\").removeClass(\"show\");\n\t\t$(\"#sendmessage\").addClass(\"show\");\n\t}\n\t\n\t\n\t//----------------------------------------//\n\t// Send user's information to create mail //\n\t//----------------------------------------//\n\t\n\t// Stores user's information\n\tvar data = {};\n\tdata.name = name;\n\tdata.email = email;\n\tdata.subject = subject;\n\tdata.message = message;\n\t\n\t//alert(data.name + \" || \" + data.email + \" || \" + data.subject + \" || \" + data.message); \n\t\n\t//var loc = window.location.pathname;\n\t//var dir = loc.substring(0, loc.lastIndexOf('/'));\n\t//alert(dir);\n\t\n\t//$.post(dir + \"/contactform/emailtransfer.php\", data, mailReturn);\n}", "function sendMail() {\n let emailTo = toEmail.value;\n let emailFrom = fromEmail.value;\n let uuid = downloadLink.value.split(\"/\").splice(-1, 1)[0];\n const data = {\n uuid,\n emailTo,\n emailFrom,\n };\n fetch(emailUrl, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(data),\n })\n .then((res) => res.json())\n .then((data) => {\n if (data.success) {\n toEmail.value = \"\";\n fromEmail.value = \"\";\n sharingContainer.style.display = \"none\";\n showPrompt(\"Email Sent Successfully\");\n }\n });\n}", "function validateEmail() {\n $scope.errorEmail = false;\n\t\t\tif(!/^([\\da-z_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$/.test($scope.email)) {\n\t\t\t\t$scope.errorEmail = true;\n $scope.messageEmail = 'E-mail address has a wrong format.';\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvar data = {\n\t\t\t\t\taction: \"validateEmail\",\n\t\t\t\t\temail: $scope.email\n\t\t\t\t};\n\n // Calls the validate e-mail method in the registration factory.\n RegistrationFactory.validateEmail(data)\n .then(function(response) {\n if(typeof(response) == 'string') {\n $scope.errorEmail = true;\n $scope.messageEmail = 'An unexpected error occurred while e-mail address is validated. Please try again.';\n }\n else if (response[0]) {\n $scope.errorEmail = true;\n $scope.messageEmail = 'E-mail address is already registered.';\n }\n });\n\t\t\t}\n }", "function sendAndReturn(collection, element, callback) {\n var token = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {\n var r = Math.random() * 16 | 0,\n v = c == 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n var querry = {\n 'email': element.email,\n 'password': element.password,\n 'username': '',\n \"address\": '',\n \"orders\": [],\n \"messages\": [],\n \"token\": token\n }\n collection.insertOne(querry, callback);\n }", "function on_customer_save() {\n var username = $(\"#widget-customers-manage input#username\").val();\n var selected_type = $(\"#user_type option:selected\").val();\n afrimesh.customers.generate(username, selected_type, 0, function(error, result) {\n console.debug(\"Inserted: \" + dump_object(result[0]));\n $(\"ul#menu ul#customers li#manage\").click();\n });\n }", "async function SendEmail(ctx, User = ctx.state.user) {\n const ConfirmationToken = new Token();\n\n User.email_token_hash = await ConfirmationToken.hash;\n await User.save();\n\n ctx.state.Mq.Push({\n from: '\"Fred Foo 👻\" <foo@example.com>',\n to: User.email,\n subject: 'Επιβεβαίωση εγγραφής στη Ψηφιακή Πλατφόρμα της ΕΦ',\n html: Nunjucks.render('email_confirmation.html', {\n 'onoma': User.onoma,\n 'epitheto': User.epitheto,\n 'email': User.email,\n 'token': await ConfirmationToken.hex\n })\n });\n\n log.info('ConfirmEmail', 'Sent to', User.email);\n}", "function emailSubmit(email) {\n var re = /^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n}", "function OnEmailAlert()\n{\n}", "TestSetEmail(email_input) {\n // set a default value to the email input\n email_input.value = \"test\";\n // invoke the event from the email input\n email_input.dispatchEvent(new Event(\"change\"));\n // print on the console that the test is completed\n console.log(\"Testing Set email method completed\");\n // add the state of was the email of the client instance had the default value or not\n this._errors_exists = this._main_store.client.email != \"test\";\n }", "function SparkEmailSignupNotification(email, res, memberCount, username, src) {\n console.log('[Spark] Sending signup notification email to admins..');\n \n transporter.sendMail({\n from: '\"Imperium42\" <noreply@imperium42.com>',\n to: adminEmails, // []\n subject: '[MC] +1 Subscriber (' + email + ') >> ' + memberCount + ' members (from ' + src + ')!',\n text: 'Username: ' + username + ' ~ Rock on, i42!',\n html: '<span style=\"font-weight:bold;\">Username: </span>' + username + '<br><br>Rock On, i42!'\n }, (err, info) => {\n if (err) {\n var errSend = '[MC] **ERR @ SparkEmailSignupNotification: ' + J(err);\n console.log(errSend);\n if (res) \n res.send(errSend);\n } else {\n console.log( '[Spark] Success: ' + J(info) );\n if (res)\n res.send('Success (' + info[\"accepted\"] + ')!')\n }\n });\n}", "function emailLogin() {\n AccountKit.login(\n 'EMAIL',\n {},\n loginCallback\n );\n }", "function connectingMail(){\r\n client.query('select * from scheduler_table', (err, res) => {\r\n if(err){\r\n errorCatch(err.message, \"ConnectionError\", \"Pending\");\r\n }else{\r\n var mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{​​​​​​​​|}​​​​​​​​~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\r\n res.rows.map(rowsVal => {\r\n errorMail = [''];\r\n \r\n //email validation \r\n errorMail = process.env.mail_strVal + rowsVal.emailid;\r\n if (err == null && mailformat.test(rowsVal.emailid.trim())) {\r\n for (let i = 0; i < res.rows.length; i++) {\r\n emailVal[i] = res.rows[i].emailid\r\n\r\n }\r\n mailSend(emailVal)\r\n } else {\r\n errorCatch(errorMail, \"emailValidationError\",\"Pending\");\r\n }\r\n })\r\n }\r\n })\r\n}", "async createCustomer(customerName, customerPhone, customerEmailAddress, otherDetails) {\n if (!customerName || !customerPhone || !customerEmailAddress) {\n return {msg: 'There was an error with the customer information supplied.', payload: 1};\n }\n\n try {\n let result = await customers.create({\n customerName: customerName,\n customerPhone: customerPhone,\n customerEmailAddress: customerEmailAddress,\n otherDetails: otherDetails\n });\n\n return {msg: 'Success', payload: 0, insertedId: result.dataValues.id};\n }\n catch (e) {\n return {msg: 'An error occurred while trying to create a new customer', payload: 1};\n }\n }", "function initEmailAddress(cart) {\n if (cart.getCustomerEmail() !== null) {\n app.getForm('billing').object.billingAddress.email.emailAddress.value = cart.getCustomerEmail();\n } else if (customer.authenticated && customer.profile.email !== null) {\n app.getForm('billing').object.billingAddress.email.emailAddress.value = customer.profile.email;\n }\n}", "function onEmailBlur(email) {\n\n\t\t// Save input value to the store\n\t\tdispatch(SET_EMAIL(email));\n\t}", "function sendEmail(e) {\n e.preventDefault();\n emailjs\n .sendForm(\n \"service_detp45p\",\n \"template_23zv4dw\",\n e.target,\n \"user_hV8uzE2oGvxy4MCE4JnvA\"\n )\n .then(\n (result) => {\n console.log(\"email sent\");\n },\n (error) => {\n console.log(error.text);\n }\n );\n }", "sendByEmail(item,callback) {\n if (!callback)\n callback = () => null;\n let url = \"http://\"+backendConfig.host+\":\"+backendConfig.port+\n \"/report/generate/\"+item[\"company\"].replace(/#/,\"\").replace(/:/g,\"_\")+\"/\"+\n item[\"type\"]+\"/\"+item[\"period\"]+\"/email\";\n Backend.getAuthToken(null,null, function(token) {\n if (token) url += '?token='+token;\n url += \"&email=\"+item[\"email\"].trim();\n Backend.request(url,{},'GET',{},null, function(err,response) {\n callback(err,response);\n })\n });\n }", "function sendEmail (event, body) {\n event.preventDefault()\n const params = {\n method: \"POST\",\n mode: \"cors\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(body)\n }\n return fetch(process.env.GATSBY_CONTACT_POST_URL, params)\n}", "function processPurchaseForm(){\n\n //Assign variables for each input, as well as corresponding validation formats\n var amountInput = document.getElementById(\"amountInput\");\n var nameInput = document.getElementById(\"nameInput\");\n var emailInput = document.getElementById(\"emailInput\");\n var senderInput = document.getElementById(\"senderInput\");\n var dateInput = document.getElementById(\"deliveryDateInput\");\n var fullDateInput = dateInput.value;\n var timeNow = new Date();\n var dateSelected = new Date(fullDateInput + 'T23:59:59');\n var messageInput = document.getElementById(\"message\");\n \n\n //REGEX formatting\n var stringFormat = /^[A-Za-z]+\\s?[A-Za-z]+$/i;\n var intFormat = /^([1-9][0-9]*)\\.?(\\d{2})?$/;\n var emailFormat = /^([\\w\\.\\-\\_]+)@(\\w+)\\.(\\w{2,3})/;\n \n //Validates form fields\n if(!intFormat.test(amountInput.value)){ \n amountInput.style.background = \"red\";\n amountInput.focus();\n return false;\n }\n else{\n amountInput.style.background = \"white\";\n }\n \n if(!stringFormat.test(nameInput.value)){ \n nameInput.style.background = \"red\";\n nameInput.focus();\n return false;\n }\n else{\n nameInput.style.background = \"white\";\n }\n \n if(!emailFormat.test(emailInput.value)){ \n emailInput.style.background = \"red\";\n emailInput.focus();\n return false;\n }\n else{\n emailInput.style.background = \"white\";\n }\n\n if(!stringFormat.test(senderInput.value)){ \n senderInput.style.background = \"red\";\n senderInput.focus();\n return false;\n }\n else{\n senderInput.style.background = \"white\";\n }\n\n if (dateSelected < timeNow || dateInput.value === \"\"){\n dateInput.style.background = \"red\";\n dateInput.focus();\n return false;\n }\n else{\n dateInput.style.background = \"white\";\n }\n\n //Gets HTML elements for displaying thanks message\n var thanksMsg = document.getElementById(\"thanksMsg\");\n var buyGCForm = document.getElementById(\"buyGCForm\");\n var buyGCTitle = document.getElementById(\"buyGCTitle\")\n\n var buyerName = document.getElementById(\"buyerName\");\n var gcAmount = document.getElementById(\"gcAmount\");\n var gcEmail = document.getElementById(\"gcEmail\");\n var sendDate = document.getElementById(\"sendDate\");\n var customerMsg = document.getElementById(\"customerMsg\");\n\n //Displays thanks message\n buyGCTitle.style.display = \"none\";\n buyGCForm.style.display = \"none\";\n thanksMsg.style.display = \"inherit\";\n\n customerMsg.innerText = messageInput.value;\n buyerName.innerText = nameInput.value;\n gcAmount.innerText = '$' + amountInput.value;\n gcEmail.innerText = emailInput.value;\n sendDate.innerText = fullDateInput;\n\n //Prevents form from fully submitting, for project purposes\n return false;\n }", "function sendRegister() {\n let name = document.getElementById('nameFieldReg').value;\n let email = document.getElementById('emailFieldReg').value;\n let password = document.getElementById('passwordFieldReg').value;\n\n if (!name) {\n showErrorMsg(\"Name missing\");\n } else if (!validateEmail(email)) {\n showErrorMsg(\"Email invalid\");\n } else if (!password) {\n showErrorMsg(\"Password missing\");\n } else {\n clearErrorMsg();\n sendData({\n cmd: \"reg\",\n nam: name,\n ema: email,\n psw: password\n }, receiveRegister);\n }\n}" ]
[ "0.6261569", "0.6227997", "0.61971116", "0.60470176", "0.60024", "0.5932843", "0.5869347", "0.58640057", "0.5853498", "0.5839002", "0.58258295", "0.58194643", "0.58033925", "0.5773742", "0.5772486", "0.57627356", "0.5728164", "0.572404", "0.56651497", "0.5661379", "0.5659271", "0.5582543", "0.5575779", "0.55568254", "0.55534506", "0.55333376", "0.5526097", "0.5526031", "0.55253804", "0.55136466", "0.5506935", "0.5496465", "0.5487906", "0.5474608", "0.5472286", "0.54670674", "0.54644907", "0.54535043", "0.54442394", "0.5435294", "0.54288596", "0.5420337", "0.5408164", "0.5400596", "0.5384666", "0.5383018", "0.53817", "0.53748226", "0.5373613", "0.5369849", "0.53664684", "0.5363924", "0.5363746", "0.53630596", "0.53618866", "0.5359734", "0.53457665", "0.5343095", "0.5340009", "0.5330566", "0.5314663", "0.53141034", "0.5313615", "0.5312082", "0.5307233", "0.53044313", "0.53012276", "0.52936435", "0.5289987", "0.52893376", "0.5288894", "0.5288274", "0.5286584", "0.52840203", "0.52811736", "0.52697426", "0.5266243", "0.52590996", "0.5253252", "0.52527124", "0.52514243", "0.52482325", "0.52426153", "0.52321666", "0.5226102", "0.5224834", "0.52237886", "0.5221386", "0.5217733", "0.52172303", "0.5216402", "0.52143806", "0.521429", "0.5211286", "0.52101535", "0.52074534", "0.52053344", "0.519375", "0.5191831", "0.51885056", "0.5183005" ]
0.0
-1
panelstatus=true is sidepanel is open
function openpanel() { let topcell=document.getElementById("topcell"); let new_margin="350px"; panelstatus=true; sidepanel.style.width="300px"; sidepanel.style.paddingRight="10px"; container.style.marginLeft=new_margin; para.style.marginLeft=new_margin; topcell.style.marginLeft=new_margin; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sidePanel() {\n var x = document.getElementById(\"panelOpen\");\n if (x.style.display === \"none\") {\n x.style.display = \"block\";\n } else {\n x.style.display = \"none\";\n }\n}", "get isOpen() {\n return this._panel &&\n (this._panel.state == \"open\" || this._panel.state == \"showing\");\n }", "get panelOpen() {\n return this._panelOpen;\n }", "function showSidepanel() {\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\n isSidepanelOpen = true;\n}", "togglePanel() {\n const panelIsVisible = hasClass(this.panel, IS_OPEN);\n\n if (panelIsVisible) {\n closePanel(this.panel);\n } else {\n openPanel(this.panel);\n }\n }", "toggle() {\n this.panelOpen ? this.close() : this.open();\n }", "function checkOpenPanels() {\n\tif (window.localStorage.getItem('panelLeft') === \"closed\" && window.localStorage.getItem('panelRight') === \"closed\" && window.localStorage.getItem('panelWall') === \"closed\" && window.localStorage.getItem('panelRing') === \"closed\" && window.localStorage.getItem('panelFilter') === \"closed\") {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function hideSidepanel() {\n document.getElementById(\"mySidepanel\").style.width = \"0\";\n isSidepanelOpen = false;\n}", "isOpenIn(panelMultiView) {\n return this.node.panelMultiView == panelMultiView.node;\n }", "function show_hide_panel(e){\n\t\t\t\t\tif($mainContainer.length === 0)\n\t\t\t\t\t\t$mainContainer = $(\"#mainContainer\");\n\t\t\t\t\t\n\t\t\t\t\tif($panel.is_visible()){\n\t\t\t\t\t\t$mainContainer.removeClass(\"lyrics_visible\");\n\t\t\t\t\t}else {\n\t\t\t\t\t\tif($panel.is_popped_in()) $mainContainer.addClass(\"lyrics_visible\");\n\t\t\t\t\t\tif(!cur_song.gotLyrics && cur_song.artist !== \"\"){\n\t\t\t\t\t\t\tcur_song.cur_time = $(\"#time_container_current\").text();\n\t\t\t\t\t\t\t$lyrics.get_lyrics(cur_song, true, [$panel.autoscroll, manual_search]);\n\t\t\t\t\t\t\tcur_song.gotLyrics = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$panel.show_hide_panel(e, site);\n\t\t\t\t}", "function toggle_panel(e){\n\t\t\tif($panel.is_popped_in()){\n\t\t\t\theightFix();\n\t\t\t}\n\t\t\t// If the user opens the panel and we didn't get the lyrics yet, pull it.\n\t\t\tif(!cur_song.gotLyrics && cur_song.title !== \"\"){\n\t\t\t\tcur_song.cur_time = $(\".ytp-time-display .ytp-time-current\").text();\n\t\t\t\t$lyrics.get_lyrics(cur_song, true, [$panel.autoscroll, manual_search]);\n\t\t\t\tcur_song.gotLyrics = true;\n\t\t\t}\n\t\t\t$panel.show_hide_panel(e, site);\n\t\t}", "openPanel() {\n this.overlay.openPanel();\n }", "function togglePanel() {\n if (panel.isVisible()) {\n panel.hide();\n noteIcon.removeClass('active');\n CommandManager.get('georapbox.notes.viewNotes').setChecked(false);\n localStorage.setItem(STORAGE_KEY_VISIBLE, 'false');\n } else {\n panel.show();\n noteIcon.addClass('active');\n CommandManager.get('georapbox.notes.viewNotes').setChecked(true);\n renderNotes();\n localStorage.setItem(STORAGE_KEY_VISIBLE, 'true');\n }\n }", "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "[mutation.SHOW_LEFT_PANEL] (state, id) {\n if (state.openLeftPanel !== id) {\n state.toggleLeftPanel = true\n } else {\n state.toggleLeftPanel = !state.toggleLeftPanel\n }\n\n state.openLeftPanel = id\n }", "function show_hide_panel(e){\n\t\t\t\t\tif($panel.is_visible()){\n\t\t\t\t\t\t$mainContainer.removeClass(\"lyrics_visible\");\n\t\t\t\t\t}else {\n\t\t\t\t\t\tif($panel.is_popped_in()) $mainContainer.addClass(\"lyrics_visible\");\n\t\t\t\t\t\tif(!cur_song.gotLyrics && cur_song.artist !== \"\"){\n\t\t\t\t\t\t\tcur_song.cur_time = $(\"#time_container_current\").text();\n\t\t\t\t\t\t\t$lyrics.get_lyrics(cur_song, true, [$panel.autoscroll, manual_search]);\n\t\t\t\t\t\t\tcur_song.gotLyrics = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$panel.show_hide_panel(e, site);\n\t\t\t\t}", "_showToggle() {\n return !this.panel.hideToggle && !this.panel.disabled;\n }", "isPanelVisible()\n\t{\n\t\treturn this.modalPanel.isVisible();\n\t}", "function togglePanel(panel) {\n\tif ($.mobile.pageContainer.pagecontainer(\"getActivePage\")[0].id === 'syncPage' && $(\"#startSyncButton\").is(\":disabled\")) {\n\t\tvar waitforupdate = $.t('waitforupdate');\n\t\ttoast(waitforupdate, 'short');\n\t} else {\n\t\t$(panel).panel(\"toggle\");\n\t}\n}", "function _handlerPanelVisibility() {\n $appButton.toggleClass('active');\n Resizer.toggle($appPanel);\n _command.setChecked($appButton.hasClass('active'));\n if (!$appButton.hasClass('active')) {\n EditorManager.focusEditor();\n }\n }", "function setSideBarStatus() {\n if (sideBarIsOpen == 0) {\n openSideBar();\n } else {\n closeSideBar();\n }\n}", "function _showPanelsIfRequired() {\n var panelIDs = _previouslyOpenPanelIDs;\n panelIDs.forEach(function (panelID) {\n var panel = WorkspaceManager.getPanelForID(panelID);\n if (panel) {\n panel.show();\n }\n });\n _previouslyOpenPanelIDs = [];\n }", "toggleTools() {\n if (this.panelTool.classList.contains(\"show\"))\n this.showTools(); \n else\n this.hiddenTools();\n }", "function isPanel(o) {\n return !!o && o.parentNode.id === 'spin-panels';\n}", "function _togglePanels() {\n var togglePanelCount;\n panelsToggled = !panelsToggled;\n if (panelsToggled) {\n _hidePanelsIfRequired();\n layoutUpdated = false;\n panelsToggled = true;\n } else if (!layoutUpdated) {\n _showPanelsIfRequired();\n }\n\n //log health data\n togglePanelCount = HealthLogger.getHealthDataLog(HEALTH_TOGGLE_PANELS);\n togglePanelCount = (typeof togglePanelCount === 'number') ? togglePanelCount + 1 : 0;\n HealthLogger.setHealthDataLog(HEALTH_TOGGLE_PANELS, togglePanelCount);\n }", "get visible() {\n return this._panel.visible;\n }", "isExpanded(panelId) { return this.activeIds.indexOf(panelId) > -1; }", "togglePanel(e){\n this.setState({open: !this.state.open})\n }", "function togglePanel() {\n\t$('#schedule-panel').collapse('toggle');\n\t$('#data-panel').collapse('toggle');\n}", "function openPanel(msg){\t \t \r\n var bot = $('iframe#canvas_frame', parent.document).contents().find('div.J-Zh-I.J-J5-Ji.bot'); //get the button recentily created\r\n\t\t if(bot.is('*')){\r\n\t\t\t\tbot.remove();\r\n\t\t }\r\n\t\t \r\n\t\t Panel = $('iframe#canvas_frame', parent.document).contents().find('div.aC').find('div.no');//Takes the Div where the panel will be\r\n if(Panel.is('*')){ //take a div to put the panel\r\n\t\t\r\n\t\t\t\tvar tab = $('iframe#canvas_frame', parent.document).contents().find('div.no').find('div#filterPanel');\r\n\t\t\t\tif(tab.is('*')){ //test if the panel is already present and remove it if it's truth\r\n\t\t\t\t\ttab.remove();\r\n\t\t\t\t}\r\n\t\t\t\tvar modulos;//this variable will store the modules in use for each state.\r\n\t\t\t\tswitch (state){\r\n\t\t\t\t\tcase 0: // unloged filterMenu state\r\n\t\t\t\t\t\tupdateModules();\r\n\t\t\t\t\t\tmodulos = userPswd; \r\n\t\t\t\t\t\tPanel.append(drawPanel(modulos));\r\n\t\t\t\t\t\taccess_panel_handler();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 1: // loged and waiting filterMenu state\r\n\t\t\t\t\t\tmsgLog = \"Select SuggestFilter in a Label Menu\";\r\n\t\t\t\t\t\tupdateModules();\r\n\t\t\t\t\t\tmodulos = logMsg;\r\n\t\t\t\t\t\tPanel.append(drawPanel(modulos));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 2: // loged and processing filterMenu state\r\n\t\t\t\t\t\tmsgLog = msg;\r\n\t\t\t\t\t\tupdateModules();\r\n\t\t\t\t\t\tmodulos = logMsg;\r\n\t\t\t\t\t\tPanel.append(drawPanel(modulos));\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 3: // loged and conclude filterMenu state\r\n\t\t\t\t\t\tmsgLb = msg;\r\n\t\t\t\t\t\tupdateModules();\r\n\t\t\t\t\t\tmodulos = apply;\r\n\t\t\t\t\t\tPanel.append(drawPanel(modulos));\r\n\t\t\t\t\t\tapply_panel_handler();\r\n\t\t\t\t\t\tremove_panel_handler();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 4: // login ERROR filterMenu state\r\n\t\t\t\t\t\tupdateModules();\r\n\t\t\t\t\t\tmodulos = erroPswd+userPswd;\r\n\t\t\t\t\t\tPanel.append(drawPanel(modulos));\r\n\t\t\t\t\t\taccess_panel_handler();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tcase 5: // general error filterMenu state\r\n\t\t\t\t\t\tmsgError = msg;\r\n\t\t\t\t\t\tupdateModules();\r\n\t\t\t\t\t\tmodulos = erroMsg;\r\n\t\t\t\t\t\tPanel.append(drawPanel(modulos));\r\n\t\t\t\t\t\treturn_panel_handler();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tclose_panel_handler();\r\n\r\n\t\t } else{GM_log(\"Div for the panel was not found\");} \r\n\t\t}", "function check_sidepanel_hieght()\n{\n\n var side_panel_h = document.getElementById('side_panel_id').clientHeight;\n\n\n if(side_panel_h>665)\n {\n document.getElementById('left_container_id').className=\"left_container_scrool\";\n\t document.getElementById('side_panel_id').className=\"side_panel_scroll\";\n\t document.getElementById('side_panel_table_id').className=\"side_panel_scroll_table\";\n\t document.getElementById('right_section_id').className=\"right_section_scrool\";\n\t side_p_hieght = side_panel_h;\n }\n\telse\n\t{\n\t side_p_hieght = side_panel_h;\n\t document.getElementById('left_container_id').className=\"left_container\";\n\t document.getElementById('right_section_id').className=\"right_section_new\";\n\t document.getElementById('side_panel_id').className=\"side_panel\";\n\t document.getElementById('side_panel_table_id').className=\"side_panel_table\";\n\t}\n}", "function showPanel(panel) {\n if ( $('#' + panel).length === 0 && $('#' + panel + 'Panel').length === 1) {\n $('#' + panel + 'Panel').clone().attr('id', panel).appendTo('#board');\n $('#' + panel + 'Panel').remove();\n if (panel === 'pause' || panel === 'gameOver') {\n $('#play').css('opacity', 0.3);\n }\n // Google Analytics tracking of activated panel\n offlineAnalytics.push({ name: 'view', value: '/' + panel + '/' });\n }\n }", "function OpenPanelEdit(panelId)\r\n{\t\t\t\t\r\n\tif($(panelId).style.display==\"none\")\r\n\t{\r\n\t\t$(panelId).style.display=\"\";\r\n\t}\r\n\telse\r\n\t{\t\t\t\t\t\r\n\t\t$(panelId).style.display=\"none\";\r\n\t}\t\t\t\t\r\n}", "function panelMaintenance(){\n\tif(panelView != 'maintenance'){\n\t\tpanelShow(40, 'maintenance');\n\t\t$('panelFrame').src = myPath+'ressource/lib/media.maintenance.php';\n\t}else{\n\t\tpanelHide();\n\t}\n}", "function togglePanel(which) {\n let panelToggled = document.getElementById(`${which}-panel`)\n\n if (panelToggled.style.display === 'block') {\n panelToggled.style.display = 'none'\n } else {\n panelToggled.style.display = 'block'\n\n if (!isSettingsInitialized && which === panel.SETTINGS) {\n initializeSettings()\n }\n }\n}", "function togglePanels(){\n $('#addLPanel').toggle();\n $('#updateLPanel').toggle();\n}", "function openPanel() {\n \n // Start Override: set the flag to false and hide the image panel\n imagePanelInline = false;\n hidePanel('imageViewer');\n // End Override: set the flag to false and hide the image panel\n \n var mssArea = document.getElementById(\"mssArea\");\n var manuscriptsDiv = document.getElementById(\"manuscripts\");\n var panelButton = document.getElementById(\"newPanel\");\n var mssPanels = getElementsByClass(\"mssPanel\",manuscriptsDiv,\"div\");\n var totalPanels = mssPanels.length;\n\n if (totalPanels + 1 >= maxPanels) {\n panelButton.disabled = true;\n }\n if (totalPanels >= maxPanels) {\n alert(\"Sorry, but the number of visible versions may not exceed the total number of available witnesses.\");\n } else {\n var witnessIndex = getElementsByClass(\"witnessMenu\",mssPanels[totalPanels - 1],\"select\")[0].selectedIndex;\n var newPanel = mssPanels[totalPanels - 1].cloneNode(true);\n var newMenu = getElementsByClass(\"witnessMenu\",newPanel,\"select\")[0];\n var newWitnessIndex = witnessIndex + 1;\n if (newWitnessIndex >= newMenu.length) newWitnessIndex = witnessIndex;\n newMenu.selectedIndex = newWitnessIndex;\n manuscriptsDiv.appendChild(newPanel);\n resizePanels();\n changeWitness(newMenu.value,newPanel);\n }\n}", "function toggle_off()\n{\n\n\tdocument.getElementById('toggle').className='togle_btn_new';\n\tdocument.getElementById('toggle_up').className='togle_btn_up_new';\n\tvar h1 = document.getElementById('side_panel_id').clientHeight;\n\tdocument.getElementById('panel_td').style.height=h1+'px';\n\n\tif(side_p_hieght<665){\n document.getElementById('left_container_id').className=\"left_container\";\n\tdocument.getElementById('right_section_id').className='right_section_new';\n\tdocument.getElementById('side_panel_id').className='side_panel';\n\t}\n\telse\n\t{\n\n\t document.getElementById('right_section_id').className='right_section_scrool';\n\t document.getElementById('side_panel_id').className=\"side_panel_scroll\";\n\t document.getElementById('left_container_id').className=\"left_container_scrool\";\n\t}\n\n\tshow('side_panel_id');\n\tshow('tg');\n\thide('tg_1');\n\thide('search_top');\n\tdocument.getElementById('action_panel_main_id').className='action_panel_main';\n\t//document.getElementById('left_container_id').className='left_container';\n\t//document.getElementById('right_section_id').className='right_section_new';\n\tdocument.getElementById('right_container_id').className='right_container';\n\n\n}", "function openNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\r\n document.getElementById(\"mySidepanel\").style.height = \"1000px\";\r\n \r\n }", "function settingClick(){\n if(gwhSettingStatus == 0){\n $('.panel').css(\"display\", \"none\");\n gwhSettingStatus =1;\n document.getElementById(\"setting-button-text\").innerHTML = \"Open Setting Panel\";\n }else if(gwhSettingStatus == 1){\n $('.panel').css(\"display\", \"block\");\n gwhSettingStatus =0;\n document.getElementById(\"setting-button-text\").innerHTML = \"Close Setting Panel\";\n\n }\n\n}", "function toggle(){\n vm.show = !vm.show;\n var button = angular.element('.pane-toggle-button');\n if(!vm.show)\n {\n angular.element('.pane-toggle-button-container').css('left','0px');\n\n button.css('transform','scaleX(-1)');\n button.attr('data-original-title','expand side pane');\n\n }\n else\n {\n angular.element('.pane-toggle-button-container').css('left','100%');\n button.css('transform','scaleX(1)');\n button.attr('data-original-title','collapse side pane');\n\n }\n }", "function togglePanel() {\n renewElement($(\".anim-wrap\"));\n var $animated = $(\".anim-wrap\");\n var shown = $animated.hasClass('on');\n $animated.toggleClass('on', !shown).toggleClass('off', shown);\n }", "function searchPanelOpen(state) {\n var _a;\n return ((_a = state.field(searchState, false)) === null || _a === void 0 ? void 0 : _a.panel) != null;\n}", "function toggle_on()\n{\n\n document.getElementById('toggle').className='togle_btn';\n\tdocument.getElementById('toggle_up').className='togle_btn_up';\n\n\tvar h = document.getElementById('side_panel_id').clientHeight;\n\tdocument.getElementById('panel_td').style.height=h+'px';\n\n\thide('side_panel_id');\n\thide('tg');\n\tshow('tg_1');\n\tshow('search_top');\n\tdocument.getElementById('action_panel_main_id').className='action_panel_main_new';\n\tdocument.getElementById('left_container_id').className='left_container_new';\n\tdocument.getElementById('right_section_id').className='right_section';\n\tdocument.getElementById('right_container_id').className='right_container_new';\n\t//load('toggle');\n\tif(getWindowWidth()>650)\n\tmapInst.checkResize(); // for manage map accroding to the new width and hieght\n}", "function showControlPanel () {\n\n controlPanel.style.display = 'block';\n\n }", "function findOpenPanel(openClass) {\n var $alertsPanel = $('#alerts-sidebar-panel');\n var $messengerPanel = $('#messenger-sidebar-panel');\n\n if ($alertsPanel.hasClass(openClass)) {\n return $alertsPanel;\n }\n else if ($messengerPanel.hasClass(openClass)) {\n return $messengerPanel;\n }\n else {\n return false;\n }\n }", "function openNav() {\n document.getElementById('mySidepanel').style.width = '250px';\n}", "function openNav() {\r\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\r\n}", "function propToggle(e) {\n e.preventDefault();\n panel.document.getElementById('props_handler').classList.toggle('active-sidebar');\n var element = panel.document.querySelector('.props-list').classList.toggle('opened');\n console.log(element)\n }", "function showSideMenu() {\n if (sideMenuToggle == 0) {\n $(\"#mainpane\").animate({\n left: \"300\"\n }, 500);\n sideMenuToggle = 1;\n }\n else {$(\"#mainpane\").animate({\n left: \"0\"\n }, 500);\n sideMenuToggle = 0;\n }\n}", "function show() {\n if (!visible && body !== undefined) {\n body.insertBefore(overlay, body.firstChild);\n body.style.overflow = \"hidden\";\n panel.style.display = \"block\";\n setTimeout(function () {\n panel.classList.add(SHOW_CLASS);\n }, 10);\n visible = true;\n self.port.emit(\"panel-visible\");\n }\n}", "function openPanel(containerNameEl) {\r\n containerNameEl.classList.add('active');\r\n}", "firstState() {\n\n\t\t$(\"#btn_panel\").on(\"click\", () => {\n\t\t\tif ($(\"#panel_info\").css(\"display\") === \"block\") {\n\t\t\t\t$(\"#panel_info\").hide(500);\n\t\t\t\t$(\"#panel_canvas\").show(500, () => {\n\t\t\t\t\tthis.canvas.size();\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t}", "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"300px\";\n}", "open() {\n if (this.onOpen !== undefined) {\n this.onOpen();\n }\n // Configure options.\n for (const displayedOption of this.displayedOptions) {\n displayedOption.input.checked = displayedOption.block.isChecked(displayedOption.option.value, this.trs80.getConfig());\n }\n this.updateEnabledOptions();\n this.panelNode.classList.add(gShownCssClass);\n }", "_isExpanded() {\n return this.panel.expanded;\n }", "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\n}", "function sidebarPanelOpen($sidebarPanel) {\n var sidebarPanelWidth = $sidebarPanel.outerWidth();\n var $firstOpenPanel = findOpenPanel('open');\n\n if ($firstOpenPanel) {\n $firstOpenPanel.addClass('open-first');\n\n // If open sidebar panel exists move it to the left of current opened panel\n sidebarPanelAnimate($firstOpenPanel, sidebarPanelWidth);\n }\n\n $sidebarPanel.addClass('open');\n\n // Open current sidebar panel\n sidebarPanelAnimate($sidebarPanel, 0);\n }", "onClickedSidePanelBtn() {\n console.log(\"Clicked Side Panel Button!!!\")\n Base._iSDK.Global.addSidebarContentPanel({\n el: createDOM(\"<div>asdfasdfasdfa</div>\"),\n title: \"sdfasdfasd\",\n iconUrl: SIDE_PANEL_BTN_IC\n })\n }", "function ac_showConfigPanel() {\n\tac_switchTool(\"cfg\");\n}", "function togglePanelVisibility(id) {\n if (Element.visible(id)) {\n Element.hide(id);\n $(id + \"-img\").src = \"/images/arrow-closed.png\";\n } else {\n Element.show(id);\n $(id + \"-img\").src = \"/images/arrow-open.png\";\n }\n if (typeof _IG_AdjustIFrameHeight != \"undefined\")\n _IG_AdjustIFrameHeight();\n}", "function sidePanel() {\n strokeWeight(0);\n textSize(36);\n textStyle(BOLD);\n textAlign(CENTER);\n textFont(\"Cambria\");\n\n //This makes the side pannel\n fill(0, 45, 72);\n rect(width - 400, 0, width, height);\n\n //This is for the dividers on the side pannel\n fill(0, 140, 174);\n rect(width - 400, 445, width, 8);\n rect(width - 400, 545, width, 8);\n rect(width - 400, 715, width, 8);\n\n //This is just used to label the pen color and pan size sliders\n fill(200, 241, 247);\n text(\"Pen Color\", width - 200, 40);\n text(\"Pen Size\", width - 200, 490);\n}", "function toggleOpen(e) {\n //This will close all open panels before the new one is opened\n const open = document.querySelector('.open');\n if (open) {\n open.classList.remove('open');\n }\n e.target.classList.toggle('open');\n}", "showPanel()\n\t{\n\t\tthis.modalPanel.show();\n\t}", "function openNav() {\n document.getElementById(\"mySidepanel\").style.width = \"250px\";\n}", "function togglePanels(){\n $('#btnAddEvent').toggle();\n $('#updateEventPanel').toggle();\n }", "function openNav() {\n\t//document.getElementById(\"ControlPanel\").style.display = \"block\";//show control pannel\n\tShowOf(ControlPanel, true);\n\t//document.getElementById(\"buttonOpenControlPanel\").style.display = \"none\";//hide open control pannle button\n\tShowOf(buttonOpenControlPanel, false);\n}", "function checkStatus() {\n var stateSidebar = localStorage.getItem('stateSidebar');\n if (stateSidebar || $('html').hasClass('ls-sidebar-toggled')){\n minimizeSidebar();\n } else {\n maximizeSidebar();\n }\n }", "function update_wallpaper_option_panels_visibility()\n {\n const value = DOM.is_enabled.checked ? \"block\" : \"none\";\n DOM.panels.forEach(panel => { panel.style.display = value; });\n }", "get panel() {\n return this._panel;\n }", "function OpenExportPanel() {\n if (dojo.byId(\"ExportPanel\").style.display == \"none\") {\n dojo.byId(\"ExportPanel\").style.display = \"block\";\n }\n\n else {\n dojo.byId(\"ExportPanel\").style.display = \"none\";\n }\n }", "function ShowCommunityButton() {\n\tvar community_panel = $.GetContextPanel().FindChildTraverse(\"CommunityPanel\");\n\t\n\tcommunity_panel.ToggleClass('invisible')\n}", "function isFightPopOpen() {\r\n if (document.getElementById(\"fv2_widget_wrapper\")) {\r\n if (document.getElementById(\"fv2_widget_wrapper\").style.display != \"none\") {\r\n return true\r\n } else {\r\n return false\r\n }\r\n } else {\r\n return false\r\n }\r\n }", "toggle(panelId) {\n const panel = this._findPanelById(panelId);\n if (panel) {\n this._changeOpenState(panel, !panel.isOpen);\n }\n }", "toggle() {\n return (\n this.modalPanel.isVisible() ?\n this.quit() :\n this.warn()\n );\n }", "function cardboardTogglePanel(toggle) {\n if(panel.isVisible() || toggle) {\n panel.hide();\n $icon.removeClass(\"active\");\n CommandManager.get(COMMAND_ID).setChecked(false);\n }\n else {\n panel.show();\n $icon.addClass(\"active\");\n $(\".brackets-cardboard-search input\").focus();\n CommandManager.get(COMMAND_ID).setChecked(true);\n }\n }", "function ToggleBuildPanel()\n{\n\tif(buildPanelOpen) //is the build panel already open? if so, do this...\n\t{\n\t\t//hide all build tiles\n\t\tfor(var thePlane : Transform in placementPlanesRoot)\n\t\t{\n\t\t\tthePlane.gameObject.renderer.enabled = false;\n\t\t}\n\t\t\n\t\t//fly out the build panel\n\t\tbuildPanelTweener.Play(false);\n\t\t//rotate the build panel arrow\n\t\tbuildPanelArrowTweener.Play(false);\n\t\t//mark the panel as \"closed\"\n\t\tbuildPanelOpen = false;\n\t}\n\telse //...the build panel was closed, so instead do this...\n\t{\n\t\t//show all build tiles\n\t\tfor(var thePlane : Transform in placementPlanesRoot)\n\t\t{\n\t\t\tthePlane.gameObject.renderer.enabled = true;\n\t\t}\n\t\t\n\t\t//fly in the build panel\n\t\tbuildPanelTweener.Play(true);\n\t\t//rotate the build panel arrow\n\t\tbuildPanelArrowTweener.Play(true);\n\t\t//mark the panel as \"open\"\n\t\tbuildPanelOpen = true;\n\t}\t\n}", "togglePlayerPane(side) {\n logAppStateChange.debug('app-state-store.togglePlayerPane', side);\n\n const className = `appstate--pane--player--${side}--open`;\n\n const possiblePanes = [\n 'appstate--pane--player--left--open',\n 'appstate--pane--player--right--open',\n ];\n\n // if already open, then just close that one\n if (this.classes.indexOf(className) > -1) {\n log.debug('Already open, closing', className);\n this.removeClass(className);\n\n // otherwise close all of the panes and then open that one\n } else {\n log.debug('Opening', className);\n forEach(possiblePanes, (pane) => {\n this.removeClass(pane);\n });\n\n this.addClass(className);\n }\n }", "async _showMainView() {\n let nextPanelView = PanelView.forNode(\n this.document.getElementById(this.node.getAttribute(\"mainViewId\"))\n );\n\n // If the view is already open in another panel, close the panel first.\n let oldPanelMultiViewNode = nextPanelView.node.panelMultiView;\n if (oldPanelMultiViewNode) {\n PanelMultiView.forNode(oldPanelMultiViewNode).hidePopup();\n // Wait for a layout flush after hiding the popup, otherwise the view may\n // not be displayed correctly for some time after the new panel is opened.\n // This is filed as bug 1441015.\n await this.window.promiseDocumentFlushed(() => {});\n }\n\n if (!(await this._openView(nextPanelView))) {\n return false;\n }\n\n // The main view of a panel can be a subview in another one. Make sure to\n // reset all the properties that may be set on a subview.\n nextPanelView.mainview = true;\n nextPanelView.headerText = \"\";\n nextPanelView.minMaxWidth = 0;\n\n // Ensure the view will be visible once the panel is opened.\n nextPanelView.visible = true;\n nextPanelView.descriptionHeightWorkaround();\n\n return true;\n }", "function activateSidebarComponent() {\n if (isMobile()) {\n var content = $('#content');\n\n if (!content.hasClass('slideout-panel')) {\n return; //if slideout is not enabled then do nothing\n }\n\n if ($('div.ui-sidebar-active').length > 0) {\n content.css('will-change', 'unset');\n content.css('position', 'unset');\n } else {\n content.css('will-change', 'transform');\n content.css('position', 'relative');\n }\n }\n}", "function show_additional_panel(tool){\n var new_panel = '';\n switch(tool){\n case 'polyline':\n case 'line':\n case 'path':\n case 'multipath':\n new_panel = 'open_shape_style';\n break;\n case 'polygon':\n case 'rect':\n case 'circle':\n new_panel = 'closed_shape_style';\n break;\n case 'image':\n new_panel = 'image_style';\n break;\n }\n if(g['additional_panel'] != new_panel){\n if(g['additional_panel'] != '')\n // Hide old panel\n getById(g['additional_panel']).className = 'hidden';\n if(new_panel != ''){\n var panel = getById(new_panel);\n // Show the new panel\n panel.className = 'new_panel';\n }\n // Save changes\n g['additional_panel'] = new_panel;\n }\n}", "function openSide() {\n sideMenu.style.height = \"100vh\";\n sideMenu.style.width = \"75%\";\n sideLinks.style.display = \"flex\";\n application.style.display = \"flex\";\n toggler.style.display = \"none\";\n overlayed.style.display = \"block\";\n}", "function PanelHelper() {\n\t}", "function openCaseList() {\n displayElement('leftPanel');\n}", "doOpenPanel(panelId) {\n const params = this.service.currentParams;\n\n let triggerElement = params.triggered;\n\n if (typeof triggerElement === 'string') {\n triggerElement = $(triggerElement);\n }\n\n // will apply css class to triggering element if provide.\n if (triggerElement.length > 0) {\n this.setTriggerElement(panelId, triggerElement, params);\n }\n\n this.getPropertyValue(panelId, '$panel').addClass(this.getPropertyValue(panelId, 'visible'));\n this.service.currentVisibleId = panelId;\n if (this.getPropertyValue(panelId, 'hasClickAway')) {\n this.addClickAwayEvent(panelId);\n }\n if (this.getPropertyValue(panelId, 'hasEscAway')) {\n this.addEscAwayEvent(panelId);\n }\n }", "@radio('sidebar', 'show')\n show() {\n if (this.user.isConnected()) {\n this.showMenu();\n }else {\n this.showLoginForm();\n }\n }", "function setSlidingPanel(container, map, offlineMode)\n{\n\tvar control = this;\n control.isOpen = false;\n\t\n\tvar createPanel = document.createElement('div');\n\tcreatePanel.id = 'listingsPane';\n\tcreatePanel.style.width = '50px';\n\tcreatePanel.style.height = '100px';\n\t\n\tcontainer.appendChild(createPanel);\n\t\n\tvar toggleBtnOne = document.createElement('div');\n toggleBtnOne.id = 'openrentals';\n\n\tvar toggleBtnTwo = document.createElement('div');\n\ttoggleBtnTwo.id = 'openfavourites'; \n\n createPanel.appendChild(toggleBtnOne);\n createPanel.appendChild(toggleBtnTwo);\n\t\n\t$(\"#listContent\").show().animate({display :'inline'}, 500);\n\t\n\t/* (function($){\n $(window).load(function(){\n $(\"#content\").mCustomScrollbar();\n\t //$(\".mCSB_dragger_bar\").css('height','50px');\n\t \n $(\"div[rel='with-custom-scrollbar']\").mCustomScrollbar({\n autoDraggerLength:false,\n\t\tset_height:\"45px\",\n\t\t});\n\t\t});\n\t})(jQuery);*/\n\n\t$(\"#listContent\").appendTo(createPanel);\n\t\t\t\t\t\n\t$(document).on(\"click\", \"#openrentals\", function(){ \n\tif (control.isOpen) {\n\t\t$(\"#listingsPane\").animate({\n\t\t\t\"marginLeft\": \"0px\", \"height\" : \"100px\", \"width\" : \"50px\"},\n\t\t\t{\t\t\t\n\t\t\t\tduration: 500,\n\t\t\t\tstep: function() {\n\t\t\t\tgoogle.maps.event.trigger(map, 'resize');\n\t\t\t\t\t$('#slider').css('width', '50px');\n\t\t\t\t\t$('#listContent').css('display','none');\n\t\t\t\t\t$('#openfavourites').css('visibililty', 'hidden');\n\t\t\t\t\t$(\"#controls\").css('display','none');\n\t\t\t\t\t//$(\"#listingsPane\").mCustomScrollbar(\"update\");\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\tcontrol.isOpen = false;\n\t\t\t} else {\n\t\t\t\t$(\"#listingsPane\").animate({\n\t\t\t\t\t\"marginLeft\": \"0px\", \"height\" : \"900px\", \"width\" : \"100%\"}, \n\t\t\t\t{\n\t\t\t\t\tduration: 500,\n\t\t\t\t\tstep: function() {\n\t\t\t\t\t\tgoogle.maps.event.trigger(map, 'resize');\n\t\t\t\t\t\t$('#listContent').css('display','inline');\n\t\t\t\t\t\t$('#openfavourites').css('visibililty', 'visible');\n\t\t\t\t\t\t$('#openfavourites').css('margin-top', '50px');\n\t\t\t\t\t\t$('#openfavourites').css('margin-right', '-50px');\n\t\t\t\t\t\t$('#slider').css('width', '100%');\n\t\t\t\t\t\t$(\"#controls\").css('display','inline');\n\t\t\t\t\t\t//$(\"#listingsPane\").mCustomScrollbar(\"update\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\tcontrol.isOpen = true;\n\t\t\t\t};\t\n\t\t});\n}", "function ybSideNavVisibility(status) {\n const navSidebar = document.querySelector('aside.td-sidebar');\n\n let preWidth = 300;\n if (status === 'hide') {\n let leftMenuWidth = navSidebar.style.width;\n if (leftMenuWidth < 300) {\n leftMenuWidth = 300;\n } else if (leftMenuWidth > 500) {\n leftMenuWidth = 300;\n }\n\n navSidebar.setAttribute('data-pwidth', leftMenuWidth);\n jQuery('.left-sidebar-wrap-inner').animate({\n opacity: '0',\n });\n jQuery('aside.td-sidebar').animate({\n minWidth: '0px',\n width: '60px',\n maxWidth: '60px',\n });\n } else {\n if (ybGetCookie('leftMenuWidth')) {\n preWidth = ybGetCookie('leftMenuWidth');\n }\n\n if (navSidebar.getAttribute('data-pwidth')) {\n preWidth = navSidebar.getAttribute('data-pwidth');\n }\n\n if (preWidth < 300) {\n preWidth = 300;\n } else if (preWidth > 500) {\n preWidth = 300;\n }\n\n jQuery('.left-sidebar-wrap-inner').animate({\n opacity: '1',\n });\n\n jQuery('aside.td-sidebar').animate({\n width: preWidth,\n maxWidth: preWidth,\n });\n }\n }", "ngAfterContentChecked() {\n let activePanel = this._getPanelById(this.activeId);\n this.activeId = activePanel ? activePanel.id : ( this.tabpanels.length ? this.tabpanels.first.id : null);\n activePanel = this._getPanelById(this.activeId);\n activePanel.active = true;\n }", "clicked(panel) {\n\t}", "function panelPref(){\n\tif(panelView != 'pref'){\n\t\tpanelShow(80, 'pref');\n\t\t$('panelFrame').src = myPath+'ressource/lib/media.pref.php';\n\t}else{\n\t\tpanelHide();\n\t}\n}", "function toggleSideMenu(option) {\n\t$(option).show();\n\t$(\".panel\").not(option).hide();\n}", "function w3_open() {\n document.getElementById('portSidebar').style.display = 'block';\n}", "function showPanel(panel){\n\n var expandedPanel = accordionElem.querySelector(\".active\");\n if (expandedPanel){\n expandedPanel.classList.remove(\"active\");\n }\n\n panel.classList.add(\"active\");\n\n }", "constructor(props) {\n super(props);\n this.state = {\n allPanelsOpen: false\n };\n }", "function togglePanel4Content(condition) {\n if(condition) {\n $('#panel-4-content').removeClass('d-none');\n $('.panel-4 .panel4-content').addClass('plain-background');\n $('#content-inner').addClass('d-none');\n }else{\n $('#panel-4-content').addClass('d-none');\n $('.panel-4 .panel4-content').removeClass('plain-background');\n $('#content-inner').removeClass('d-none');\n }\n}", "function expandPanel() {\n phone.mode = DisplayMode.Docked;\n $(\".expanded\").show();\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function sidemenuToggle() {\n if(isSideMenuOpen) {\n sidemenuClose();\n } else {\n sidemenuOpen();\n }\n}", "function togglePiecesList() {\n $mdSidenav('left').toggle();\n }" ]
[ "0.7835428", "0.7289974", "0.7199308", "0.7139997", "0.7120259", "0.69672173", "0.66165495", "0.6614521", "0.65449375", "0.6543017", "0.65412164", "0.6526333", "0.6411253", "0.6396312", "0.6361279", "0.63382506", "0.6336879", "0.6313034", "0.63080853", "0.62811947", "0.62693155", "0.62675905", "0.62442017", "0.6211279", "0.6199301", "0.6196343", "0.6191008", "0.60965216", "0.6094298", "0.6060987", "0.6025214", "0.60138047", "0.6003525", "0.5997318", "0.59934855", "0.598428", "0.59805775", "0.59747416", "0.5968041", "0.5966836", "0.59510165", "0.59498113", "0.5944344", "0.5943454", "0.59387803", "0.5934192", "0.5930725", "0.5927173", "0.5914827", "0.59143955", "0.5913833", "0.59115845", "0.58998495", "0.58904237", "0.5888454", "0.58781475", "0.58765256", "0.5874652", "0.58741975", "0.5857573", "0.5855923", "0.58447015", "0.58305675", "0.58281606", "0.5824033", "0.58207047", "0.58181775", "0.5810166", "0.58019996", "0.5801447", "0.5796637", "0.5795737", "0.5792849", "0.57813495", "0.57759035", "0.57668036", "0.5764351", "0.57572234", "0.5754955", "0.5745642", "0.57348585", "0.5722616", "0.57163763", "0.57048696", "0.56961024", "0.5695649", "0.5693351", "0.56926733", "0.56821555", "0.56802666", "0.56784534", "0.56718796", "0.5669595", "0.56632346", "0.5660573", "0.56571764", "0.564867", "0.5647225", "0.5647225", "0.5637193" ]
0.60071975
32
This method will be invoked when the user enters the user's height
height(e) { this.setState({ height: e.nativeEvent.text }, function () { this.bmi(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeight(v) {\n self = v;\n self.prompt({\n type: 'input',\n name: 'height',\n default: false,\n message: 'Max height? ',\n },\n function(result){\n if (result.height)\n height = result.height;\n doResize(self);\n });\n}", "function validate_height() {\n\tvar height_input = $('#height');\n\tvar height_val = parseInt(height_input.val());\n\tif(isNaN(height_val)) {\n\t\theight_val = 0;\n\t}\n\n\tif(height_val < height_input.data('min') || height_val > height_input.data('max')) {\n\t\tshow_input_error('height', true);\n var oConfig = $('div.configoption');\n oConfig.html('<div class=\"config-waiting\"><p>Enter your sizes to view further options</p></div>');\n reset_selected_options();\n\t\treturn false;\n\t} else {\n\t\tshow_input_error('height', false);\n\t\treturn true;\n\t}\n}", "set height(value) {\n if (value === this.heightIn) {\n return;\n }\n this.heightIn = value;\n this.notifyPropertyChanged('height');\n }", "set height(value) {}", "heightChanged(e) {\n this.setState({height: parseInt(e.target.value)});\n }", "function validateHeight(height) {\n var labelHeight = document.getElementById(\"informationLabelHeight\");\n\n if(measurementUnit === \"imperial\") {\n height = height * 2.54;\n }\n\n if(validateUserInput(height, 54.6, 251)) {\n labelHeight.classList.remove(\"statusAlert\");\n labelHeight.classList.add(\"statusSuccess\");\n labelHeight.innerHTML = \"<i class=\\\"iconSuccess\\\"></i> You have entered a valid height\";\n\n return true;\n }\n\n else {\n labelHeight.classList.remove(\"statusSuccess\");\n labelHeight.classList.add(\"statusAlert\");\n\n if(measurementUnit === \"metric\") {\n labelHeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your height must be between 54.6 and 251 cm\";\n }\n\n else {\n labelHeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your height must be between 21.5 and 99.2 in\";\n }\n\n return false;\n }\n}", "function getHeight() {\n var height = Number(document.getElementById(\"theheight\").value);\n return height;\n\n}", "handleHeightChange(e) {\n // console.log(e.target.value);\n this.setState({ 'height': e.target.value });\n \n }", "setHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Height\")),t!==this.__height&&(this.__height=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Height\"}),this.__processHeight())}", "setHeight(){\n var newHeight = prompt(\"Enter a new bitmap height: \", 8);\n if(newHeight != null){\n newHeight = parseInt(newHeight);\n if(newHeight != NaN){\n if(newHeight >= 1 && newHeight <= 40){\n this.ROW_COUNT = newHeight;\n this.updatePanelTitle();\n this.renderGrid();\n this.saveLocally();\n this.applyGridSize();\n return true;\n }else{\n alert(\"That height is too large (min: 1, max: 40)\")\n return false;\n }\n }\n }\n return false;\n }", "function setCameraHeightValue()\r\n{\r\n // Step 3: Set camera height\r\n \r\n // Prompt user for estimated height of camera\r\n var heightEstimate = prompt(\"Please input estimated height of phone to ground in metres\");\r\n \r\n // Check for invalid inputs such as\r\n // 1. No input at all\r\n // 2. Input less than zero (negative) or input greater than 3\r\n // 3. Input is not a number (NaN)\r\n // 4. Input is alphanumeric or alphabets\r\n \r\n if (heightEstimate == null)\r\n {\r\n // if user press cancel when set cam height\r\n // do nothing\r\n }\r\n else if(heightEstimate === \"\" || heightEstimate <= 0 || heightEstimate >= 3 || isNaN(heightEstimate) === true) \r\n {\r\n // alert user of invalid input\r\n alert(\"please input legit value\");\r\n }\r\n else\r\n {\r\n //store height estimate value to camera height value\r\n camHeight = heightEstimate;\r\n \r\n // Display estimated height of camera\r\n cameraVideoPage.displayMessage(\"Estimated height of camera is: \" + camHeight + \" metres\", 2000);\r\n \r\n // Check if camera height is updated after estimated distance is already calculated at least once\r\n checkValues();\r\n } \r\n \r\n}", "function _onValueChanged(event) {\n this._heightInvalidated = true;\n }", "setHeight(height) {\n this.height = height;\n }", "handleHeightChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ height: processedData })\n this.bmi(processedData, this.state.weight);\n }", "setHeightIfBigger(height) {\n if (height > this.height) this.height = height;\n }", "function displayHeight() {\n\n // set the content of desired element --------------- to the value of the height selector\n document.getElementById(\"height_display\").innerHTML = parseInt(document.getElementById(\"height\").value);\n}", "set minHeight(value) {}", "function DDLightbarMenu_SetHeight(pHeight)\n{\n\tif (typeof(pHeight) == \"number\")\n\t{\n\t\tif ((pHeight > 0) && (pHeight <= console.screen_rows))\n\t\t\tthis.size.height = pHeight;\n\t}\n}", "function heightChange(event,slider){\n $slider.css('height',slider.value + 'px');\n $('#higVal').text(slider.value + 'px');\n }", "function getHeight(){\n\tvar usersHeight = screen.height;\n\tvar uHeight = usersHeight - 300;\n\t\t\tdocument.getElementById('container').style.minHeight=uHeight+10+\"px\";\n}", "function displayHeight () {\n const sealevel = document.getElementById(\"sea-level\");\n sealevel.innerHTML = Math.floor(diveHeight);\n\n const conv = document.getElementById(\"conversion-rate\");\n conv.innerHTML = convRate;\n }", "function myheight(e){\r\n if(inputh.value<0 || inputh.value.length>4){\r\n alert(\"you have entered wrong value or enter two decimal point or enter all the fields\");\r\n inputh.value=\"\";\r\n }\r\n else if(exp.test(inputh.value) && event.key==\"Enter\"){\r\n inputHeight=inputh.value;\r\n BMI=inputWeight / (inputHeight ** 2);\r\n let heading=document.querySelector('.heading');\r\n const todayBmi = BMI.toFixed(2);\r\n heading.innerHTML=todayBmi;\r\n valueBmi.push(todayBmi);\r\n valueWeight.push(inputWeight);\r\n function ishealthy(){\r\n if(todayBmi>=30){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Obese : (\";\r\n }\r\n else if(todayBmi>25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Overweight : (\";\r\n }\r\n else if(todayBmi<19){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Underweight : (\";\r\n }\r\n else if(todayBmi>=19 || valueBmi<=25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Normal weight : )\";\r\n }\r\n }\r\n ishealthy();\r\n \r\n \r\n //local storage save function\r\n saveFunc= () =>{\r\n localStorage.setItem('valueOfWeight',JSON.stringify(valueWeight));\r\n localStorage.setItem('values',JSON.stringify(valueBmi));\r\n }\r\n }\r\n }", "_updateHeight () {\n const height = document.body.scrollHeight\n if (height === this._lastHeight) {\n return\n }\n \n this._lastHeight = height\n this._sendMessage('height', { height: height })\n }", "function setHeight(height)\n {\n _height = height;\n }", "function setBookshelfHeightUI(){\n\tvar hDiv = document.getElementById(\"heightOut\");\n\tvar inches = bookshelf.height/25.4;\n\thDiv.value = parseFloat(inches).toFixed(1);\n}", "set setHeight (height) {\n this.height = height;\n }", "changeHeight() {\n\n // Get a random height and store in variable\n this.height = Math.floor(Math.random() * 200);\n\n // Check if height is less then 30\n if(this.height < 30) {\n // Set the height to 30\n this.height = 30;\n }\n\n // Set the y value of the pipe\n this.y = board.height - this.height;\n\n // Store the y-value in variable\n y_value = this.y;\n\n }", "determineHeight()\n {\n // figure the min and max\n let min = Math.max(this.icePoint.height - this.searchRange, -this.totalRange),\n max = Math.min(this.icePoint.height + this.searchRange, this.totalRange);\n // pick a random int between those\n this.height = helper.getRandomIntegerBetween(min, max);\n // Make sure it's not the same as the icePoint\n if(this.height === this.icePoint.height)\n {\n if(this.height === this.totalRange)\n {\n // all we can do is shift it down\n this.height --;\n }\n else if (this.height === -this.totalRange)\n {\n // all we can do is shift it up\n this.height++;\n }\n else\n {\n // we can shift it either way\n let shift = helper.getRandomIntegerBetween(0, 1);\n this.height += shift?1:-1;\n }\n }\n }", "function acceptHeight(){\n clearTimerCheck();\n var tl = gsap.timeline();\n\n tl.to(\"#heightCheck\", {\n duration: 1,\n y: 300,\n opacity: 0\n })\n tl.set(\"#heightCheck\", {display: 'none'})\n tl.from(\"#difficultybox\", {\n display: 'block',\n duration: 1,\n y: 400,\n opacity: 0\n\n })\n tl.call(setTiplist)\n tl.set(\"#difficultybox\", {display: 'block'});\n\n return tl;\n}", "get height() {\n return this.heightIn;\n }", "get height() {\n return this.heightIn;\n }", "get heightChanged() {\n return (this.flags & 2 /* Height */) > 0;\n }", "set height(height) {\n // this._height = height;\n }", "set height(height) {\n // this._height = height;\n }", "function heightslider(val) {\n //show the selected height on the slider\n document.getElementById(\"showheight\").innerHTML = val;\n //retrieve the height and symbol\n bricksymbol = brickElem.value;\n heightStr = heightElem.value;\n height = parseInt(heightStr);\n //draw pyramid with these parameters\n drawPyramid(height,bricksymbol);\n}", "height() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "setHeight(height) {\n const realFeet = ((height * 3.93700) / 12);\n const feet = Math.floor(realFeet);\n const inches = Math.round((realFeet - feet) * 12);\n this.height = `${feet}' ${(`0${inches}`).substr(-2)}''`;\n }", "onChangeTotalHeight() {\n if (this.client.isEngineReady) {\n // redraw all dependencies if the height changes. Could be caused by resource add/remove.\n // in reality not all deps needs to be redrawn, those fully above the row which changed height could be left\n // as is, but determining that would likely require more processing than redrawing\n this.scheduleDraw(true);\n }\n }", "get height() {}", "set height(height) {\n this.instance.setHeight(height);\n }", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "getHeight() {\n console.log(this.height);\n }", "onChangeTotalHeight() {\n // redraw all dependencies if the height changes. Could be caused by resource add/remove.\n // in reality not all deps needs to be redrawn, those fully above the row which changed height could be left\n // as is, but determining that would likely require more processing than redrawing\n this.scheduleDraw(true);\n }", "get height() { return this._height; }", "function handleSize() {\n const height = document.getElementById('image').clientHeight\n console.log(height)\n setHeight(-height)\n }", "function rangeChange() {\n heightElem = document.getElementById(\"height\").value;\n drawPyramid(heightElem);\n}", "set heightType(value) {\n if (value === this.heightTypeIn) {\n return;\n }\n this.heightTypeIn = value;\n this.notifyPropertyChanged('heightType');\n }", "function heightDetect() {\n\t\t$(\".main_head\").css(\"height\", $(window).height());\n\t}", "trackHeight(height) {\n if ( this.maxUserHeight && height != this.prevUserHeight ) {\n var delta = height-this.prevUserHeight;\n //this.trackDelay = 1000/this.fps;\n //var speed = delta/this.trackDelay*1000; // speed in m/s\n var speed = delta*this.fps;\n if ( this.jumping ) {\n var delay = Date.now() - this.jumping;\n if ( height <= this.maxUserHeight && delay > 300 ) {\n this.standUp();\n this.jumping = null;\n this.log(\"jump stopped\")\n } else if ( delay > 500 ) {\n this.log(\"jump stopped - timeout\")\n this.standUp();\n this.jumping = null;\n } else {\n this.jump(height - this.maxUserHeight);\n }\n } else if ( height > this.maxUserHeight && Math.abs(speed) > 0.2 ) {\n // CHECKME speed is not really important here\n this.jump(height - this.maxUserHeight);\n this.jumping = Date.now();\n this.log(\"jump starting\")\n } else {\n // ignoring anything less than 1mm\n if ( delta > 0.001 ) {\n this.rise(delta);\n } else if ( delta < -0.001 ) {\n this.crouch(-delta);\n }\n }\n\n } else {\n this.maxUserHeight = height;\n }\n this.prevUserHeight = height;\n }", "function checkRectHeight() {\n if (rectangle.uCornerY < 0) {\n state = `level up`\n } else {\n state = `simulation`\n }\n}", "height() {\n return this.win.innerHeight;\n }", "function fullHeight() {\r\n let elements = document.querySelectorAll('.set-h'),\r\n innerInput = document.querySelector('.questions-section .drop-menu'),\r\n winHeight = window.innerHeight;\r\n if (winHeight <= 690 && winHeight > 550) {\r\n winHeight += 70;\r\n } else if (winHeight <= 550) {\r\n winHeight += 150;\r\n }\r\n for (let i = 0; i < elements.length; i++) {\r\n if (elements[i].classList.contains('full-h')) {\r\n elements[i].style.minHeight = winHeight + 'px';\r\n } else {\r\n elements[i].style.minHeight = (winHeight - 87) + 'px';\r\n }\r\n }\r\n // add space below questions\r\n if (window.innerHeight > 660) {\r\n innerInput.style.marginBottom = globalFun.animationSpeed([80,100,130,180], null) + \"px\";\r\n } else {\r\n innerInput.style.marginBottom = globalFun.animationSpeed([80,100,180,180], null) + \"px\";\r\n }\r\n }", "handleShelfHeightChange( event ) {\n let [ stackIndex, shelfIndex, height ] = event.target.value.split( /,/ )\n this.props.setShelfHeight( Number( stackIndex ), Number( shelfIndex ), Number( height ))\n }", "get height() {\n return this._getOption('height');\n }", "getHeight(){return this.__height}", "setHeightMode(valueNew){let t=e.ValueConverter.toSizeMode(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"HeightMode\")),t!==this.__heightMode&&(this.__heightMode=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"HeightMode\"}),this.__processHeightMode())}", "static keyboardListener(height) {\n const keyboardHeight = Platform.OS === 'android' ? height / PixelRatio.get() : height;\n RNKeyboard.callbacks.forEach(callback => {\n callback(keyboardHeight);\n });\n }", "set maxHeight(value) {}", "function getHeight(){\n let height = $('.accountOverview-content').height();\n $('.verticalMenu').css('height', height);\n}", "function updateWorldHeight() {\n const unit = document.querySelector(\"#options-height-unit\").value;\n const value = Math.max(0.000000001, document.querySelector(\"#options-height-value\").value);\n const oldHeight = config.height;\n\n setWorldHeight(oldHeight, math.unit(value, unit));\n}", "setHeightUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"HeightUnit\")),t!==this.__heightUnit&&(this.__heightUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"HeightUnit\"}),this.__processHeightUnit())}", "get height() {\n\t\treturn this._height;\n\t}", "get height() {\n\t\treturn this._height;\n\t}", "function playerHeight() {\n\treturn 30;\t\n}", "set pageHeight(value) {\n this.pageHeightIn = value;\n this.notifyPropertyChanged('pageHeight');\n }", "get height() { return 2.5; }", "setHeight() {\n if(this.props.height && Number.isInteger(this.props.height)) {\n this.setState({\n height: this.props.height\n });\n }\n }", "function heightDetect() {\n $(\".main_head\").css(\"height\", $(window).height());\n }", "get height() {\n return this.m_height;\n }", "function getHeight(){\n\tif( $(window).height() > MAXHEIGHT +100 ) return MAXHEIGHT;\n\treturn $(window).height() - 100;\n}", "function change_height() {\n\tvar w = document.getElementById(\"input_width\").value;\n\tvar h = document.getElementById(\"input_height\").value;\n\tvar dh = document.getElementById(\"input_dest_height\").value;\n\tvar dw = document.getElementById(\"input_dest_width\");\n\n\tdw.value = (w*dh/h)\n}", "function setHeight() {\n $('.voyage').css('height', 'auto');\n var maxHeight = Math.max.apply(null, $(\".voyage\").map(function() {\n return $(this).height();\n }).get());\n $('.voyage').height(maxHeight);\n }", "get heightType() {\n return this.heightTypeIn;\n }", "get height() {\n return this._height;\n }", "get height() {\n return this._height;\n }", "getMaxHeight(){return this.__maxHeight}", "function setHeight(){\n\tvar h = document.body.clientHeight-8;\n\treturn h/2;\n}", "function handleToggleHeightProfile(e) {\n\t\t\tvar height = $('#heightProfile').get(0);\n\n\t\t\t//when calling this for the first time on page startup, style.display attribute will be empty which corresponds to the default case of \"not visible\"\n\t\t\tif (height.style.display == 'inline') {\n\t\t\t\t//height profile is visible, hide it\n\t\t\t\t$('#heightProfile').css('display', 'none');\n\t\t\t\t$('#map').css('bottom', '25px');\n\t\t\t\t$('#toggleHeightProfile').attr('class', 'heightProfileInvisible');\n\t\t\t\t//trigger map update\n\t\t\t\ttheInterface.emit('ui:mapPositionChanged');\n\t\t\t} else {\n\t\t\t\t//height profile is not visible, show it\n\t\t\t\t$('#heightProfile').css('display', 'inline');\n\t\t\t\t$('#map').css('bottom', '200px');\n\t\t\t\t$('#toggleHeightProfile').attr('class', 'heightProfileVisible');\n\t\t\t\t//trigger map update\n\t\t\t\ttheInterface.emit('ui:mapPositionChanged');\n\t\t\t}\n\t\t}", "function setverticalBounds() {\n\n\tlet maxExpandingHeight = document.getElementById('expandingMax').value;\n\tlet minExpandingHeight = document.getElementById('expandingMin').value;\n\n\tdocument.getElementById('expandingTextArea').setAttribute('style', \n\t\t\t\t\t\t\t'max-height:' + maxExpandingHeight + 'em;' +\n\t\t\t\t\t\t\t'min-height:' + minExpandingHeight + 'em;'\n\t\t\t\t\t\t\t);\n\n}", "setMaxHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"MaxHeight\")),t!==this.__maxHeight&&(this.__maxHeight=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"MaxHeight\"}),this.__processMaxHeight())}", "get minHeight() {}", "_getGameHeight() {\n return this.scene.scene.manager.game.config.height;\n }", "function changeHeight() {\n var profileBox = $('.profile__item');\n var max = 0;\n profileBox.each(function() {\n if (max < $(this).outerHeight()) {\n max = $(this).outerHeight();\n }\n })\n profileBox.height(max);\n }", "function getHeight(elem, eventTarget) {\n if (eventTarget === 1) {\n elem.style.display = 'block';\n var height = elem.scrollHeight + 'px';\n elem.style.display = '';\n } else if (eventTarget === 2) {\n var height = headerHeight;\n } else if (eventTarget === 3) {\n var height = searchBarHeight;\n }\n return height;\n}", "function userInput (event) {\n\tif (height.value === \"\" || char.value === \"\") {\n\t\talert(\"Both fields require a value!\");\n\t} else {\n\t\ttree(event);\n\t}\n}", "function setHeroHeight() {\n var cars = document.querySelector('#cars');\n var personalTrucks = document.querySelector('#personalTrucks').offsetHeight;\n // var personalTrucks = document.querySelector('#personalTrucks');\n if(window.innerWidth >= 1024) { \n // cars.style.height = \"auto\";\n var carSelection = document.querySelector('#carSelection').offsetHeight;\n // var carSelection = document.querySelector('#carSelection').style.height;\n // console.log(carSelection+' is the car selection height');\n red.style.height = carSelection+'px';\n }\n else if(window.innerWidth >= 639 && window.innerWidth < 1024) {\n cars.style.height=personalTrucks+'px';\n }\n else if(window.innerWidth < 638) {\n cars.style.height = 'auto';\n }\n}", "getHeight() {\n return this.height;\n }", "getHeight() {\n return this.height;\n }", "get height() {\n return this.bottom - this.top;\n }", "function checkHeightAndReturn() {\n const iframe = d3Select(this.root).selectAll('iframe');\n lastHeight = height;\n height = parseInt(iframe.node().style.height.replace(\"px\", \"\"));\n if(height > 0 && heightStableSince > 3) {\n this.props.onLoadSuccess(height, this.props.item);\n window.clearInterval(this.heightCheckInterval);\n }\n\n if(height === lastHeight) \n heightStableSince += 1;\n else\n heightStableSince = 0;\n }", "function setHeight(value){\n var val = value || Math.min(textarea.scrollHeight, settings.maxHeight);\n textarea.style.height = val + 'px';\n\n //we store the height locally so that other pages can adjust to this height\n localStorage.setItem('height', val);\n }", "function taskPeak() {\n let height = document.getElementById('tasks').style.height;\n if (height == '0vh' || height == '') {\n document.getElementById('tasks').style.height = '2vh';\n }\n}", "function setBoxHeight() {\n var maxHeight = -1;\n\n $('.home_box').each(function() {\n maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();\n });\n $('.home_box').each(function() {\n $(this).height(maxHeight);\n });\n }", "setMinHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"MinHeight\")),t!==this.__minHeight&&(this.__minHeight=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"MinHeight\"}),this.__processMinHeight())}", "function awardsItemHei() {\n var awardsHei = $(window).height();\n orientHeight = $(window).height();\n orientWidth = $(window).width();\n if (orientWidth>orientHeight) { \n $('.awards_grid .grid__item').css('height', (+awardsHei/2.5)+'px');\n } else {\n $('.awards_grid .grid__item').css('height', (+awardsHei/4)+'px');\n }\n }", "handleOnResize () {\n const contentHeight = this.contentNode.offsetHeight\n const minimumHeight = this.minimumLinesNode\n ? this.minimumLinesNode.offsetHeight\n : 0\n const newHeight = Math.max(contentHeight, minimumHeight)\n\n const { currentHeight, onResize } = this.props\n\n if (newHeight !== currentHeight) {\n onResize(newHeight)\n }\n }", "function WinHeight(){\r\n\t\tvar heightWin = $(\".dhtmlx_window_active\").height();\r\n\t\tvar heightForm = $(\".dhxform_base\").height();\r\n\t\tif (heightWin == 0) {\r\n\t\t\tparseInt(document.getElementsByClassName(\"dhtmlx_wins_body_outer\")[0].style.height = heightForm+42);\r\n\t\t\t//console.log(\"Altura automatica\");\r\n\t\t} else {\r\n\t\t\t//console.log(\"Altura manual \"+heightWin);\r\n\t\t}\r\n\t}", "adjustUI() {\n this.calculateHeightOfCy(this);\n var _this = this;\n window.addEventListener(\n \"resize\",\n function() {\n _this.calculateHeightOfCy(_this)\n },\n true\n );\n }", "get height() {\n return this._height;\n }", "changeClosetHeight(height) {\n if (height > 0) {\n var axesHeight = height / 2;\n var heighpos = this.faces.get(FaceOrientation.TOP).Y()[4]; //TODO: Remove heighpos ?\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.TOP).Y()-this.faces.get(FaceOrientation.LEFT).height()/2)+axesHeight);\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.BASE).Y()+this.faces.get(FaceOrientation.LEFT).height()/2)-axesHeight);\n this.faces.get(FaceOrientation.LEFT).changeHeight(height);\n this.faces.get(FaceOrientation.RIGHT).changeHeight(height);\n this.faces.get(FaceOrientation.BACK).changeHeight(height);\n for(let closetSlot of this.getSlotFaces()){\n closetSlot.changeHeight(height);\n }\n }\n }" ]
[ "0.69649816", "0.68736035", "0.68286514", "0.6766266", "0.66395575", "0.6597417", "0.6586647", "0.65657324", "0.6492461", "0.64117503", "0.63757414", "0.6331665", "0.6331053", "0.63237756", "0.63001287", "0.6211713", "0.61835086", "0.61806315", "0.61775804", "0.61756057", "0.6148814", "0.61457634", "0.6138543", "0.61189914", "0.6112068", "0.6111595", "0.61113125", "0.6105858", "0.6093125", "0.6071805", "0.6071805", "0.6060927", "0.60318923", "0.60318923", "0.6028488", "0.60172975", "0.6008237", "0.6002168", "0.59719545", "0.5969608", "0.59379274", "0.5913719", "0.5910057", "0.59039056", "0.58921367", "0.5882804", "0.5879409", "0.587089", "0.5870304", "0.5858192", "0.58455545", "0.5844586", "0.5844241", "0.58441895", "0.58310926", "0.5821919", "0.5819441", "0.5809505", "0.57971835", "0.57968336", "0.5775418", "0.5761982", "0.5761982", "0.5760653", "0.5759997", "0.5756148", "0.5742049", "0.57390773", "0.5733971", "0.573101", "0.57279354", "0.57261884", "0.5726073", "0.57246834", "0.57246834", "0.570788", "0.57078046", "0.57075495", "0.57026684", "0.56989753", "0.5697491", "0.56919354", "0.56825066", "0.5680221", "0.567509", "0.5664894", "0.56520987", "0.56520987", "0.5644261", "0.56419593", "0.564109", "0.5637339", "0.5635582", "0.56350523", "0.5627149", "0.5624241", "0.56238896", "0.56163764", "0.56083757", "0.55991906" ]
0.6197897
16
This method will be invoked when the user enters the user's weight
weight(e) { this.setState({ weight: e.nativeEvent.text }, function () { this.bmi(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleWeight(e) {\n e.preventDefault();\n dispatch(orderByWeight(e.target.value));\n setPagActual(1);\n }", "handleLetsGo(event) {\n event.preventDefault();\n const weight = this.element.value;\n if (this.state.accept) {\n //alert(\"start analysis your bmi ,wait\")\n this.setState({\n show: false\n })\n // console.log(weight);\n this.handleChangeWeight(weight);\n }\n }", "weightChanged(e) {\n this.setState({weight: parseInt(e.target.value)});\n }", "handleWeightChange(e) {\n this.setState({ 'weight': e.target.value });\n }", "function validateWeight(weight) {\n var labelWeight = document.getElementById(\"informationLabelWeight\");\n\n if(measurementUnit === \"imperial\") {\n weight = weight * 0.453592;\n }\n\n if(validateUserInput(weight, 2.1, 560)) {\n labelWeight.classList.remove(\"statusAlert\");\n labelWeight.classList.add(\"statusSuccess\");\n labelWeight.innerHTML = \"<i class=\\\"iconSuccess\\\"></i> You have entered a valid weight\";\n\n return true;\n }\n\n else {\n labelWeight.classList.remove(\"statusSuccess\");\n labelWeight.classList.add(\"statusAlert\");\n\n if(measurementUnit === \"metric\") {\n labelWeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your weight must be between 2.1 and 560 kg\";\n }\n\n else {\n labelWeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your weight must be between 4.7 and 1234.6 lb\";\n }\n\n return false;\n }\n}", "function getWeight() {\n var weight = Number(document.getElementById(\"theweight\").value);\n return weight;\n}", "function onType() {\n let weight = document.querySelectorAll(\".bmi .calc input\")[0].value;\n let height = document.querySelectorAll(\".bmi .calc input\")[1].value;\n if (weight != \"\" && height != \"\") {\n // document.querySelector(\".bmi .ans\").style.display = \"flex\";\n document.querySelector(\".bmi .ans\").innerHTML = (Number(weight) / (Math.pow(Number(height), 2))).toFixed(1);\n }\n else {\n document.querySelector(\".bmi .ans\").innerHTML = \"הכניסו נתונים\";\n }\n}", "setWeightFromEvent(e) {\n const value = parseFloat(e.target.value)\n const newValue = (Number.isNaN(value))? \"\" : value;\n this.props.setWeight(newValue)\n }", "handleWeighttChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ weight: processedData })\n this.bmi(this.state.height, processedData);\n }", "changeWeight(weight) {\n this._currentWeight = weight\n }", "handleChange(event) {\r\n this.setState({ weight: event.target.value });\r\n }", "function checkweight(){\n let weight = prompt(\"How much do you weight\");\n if (weight > 170) { //then\n alert(\" Your to fat to be here go away\"); \n\n }\n if( weight < 170){ //then\n alert (\"You need some meat on your bones. Get food now!!!!! But read my story first this took me a lot of time todo. Then go get something to eat. Now\");\n }\n}", "set weight(value) {}", "function calculateWeight() {\n var theWeight = document.getElementById(\"user-weight\").value;\n var thePlanet = document.getElementById(\"planets\").selectedIndex;\n var theGravity = planets[thePlanet].gravity;\n var planetName = planets[thePlanet].planet;\n var results = theWeight * theGravity;\n var totalWeight = results;\n document.getElementById(\"output\").innerHTML= \"If you were on \" + planetName + \", you would weigh \" + totalWeight + \"lbs!\";\n\n}", "function updateWeight () {\n\n\tdocument.getElementById(\"weight_val\").value = document.getElementById(\"weight_val_selector\").value;\n}", "function setWeight(){\n\t //remove the old event listenner;\n\t if (window.removeEventListener) {\n\t\t\twindow.removeEventListener('click',clickHandler);\n\t }\t\n\t else if (window.detachEvent) {\n\t\t\twindow.detachEvent('click',clickHandler);\n\t }\n\t\n\t //restart the game;\n\t if(myStartBt.isStart)\n\t\tmyGameArea.stop();\n\t startGame();\n\t \n\t myBucket.weight=Number(document.getElementById(\"bucket\").value);\n\t mySlider.weight=Number(document.getElementById(\"slider\").value);\n\t myGameArea.frictionFactor=Number(document.getElementById(\"frictionFactor\").value);\n\t mySlider.gravity=myGameArea.frictionFactor*0.03;\n\t myBucket.gravity=(myBucket.weight-myGameArea.frictionFactor*mySlider.weight)/(myBucket.weight+mySlider.weight)*0.05;\n\t output.a=(myBucket.weight-myGameArea.frictionFactor*mySlider.weight)/(myBucket.weight+mySlider.weight)*output.g;\n\t //the animation will run very fast if myBucket.gravity==output.a\n}", "function calculateWeight(userWeight, planetName){\n var userWeight = document.getElementById(\"user-weight\").value;\n var planetName = document.getElementById(\"planets\").selectedIndex;\n var gravity = planets[planetName][1];\n var result = userWeight * gravity;\n return result;\n}", "function healthyWeight(){\n var hw = document.getElementById(\"hweight\").value;\n if (hw <= 18.5){\n return \"Underweight\";\n } else if (hw<=24.9){\n return \"Ideal\";\n } else if (hw <=29.9){\n return \"Overweight\";\n } else{\n return \"Obesity\";\n }\n\n}", "function showTextBox(text){\n weightChanged = false;\n $('#edgeWeight').val(text);\n $('#editEdgeWeightForm').modal('show');\n $('#edgeWeightSubmit').bind('click', function(){\n var newWeight = Number($('#edgeWeight').val());\n console.log(\"New weight: \"+newWeight);\n if (newWeight == NaN){\n alert(newWeight+ \" is not a number. \\nPlease\" \n + \"Enter a number between 0 and 1\");\n return;\n }\n updateWeight(newWeight);\n $(\"#editEdgeWeightForm\").modal('hide');\n return true;\n });\n}// end(showTextBox)", "function dateWeighting(){\n \n dateWeight = 1;\n \n }", "function bmiCalc() {\n //prompt whether user wants to use the imperial or metric system\n var type = parseInt(prompt(\"please chose your operation \\n\" + \"1 - Imperial (lb)\\n\" +\" 2 - Metric (kg)\"));\n // conditional if the type is imperial\n var weight, height, value_array;\n if (type == 1) {\n value_array = prompt_for_values(2,\"please enter your weight(lb)\",\"please enter your height(in)\");\n weight = value_array[0];\n height = value_array[1];\n // we carry out the imperial formula for BMI calculation\n return alert(\"Your BMI is :\" + (weight / Math.pow(height,2) * 703).toFixed(2));\n // conditional if the type is metric\n }else if(type == 2 ){\n value_array = prompt_for_values(2,\"please enter your weight(kg)\",\"please enter your height(m)\");\n weight = value_array[0];\n height = value_array[1];\n //we carry our the metric formula\n return alert(\"Your BMI is : \" + (weight / Math.pow(height,2).toFixed(2)).toFixed(2));\n }\n}", "displayWeight(){\n console.log(`${this.weight} pounds`);\n }", "activateUpdateHandler(item_id, inx, type){\n //implement\n if(type==\"input\"){\n try {\n var id = \"priority_\" + inx;\n var weight = document.getElementById(id).value;\n {weight==\"\"? this.setState({ alertopen: true }) : putUpdate(item_id, inx, Number(weight), this.props.updateWeight, this)}\n document.getElementById(id).value=\"\";\n }\n catch(error) {\n //not number value\n this.setState({ alertopen: true });\n }\n }\n else if(type==\"increase\"){\n putUpdate(item_id, inx, this.props.data.event_data[inx].weight + 1, this.props.updateWeight, this);\n }\n else if(type==\"decrease\"){\n putUpdate(item_id, inx, this.props.data.event_data[inx].weight - 1, this.props.updateWeight, this);\n }\n else if(type==\"top\"){\n putUpdate(item_id, inx, this.props.data.event_data[0].weight + 1, this.props.updateWeight, this);\n }\n else if(type==\"bottom\"){\n var len = this.props.data.event_data.length-1;\n var newWeight = this.props.data.event_data[len].weight==0? 0 : this.props.data.event_data[len].weight - 1\n putUpdate(item_id, inx, newWeight, this.props.updateWeight, this);\n }\n }", "function BMIcalculate()\n{\n //Getting the user input for weight //\n var weightofuser = document.getElementById(\"weight\").value;\n //Getting the user input for height //\n var heightofuser = document.getElementById(\"height\").value;\n \n// Calculating the BMI of user //\n \n var BMI = (weightofuser / (heightofuser*heightofuser));\n \n// If statement for BMI Under 18.5 ///\n if ( BMI > 0 && BMI < 18.5)\n {\n // Displaying the result for Underweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Underweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI between 18.5 & including 24.9 //\n else if ( BMI >= 18.5 && BMI <= 24.9)\n {\n // Displaying the result for Normal //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Normal.\"+\"</li>\";\n \n }\n\n// If statement for BMI between 25 & including 29.9 //\n else if ( BMI >= 25 && BMI <= 29.9)\n {\n // Displaying the result for Overweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Overweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI over 30 //\n else \n {\n // Displaying the result for Obese //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Obese.\"+\"</li>\";\n \n } \n \n}", "function stealthWeapon() {\n var currentUnitPoints = parseInt(event.target.parentNode.childNodes[2].childNodes[0].innerHTML);\n var currentTotal = parseInt(totalPoints.innerText);\n if (event.target.value === \"Fusion Blaster - 4pt\") {\n totalPoints.innerText = currentTotal +4;\n event.target.parentNode.childNodes[2].childNodes[0].innerHTML = currentUnitPoints +4;\n } else {\n totalPoints.innerText = currentTotal -4;\n event.target.parentNode.childNodes[2].childNodes[0].innerHTML = currentUnitPoints -4;\n }\n}", "function heuristics(weight) {\n choice = 1;\n w = weight;\n}", "function bmiCalc(){\n let weight = $('#weight').val()\n let height = $('#height').val()\n let bmi = weight/(height**2)\n $('#bmi').val(bmi)\n}", "function calculateBmi() {\n\n let weight = document.getElementById(\"weight_input\").value;\n let height = document.getElementById(\"height_input\").value;\n bmi = weight / (height / 100) ** 2\n\n //if any input is empty, give message that you have to fill inn all of the inputs.\n if (weight == \"\" || height == \"\") {\n document.getElementById(\"bmi_output\").innerHTML = \"Please fill all of the inputs\";\n document.getElementById(\"bmi_output_def\").innerHTML = \"\";\n }\n //if all inputs is filled, run this else that runs some if statements, dependent on the bmi.\n else {\n document.getElementById(\"bmi_output\").innerHTML = \"Your BMI is: \" + parseFloat(bmi).toFixed(2);\n\n if (bmi < 18.4) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Underweight\";\n }\n else if (bmi < 24.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Normalweight\";\n }\n else if (bmi < 29.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Overweight\";\n }\n //a bmi over 100 doesn't make any sense.\n else if (bmi > 100) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That can't be right, try again\";\n }\n else {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Obese\";\n }\n }\n}", "onChangeWeight(value) {\n\n let ex = this.state.exercise;\n\n ex.weight = value;\n\n this.setState({exercise: ex});\n\n }", "function checkNetWeight(itemW, itemWType, wtToCheck, wtToCheckType, focusId, panelName) {\r\n if (panelName == 'loanPanel') {\r\n alertMessage = 'Net Weight Exceeding Gross Weight!\\nPlease Enter Correct Net Weight!';\r\n }\r\n if (itemWType == wtToCheckType) {\r\n if (parseFloat(wtToCheck) > parseFloat(itemW)) {\r\n alert(alertMessage);\r\n document.getElementById(focusId).focus();\r\n }\r\n } else {\r\n if (itemWType == 'GM' && wtToCheckType == 'KG') {\r\n alert(alertMessage);\r\n document.getElementById(focusId).focus();\r\n } else if (itemWType == 'MG' && (wtToCheckType == 'GM' || wtToCheckType == 'KG')) {\r\n alert(alertMessage);\r\n }\r\n }\r\n return false;\r\n}", "function myheight(e){\r\n if(inputh.value<0 || inputh.value.length>4){\r\n alert(\"you have entered wrong value or enter two decimal point or enter all the fields\");\r\n inputh.value=\"\";\r\n }\r\n else if(exp.test(inputh.value) && event.key==\"Enter\"){\r\n inputHeight=inputh.value;\r\n BMI=inputWeight / (inputHeight ** 2);\r\n let heading=document.querySelector('.heading');\r\n const todayBmi = BMI.toFixed(2);\r\n heading.innerHTML=todayBmi;\r\n valueBmi.push(todayBmi);\r\n valueWeight.push(inputWeight);\r\n function ishealthy(){\r\n if(todayBmi>=30){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Obese : (\";\r\n }\r\n else if(todayBmi>25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Overweight : (\";\r\n }\r\n else if(todayBmi<19){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Underweight : (\";\r\n }\r\n else if(todayBmi>=19 || valueBmi<=25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Normal weight : )\";\r\n }\r\n }\r\n ishealthy();\r\n \r\n \r\n //local storage save function\r\n saveFunc= () =>{\r\n localStorage.setItem('valueOfWeight',JSON.stringify(valueWeight));\r\n localStorage.setItem('values',JSON.stringify(valueBmi));\r\n }\r\n }\r\n }", "function userInput (event) {\n\tif (height.value === \"\" || char.value === \"\") {\n\t\talert(\"Both fields require a value!\");\n\t} else {\n\t\ttree(event);\n\t}\n}", "function computeBMI() {\r\n clearAll(true);\r\n\r\n // obtain user inputs\r\n var height = Number(document.getElementById(\"height\").value);\r\n var weight = Number(document.getElementById(\"weight\").value);\r\n var unittype = document.getElementById(\"unittype\").selectedIndex;\r\n\r\n if (height === 0 || isNaN(height) || weight === 0 || isNaN(weight)) {\r\n setAlertVisible(\"error-bmi-output\", ERROR_CLASS, true);\r\n document.getElementById(\"error-bmi-output\").innerHTML = errorString;\r\n } else { // convert\r\n // Perform calculation\r\n var BMI = calculateBMI(height, weight, unittype);\r\n\r\n // Display result of calculation\r\n var result = \" Your BMI index are <strong>\" + BMI + \"</strong>.\";\r\n var warning = true;\r\n if (BMI < BMI_LOWINDEX)\r\n result = \"<strong>Underweight!!</strong>\" + result + \" C'mon, McDonald is near by then.\";\r\n else if (BMI >= BMI_LOWINDEX && BMI <= BMI_HIGHINDEX) {\r\n warning = false;\r\n result = \"<strong>Normal!</strong>\" + result + \" Good exercises!\";\r\n }\r\n else // BMI > 25\r\n result = \"<strong>Overweight!!!</strong>\" + result + \" Recreation center welcome you !!\";\r\n\r\n // if we need to show warning so we show alert with warning, otherwise we show success message.\r\n if (warning) {\r\n setAlertVisible(\"warning-bmi-output\", WARNING_CLASS, true);\r\n document.getElementById(\"warning-bmi-output\").innerHTML = result;\r\n } else {\r\n setAlertVisible(\"normal-bmi-output\", SUCCESS_CLASS, true);\r\n document.getElementById(\"normal-bmi-output\").innerHTML = result;\r\n }\r\n }\r\n}", "function convertKg() {\n if (dropdown.value === 'pounds') {\n let weight = inputWeight.value;\n weight = (weight/2.2).toFixed(2)\n output.innerHTML = `${(weight)} kilograms`\n }\n if(dropdown.value ==='kg') {\n let weight = inputWeight.value;\n weight = (weight*2.2).toFixed(2)\n output.innerHTML = `${weight} pounds`\n }\n}", "function heuristics1(weight) {\n choice = 2;\n w = weight;\n}", "function bmi(name, weight, height) {\n \n// This is calculating the bmi and storing it into a variable. This is the set standard formula; it cannot be changed.\n var bmiResult = (weight / (height * height)) * 703;\n \n//These are the weight classification for bmi. Depending on the user's bmi, the corresponding message will be sent to the console and alerted to the user.\n if (bmiResult > 29.99) {\n console.log(\"The user is considered obese.\");\n alert(name + \", you are considered obese. \\n\\nYou should consult with your physician on a diet and exercise plan.\");\n } else if (bmiResult > 24.99) {\n console.log(\"The user is considered overweight.\");\n alert(name + \", you are considered overweight. \\n\\nYou should work on losing a few pounds.\");\n } else if (bmiResult > 18.49) {\n console.log(\"The user is considered at a normal weight.\");\n alert(name + \", you are considered normal weight. \\n\\nYou should continue to maintain your weight.\");\n } else {\n console.log(\"The user is considered underweight.\");\n alert(name + \", you are considered underweight. \\n\\nYou should probably bulk up a few pounds.\");\n }\n \n//This is returning the bmiResult outside of the function.\n return bmiResult;\n \n}", "function desirableWeight() {\n var desirableWeight = userInfo[\"desirable-weight\"];\n var weight = userInfo[\"weight\"];\n var step1 = weight - desirableWeight;\n var step2 = step1 * 0.32;\n var DW = step2 + desirableWeight;\n return DW;\n}", "function lettersSCalc(weight) {\n\n var result;\n\n if(weight <= 1) {\n return result = 0.49;\n }\n else if (weight <= 2) {\n return result = 0.70;\n }\n else if (weight <= 3) {\n return result = 0.91;\n }\n else if (weight <= 3.5) {\n return result = 1.12;\n }\n else {\n return result = -1;\n }\n}", "function handleSortByWeight(e){\n e.preventDefault();\n dispatch(sortByWeight(e.target.value));\n setCurrentPage(1);\n setOrderW(`${e.target.value}`);\n e.target.value ='default';\n setOrder(`${e.target.value}`);\n\n}", "function incrementWeight(numberInput) {\n\tif (Number(numberInput.value) < Number(numberInput.max)) {\n\t\tnumberInput.value = Number(numberInput.value) + 1;\n\t}\n}", "get weight() {}", "function CalcWeight()\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(\"gear\").rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[\"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(\"bagWeight\").innerHTML = total.toFixed(1);\n\n // Add the armor weight.\n for ( var i = 1; i <= 4; i++ )\n {\n // If the armor is flagged as not carried, then don't add it to the weight.\n if ( !sheet()[\"Armor\" + i + \"Carried\"].checked )\n continue;\n\n var num = parseFloat(sheet()[\"Armor\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n // Add the weapon weight\n for ( var i = 1; i <= 4; i++ )\n {\n if ( sheet()[ \"Weapon\" + i + \"Carried\" ].checked )\n {\n var num = parseFloat(sheet()[\"Weapon\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n }\n\n sheet().TotalWeight.value = total.toFixed(1);\n\n // Check to see if the character is encumbered. If so, then set the background\n // color of \"Total Weight\", Speed, and DexMod input fields to red.\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().LightLoad.value ) )\n {\n debug.trace(\"Character is encumbered.\");\n var maxDexMod = 99;\n\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().MediumLoad.value ) )\n {\n maxDexMod = 1;\n sheet().TotalWeight.title = \"Check penalty of -6 while encumbered\";\n }\n else\n {\n maxDexMod = 3;\n sheet().TotalWeight.title = \"Check penalty of -3 while encumbered\";\n }\n\n debug.trace(\"MaxDexMod = \" + maxDexMod + \" DexMod = \" + Clean( sheet().DexMod.value ) );\n if ( Clean( sheet().DexMod.value ) > maxDexMod )\n {\n sheet().DexMod.title = \"Max dex bonus to AC is +\" + maxDexMod + \" while encumbered.\";\n sheet().DexMod.style.color = \"white\";\n sheet().DexMod.style.backgroundColor = \"red\";\n }\n else\n {\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n }\n\n sheet().TotalWeight.style.color = \"white\";\n sheet().TotalWeight.style.backgroundColor = \"red\";\n\n sheet().Speed.title = \"Max speed is reduced by roughly 1/3 due to encumbrance\";\n sheet().Speed.style.color = \"white\";\n sheet().Speed.style.backgroundColor = \"red\";\n\n ACCheckMaxDex(); // Check if the dex bonus to AC should be reduced.\n }\n else\n {\n sheet().TotalWeight.title = sheet().TotalWeight.value;\n sheet().TotalWeight.style.color = \"black\";\n sheet().TotalWeight.style.backgroundColor = \"white\";\n\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n\n sheet().Speed.title = sheet().Speed.value;\n sheet().Speed.style.color = \"black\";\n sheet().Speed.style.backgroundColor = \"white\";\n }\n\n\n SkillsUpdateCheckPen();\n\n debug.trace(\"Calculated total weight.\");\n}", "function createBasketWeightGuide(){\n // create the element for the guide\n $('.af__basket__weight-guide--label').after('<div class=\"js-af__weight-guide__wrapper\"></div>');\n $('.js-af__weight-guide__wrapper').append('<div class=\"js-af__weight-guide__meter\"></div>');\n \n $('.af__product__add-to-basket').submit(function(e){\n e.preventDefault();\n //var $multiplier=\n weightGuideListener();\n })\n}", "function calculateGradeNeeded(){\n\n var finalExamWeight = document.getElementById(\"examWeight\").value;\n var preferredScore = document.getElementById(\"preferredScore\").value;\n var gradeNeeded = \"\";\n if(finalExamWeight == \"\" || preferredScore == \"\"){\n document.getElementById(\"output1\").innerHTML = \"Please enter your your final weight and desired grade\"\n }else{\n gradeNeeded = ((preferredScore - ((100-(finalExamWeight))/100)*CurrentGrade) / finalExamWeight) *100;\n if(CurrentGrade == \"\"){\n document.getElementById(\"output1\").innerHTML = \"Please Calculate your Current Grade first!\"\n }else{\n document.getElementById(\"output1\").innerHTML = \"You will need to score at least \" + gradeNeeded + \"% on your final to get a \" + preferredScore + \"% overall.\";\n }\n\n }\n\n\n}", "function calculateCaloriesFromWeight() {\n var weight = userInfo[\"weight\"];\n var totalCalories = weight * 22;\n return totalCalories;\n}", "function getWeight(mat) {\n\n //if(buttonIsPressed) then set mat to 4\n if (document.getElementById(\"wheatIncrease\").checked && mat == 5) {\n console.log(\"Checked\")\n mat = 4\n }\n\n if (mat % 2 == 0) {\n return (1 / 3)\n }\n else {\n return (1 / 4)\n }\n}", "function setBMI() {\n document.querySelectorAll(\".bmi .calc input\")[0].addEventListener(\"input\", onType);\n document.querySelectorAll(\".bmi .calc input\")[1].addEventListener(\"input\", onType);\n}", "processHeuristicWeight(x,y, currentWeight) {\n this.field[x][y].weight = currentWeight + 5;\n }", "updateWeightIn(val) {\n this.setState({\n weightIn: val\n })\n }", "function bmiCalculator(weight, height) {\r\n var bmi = Math.round(weight / (height * height));\r\n var interpretation;\r\n\r\n if (bmi < 18.5) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are underweight.\"\r\n } else if (bmi >= 18.5 && bmi < 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you have a normal weight.\"\r\n } else if (bmi >= 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are overweight.\"\r\n }\r\n\r\n return interpretation;\r\n}", "function getVals() {\n\n //Get Current Grade\n var currentGrade = document.getElementById(\"currentGrade\").value;\n currentGrade /= 100;\n\n //Get Desired Grade\n var desiredGrade = document.getElementById(\"desiredGrade\").value;\n desiredGrade /= 100;\n\n //Get Weight\n var weight = document.getElementById(\"weight\").value;\n weight /= 100;\n\n //Calcuate Final Grade\n var finalGrade = (desiredGrade - (1-weight)*currentGrade) / weight;\n finalGrade = Math.round(finalGrade * 100)\n\n\n if(finalGrade > 90){\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Better start studying.\";\n } else if (finalGrade <= 90 && finalGrade > 80) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Could be worse.\";\n } else if (finalGrade <= 80 && finalGrade > 70) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. No sweat, you got this.\";\n } else if (finalGrade <= 70 && finalGrade > 60) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. This'll be easy.\";\n } else {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Enjoy not studying!\";\n }\n\n\n }", "function weightSliderValueChange() {\n $('#sliderWeight').on('input', function () { //versions of IE < 9 do not support this event, they have proprietary onPropertyChange event\n $('.sliderWeightValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderSummation').val(0);\n $('.sliderSummationValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderWeightValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeight(value);\n displayModelsSelectedByWeight(value, selectedSolution);\n displayCurves();\n }, 10);\n });\n}", "function setConnectionWeight(weight) {\n\t\tthis.weight = eval(weight);\n\t\tif (document.getElementById(this.id) != null) {\n\t\t\tdocument.getElementById(this.id).strokeWeight = eval(weight);\n\t\t}\n\t}", "function bodyMassIndexCalculator(weight,height) {\n\tvar bmi = weight/(Math.pow(height,2));\n\tif (isNaN(bmi)) {\n\t\talert(\"You should type only numbers! (No commas allowed)\")\n\t} else if(bmi < 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are underweight.\");\n\t\t}\n\telse if(bmi < 24.9 && bmi > 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are a normal weight.\");\n\t\t}\t\n\telse if(bmi > 24.9) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are overweight.\");\n\t\t}\n}", "function setWeight( action, weight ) {\n\t\taction.enabled = true;\n\t\taction.setEffectiveTimeScale( 1 );\n\t\taction.setEffectiveWeight( weight );\n\t}", "function searchByWeight(people){\n let weightType = parseInt(promptFor('What do you want to search for:' +'\\n' +' 1 - Search people weighing below amount:' +'\\n'+ '2 - Search people weighing above amount: ',autoValid))\n let weightAmount = \"\"\n let searchResults\n\n if (weightType === 1)\n {\n weightAmount = parseInt(promptFor('Please enter the weight to search below:',autoValid))\n let foundPerson = people.filter(function(potentialMatch){\n if (potentialMatch.height <= weightAmount)\n {\n return true;\n }\n else{\n return false;\n }\n \n ;\n })\n searchResults = foundPerson\n }\n\n else{\n weightAmount = parseInt(promptFor('Please enter the weight to search above:',autoValid))\n let foundPerson = people.filter(function(potentialMatch)\n {\n if (potentialMatch.height >= weightAmount)\n {\n return true;\n }\n else{\n return false;\n }\n \n ;\n })\n searchResults = foundPerson\n }\n\n return searchResults\n}", "function sendGuess(firstName, lastName, weight) {\n channel.trigger('client-newGuess', {\n weight: weight,\n firstName: firstName,\n lastName: lastName\n });\n }", "function rateLetterStamped(weight) {\n if (weight <= 1.0) {\n return 0.50;\n } else if (weight <= 2.0) {\n return 0.71;\n } else if (weight <= 3.0) {\n return 0.92;\n } else if (weight <= 3.5) {\n return 1.13;\n } else {\n return rateLargeFlat(weight);\n }\n}", "onEntered() {\n if (this.state.carrating != 0) {\n let selector = this.state.carrating.toString();\n selector = selector.replace(\"0.5\", \"half\");\n selector = selector.replace(\".5\", \"half\");\n document.getElementById(\"star\" + selector).checked = true;\n }\n }", "function alertCheck(){\n spawnRate = document.getElementById('speed-input').value;\n console.log(\"speed: \"+spawnRate);\n if (spawnRate < 0.2){\n alert(\"TOO SMALL! Try something over or equal to 0.2\");\n }\n if (spawnRate > 4){\n alert(\"TOO BIG! Try something under or equal to 4\");\n }\n spawnRate = 1/spawnRate;\n console.log(spawnRate);\n}", "get weighting() { return this._weighting; }", "function bmiCalculator(height,weight){\n return(Math.round(weight/(height**2)));\n }", "function bmiCalculator (weight, height) {\n var message = \"\";\n var bmi = Math.round(weight /(Math.pow(height,2)));\n if (bmi < 18.5) {\n message = \"Your BMI is \"+bmi+\", so you are underweight.\";\n }\n if (bmi >= 18.5 && bmi <24.9) {\n message = \"Your BMI is \"+bmi+\", so you have a normal weight.\";\n }\n if (bmi > 24.9) {\n message = \"Your BMI is \"+bmi+\", so you are overweight.\";\n }\n return message;\n}", "bmi(height, weight) {\n if (height > 0 && weight > 0) {\n var bmi = 10000 * (weight / ((height) * (height)));\n bmi = Math.round(bmi * 100) / 100\n this.setState({ bmi: bmi })\n }\n }", "handleSubmit(event) { \n // console.log(this.state);\n let hinMeters;\n let winKg;\n let bmiCat;\n if(this.state.isCm)\n hinMeters = 0.01* this.state.height;\n else{\n console.log(this.state.height + this.state.height_in);\n hinMeters = 0.01*(this.state.height + this.state.height_in)*2.54; \n }\n \n if(this.state.isKg)\n winKg = this.state.weight;\n else\n winKg = this.state.weight*0.453592;\n event.preventDefault();\n console.log('hinm',hinMeters);\n // console.log('winK',winKg);\n let bMi = (winKg/(hinMeters*hinMeters)).toFixed(2);\n console.log(this.u_cat,this.h_cat,this.ov_cat);\n if(bMi<parseFloat(this.u_cat))\n bmiCat='Underweight';\n else if(bMi>=parseFloat(this.u_cat) && bMi<parseFloat(this.h_cat))\n bmiCat='Healthy';\n else if(bMi>=parseFloat(this.h_cat) && bMi<parseFloat(this.ov_cat))\n bmiCat='Overweight';\n else\n bmiCat='Obese';\n this.setState({'bmi':bMi,'cat':bmiCat});\n this.showModal();\n \n }", "function checkWeight(Weight) {\n\n if(Weight > 5000){\n var text=\"no free shipping for you\";\n console.log(text);\n }\n // console.log(text);\n\n}", "function bmiCalculator (weight, height) {\r\n var bmi = weight/(height * height);\r\n var interpretation = \"\";\r\n\r\n if(bmi < 18.5){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are underweight.\");\r\n }\r\n if(bmi >= 18.5 && bmi <= 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you have a normal weight.\");\r\n }\r\n if(bmi > 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are overweight.\");\r\n }\r\n return interpretation;\r\n}", "function handleEnter() {\n // storing entered values as numbers\n let init = Number(ini.value);\n let num = Number(amt.value);\n let cur = Number(curr.value);\n // calculating profit(-ve or +ve)\n let profit = (cur - init) * num;\n // if there is a profit, print profit and also calculate % profit\n if (profit > 0) {\n let percent = (profit / init) * 100;\n message.innerHTML =\n \"profit of \" + profit + \"! and the percent is \" + percent + \"%\";\n }\n // when there is no profit or loss\n if (profit === 0) {\n message.innerHTML = \"no loss and no gain\";\n }\n // calculate loss and % loss\n if (profit < 0) {\n profit = -1 * profit;\n let percent = (profit / init) * 100;\n message.innerHTML =\n \"loss of \" + profit + \" and the percent is \" + percent + \"%\";\n }\n}", "function calcGrade() {\n var hwCount = 0;\n var pointEarned = 0;\n var pointTotal = 0;\n var totalGrade = 0;\n hwCount = document.getElementById(\"liAssignments\").childElementCount;\n\n for (var i = 1; i <= hwCount; i++) {\n if (document.getElementById(\"weight\" + i).value != 0) {\n totalGrade += ((document.getElementById(\"hw\" + i).value) / (document.getElementById(\"total\" + i).value)) * (document.getElementById(\"weight\" + i).value);\n }\n\n }\n findLetterGrade(totalGrade);\n totalGrade = parseFloat(totalGrade).toFixed(2);\n document.getElementById(\"WHO\").value = totalGrade;\n\n}", "function gunnerChange() {\n var currentUnitPoints = parseInt(event.target.parentNode.childNodes[2].childNodes[0].innerHTML);\n var currentTotal = parseInt(totalPoints.innerText);\n if (event.target.value === \"Ion Rifle - 3pt\" && currentUnitPoints === 12) {\n ionFromRail(event, currentTotal, currentUnitPoints);\n } else if (event.target.value === \"Ion Rifle - 3pt\") {\n ionFromCarbine(event, currentTotal, currentUnitPoints);\n } else if (event.target.value === \"Rail Rifle - 5pt\" && currentUnitPoints === 7) {\n railFromCarbine(event, currentTotal, currentUnitPoints)\n } else if (event.target.value === \"Rail Rifle - 5pt\") {\n railFromIon(event, currentTotal, currentUnitPoints);\n } else if (event.target.value === \"Pulse Carbine w/ ML\" && currentUnitPoints === 12) {\n carbineFromRail(event, currentTotal, currentUnitPoints);\n } else {\n carbineFromIon(event, currentTotal, currentUnitPoints);\n }\n}", "rating(event) {\n if (event.target.name === \"feedbackRating\") {\n this.feedbackRating = event.target.value;\n }\n }", "function AddWeight(){\n specAttribute.style.cssText = \"height: 85px;\";\n\n size.style.cssText = \"height:0; opacity:0;\";\n dimentions.style.cssText = \"height:0; opacity:0;\";\n weight.style.cssText = \"height: 85px; width:100%; opacity:1; overflow: visible;\";\n weight.getElementsByTagName(\"input\")[0].required = true; \n \n size.getElementsByTagName(\"input\")[0].required = false; \n size.getElementsByTagName(\"input\")[0].value= \"\"; \n for (let i=0; i<3; i++) {\n dimentions.getElementsByTagName(\"input\")[i].required = false; \n dimentions.getElementsByTagName(\"input\")[i].value= \"\"; \n }\n}", "function poundsConversion() {\n const pWeight = parseFloat(poundsInput.value); // turns the string into a number which is used for each conversion in this function\n const gWeight = pWeight / 0.0022046;\n const oWeight = pWeight * 16;\n const kWeight = pWeight * 0.45359;\n gramsInput.value = gWeight.toFixed(3); //sets values to DOM using a fixed decimal input\n ounceInput.value = oWeight.toFixed(3);\n kilogramInput.value = kWeight.toFixed(3);\n}", "function calculate(){\n\n \tvar\twtkg = document.getElementById('wtDrop').selectedIndex +1;\n \tvar wtlb = document.getElementById('wtDropLbs').selectedIndex;\n \tvar chk = document.getElementById('wtChk');\n \tvar weight;\n\n\n \t//checks which unit has been inputed by user then converts lbs to kg\n \tif(chk.checked == true){\n \t\tweight = wtkg.toFixed();\n \t}else if(chk.checked == false){\n \t\tweight = (wtlb*0.453592).toFixed();\n \t}\n\n \t//height function to check which height is used\n\n \tvar htf = document.getElementById('htDropF').selectedIndex -1;\n \tconsole.log(htf);\n \tvar hti = document.getElementById('htDropF2').selectedIndex-1;\n \tvar htC = (htf * 30.48) + (hti *2.54);\n \t\n\n \tvar htm = document.getElementById('htDropM').selectedIndex -1;\n \tvar htChk = document.getElementById('htChk');\n \t\n\n \tvar height;\n\n \tif(htChk.checked == true && hti >= 0){\n \t\theight = htC;\n \t}else if(htChk.checked == false){\n \t\theight = htm;\n \t}\n\n \t//gender\n \tvar r1 = document.getElementById('mRad');\n \tvar r2 = document.getElementById('fRad');\n \tvar gender;\n \tif(r1.checked == true){\n \t\tgender = 1.23;\n \t}else if(r2.checked == true){\n \t\tgender = 1.04;\n \t}\n \t\n \t//calculate height over 5 foot, IBW and ABW\n \tvar inchover5 = (height - 152.4)/2.54;\n \tvar mIBW = (inchover5 * 2.3) + 50;\n\tvar fIBW = (inchover5 * 2.3) + 45.5;\n\tvar mABW = mIBW + 0.4 * (weight - mIBW);\n\tvar fABW = fIBW + 0.4 * (weight - fIBW);\n\n\tvar modalWt = document.getElementById('modalWt');\n\tvar modalIBW = document.getElementById('modalIBW'); \n\tvar modalABW = document.getElementById('modalABW');\n\n\n\tif(gender == 1.23){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = mIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = mABW.toFixed(1) + \"kg\";\n\t}else if(gender == 1.04){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = fIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = fABW.toFixed(1) + \"kg\";\n\n\t}\n\n\n\n\t//age and creatinine\n \tvar age = document.getElementById('ageDrop').selectedIndex -1;\n \tvar srcr = document.getElementById('creatDrop').selectedIndex -1;\n \tvar wtType = document.getElementById('wtType');\n\n \tvar CRCLAnswer = document.getElementById('ansDisplay');\n \tvar crcl = 0;\n \tif(gender == 1.23 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * mABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\n\t} else if(gender == 1.23 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender)/srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t\t\n\t} else if(gender == 1.04 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * fABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\t\t\t\n\t} else if(gender == 1.04 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t}\n\n\n\t//displays answer jumbo if criteria matches\n\tif(weight >= 30 && inchover5 >= 0 && age >= 18 && srcr > 1 && gender > 1){\n\t\tconsole.log(\"criteria matches\");\n\t\tdocument.getElementById('ansJumbo').style.display = \"block\";\n\t\tdocument.getElementById('inputForm').style.display = \"none\";\n\t\tvar title = document.getElementById('title');\n\t\ttitle.innerHTML = \"Creatinine Clearance\"\n\t\ttitle.style.marginLeft = \"50px\";\n\t\tdocument.getElementById('backBtn').style.display = \"block\";\n\t\t\n\n\t}\n \tconsole.log(\"\\nweight: \" + weight + \"\\nHeight: \" + height +\"\\ninches over 5 foot: \" + inchover5 + \" \\nage: \" + age + \"\\nsrcr: \" + srcr + \" \\ngender: \" + gender);\n \treturn crcl;\n}", "function handle() {\n /*\n\t\t\tCalls the core function to set the volume to the computed value\n\t\t\tbased on the user's intent.\n\t\t*/\n Core.setVolume(this.value);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync the volume slider locations\n\t\t*/\n VolumeSliderElements.sync();\n }", "onClick() {\n this.validateInput('weight', (weightStatus) => {\n if (weightStatus) {\n this.validateInput('pantsSize', (pantsSizeStatus) => {\n if (pantsSizeStatus) {\n this.validateInput('chest', (chestStatus) => {\n if (chestStatus) {\n this.validateInput('waist', (waistStatus) => {\n if (waistStatus) {\n this.validateInput('biceps', (bicepsStatus) => {\n this.httpRequest();\n });\n }\n });\n }\n });\n }\n });\n }\n });\n }", "function amountsChanged()\r\n{\r\n //JQuery!!!\r\n var newWeights = [];\r\n $(\"input[name='ingredient-form']\").each(function() {\r\n newWeights.push($(this).val());\r\n });\r\n\r\n // console.log(\"New weights\",newWeights);\r\n // console.log(\"Orig weights\", origWeights);\r\n \r\n //multiplier to adjust mutrition info based off ingredient amount change\r\n multiplier = [];\r\n for(i=0;i<origWeights.length;i++) {\r\n if (origWeights[i] != 0) { \r\n var x = newWeights[i]/origWeights[i];\r\n multiplier.push(x);\r\n }\r\n\r\n else {multiplier.push(1);\r\n }\r\n }\r\n // console.log(\"multiplier\", multiplier);\r\n\r\n updatePlot();\r\n}", "function bmiCalculator(weight, height){\r\nvar bmi = weight / Math.pow(height, 2);\r\nreturn Math.round(bmi);\r\nconsole.log(`${bmi} is Calculator`);\r\n}", "function bmi(weight, height) {\n var bmi = weight / (height * height);\n console.log(bmi);\n switch (true) {\n case bmi < 15:\n console.log(\"Anorexic\");\n break;\n case bmi < 17.5 && bmi > 15:\n console.log(\"Starvation\");\n break;\n case bmi > 18.5 && bmi < 25:\n console.log(\"Ideal\");\n break;\n case bmi > 25 && bmi < 30:\n console.log(\"Overweight\");\n break;\n case bmi > 30 && bmi < 40:\n console.log(\"Obese\");\n break;\n case bmi > 40:\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "function calculateWeightsAndValues(value, weight){\r\n return(value * weight)\r\n}", "function userInputClick() {\n // Get input from user and store it in variable\n const age = parseInt(document.getElementById(\"age-entered\").value)\n const day = document.getElementById(\"day-entered\").value\n\n // Checks if user should go to the movies\n if ((day == \"tuesday\" || day == \"thursday\") || (age > 12 && age < 21)) {\n document.getElementById(\"output\").innerHTML = \"You should go to the museum because you will get a discount\"\n } else {\n document.getElementById(\"output\").innerHTML = \"You should not go to the museum today because you will not get a discount\"\n }\n}", "function foodValue(event){\n food = event.target.value;\n }", "function calcNumBeeStings (w){\n\n //declare and define a variable to calculate the total number of bee stings based on the input of the user.\n var totalBeeStings = w * 8.666666667;\n\n //return the total number of bee stings back to the main code.\n return totalBeeStings;\n }", "function weightSumValueChange() {\n $('#sliderSummation').on('input', function () {\n $('.sliderSummationValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderWeight').val(0);\n $('.sliderWeightValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderSummationValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeightSummation(value, selectedSolution);\n displayModels();\n displayCurves();\n }, 10);\n });\n}", "function handleInput() {\n\t\t\tif (onInput) {\n\t\t\t\tonInput(value);\n\t\t\t}\n\t\t}", "static isValidWeightInKg(weightInKg) {\n return (!Number.isNaN(weightInKg) && weightInKg > BMI.minWeightInKg && weightInKg <= BMI.maxWeightInKg)\n }", "function beeStung(weight) {\n \n //calculate for bee stings\n var stings=8.666666667*weight\n \n //Return number of Bee stings\n return stings;\n}", "function beeStingsNeeded(victimWeight)\n{\n var totalStings = 8.666666667 * victimWeight; // This is the code that will run in the function.\n\n return totalStings; // This is the code to return the total number of bee stings to the function.\n}", "function updateSummationWeights(value) {\n total_weight += value;\n}", "function BuyBoost() {\n if (BoostLevel == 0){\n Score = Score - 10;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x2\";\n document.getElementById(\"boostcost\").innerHTML = \" 10\";\n BoostLevel++;\n }\n else if (BoostLevel == 1){\n Score = Score - 20;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x4\";\n document.getElementById(\"boostcost\").innerHTML = \" 20\";\n BoostLevel++;\n }\n else if (BoostLevel == 2){\n Score = Score - 30;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x6\";\n document.getElementById(\"boostcost\").innerHTML = \" 30\";\n BoostLevel++;\n }\n else if (BoostLevel == 3){\n Score = Score - 40;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x8\";\n document.getElementById(\"boostcost\").innerHTML = \" 40\";\n BoostLevel++;\n }\n else {\n Score = Score - 50;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x10\";\n document.getElementById(\"boostcost\").innerHTML = \" 50\";\n }\n}", "function canBeWeighted(item, weight) {\n\t Object.assign(item, {\n\t weight: weight,\n\t examineWeight: examineWeight,\n\t pickUp: pickUp\n\t });\n\t\n\t function examineWeight() {\n\t if (item.weight > 50) {\n\t console.log(item.toString() + ' looks heavy');\n\t } else {\n\t console.log(item.toString() + ' looks light');\n\t }\n\t }\n\t function pickUp() {\n\t if (weight > 50) {\n\t console.log(item.toString() + ' is too heavy, you can\\'t pick it up');\n\t } else {\n\t console.log('You pick ' + item + ' up');\n\t }\n\t }\n\t}", "checkAge() {\n let messageField = document.getElementById('alertAge');\n\n let messageWeightField = document.getElementById('alertWeight');\n let inputAgeField = document.getElementById('donor-age').value;\n let inputWeightField = document.getElementById('donor-weight').value;\n if (inputAgeField < 16 || inputAgeField > 60) {\n messageField.textContent = \"your age is not eligible for Blood Donation\";\n messageField.style.color = 'red';\n messageField.style.fontSize = \"17px\";\n messageField.style.fontWeight = \"bold\"\n let btns = document.getElementById('btn1');\n btns.disabled = true;\n\n\n } else {\n messageField.textContent = \"\";\n\n let btnCheck = document.getElementById('btn1');\n btnCheck.disabled = false;\n\n }\n // Check for weight\n if (inputWeightField < 50) {\n messageWeightField.textContent = \"your Weight is not enough for Blood Donation\";\n messageWeightField.style.color = 'red';\n messageWeightField.style.fontSize = \"15px\";\n messageWeightField.style.fontWeight = \"bold\";\n let btns = document.getElementById('btn1');\n btns.disabled = true;\n\n } else {\n messageWeightField.textContent = \"\";\n let btns = document.getElementById('btn1');\n btns.disabled = false;\n }\n }", "renderSwitch(weight) {\n if(weight <= 200){\n return <span>$5</span>\n }else if(weight <= 500){\n return <span>$10</span>\n }else if(weight <= 1000){\n return <span>$15</span>\n }else if(weight <= 5000){\n return <span>$20</span>\n }else{\n return <span>$22</span>\n }\n }", "function handleInput() {\n const { checked: sortByRole } = this;\n if (sortByRole) {\n displayBandMembers(bandRoles);\n } else {\n displayBandMembers(bandYears);\n }\n}", "function bmi(weight, height) {\n var bmi = weight / (height * height)\n console.log(bmi)\n switch (true) {\n case (bmi < 15):\n console.log(\"Anorexic\");\n break;\n case (bmi < 17.5 && bmi > 15):\n console.log(\"Starvation\");\n break;\n case (bmi > 18.5 && bmi < 25):\n console.log(\"Ideal\");\n break;\n case (bmi > 25 && bmi < 30):\n console.log(\"Overweight\");\n break;\n case (bmi > 30 && bmi < 40):\n console.log(\"Obese\");\n break;\n case (bmi > 40):\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "setrating() \n {\n this.rating = prompt(\"What is your rating from 0-10?\"); // whatever is passed into the parameter CHANGES the default parameter we set in the beginning\n }", "function calcPrice() {\n // alert(\"Calc Price\")\n let price = parseInt(elRankDesired.value) - parseInt(elRankCurrent.value);\n \n /* Increases price based on what mode they user selects. */\n let queue = elRankQueue.value;\n if (queue === '2v2') {\n price += (0.15 * price);\n } else if (queue === '3v3') {\n price += (0.25 * price);\n }\n\n /* Adds 50% to price if user selects the checkbox to play alongside. */\n if (isBoosted()) {\n price += (0.50 * price);\n }\n \n /* Convert to String Dollar Amount */\n price = price.toFixed(2);\n let text = \"Boost $\" + price + \" USD\";\n \n document.getElementById('price-text').innerHTML = text;\n }", "function changeMinimumEdgeWeight(event, ui) {\n graphControls.minimumEdgeWeight = ui.value;\n $('#updateGraphButton').attr('disabled', false);\n}", "function getAveWeight() {\n\tvar totalE=0\n\tfor (var i=0; i<weight.length; i++) {\n\t\ttotalE=totalE+weight[i]\n\t}\n\taveWeight=Math.round((totalE/5)*10)/10\n\t$(\"#aveWeight\").html(aveWeight)\n}", "function me(){\n if( principal.value === '' && time.value === '' && rate.value === '')\n {\n result.value = 'pls enter a valid number';\n }\n else \n {\n result.value = ((parseFloat(principal.value) * parseFloat(time.value) * parseFloat(rate.value))/100).toFixed(2);\n }\n\n }" ]
[ "0.6976837", "0.6957045", "0.68216354", "0.6758603", "0.67144966", "0.67116195", "0.6620056", "0.65649325", "0.6563489", "0.65626895", "0.65352225", "0.65047073", "0.6482548", "0.6471021", "0.6451936", "0.6391041", "0.6355199", "0.6308896", "0.61773646", "0.61657387", "0.6101759", "0.6048837", "0.60267746", "0.5987582", "0.59477496", "0.5939578", "0.5928367", "0.5917534", "0.5879298", "0.5879065", "0.5865558", "0.5829373", "0.58155173", "0.5810659", "0.580794", "0.57931983", "0.5751067", "0.57486117", "0.5747643", "0.57413745", "0.5723704", "0.57070863", "0.5689393", "0.56866443", "0.5679387", "0.5674629", "0.56596255", "0.5656182", "0.5653526", "0.56340057", "0.5632927", "0.56316006", "0.5615086", "0.56087327", "0.5598838", "0.55982107", "0.55899143", "0.55730903", "0.55464906", "0.5539671", "0.551239", "0.5512256", "0.55115527", "0.55045134", "0.54951036", "0.5493067", "0.5488781", "0.54874647", "0.5484611", "0.5484049", "0.54800373", "0.54662377", "0.54659235", "0.5458557", "0.5441745", "0.5441251", "0.54174376", "0.5415638", "0.5412778", "0.54070586", "0.5397485", "0.5394159", "0.53842235", "0.53835714", "0.53786874", "0.53761226", "0.5374213", "0.5370785", "0.53659976", "0.53655064", "0.5364837", "0.5360045", "0.5359083", "0.5353552", "0.53263783", "0.532591", "0.5316964", "0.5315324", "0.53121096", "0.5308658" ]
0.6698073
6
This method will be invoked to calculate the BMI
bmi(height, weight) { if (height > 0 && weight > 0) { var bmi = 10000 * (weight / ((height) * (height))); bmi = Math.round(bmi * 100) / 100 this.setState({ bmi: bmi }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function calculateBMI() {\n var weight = userInfo[\"weight\"];\n var height = userInfo[\"height\"];\n var BMI = weight / Math.pow(height, 2);\n return BMI;\n}", "calculeBMI() {\n this.BMI = this.WeightKg / Math.pow(this.convertHeightToMeters(this.HeightCm), 2);\n }", "function calculateBMI(){\r\n const heightToMeters = inputHeight.value / 100;\r\n const heightExponent = Math.pow (heightToMeters, 2)\r\n const calculateBMI = inputWeight.value / heightExponent;\r\n const roundBMI = Math.round(calculateBMI * 10) / 10;\r\n return roundBMI;\r\n}", "function calculateBMI(weight, height) {\n\tvar bmi=weight/(height*height)\n\tconsole.log(\"Your BMI: \"+bmi)\n}", "function bmiCalculator(height,weight){\n return(Math.round(weight/(height**2)));\n }", "function bmiCalculator(weight, height){\r\n var bmi = weight/math.pow(height, 2);\r\n return bmi;\r\n}", "function bmiCaluculator(weight, height) {\n let bmi = weight/(height*height);\n return Math.round(bmi) ;\n}", "function calcBMI(weight, height, formula) {\n return formula(weight, height);}", "function bmiCalculator(weight, height) {\n var bmi = Math.floor(weight / (height * height));\n return bmi;\n}", "function calculateBMI(mass,height)\r\n{\r\n let BMI=( mass/(height*height));\r\n return BMI\r\n}", "function calcBMI(height, weight)\n{\n\treturn Math.round((weight)/(height * height) * 10) / 10;\n}", "function calcBMI ( mass,height ) {\n return mass / (height * height)\n}", "function bmiCalc(weight, height) {\n var bmi = weight / Math.pow(height, 2);\n return Math.round(bmi);\n}", "get getBMI() {\n return this.BMI.toFixed(2);\n }", "function calculateBMI(inputHeight, inputWeight, type, scale) {\r\n var weight = inputWeight;\r\n var height = inputHeight;\r\n // if lb and pound so multiply 703, if kgs and meters so just calculate normally\r\n if (type === 0) weight = weight * 704;\r\n var result = weight / Math.pow(height, 2);\r\n var roundScale = scale ? scale : DEFAULT_SCALE;\r\n return Math.round(result * roundScale) / roundScale; // beautify result.\r\n}", "function calculateBMIUsingImperial(w, h) {\n return w/h**2*703;\n}", "function bmiCalculator(weight, height){\r\nvar bmi = weight / Math.pow(height, 2);\r\nreturn Math.round(bmi);\r\nconsole.log(`${bmi} is Calculator`);\r\n}", "function bmiCalculator(weight, height) {\r\n var bmi = Math.round(weight / (height * height));\r\n var interpretation;\r\n\r\n if (bmi < 18.5) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are underweight.\"\r\n } else if (bmi >= 18.5 && bmi < 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you have a normal weight.\"\r\n } else if (bmi >= 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are overweight.\"\r\n }\r\n\r\n return interpretation;\r\n}", "function BMI(mass, height) {\n return mass /(height*height);\n}", "calculateBMI(request, response){\n \n const loggedInMember = accounts.getCurrentMember(request);\n \n const latestBmi = 0;\n \n latestBmi = (loggedInMember.startWeight / (loggedInMember.height * loggedInMember.height))\n \n /*\n \n calculateBmi(id){\n \n const loggedInMember = accounts.getCurrentMember(id);\n const assessments = assessmentStore.getAssessment(id);\n const latestBmi = 0;\n \n if(assessments.length == 0){\n latestBmi = (loggedInMember.startWeight / (loggesInMember.height * loggesInMember.height))\n }\n else{\n assessments = assessments.lenght - 1;\n latestBmi = (assessments.weight / (assessments.height * assessments.height))\n }\n \n }\n \n */\n return latestBmi;\n }", "getBMIRatio() {\n const htInMeter = this.height / 100; // converts height to meter\n console.log(htInMeter);\n return this.weight / (htInMeter * htInMeter);\n }", "function bmi(weight, height) { // the parameters are height and weight\n var bodyMass = weight / (height * height); // i declared the variable to bodyMass to calculate the bodymass but instead of exponent 2 since it wasnt working i did height times itself\n if (bodyMass <= 18.5) return \"Underweight\"\n if (bodyMass <= 25.0) return \"Normal\"\n if (bodyMass <= 30.0) return \"Overweight\"\n if (bodyMass > 30.0) return \"Obese\"\n}", "function calcBMR(gender,feet,inches,weight,age,callback){\n var bmi = 0;\n if(gender===\"female\"){\n bmi = Math.floor(655+(4.7*callback(feet,inches))+(4.35*weight)-(4.7*age));\n }\n else{\n bmi = Math.floor(66+(12.7*callback(feet,inches))+(6.23*weight)-(6.8*age));\n }\n return bmi;\n }", "function calculateBMIUsingSI(w, h) {\n return w/h**2;\n}", "function bmi(name, weight, height) {\n \n// This is calculating the bmi and storing it into a variable. This is the set standard formula; it cannot be changed.\n var bmiResult = (weight / (height * height)) * 703;\n \n//These are the weight classification for bmi. Depending on the user's bmi, the corresponding message will be sent to the console and alerted to the user.\n if (bmiResult > 29.99) {\n console.log(\"The user is considered obese.\");\n alert(name + \", you are considered obese. \\n\\nYou should consult with your physician on a diet and exercise plan.\");\n } else if (bmiResult > 24.99) {\n console.log(\"The user is considered overweight.\");\n alert(name + \", you are considered overweight. \\n\\nYou should work on losing a few pounds.\");\n } else if (bmiResult > 18.49) {\n console.log(\"The user is considered at a normal weight.\");\n alert(name + \", you are considered normal weight. \\n\\nYou should continue to maintain your weight.\");\n } else {\n console.log(\"The user is considered underweight.\");\n alert(name + \", you are considered underweight. \\n\\nYou should probably bulk up a few pounds.\");\n }\n \n//This is returning the bmiResult outside of the function.\n return bmiResult;\n \n}", "function computeBMI() {\r\n clearAll(true);\r\n\r\n // obtain user inputs\r\n var height = Number(document.getElementById(\"height\").value);\r\n var weight = Number(document.getElementById(\"weight\").value);\r\n var unittype = document.getElementById(\"unittype\").selectedIndex;\r\n\r\n if (height === 0 || isNaN(height) || weight === 0 || isNaN(weight)) {\r\n setAlertVisible(\"error-bmi-output\", ERROR_CLASS, true);\r\n document.getElementById(\"error-bmi-output\").innerHTML = errorString;\r\n } else { // convert\r\n // Perform calculation\r\n var BMI = calculateBMI(height, weight, unittype);\r\n\r\n // Display result of calculation\r\n var result = \" Your BMI index are <strong>\" + BMI + \"</strong>.\";\r\n var warning = true;\r\n if (BMI < BMI_LOWINDEX)\r\n result = \"<strong>Underweight!!</strong>\" + result + \" C'mon, McDonald is near by then.\";\r\n else if (BMI >= BMI_LOWINDEX && BMI <= BMI_HIGHINDEX) {\r\n warning = false;\r\n result = \"<strong>Normal!</strong>\" + result + \" Good exercises!\";\r\n }\r\n else // BMI > 25\r\n result = \"<strong>Overweight!!!</strong>\" + result + \" Recreation center welcome you !!\";\r\n\r\n // if we need to show warning so we show alert with warning, otherwise we show success message.\r\n if (warning) {\r\n setAlertVisible(\"warning-bmi-output\", WARNING_CLASS, true);\r\n document.getElementById(\"warning-bmi-output\").innerHTML = result;\r\n } else {\r\n setAlertVisible(\"normal-bmi-output\", SUCCESS_CLASS, true);\r\n document.getElementById(\"normal-bmi-output\").innerHTML = result;\r\n }\r\n }\r\n}", "function calculateBmi() {\n\n let weight = document.getElementById(\"weight_input\").value;\n let height = document.getElementById(\"height_input\").value;\n bmi = weight / (height / 100) ** 2\n\n //if any input is empty, give message that you have to fill inn all of the inputs.\n if (weight == \"\" || height == \"\") {\n document.getElementById(\"bmi_output\").innerHTML = \"Please fill all of the inputs\";\n document.getElementById(\"bmi_output_def\").innerHTML = \"\";\n }\n //if all inputs is filled, run this else that runs some if statements, dependent on the bmi.\n else {\n document.getElementById(\"bmi_output\").innerHTML = \"Your BMI is: \" + parseFloat(bmi).toFixed(2);\n\n if (bmi < 18.4) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Underweight\";\n }\n else if (bmi < 24.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Normalweight\";\n }\n else if (bmi < 29.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Overweight\";\n }\n //a bmi over 100 doesn't make any sense.\n else if (bmi > 100) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That can't be right, try again\";\n }\n else {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Obese\";\n }\n }\n}", "function bmi(weight, height) {\n\n const bmi = weight / (height**2);\n\n if(bmi <= 18.5) return \"Underweight\";\n if(bmi <= 25.0) return \"Normal\";\n if(bmi <= 30.0) return \"Overweight\";\n\n return \"Obese\";\n\n}", "function bmiCalculator (weight, height) {\r\n var bmi = weight/(height * height);\r\n var interpretation = \"\";\r\n\r\n if(bmi < 18.5){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are underweight.\");\r\n }\r\n if(bmi >= 18.5 && bmi <= 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you have a normal weight.\");\r\n }\r\n if(bmi > 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are overweight.\");\r\n }\r\n return interpretation;\r\n}", "getBMI(weightInKg, heightInCm) {\n const heightInM = heightInCm/100\n const bmi = weightInKg/Math.pow(heightInM, 2)\n return parseFloat(bmi.toFixed(1))\n }", "function bmiCalculator (weight, height) {\n var message = \"\";\n var bmi = Math.round(weight /(Math.pow(height,2)));\n if (bmi < 18.5) {\n message = \"Your BMI is \"+bmi+\", so you are underweight.\";\n }\n if (bmi >= 18.5 && bmi <24.9) {\n message = \"Your BMI is \"+bmi+\", so you have a normal weight.\";\n }\n if (bmi > 24.9) {\n message = \"Your BMI is \"+bmi+\", so you are overweight.\";\n }\n return message;\n}", "function bmi() {\n var c = document.getElementById(\"mass\").value;\n return (c/exponentHeight()+\"kg/m^2\");\n}", "function BMIcalculate()\n{\n //Getting the user input for weight //\n var weightofuser = document.getElementById(\"weight\").value;\n //Getting the user input for height //\n var heightofuser = document.getElementById(\"height\").value;\n \n// Calculating the BMI of user //\n \n var BMI = (weightofuser / (heightofuser*heightofuser));\n \n// If statement for BMI Under 18.5 ///\n if ( BMI > 0 && BMI < 18.5)\n {\n // Displaying the result for Underweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Underweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI between 18.5 & including 24.9 //\n else if ( BMI >= 18.5 && BMI <= 24.9)\n {\n // Displaying the result for Normal //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Normal.\"+\"</li>\";\n \n }\n\n// If statement for BMI between 25 & including 29.9 //\n else if ( BMI >= 25 && BMI <= 29.9)\n {\n // Displaying the result for Overweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Overweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI over 30 //\n else \n {\n // Displaying the result for Obese //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Obese.\"+\"</li>\";\n \n } \n \n}", "function hitungBmi(weight, height) {\n return weight / (height * height);\n}", "function bmiCalc(){\n let weight = $('#weight').val()\n let height = $('#height').val()\n let bmi = weight/(height**2)\n $('#bmi').val(bmi)\n}", "function calculateBmr(nutritionProfile){\n var age = nutritionProfile.age;\n var weightInLbs = nutritionProfile.weight; //TODO get most recent weight instead of static one\n var heightFeet = nutritionProfile.heightFeet;\n var heightInches = nutritionProfile.heightInches;\n var totalHeight = (heightFeet * 12) + heightInches;\n var gender = nutritionProfile.sex;\n\n //convert weight from lbs to kg:\n // kg = (weight in lbs) * .454\n var weightInKg = weightInLbs * .454;\n\n //convert height from inches to cms\n //height in cms = (height in inches * 2.54)\n var heightInCms = totalHeight * 2.54;\n\n var bmr = 0;\n\n //BMR for Men = 66.47 + (13.75 x weight in kg.) + (5 x height in cm) - (6.75 x age in years)\n if(gender == \"Male\"){\n bmr = 66.47 + (13.75 * weightInKg) + (5 * heightInCms) - (6.75 * age);\n }\n //BMR for Women = 655 + (9.6 x weight in kg.) + (1.8 x height in cm) - (4.7 x age in years).\n else{\n bmr = 655.09 + (9.56 * weightInKg) + (1.84 * heightInCms) - (4.67 * age);\n }\n\n return bmr;\n }", "function bmiCalc() {\n //prompt whether user wants to use the imperial or metric system\n var type = parseInt(prompt(\"please chose your operation \\n\" + \"1 - Imperial (lb)\\n\" +\" 2 - Metric (kg)\"));\n // conditional if the type is imperial\n var weight, height, value_array;\n if (type == 1) {\n value_array = prompt_for_values(2,\"please enter your weight(lb)\",\"please enter your height(in)\");\n weight = value_array[0];\n height = value_array[1];\n // we carry out the imperial formula for BMI calculation\n return alert(\"Your BMI is :\" + (weight / Math.pow(height,2) * 703).toFixed(2));\n // conditional if the type is metric\n }else if(type == 2 ){\n value_array = prompt_for_values(2,\"please enter your weight(kg)\",\"please enter your height(m)\");\n weight = value_array[0];\n height = value_array[1];\n //we carry our the metric formula\n return alert(\"Your BMI is : \" + (weight / Math.pow(height,2).toFixed(2)).toFixed(2));\n }\n}", "function bmi(kg, m) {\n let indexBmi = kg / Math.pow(m, 2);\n if (indexBmi >= 30) {\n return console.log(\"Obese\");\n } else if (indexBmi >= 25) {\n return console.log(\"Overweight\");\n } else if (indexBmi >= 18.5) {\n return console.log(\"Normal weight\");\n } else {\n return console.log(\"Underweight\");\n }\n}", "constructor(weightInKg, heightInCm) {\n this.bmi = this.getBMI(weightInKg, heightInCm)\n this.label = this.getLabelFromBMI()\n }", "function interpretBMI(bmi){\n\tif (bmi < 18.5)\n\t{\n\t\treturn \"Underweight\";\n\t}\n\telse if (bmi >= 18.5 && bmi <= 24.9)\n\t{\n\t\treturn \"Normal Weight\";\n\t}\n\telse if (bmi >= 25 && bmi <= 29.9)\n\t{\n\t\treturn \"Overweight\";\n\t}\n\telse if (bmi >= 30 && bmi <= 34.9)\n\t{\n\t\treturn \"Obese\";\n\t}\n\telse if (bmi >= 35 && bmi <= 39.9)\n\t{\n\t\treturn \"Severe Obesity\";\n\t}\n\telse if (bmi >= 40 && bmi <= 44.9)\n\t{\n\t\treturn \"Morbid Obesity\";\n\t}\n\telse if (bmi >= 45)\n\t{\n\t\treturn \"Super Obesity\";\n\t}\n\telse \n\t{\n\t\treturn \"I am error\";\n\t}\n}", "function calculateHealth() {\r\n let heightType = document.querySelector(\"input[name='heightType']:checked\").value;\r\n let calculateItemChecked = document.querySelector(\"input[name='calculate']:checked\").value;\r\n let age = Number(inputAge.value);\r\n let weight = Number(inputWeight.value);\r\n let gender = document.querySelector(\"input[name='gender']:checked\").value;\r\n let physicalState = document.getElementById('physicalState').value;\r\n let height;\r\n //Convert Inches to centimeter for get the height in cm scale \r\n if (heightType === \"centimeter\") {\r\n let centimeter = Number(inputCentimeter.value);\r\n height = centimeter;\r\n } else {\r\n console.log(\"You used inch section\");\r\n let foot = Number(inputFoot.value);\r\n let inches = Number(inputInch.value);\r\n let totalInches = Number((foot * 12) + inches);\r\n let convertToCentimeter = Number(totalInches * 2.54);\r\n console.log(foot, inches, totalInches, convertToCentimeter);\r\n height = convertToCentimeter;\r\n }\r\n\r\n console.log(`Height ${height}, Weight ${weight}, Age ${age}, gender ${gender}, physical state ${physicalState}`);\r\n //TODO: Add a verification for calculation\r\n\r\n if (age == 0 || height == null || height === undefined || weight == 0 || physicalState === \"none\") {\r\n errorAlert.style.display = \"block\";\r\n successAlert.style.display = \"none\";\r\n result.innerHTML = `\r\n <div class=\"d-flex align-items-center\">\r\n <strong>Loading...</strong>\r\n <div class=\"spinner-border ml-auto\" role=\"status\" aria-hidden=\"true\"></div>\r\n </div>`\r\n setTimeout(() => {\r\n result.innerHTML = `\r\n <h5 class=\"alert alert-danger d-block font-weight-bolder text-center\">404 Error <i class=\"fa fa-exclamation-circle\"></i> <br> No values has been given</h5>`\r\n }, 5000);\r\n }\r\n //! When all values is correct\r\n else {\r\n // !Calculate BMR (Heris BeneDict law)\r\n //According to gender\r\n let BMR;\r\n let calories;\r\n let kilojoules;\r\n let icon;\r\n if (gender === \"male\") {\r\n BMR = `${(66 + (13.7 * weight) + (5 * height)) - (6.8 * age)}`\r\n icon = 'male';\r\n } else {\r\n BMR = `${(655 + (9.6 * weight) + (1.8 * height)) - (4.7 * age)}`\r\n icon = 'female';\r\n }\r\n console.log(`Your BMR ${BMR}`);\r\n\r\n //TODO: Calculate calorie according to physical state \r\n let multipicationValue;\r\n if (physicalState === 'low') {\r\n multipicationValue = 1.2;\r\n } else if (physicalState === 'normal') {\r\n multipicationValue = 1.375;\r\n } else if (physicalState === 'medium') {\r\n multipicationValue = 1.55;\r\n } else if (physicalState === 'high') {\r\n multipicationValue = 1.725;\r\n } else if (physicalState === 'veryHigh') {\r\n multipicationValue = 1.9;\r\n } else {\r\n multipicationValue = \"Choose the physical state\"\r\n }\r\n calories = (BMR * multipicationValue);\r\n\r\n // TODO: Calculate KiloJoules from calories\r\n kilojoules = calories * 4.184;\r\n calories = Number(calories).toFixed(2);\r\n kilojoules = Number(kilojoules).toFixed(1);\r\n BMR = Number(BMR).toFixed(2);\r\n console.log(`Your calorie need ${calories}`);\r\n\r\n //TODO: Show the bodyBurnsValue let \r\n let bodyBurning;\r\n let bodyBurningText;\r\n let multipicationValue2;\r\n let resultTypeChecked = document.querySelector(\"input[name='resultIn']:checked\").value;\r\n if (resultTypeChecked === \"kiloJoules\") {\r\n bodyBurning = kilojoules;\r\n bodyBurningText = \"kiloJoules\";\r\n multipicationValue2 = \"X 4.184\";\r\n } else {\r\n bodyBurning = calories;\r\n bodyBurningText = \"calories\";\r\n multipicationValue2 = \"\";\r\n }\r\n\r\n // !Calculate BMI according to height and weight\r\n heightInMeter = `${height / 100}`;\r\n let BMI = `${weight / (heightInMeter**2)}`\r\n BMI = Number(BMI).toFixed(1);\r\n console.log(BMI, heightInMeter);\r\n\r\n //TODO: Justify the BMI index value\r\n let textColor;\r\n let state;\r\n let explainState;\r\n let tips;\r\n let weightText;\r\n if (BMI < 18.5) {\r\n state = \"Underweight\"\r\n explainState = \"শরীরের ওজন কম\";\r\n tips = \"পরিমিত খাদ্য গ্রহণ করে ওজন বাড়াতে হবে\"\r\n textColor = 'black-50';\r\n weightText = \"Low weight\";\r\n } else if (BMI >= 18.5 && BMI <= 24.9) {\r\n state = \"Normal\"\r\n explainState = \"সুসাস্থ্যের আদর্শ মান\";\r\n tips = \"এটি বজায় রাখতে হবে । অতিরিক্ত বা অসাস্থ্যকর খাদ্য গ্রহণ করে সাস্থ্য বাড়ানো যাবে না\"\r\n textColor = 'success';\r\n weightText = \"OverWeight / Underweight\";\r\n } else if (BMI > 24.9 && BMI <= 29.9) {\r\n state = \"Overweight\"\r\n explainState = \"শরীরের ওজন বেশি\";\r\n tips = \"চিন্তিত হবেন না । ব্যায়াম করে ওজন কমাতে হবে\";\r\n textColor = 'warning'\r\n weightText = \"OverWeight\";\r\n } else if (BMI > 29.9 && BMI <= 34.9) {\r\n state = \"obese\"\r\n explainState = \"স্থুল (পর্যায়-১): মেদ বেশি | অতিরিক্ত ওজন\";\r\n tips = \"বেছে খাদ্যগ্রহণ ও ব্যায়াম করা প্রয়োজন ।\"\r\n textColor = 'warning';\r\n weightText = \"High OverWeight\";\r\n } else if (BMI > 34.9 && BMI <= 39.9) {\r\n state = \"obese (High)\"\r\n explainState = \"বেশি স্থুল (পর্যায়-২) ।<br> অতিরিক্ত মেদ\";\r\n tips = \"পরিমিত খাদ্যগ্রহণ ও বেশ ব্যায়াম করা প্রয়োজন । <br> ওজন নিয়োন্ত্রণে আনতে হবে | <br> প্রয়োজনে ডাক্তারের পরামর্শ প্রয়োজন\"\r\n textColor = 'danger';\r\n weightText = \"OverWeight (very high)\";\r\n } else {\r\n state = \"Extremly obese\"\r\n explainState = \"অতিরিক্ত স্থুল (শেষ পর্যায়)। মৃত্যুঝুঁকির আশংকা!\";\r\n tips = \"ডাক্তারের পরামর্শ প্রয়োজন । দ্রুত ওজন নিয়ন্ত্রণে আনতে হবে\"\r\n textColor = 'danger';\r\n weightText = \"OverWeight (extreme)\";\r\n }\r\n // TODO: According to good BMI and given Height calculate the perfect weight for this height\r\n //from \r\n let healthyBMI1 = 18.5;\r\n //to\r\n let healthyBMI2 = 24.9;\r\n //from\r\n let healthyWeight1 = `${healthyBMI1 * (heightInMeter**2)}`\r\n healthyWeight1 = Math.round(healthyWeight1);\r\n //to\r\n let healthyWeight2 = `${healthyBMI2 * (heightInMeter**2)}`\r\n healthyWeight2 = Math.round(healthyWeight2);\r\n //a sequence resulth\r\n let healthyWeight = `${healthyWeight1} to ${healthyWeight2}`\r\n let healthyBMI = `${healthyBMI1} to ${healthyBMI2}`\r\n //Average Result\r\n let averageHealthyWeight = `${(healthyWeight1 + healthyWeight2) / 2}`\r\n let averageHealthyBMI = `${(healthyBMI1 + healthyBMI2) / 2}`\r\n\r\n //TODO: Calculate the difference between healty weight and Given Weight;\r\n let defferenceWeight;\r\n if (state === \"Underweight\") {\r\n defferenceWeight = `${healthyWeight1 - weight}kg To ${healthyWeight2 - weight}kg`\r\n } else if (state === \"Normal\") {\r\n defferenceWeight = \"(N/A) Perfect Weight\"\r\n } else {\r\n defferenceWeight = `${weight - healthyWeight1}kg To ${weight - healthyWeight2}kg`\r\n }\r\n\r\n //TODO; Make the HTML for show the results for each sections\r\n let htmlForBMI;\r\n let htmlForCalories;\r\n let htmlForButtons\r\n\r\n htmlForCalories = `\r\n <div class=\"my-3 d-flex justify-content-center align-content-center flex-column\">\r\n <h5 class=\"card-header text-center my-3\">Your Daily ${bodyBurningText} needs</h5>\r\n <h3 class=\"card-title text-center\" id=\"calculateTitle\">${bodyBurningText} need Per Day : </h3>\r\n <h4 class=\"d-block font-weight-bold mx-auto\" style=\"font-size: 1.5rem;\">\r\n <sup><i class=\"fa fa-fire text-danger\"></i></sup> <span id=\"calorieResult\"> ${bodyBurning}\r\n ${bodyBurningText}/Day</span>\r\n </h4>\r\n</div>\r\n<hr>\r\n<h5 class=\"d-inline-block\">BMR : </h5>\r\n<h5 class=\"d-inline-block text-danger font-weight-bold position-relative float-right\"\r\n style=\"font-size: 1.5rem;\" id=\"BMRResult\">${BMR}</h5>\r\n<hr>\r\n<h5 class=\"d-inline-block\">${bodyBurningText} : (c)</h5>\r\n<h5 class=\"d-inline-block text-danger font-weight-bold position-relative float-right\"\r\n style=\"font-size: 1.5rem;\" id=\"SD\">\r\n <i class=\"fa fa-clipboard\"></i> ${BMR} X ${multipicationValue} ${multipicationValue2}\r\n</h5>\r\n<hr>\r\n<h5 class=\"d-inline-block\">Used BMR Law : </h5>\r\n<h5 class=\"d-inline-block text-danger font-weight-bold position-relative float-right\"\r\nstyle=\"font-size: 1.5rem;\" id=\"SD\">\r\n<i class=\"fa fa-codepen text-codepen\"></i> Heris Bene-Dict \r\n</h5>\r\n<hr>`\r\n\r\n //TODO: BMI HTML\r\n htmlForBMI = `\r\n <div class=\"my-3 d-flex justify-content-center align-content-center flex-column text-center\">\r\n <h5 class=\"card-header my-3\">Your Health Statistics</h5>\r\n <h3 class=\"card-title text-center\" id=\"calculateTitle\">Health State (BMI) : </h3>\r\n <h4 class=\"d-block font-weight-bold mx-auto\" style=\"font-size: 1rem;\">\r\n <sup><i class=\"fa fa-${icon} text-${textColor}\"></i></sup> &nbsp;&nbsp;<span id=\"calorieResult\"> ${explainState}\r\n </span> <small><a id=\"showBMIChart\" onclick=\"showChart()\" class=\"link text-primary\">Chart <i class=\"fa fa-area-chart\"></i></a></small>\r\n </h4>\r\n</div>\r\n<h4>\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\" style=\"display: none;\" id=\"BMIChart\">Chart : <div id=\"img d-flex justify-content-center\">\r\n <img src=\"bmi-chart.gif\" class=\"d-block mx-auto img\" alt=\"BMI Chart\">\r\n </div>\r\n </li>\r\n <li class=\"list-group-item\">BMI Formula : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> weight(kg) /\r\n Height(m) <sup class=\"font-weight-bolder\">2</sup></span>\r\n </li>\r\n\r\n <li class=\"list-group-item\">Your BMI (Body Mass Index) : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\">= ${BMI}</span> <a onclick=\"showBMIStateTable()\" class=\"link text-primary\" id=\"BMITableBtn\">Show BMI Table</a>\r\n <div class=\"card mx-auto\" id=\"BMIStateTable\" style=\"border: none;\r\n width: 100%;\r\n height: auto;\r\n display: none;\">\r\n <br>\r\n <div class=\"card-body bg-light mx-auto\">\r\n <b>Check the health stats according to BMI (Body Mass Index) </b>\r\n </div>\r\n <table class=\"table table-striped mx-auto\">\r\n <thead>\r\n <tr>\r\n <th scope=\"col\">BMI</th>\r\n <th scope=\"col\">State</th>\r\n </tr>\r\n </thead>\r\n <tbody>\r\n <tr>\r\n <th scope=\"row\"> &lt; 18.5</th>\r\n <td>শরীরের ওজন কম (Underweight)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">18.5 to 24.9</th>\r\n <td>সুসাস্থ্যের আদর্শ মান (Normal)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">25 to 29.9</th>\r\n <td>শরীরের ওজন বেশি (Overweight)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">30 to 34.9</th>\r\n <td>\"স্থুল (পর্যায়-১): মেদ বেশি | অতিরিক্ত ওজন (Obese I)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">35 to 39.9</th>\r\n <td>বেশি স্থুল (পর্যায়-২) । অতিরিক্ত মেদ (Obese II)</td>\r\n </tr>\r\n <tr>\r\n <th scope=\"row\">&gt 40</th>\r\n <td>অতিরিক্ত স্থুল (শেষ পর্যায়)। মৃত্যুঝুঁকির আশংকা! (Obese III Extreme)</td>\r\n </tr>\r\n </tbody>\r\n </table>\r\n</div>\r\n </li>\r\n <li class=\"list-group-item\" id=\"state\">State : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${state}</span>\r\n </li>\r\n <hr>\r\n <h5 class=\"card-header text-weight-bolder text-muted\">Calculated Standard Health</h5>\r\n <li class=\"list-group-item\" id=\"goodValues\">1. Your BMI should be : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${healthyBMI}</span>\r\n <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${averageHealthyBMI} <small>(Average)</small></span>\r\n </li>\r\n <li class=\"list-group-item\">2.Your Weight should be : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${healthyWeight}</span>\r\n <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${averageHealthyWeight} <small>(Average)</small></span>\r\n </li>\r\n <li class=\"list-group-item\" id=\"goodWeightDifference\">${weightText}<span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${defferenceWeight}</span>\r\n </li>\r\n <hr>\r\n <h5 class=\"card-header text-weight-bolder text-muted\">Suggetions</h5>\r\n <li class=\"list-group-item\" id=\"tips\">Tips (করনীয়) : <span\r\n class=\" alert responsive d-block font-weight-bolder text-warning text-muted bg-light my-3\"><i\r\n class=\"font-weight-bolder text-muted\">=</i> ${tips}</span>\r\n </li>\r\n </ul>\r\n</h4>\r\n `\r\n //TODO: Button HTML \r\n htmlForButtons = `\r\n <button class=\"btn btn-outline-warning\" type=\"submit\" onclick=\"location.reload();\">Reload</button>\r\n <button class=\"btn btn-outline-success position-relative float-right\" type=\"submit\"\r\n onclick=\"window.print();\">Print/Save</button>`\r\n result.classList.add('d-none');\r\n\r\n //TODO: Add alert with success message when calculate will be finished\r\n errorAlert.style.display = \"none\";\r\n successAlert.style.display = \"block\";\r\n setTimeout(() => {\r\n successAlert.classList.add('hide')\r\n successAlert.style.display = \"none\";\r\n }, 4000);\r\n\r\n //TODO: Show the results according to user need\r\n if (calculateItemChecked === \"bmr\") {\r\n calorieSection.innerHTML = htmlForCalories;\r\n healthSection.innerHTML = \"\";\r\n } else if (calculateItemChecked === \"bmi\") {\r\n healthSection.innerHTML = htmlForBMI;\r\n calorieSection.innerHTML = \"\";\r\n } else if (calculateItemChecked === \"all\") {\r\n healthSection.innerHTML = htmlForBMI;\r\n calorieSection.innerHTML = htmlForCalories;\r\n }\r\n buttons.innerHTML = htmlForButtons;\r\n\r\n //! Show the navigator\r\n let navigator = document.getElementById('navigator');\r\n if (calculateItemChecked === \"all\") {\r\n navigator.style.display = \"block\";\r\n } else {\r\n navigator.style.display = \"none\";\r\n }\r\n } //End of the else statement\r\n}", "getBMInfo() {\n if (this.getBMIRatio() >= 25) {\n return \"Overweight\";\n } else if(this.getBMIRatio() > 18.5){\n return \"Healthy\";\n }else{\n return \"Underweight\";\n }\n }", "calculateByMetric() {\n\t\tthis.height = this.height/100; // convert cm to meter\n const result = (this.weight) / Math.pow(this.height, 2);\n return Math.round(result* 100) / 100;\n }", "calculateCal(){\n let BMR;\n BMR = (66 + (6.3*this.props.user.weight) + (12.9*this.props.user.height) - (6.8 * this.props.user.age))\n return BMR * 1.55;\n }", "function bmi(weight, height) {\n var bmi = weight / (height * height);\n console.log(bmi);\n switch (true) {\n case bmi < 15:\n console.log(\"Anorexic\");\n break;\n case bmi < 17.5 && bmi > 15:\n console.log(\"Starvation\");\n break;\n case bmi > 18.5 && bmi < 25:\n console.log(\"Ideal\");\n break;\n case bmi > 25 && bmi < 30:\n console.log(\"Overweight\");\n break;\n case bmi > 30 && bmi < 40:\n console.log(\"Obese\");\n break;\n case bmi > 40:\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "function determineWeightStatus(BMI){\n if (BMI < 18.5){\n return \"Underweight\";\n } else if (BMI < 25) {\n return \"Healthy Weight\";\n } else if (BMI < 30) {\n return \"Overweight\";\n } else {\n return \"Obese\";\n }\n}", "function bodyMassIndexCalculator(weight,height) {\n\tvar bmi = weight/(Math.pow(height,2));\n\tif (isNaN(bmi)) {\n\t\talert(\"You should type only numbers! (No commas allowed)\")\n\t} else if(bmi < 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are underweight.\");\n\t\t}\n\telse if(bmi < 24.9 && bmi > 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are a normal weight.\");\n\t\t}\t\n\telse if(bmi > 24.9) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are overweight.\");\n\t\t}\n}", "function bmi(hoejde, vaegt) {\n dinBmi = Math.floor((vaegt / (hoejde * hoejde)));\n console.log(\"her er din BMI: \" + dinBmi)\n //document.write(\"her er din BMI: \" + dinBmi);\n document.getElementById('content').innerHTML = '<h2>Her er din BMI: ' +\n dinBmi +\n '</h2>';\n document.getElementById(\"content\").style.backgroundColor = 'blue';\n}", "function interpretBMI(age, z_bmi){\n\n if (age > 1857) { //above 5 years old\n return z_bmi > 2 ? \"Obese\" : z_bmi > 1 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age > 730 && age < 1858){ //ages 2 - 5\n return z_bmi > 3 ? \"Obese\" : z_bmi > 1.35 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age < 731){\n return \"Not for age < 2\"\n }\n \n }", "function BMICalculator(height, weight) {\n // Convert height from cm to m\n height = height/100;\n\n return (weight/(height * height)).toFixed(1);\n}", "function bmi(weight, height) {\n var bmi = weight / (height * height)\n console.log(bmi)\n switch (true) {\n case (bmi < 15):\n console.log(\"Anorexic\");\n break;\n case (bmi < 17.5 && bmi > 15):\n console.log(\"Starvation\");\n break;\n case (bmi > 18.5 && bmi < 25):\n console.log(\"Ideal\");\n break;\n case (bmi > 25 && bmi < 30):\n console.log(\"Overweight\");\n break;\n case (bmi > 30 && bmi < 40):\n console.log(\"Obese\");\n break;\n case (bmi > 40):\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "getLabelFromBMI() {\n let label = ''\n\n if (this.bmi >= 25) {\n label = 'overweight'\n } else if (this.bmi >= 18.5 && this.bmi < 25) {\n label = 'normal'\n } else {\n label = 'underweight'\n }\n\n return label\n }", "function handleUpdateToBmi() {\n let newBMI = weight / (height * height) + ''\n if ((/[.]/).test(newBMI)) {\n try {\n newBMI = newBMI.slice(0, (newBMI.indexOf('.') + 2))\n }catch{\n console.log(\"unable to cut string\")\n }\n }\n updateBmi(newBMI)\n }", "function calculate() {\n\tgetTempBonuses();\n\tgetNumberBoonsValues();\n\tgetRelicBonuses();\n\tgetFatebondBonuses();\n\tgetCoreTraitsValues();\n\tgetAttributesValues();\n\tgetSkillsValues();\n\tgetVirtuesValues();\n\tgetBoonsDiceValues();\n\tgetPresetRolls();\n\tgetAttackBonuses();\n}", "function Person(fullName, mass, height) {\r\n this.fullName = fullName;\r\n this.mass = mass;\r\n this.height = height;\r\n this.calcBMI = function() {\r\n this.bmi = Number(this.mass / this.height ** 2).toFixed(2);\r\n return this.bmi;\r\n };\r\n}", "function determineBMIHealthRisk(bmi) {\n try {\n let risk = \"\";\n if (bmi < 18.4) risk = \"Malnutrition risk\";\n else if (bmi >= 18.5 && bmi < 25) risk = \"Low risk\";\n else if (bmi >= 25 && bmi < 30) risk = \"Enhanced risk\";\n else if (bmi >= 30 && bmi < 35) risk = \"Medium risk\";\n else if (bmi >= 35 && bmi < 40) risk = \"High risk\";\n else if (bmi >= 40) risk = \"Very high risk\";\n return risk;\n } catch (error) {\n Exception.error(\"Error determining BMI.\", error, \"BMIException\");\n }\n}", "function calculateCaloriesFromWeight() {\n var weight = userInfo[\"weight\"];\n var totalCalories = weight * 22;\n return totalCalories;\n}", "function calculateBMR() {\n\n // Sedentary (little or no exercise): BMR x 1.2\n // Lightly active (light exercise/sports 1-3 days/week): BMR x 1.375\n // Moderately active (moderate exercise/sports 3-5 days/week): BMR x 1.55\n // Very active (hard exercise/sports 6-7 days a week): BMR x 1.725\n // Extra active (very hard exercise/sports & physical job or 2x training): BMR x 1.9 \n\n // you can simply add 0.175 to each level to get the next. but if we set this up in the database instead\n // of the actual varchar value of the level we can quickly calculate the BMR\n\n return calculateBEE() * activityLevel;\n}", "function calcBMI(){\r\n //get values from functions page\r\n var weight = document.getElementById('txt_bmiWeight').value;\r\n var height = document.getElementById('txt_bmiHeight').value;\r\n\r\n //Calculate bmi if input fields are valid\r\n var bmi;\r\n if (weight > 0 && weight !== \"\"\r\n && height > 0 && height !== \"\") {\r\n bmi = Math.round((weight * 703) / (height * height));\r\n } else {\r\n alert(\"Please enter a valid number for each text field.\");\r\n clearALL();\r\n }\r\n\r\n //Put BMI value back into form\r\n document.getElementById('txt_bmiCalculated').value = parseInt(bmi);\r\n\r\n //Clear the values in the Weight & Height txt boxes\r\n document.getElementById('txt_bmiWeight').value = null;\r\n document.getElementById('txt_bmiHeight').value = null;\r\n\r\n}", "function calcBMI(){\r\n //get values from functions page\r\n var weight = document.getElementById('txt_bmiWeight').value;\r\n var height = document.getElementById('txt_bmiHeight').value;\r\n\r\n //Calculate bmi if input fields are valid\r\n var bmi;\r\n if (weight > 0 && weight !== \"\"\r\n && height > 0 && height !== \"\") {\r\n bmi = Math.round((weight * 703) / (height * height));\r\n } else {\r\n alert(\"Please enter a valid number for each text field.\");\r\n clearALL();\r\n }\r\n\r\n //Put BMI value back into form\r\n document.getElementById('txt_bmiCalculated').value = parseInt(bmi);\r\n\r\n //Clear the values in the Weight & Height txt boxes\r\n document.getElementById('txt_bmiWeight').value = null;\r\n document.getElementById('txt_bmiHeight').value = null;\r\n\r\n}", "function pesobmi() {\n var altezza = document.getElementById(\"altezza\").value;\n var peso = document.getElementById(\"peso\").value;\n var bmi = peso / ((altezza / 100) * (altezza / 100));\n document.getElementById(\"esitobmi\").innerHTML = \"bmi: \" + bmi;\n}", "calculate() {\n let age = inputsRequired[0].elem.value;\n let height = inputsRequired[1].elem.value;\n let weight = inputsRequired[2].elem.value;\n let neckCircumference = inputsRequired[3].elem.value;\n let waistCircumference = inputsRequired[4].elem.value;\n let hipCircumference = inputsRequired[5].elem?.value;\n \n let person = new Person();\n \n let feetToCMFactor = 30.48; // *\n let poundsToKGFactor = 2.205; // /\n let inchesToCMFactor = 2.54; // *\n \n person.age = age;\n person.height = height;\n person.weight = weight;\n person.neckCircumference = neckCircumference;\n person.waistCircumference = waistCircumference;\n person.hipCircumference = hipCircumference;\n\n if(this.unit === 1) {\n person.height = height * feetToCMFactor;\n person.weight = weight / poundsToKGFactor;\n person.neckCircumference = neckCircumference * inchesToCMFactor;\n person.waistCircumference = waistCircumference * inchesToCMFactor;\n person.hipCircumference = hipCircumference * inchesToCMFactor;\n }\n \n if(this.gender === 'male') {\n person.gender = 0;\n } else if(this.gender === 'female') {\n person.gender = 1;\n }\n \n let bodyMassIndex = person.findBMI();\n let bodyFatPercentage = person.findBodyFatPercentage();\n let dailyCalorieIntake = person.findDailyCalorieIntake();\n let bmr = person.findBMR(dailyCalorieIntake);\n let activityLevelBmr = bmr * activityLevel.find(lvl => lvl.name === this.activityLevelDetails).value;\n \n function valueFromPercentage(v, p) {\n return ((v * p) / 100);\n }\n \n let calorieBasedOnGoal = activityLevelBmr - workoutGoal.find(goal => goal.name === this.workoutGoalChoosen).execute(activityLevelBmr);\n let macroValuesBasedOnGoal = macroForWorkoutGoal.find(goal => goal.name === this.workoutGoalChoosen);\n let carb = Math.round(valueFromPercentage(calorieBasedOnGoal, macroValuesBasedOnGoal.carb)/4);\n let protein = Math.round(valueFromPercentage(calorieBasedOnGoal, macroValuesBasedOnGoal.protein)/4);\n let fat = Math.round(valueFromPercentage(calorieBasedOnGoal, macroValuesBasedOnGoal.fat)/9);\n \n this.renderOutput(\n bodyMassIndex,\n bodyFatPercentage,\n dailyCalorieIntake,\n activityLevelBmr,\n carb,\n protein,\n fat\n );\n }", "weight(e) {\n this.setState({ weight: e.nativeEvent.text }, function () {\n this.bmi();\n });\n }", "handleWeighttChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ weight: processedData })\n this.bmi(this.state.height, processedData);\n }", "function calculator() {\n\n var $chart = $('#chart-processing .chart'); \n $chart.appear();\n initChart($chart);\n if($(\"#material_measurement\").hasClass(\"active\")) {\n age = parseInt($(\"#age\").val());\n height = parseInt($(\"#height\").val());\n weight= parseInt($(\"#weight\").val());\n target_weight = parseInt($(\"#target_weight\").val());\n } else {\n age = parseInt($(\"#imperial_age\").val());\n var ft = parseInt($(\"#ft\").val());\n var inch = parseInt($(\"#inch\").val()) || 0; // It is possible isNaN($(\"#inch\").val());\n height = 30.48*ft + 2.54*inch;\n var imweight = parseInt($(\"#imperial_weight\").val());\n weight = 0.45*imweight;\n var im_ta_weight = parseInt($(\"#imperial_target_weight\").val());\n target_weight = 0.45*im_ta_weight;\n }\n \n // get bmi\n bmi = weight*10000/(height*height);\n bmi = bmi.toFixed(2);\n // end get bmi\n\n // get water\n water = weight*0.03;\n water = water.toFixed(1);\n // end get water\n\n var genders = localStorage.getItem(\"gender\");\n\n if(genders == '1') {\n bmr = (9.99*weight) + (6.25*height - (4.92*age + 5));\n } else {\n bmr = (9.99*weight + (6.25*height - (4.92*age) - 161));\n }\n\n if(physical == \"1\"){\n bmr = bmr*1.2-500;\n metabolicAge += 3;\n }\n if(physical == \"2\"){\n bmr = bmr*1.375-500;\n metabolicAge += 2;\n }\n if(physical == \"3\"){\n bmr = bmr*1.55-500;\n }\n if(physical == \"4\"){\n bmr = bmr*1.725-500;\n metabolicAge -= 2;\n }\n if(physical == \"5\"){\n bmr = bmr*1.9-500;\n metabolicAge -= 3;\n }\n\n // get Caloires\n bmr = (bmr).toFixed(0);\n localStorage.setItem(\"cal\", bmr);\n // end get Calories\n\n // get metabolic Age\n metabolicAge = metabolicAge + briefing + age;\n // end get metabolic Age\n\n bmr = (bmr-50).toString() +\"~\"+ (+bmr+50).toString();\n target_weight = weight - 4;\n\n profile.push(bmr, water, metabolicAge, weight, target_weight, bmi);\n profile = profile.toString();\n localStorage.setItem(\"profile\", profile);\n\n //save material in localstorage\n var meats = localStorage.getItem(\"meat\");\n meats = meats.split(',');\n var vegetables = localStorage.getItem(\"veggies\");\n vegetables = vegetables.split(',');\n var products = localStorage.getItem(\"products\");\n products = products.split(',');\n var material = meats.concat(vegetables, products);\n material = material.toString();\n localStorage.setItem(\"material\", material);\n localStorage.removeItem(\"meat\");\n localStorage.removeItem(\"veggies\");\n localStorage.removeItem(\"products\");\n // end save material in localstorage\n}", "calculateByEnglish() {\n const result = ((this.weight) / Math.pow((this.height * 12), 2)) * 703.0704;\n return Math.round(result* 100) / 100;\n }", "function calculate() {\n if (validateInputs()) {\n if ($age.val() > 110) {\n $calcResultsBox.removeClass(\"hidden\").html(\"<span style='color:red'>Invalid Age</span>\");\n } else if (($weight.val() > 600 && imperial) || ($weight.val() > 270 && !imperial)) {\n $calcResultsBox.removeClass(\"hidden\").html(\"<span style='color:red'>Invalid Weight</span>\");\n } else if (imperial) { // calculation if imperial units\n if ($heightInputIn.val() > 12) {\n inchesConvert();\n }\n var BMR = Math.round(calculateBMR());\n var TDEE = Math.round(calculateBMR() * 1.2);\n var BMI = calculateBMI();\n $calcResultsBox.removeClass(\"hidden\").html(\n \"To lose \" + $slider.slider(\"value\") + \" lb per week, you would need to eat \" + Math.round((TDEE - 500 * $slider.slider(\"value\"))) + \"* kcal per day (not including exercise).<br/><br/>BMR: \" + BMR + \" kcal<br/>TDEE: \" + TDEE + \" kcal<br/>BMI: \" + BMI + \"</td><br/><br/>* Eating less than 1200 kcal daily is not recommended.\");\n } else {\n // calculation if metric units\n var BMR = Math.round(calculateBMR());\n var TDEE = Math.round(calculateBMR() * 1.2);\n var BMI = calculateBMI();\n $calcResultsBox.removeClass(\"hidden\").html(\n \"To lose \" + $slider.slider(\"value\") + \" kg per week, you would need to eat \" + Math.round((TDEE - 1102 * $slider.slider(\"value\"))) + \"* kcal per day (not including exercise).<br/><br/>BMR: \" + BMR + \" kcal<br/>TDEE: \" + TDEE + \" kcal<br/>BMI: \" + BMI + \"</td><br/><br/>* Eating less than 1200 kcal daily is not recommended.\");\n }\n } else\n $calcResultsBox.removeClass(\"hidden\").html(\"<span style='color:red'>Please fill in all fields.</span>\");\n }", "function bodyMassIndex(weight,height) {\n\tvar bmi = weight/(Math.pow(height,2));\n\tif (isNaN(bmi)) {\n\t\talert(\"You should type only numbers! (No commas allowed)\")\n\t} else {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \".\");\n\t\t}\t\n}", "function calsPerDay() {\n function find(id) { return document.getElementById(id) }\n\n var age = Number(find(\"age\").value)\n var height = (find(\"heightFt\").value * 30.48) +(find(\"heightIn\").value *2.54);\n var weight = find(\"weight\").value * .45359237\n var bmr=0\n var result = 0\n\n console.log(height);\n console.log(weight);\n console.log(age);\n\n if (find(\"male\").checked) {\n console.log(\"inside check male\")\n bmr = (10*weight) + (6.25*height) - (5*age) + 5\n }\n \n else if (find(\"female\").checked) {\n bmr = (10*weight) + (6.25*height) - (5*age) - 161\n }\n find(\"bmr\").innerHTML = Math.round( bmr ) \n console.log(bmr);\n\n if (find(\"sedentary\").checked) {\n result=(bmr*1.2);\n }\n \n if (find(\"light\").checked) {\n result=(bmr*1.37);\n }\n \n if (find(\"moderate\").checked) {\n result=(bmr*1.55);\n }\n \n if (find(\"heavy\").checked) {\n result=(bmr*1.72);\n }\n\n console.log(result);\n find(\"totalCals\").innerHTML=+Math.round(result)\n\n}", "function fnImc(){//peso entre la altura al cuadrado\n var wheight = $('#doubWeight').val();\n var height = $('#doubHeight').val();\n var imc = wheight / Math.pow(height,2);\n $(\"#doubTotal\").val(imc);\n }", "function calculateBEE() {\n BEE = 0;\n if (gender == 'Female') { //case sensitive\n return BEE = (655 + (4.35 * weight) + (4.7 * height) - (4.7 * age));\n\n }\n else if (gender == 'Male') {//case sensitive\n return BEE = (66 + (6.23 * weight) + (12.7 * height) - (6.8 * age));\n //This is why we can not account for 'other'\n }\n}", "handleSubmit(event) { \n // console.log(this.state);\n let hinMeters;\n let winKg;\n let bmiCat;\n if(this.state.isCm)\n hinMeters = 0.01* this.state.height;\n else{\n console.log(this.state.height + this.state.height_in);\n hinMeters = 0.01*(this.state.height + this.state.height_in)*2.54; \n }\n \n if(this.state.isKg)\n winKg = this.state.weight;\n else\n winKg = this.state.weight*0.453592;\n event.preventDefault();\n console.log('hinm',hinMeters);\n // console.log('winK',winKg);\n let bMi = (winKg/(hinMeters*hinMeters)).toFixed(2);\n console.log(this.u_cat,this.h_cat,this.ov_cat);\n if(bMi<parseFloat(this.u_cat))\n bmiCat='Underweight';\n else if(bMi>=parseFloat(this.u_cat) && bMi<parseFloat(this.h_cat))\n bmiCat='Healthy';\n else if(bMi>=parseFloat(this.h_cat) && bMi<parseFloat(this.ov_cat))\n bmiCat='Overweight';\n else\n bmiCat='Obese';\n this.setState({'bmi':bMi,'cat':bmiCat});\n this.showModal();\n \n }", "function calcDamage(){\n if (flankFlag == true)\n {\n return Math.floor((cannonPB.value / 12.0) * 150);\n }\n else {\n return Math.floor((cannonPB.value / 12.0) * 75);\n }\n}", "calcinterest() {\n return (this.balance * this.int_rate);\n }", "get Weight()\n {\n return fnCalcWeight(this.Shaft, this.Length);\n }", "function myheight(e){\r\n if(inputh.value<0 || inputh.value.length>4){\r\n alert(\"you have entered wrong value or enter two decimal point or enter all the fields\");\r\n inputh.value=\"\";\r\n }\r\n else if(exp.test(inputh.value) && event.key==\"Enter\"){\r\n inputHeight=inputh.value;\r\n BMI=inputWeight / (inputHeight ** 2);\r\n let heading=document.querySelector('.heading');\r\n const todayBmi = BMI.toFixed(2);\r\n heading.innerHTML=todayBmi;\r\n valueBmi.push(todayBmi);\r\n valueWeight.push(inputWeight);\r\n function ishealthy(){\r\n if(todayBmi>=30){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Obese : (\";\r\n }\r\n else if(todayBmi>25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Overweight : (\";\r\n }\r\n else if(todayBmi<19){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Underweight : (\";\r\n }\r\n else if(todayBmi>=19 || valueBmi<=25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Normal weight : )\";\r\n }\r\n }\r\n ishealthy();\r\n \r\n \r\n //local storage save function\r\n saveFunc= () =>{\r\n localStorage.setItem('valueOfWeight',JSON.stringify(valueWeight));\r\n localStorage.setItem('values',JSON.stringify(valueBmi));\r\n }\r\n }\r\n }", "function calculate(){\n\n \tvar\twtkg = document.getElementById('wtDrop').selectedIndex +1;\n \tvar wtlb = document.getElementById('wtDropLbs').selectedIndex;\n \tvar chk = document.getElementById('wtChk');\n \tvar weight;\n\n\n \t//checks which unit has been inputed by user then converts lbs to kg\n \tif(chk.checked == true){\n \t\tweight = wtkg.toFixed();\n \t}else if(chk.checked == false){\n \t\tweight = (wtlb*0.453592).toFixed();\n \t}\n\n \t//height function to check which height is used\n\n \tvar htf = document.getElementById('htDropF').selectedIndex -1;\n \tconsole.log(htf);\n \tvar hti = document.getElementById('htDropF2').selectedIndex-1;\n \tvar htC = (htf * 30.48) + (hti *2.54);\n \t\n\n \tvar htm = document.getElementById('htDropM').selectedIndex -1;\n \tvar htChk = document.getElementById('htChk');\n \t\n\n \tvar height;\n\n \tif(htChk.checked == true && hti >= 0){\n \t\theight = htC;\n \t}else if(htChk.checked == false){\n \t\theight = htm;\n \t}\n\n \t//gender\n \tvar r1 = document.getElementById('mRad');\n \tvar r2 = document.getElementById('fRad');\n \tvar gender;\n \tif(r1.checked == true){\n \t\tgender = 1.23;\n \t}else if(r2.checked == true){\n \t\tgender = 1.04;\n \t}\n \t\n \t//calculate height over 5 foot, IBW and ABW\n \tvar inchover5 = (height - 152.4)/2.54;\n \tvar mIBW = (inchover5 * 2.3) + 50;\n\tvar fIBW = (inchover5 * 2.3) + 45.5;\n\tvar mABW = mIBW + 0.4 * (weight - mIBW);\n\tvar fABW = fIBW + 0.4 * (weight - fIBW);\n\n\tvar modalWt = document.getElementById('modalWt');\n\tvar modalIBW = document.getElementById('modalIBW'); \n\tvar modalABW = document.getElementById('modalABW');\n\n\n\tif(gender == 1.23){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = mIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = mABW.toFixed(1) + \"kg\";\n\t}else if(gender == 1.04){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = fIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = fABW.toFixed(1) + \"kg\";\n\n\t}\n\n\n\n\t//age and creatinine\n \tvar age = document.getElementById('ageDrop').selectedIndex -1;\n \tvar srcr = document.getElementById('creatDrop').selectedIndex -1;\n \tvar wtType = document.getElementById('wtType');\n\n \tvar CRCLAnswer = document.getElementById('ansDisplay');\n \tvar crcl = 0;\n \tif(gender == 1.23 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * mABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\n\t} else if(gender == 1.23 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender)/srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t\t\n\t} else if(gender == 1.04 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * fABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\t\t\t\n\t} else if(gender == 1.04 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t}\n\n\n\t//displays answer jumbo if criteria matches\n\tif(weight >= 30 && inchover5 >= 0 && age >= 18 && srcr > 1 && gender > 1){\n\t\tconsole.log(\"criteria matches\");\n\t\tdocument.getElementById('ansJumbo').style.display = \"block\";\n\t\tdocument.getElementById('inputForm').style.display = \"none\";\n\t\tvar title = document.getElementById('title');\n\t\ttitle.innerHTML = \"Creatinine Clearance\"\n\t\ttitle.style.marginLeft = \"50px\";\n\t\tdocument.getElementById('backBtn').style.display = \"block\";\n\t\t\n\n\t}\n \tconsole.log(\"\\nweight: \" + weight + \"\\nHeight: \" + height +\"\\ninches over 5 foot: \" + inchover5 + \" \\nage: \" + age + \"\\nsrcr: \" + srcr + \" \\ngender: \" + gender);\n \treturn crcl;\n}", "function onType() {\n let weight = document.querySelectorAll(\".bmi .calc input\")[0].value;\n let height = document.querySelectorAll(\".bmi .calc input\")[1].value;\n if (weight != \"\" && height != \"\") {\n // document.querySelector(\".bmi .ans\").style.display = \"flex\";\n document.querySelector(\".bmi .ans\").innerHTML = (Number(weight) / (Math.pow(Number(height), 2))).toFixed(1);\n }\n else {\n document.querySelector(\".bmi .ans\").innerHTML = \"הכניסו נתונים\";\n }\n}", "function determineBMICategory(bmi) {\n let category = \"\";\n if (bmi < 18.4) category = \"Underweight\";\n else if (bmi >= 18.5 && bmi < 25) category = \"Normal weight\";\n else if (bmi >= 25 && bmi < 30) category = \"Overweight\";\n else if (bmi >= 30 && bmi < 35) category = \"Moderately obese\";\n else if (bmi >= 35 && bmi < 40) category = \"Severely obese\";\n else if (bmi >= 40) category = \"Very severely obese\";\n return category;\n}", "function displayresult(percentile_bmi, percentile_wt, percentile_ht, z_bmi, z_wt, z_ht, interpret_bmi, weightrange) {\n\n var theAge = calculateAge()[0];\n var bmiNumber = getBMI().toFixed(1);\n var weight = getWeight();\n var height = getHeight();\n\n if (theAge < 6971){ //if 19 or younger\n var ordinal_BMI = Number.getOrdinalFor((percentile_bmi * 100).toFixed(0), true);\n var ordinal_wt = Number.getOrdinalFor((percentile_wt * 100).toFixed(0), true);\n var ordinal_ht = Number.getOrdinalFor((percentile_ht * 100).toFixed(0), true);\n document.getElementById(\"result-age\").innerHTML = calculateAge(0)[1];\n //show the results in the result boxes, and grey out options where not relevant\n weight > 0 && height > 0 ? (document.getElementById(\"result-bminumber\").innerHTML = bmiNumber, document.getElementById(\"result-bminumber\").style.opacity = \"1\") : (document.getElementById(\"result-bminumber\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-bminumber\").style.opacity = \"0.4\");\n weight > 0 && height > 0 ? (document.getElementById(\"result-bmi\").innerHTML = ordinal_BMI + \" (Z-score: \" + z_bmi.toFixed(1) + \")\", document.getElementById(\"result-bmi\").style.opacity = \"1\") : (document.getElementById(\"result-bmi\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-bmi\").style.opacity = \"0.4\");\n weight > 0 && height > 0 ? (document.getElementById(\"result-it\").innerHTML = interpret_bmi, document.getElementById(\"result-it\").style.opacity = \"1\") : (document.getElementById(\"result-it\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-it\").style.opacity = \"0.4\");\n weight > 0 ? (document.getElementById(\"result-wt\").innerHTML = ordinal_wt + \" (Z-score: \" + z_wt.toFixed(1) + \")\", document.getElementById(\"result-wt\").style.opacity = \"1\") : (document.getElementById(\"result-wt\").innerHTML = \"Enter Weight\", document.getElementById(\"result-wt\").style.opacity = \"0.4\");\n height > 0 ? (document.getElementById(\"result-ht\").innerHTML = ordinal_ht + \" (Z-score: \" + z_ht.toFixed(1) + \")\", document.getElementById(\"result-ht\").style.opacity = \"1\") : (document.getElementById(\"result-ht\").innerHTML = \"Enter Height\", document.getElementById(\"result-ht\").style.opacity = \"0.4\");\n weight > 0 ? (document.getElementById(\"result-wr\").innerHTML = weightrange, document.getElementById(\"result-wr\").style.opacity = \"1\") : (document.getElementById(\"result-wr\").innerHTML = \"Enter Weight\", document.getElementById(\"result-wr\").style.opacity = \"0.4\");\n\n } else { //if an adult then just show BMI\n document.getElementById(\"result-age\").innerHTML = calculateAge(0)[1];\n document.getElementById(\"result-bmi\").innerHTML = \"for age <20\";\n weight > 0 && height > 0 ? (document.getElementById(\"result-bminumber\").innerHTML = bmiNumber, document.getElementById(\"result-bminumber\").style.opacity = \"1\") : (document.getElementById(\"result-bminumber\").innerHTML = \"Enter Weight & Height\", document.getElementById(\"result-bminumber\").style.opacity = \"0.4\");\n document.getElementById(\"result-wt\").innerHTML = ordinal_wt = \"for age <20\";\n document.getElementById(\"result-ht\").innerHTML = ordinal_ht = \"for age <20\";\n document.getElementById(\"result-it\").innerHTML = \"for age <20\";\n document.getElementById(\"result-wr\").innerHTML = \"for age < 20\";\n document.getElementById(\"result-bmi\").style.opacity = \"0.4\"\n document.getElementById(\"result-wt\").style.opacity = \"0.4\"\n document.getElementById(\"result-ht\").style.opacity = \"0.4\"\n document.getElementById(\"result-it\").style.opacity = \"0.4\"\n document.getElementById(\"result-it\").style.opacity = \"0.4\"\n document.getElementById(\"result-wr\").style.opacity = \"0.4\"\n }\n}", "determineBMICategory(latestBmi){\n\n if(latestBmi < 16 ){\n return \"SEVERELY UNDERWEIGHT\";\n }\n else if(latestBmi >= 16 && latestBmi < 18.5){\n return \"UNDERWEIGHT\";\n }\n else if(latestBmi >= 18.5 && latestBmi < 25) {\n return \"NORMAL\";\n }\n else if(latestBmi >= 25 && latestBmi < 30) {\n return \"OVERWEIGHT\";\n }\n else if(latestBmi >= 30 && latestBmi < 35) {\n return \"MODERATELY OBESE\";\n }\n else if(latestBmi >= 35) {\n return \"SEVERELY OBESE\";\n }\n\n return \"No value for BMI\";\n }", "handleHeightChange(event) {\n let processedData = event.nativeEvent.text;\n this.setState({ height: processedData })\n this.bmi(processedData, this.state.weight);\n }", "function getFatMass() {\n var fm;\n if (isMale()) {\n fm = 0.988 * getBMI() + 0.242 * w + 0.094 * a - 30.18;\n } else {\n fm = 0.988 * getBMI() + 0.344 * w + 0.094 * a - 30.18;\n }\n return fm;\n }", "function totHeight(){\n var a = document.getElementById(\"inches2\").value;\n var b = document.getElementById(\"feets2\").value;\n return (a*b*2.54);\n \n}", "function desirableWeight() {\n var desirableWeight = userInfo[\"desirable-weight\"];\n var weight = userInfo[\"weight\"];\n var step1 = weight - desirableWeight;\n var step2 = step1 * 0.32;\n var DW = step2 + desirableWeight;\n return DW;\n}", "function calculateWeightsAndValues(value, weight){\r\n return(value * weight)\r\n}", "function beeStingsNeeded(victimWeight)\n{\n var totalStings = 8.666666667 * victimWeight; // This is the code that will run in the function.\n\n return totalStings; // This is the code to return the total number of bee stings to the function.\n}", "function getBoonsDiceValues() {\n\teffectiveAnimalDice = 0 + nanEqualsZero(myRelicBonusDice.animal) + nanEqualsZero(myFatebonds.animal) + nanEqualsZero(myTempDice.animal);\n\teffectiveChaosDice = 0 + nanEqualsZero(myRelicBonusDice.chaos) + nanEqualsZero(myFatebonds.chaos) + nanEqualsZero(myTempDice.chaos);\n\teffectiveCreationDice = 0 + nanEqualsZero(myRelicBonusDice.creation) + nanEqualsZero(myFatebonds.creation) + nanEqualsZero(myTempDice.creation);\n\teffectiveDarknessDice = 0 + nanEqualsZero(myRelicBonusDice.darkness) + nanEqualsZero(myFatebonds.darkness) + nanEqualsZero(myTempDice.darkness);\n\teffectiveDeathDice = 0 + nanEqualsZero(myRelicBonusDice.death) + nanEqualsZero(myFatebonds.death) + nanEqualsZero(myTempDice.death);\n\teffectiveEarthDice = 0 + nanEqualsZero(myRelicBonusDice.earth) + nanEqualsZero(myFatebonds.earth) + nanEqualsZero(myTempDice.earth);\n\teffectiveFertilityDice = 0 + nanEqualsZero(myRelicBonusDice.fertility) + nanEqualsZero(myFatebonds.fertility) + nanEqualsZero(myTempDice.fertility);\n\teffectiveFireDice = 0 + nanEqualsZero(myRelicBonusDice.fire) + nanEqualsZero(myFatebonds.fire) + nanEqualsZero(myTempDice.fire);\n\teffectiveFrostDice = 0 + nanEqualsZero(myRelicBonusDice.frost) + nanEqualsZero(myFatebonds.frost) + nanEqualsZero(myTempDice.frost);\n\teffectiveGuardianDice = 0 + nanEqualsZero(myRelicBonusDice.guardian) + nanEqualsZero(myFatebonds.guardian) + nanEqualsZero(myTempDice.guardian);\n\teffectiveHealthDice = 0 + nanEqualsZero(myRelicBonusDice.health) + nanEqualsZero(myFatebonds.health) + nanEqualsZero(myTempDice.health);\n\teffectiveIllusionDice = 0 + nanEqualsZero(myRelicBonusDice.illusion) + nanEqualsZero(myFatebonds.illusion) + nanEqualsZero(myTempDice.illusion);\n\teffectiveJusticeDice = 0 + nanEqualsZero(myRelicBonusDice.justice) + nanEqualsZero(myFatebonds.justice) + nanEqualsZero(myTempDice.justice);\n\teffectiveMagicDice = 0 + nanEqualsZero(myRelicBonusDice.magic) + nanEqualsZero(myFatebonds.magic) + nanEqualsZero(myTempDice.magic);\n\teffectiveMoonDice = 0 + nanEqualsZero(myRelicBonusDice.moon) + nanEqualsZero(myFatebonds.moon) + nanEqualsZero(myTempDice.moon);\n\teffectiveMysteryDice = 0 + nanEqualsZero(myRelicBonusDice.mystery) + nanEqualsZero(myFatebonds.mystery) + nanEqualsZero(myTempDice.mystery);\n\teffectiveProphecyDice = 0 + nanEqualsZero(myRelicBonusDice.prophecy) + nanEqualsZero(myFatebonds.prophecy) + nanEqualsZero(myTempDice.prophecy);\n\teffectivePsychopompDice = 0 + nanEqualsZero(myRelicBonusDice.psychopomp) + nanEqualsZero(myFatebonds.psychopomp) + nanEqualsZero(myTempDice.psychopomp);\n\teffectiveSkyDice = 0 + nanEqualsZero(myRelicBonusDice.sky) + nanEqualsZero(myFatebonds.sky) + nanEqualsZero(myTempDice.sky);\n\teffectiveStarDice = 0 + nanEqualsZero(myRelicBonusDice.star) + nanEqualsZero(myFatebonds.star) + nanEqualsZero(myTempDice.star);\n\teffectiveSunDice = 0 + nanEqualsZero(myRelicBonusDice.sun) + nanEqualsZero(myFatebonds.sun) + nanEqualsZero(myTempDice.sun);\n\teffectiveThunderDice = 0 + nanEqualsZero(myRelicBonusDice.thunder) + nanEqualsZero(myFatebonds.thunder) + nanEqualsZero(myTempDice.thunder);\n\teffectiveWarDice = 0 + nanEqualsZero(myRelicBonusDice.war) + nanEqualsZero(myFatebonds.war) + nanEqualsZero(myTempDice.war);\n\teffectiveWaterDice = 0 + nanEqualsZero(myRelicBonusDice.water) + nanEqualsZero(myFatebonds.water) + nanEqualsZero(myTempDice.water);\n\n\teffectiveAnimalSucc = nanEqualsZero(myTempSucc.animal);\n\teffectiveChaosSucc = nanEqualsZero(myTempSucc.chaos);\n\teffectiveCreationSucc = nanEqualsZero(myTempSucc.creation);\n\teffectiveDarknessSucc = nanEqualsZero(myTempSucc.darkness);\n\teffectiveDeathSucc = nanEqualsZero(myTempSucc.death);\n\teffectiveEarthSucc = nanEqualsZero(myTempSucc.earth);\n\teffectiveFertilitySucc = nanEqualsZero(myTempSucc.fertility);\n\teffectiveFireSucc = nanEqualsZero(myTempSucc.fire);\n\teffectiveFrostSucc = nanEqualsZero(myTempSucc.frost);\n\teffectiveGuardianSucc = nanEqualsZero(myTempSucc.guardian);\n\teffectiveHealthSucc = nanEqualsZero(myTempSucc.health);\n\teffectiveIllusionSucc = nanEqualsZero(myTempSucc.illusion);\n\teffectiveJusticeSucc = nanEqualsZero(myTempSucc.justice);\n\teffectiveMagicSucc = nanEqualsZero(myTempSucc.magic);\n\teffectiveMoonSucc = nanEqualsZero(myTempSucc.moon);\n\teffectiveMysterySucc = nanEqualsZero(myTempSucc.mystery);\n\teffectiveProphecySucc = nanEqualsZero(myTempSucc.prophecy);\n\teffectivePsychopompSucc = nanEqualsZero(myTempSucc.psychopomp);\n\teffectiveSkySucc = nanEqualsZero(myTempSucc.sky);\n\teffectiveStarSucc = nanEqualsZero(myTempSucc.star);\n\teffectiveSunSucc = nanEqualsZero(myTempSucc.sun);\n\teffectiveThunderSucc = nanEqualsZero(myTempSucc.thunder);\n\teffectiveWarSucc = nanEqualsZero(myTempSucc.war);\n\teffectiveWaterSucc = nanEqualsZero(myTempSucc.water);\n}", "function setBMI() {\n document.querySelectorAll(\".bmi .calc input\")[0].addEventListener(\"input\", onType);\n document.querySelectorAll(\".bmi .calc input\")[1].addEventListener(\"input\", onType);\n}", "function calculateBolus(bs, carbs, protein, active, activity) {\n var bolusObj = {\n bolus: 0,\n correction: 0,\n active: 0,\n basalOffset: 0,\n total: 0,\n lowFlag: false,\n lowBs: 0,\n carbCorrection: 0,\n time: 0\n };\n bolusObj.bolus = carbs / stats.ic + protein / stats.ip;\n // modifier accounting for dehydration due to high blood sugar\n var hyperMod = 1;\n if (bs >= 130) {\n hyperMod = bs * .0015 + .806151;\n }\n bolusObj.correction = (bs - 90) / stats.cf * hyperMod;\n bolusObj.active = active;\n\n // calc basal offset \n // 12am 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12am 1 2 3\n var rates = [.9916, .9916, 1.0846, 1.1001, 1.1466, 1.1776, 1.224, 1.255, 1.2395, 1.1931, 1.1311, 1.0691, .9452, .8677, .8367, .8367, .8367, .8212, .8212, .8367, .8677, .8677, .9142, .9452, .9916, .9916, 1.0846, 1.1001];\n var time = new Date();\n var hour = time.getHours();\n if (time.getMinutes() > 30) {\n hour++;\n }\n console.log(\"current hour: \" + hour);\n var offset = 0;\n for (let i = 0; i < 4; i++) {\n console.log(hour);\n offset += rates[hour] - 1;\n console.log(offset)\n hour++;\n }\n console.log(\"hourly offset: \" + offset);\n bolusObj.basalOffset = parseFloat(stats.weight * 0.453592 * stats.sensCo / 2) / 24 * offset;\n console.log(\"basal offset: \" + bolusObj.basalOffset.toFixed(4));\n\n // calc total bolus\n bolusObj.total = Math.round((bolusObj.bolus + bolusObj.correction - bolusObj.active / activity) * activity + bolusObj.basalOffset);\n\n // check if lowblood sugar is predicted\n if (bolusObj.total < 0) {\n var low = 90 + bolusObj.total * stats.cf;\n if (low < 80) {\n bolusObj.lowFlag = true;\n bolusObj.lowBs = low;\n bolusObj.carbCorrection = (90 - low) / stats.raise;\n }\n }\n // calculate dosage time\n let desiredActive = 1 - (bolusObj.correction * activity) / (bolusObj.total + bolusObj.active);\n let increment = desiredActive <= 1 ? 5 / 60 : -5 / 60;\n bolusObj.time = findTime(desiredActive, increment, 0, null);\n return bolusObj;\n}", "function getBodyweight() {\n\t\t\t\tbodyweight.getBodyweight().then(function(result) {\n\t\t\t\t\tvm.exerciseBodyweight = result;\n\t\t\t\t\tconsole.log(vm.exerciseBodyweight);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "function CalcWeight()\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(\"gear\").rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[\"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(\"bagWeight\").innerHTML = total.toFixed(1);\n\n // Add the armor weight.\n for ( var i = 1; i <= 4; i++ )\n {\n // If the armor is flagged as not carried, then don't add it to the weight.\n if ( !sheet()[\"Armor\" + i + \"Carried\"].checked )\n continue;\n\n var num = parseFloat(sheet()[\"Armor\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n // Add the weapon weight\n for ( var i = 1; i <= 4; i++ )\n {\n if ( sheet()[ \"Weapon\" + i + \"Carried\" ].checked )\n {\n var num = parseFloat(sheet()[\"Weapon\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n }\n\n sheet().TotalWeight.value = total.toFixed(1);\n\n // Check to see if the character is encumbered. If so, then set the background\n // color of \"Total Weight\", Speed, and DexMod input fields to red.\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().LightLoad.value ) )\n {\n debug.trace(\"Character is encumbered.\");\n var maxDexMod = 99;\n\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().MediumLoad.value ) )\n {\n maxDexMod = 1;\n sheet().TotalWeight.title = \"Check penalty of -6 while encumbered\";\n }\n else\n {\n maxDexMod = 3;\n sheet().TotalWeight.title = \"Check penalty of -3 while encumbered\";\n }\n\n debug.trace(\"MaxDexMod = \" + maxDexMod + \" DexMod = \" + Clean( sheet().DexMod.value ) );\n if ( Clean( sheet().DexMod.value ) > maxDexMod )\n {\n sheet().DexMod.title = \"Max dex bonus to AC is +\" + maxDexMod + \" while encumbered.\";\n sheet().DexMod.style.color = \"white\";\n sheet().DexMod.style.backgroundColor = \"red\";\n }\n else\n {\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n }\n\n sheet().TotalWeight.style.color = \"white\";\n sheet().TotalWeight.style.backgroundColor = \"red\";\n\n sheet().Speed.title = \"Max speed is reduced by roughly 1/3 due to encumbrance\";\n sheet().Speed.style.color = \"white\";\n sheet().Speed.style.backgroundColor = \"red\";\n\n ACCheckMaxDex(); // Check if the dex bonus to AC should be reduced.\n }\n else\n {\n sheet().TotalWeight.title = sheet().TotalWeight.value;\n sheet().TotalWeight.style.color = \"black\";\n sheet().TotalWeight.style.backgroundColor = \"white\";\n\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n\n sheet().Speed.title = sheet().Speed.value;\n sheet().Speed.style.color = \"black\";\n sheet().Speed.style.backgroundColor = \"white\";\n }\n\n\n SkillsUpdateCheckPen();\n\n debug.trace(\"Calculated total weight.\");\n}", "function getDescription(thisBMI) {\n if (thisBMI < 18.5)\n return thisBMI + \" - BAJO PESO - Es conveniente que hagas una consulta con un Nutricionista para alcanzar un peso saludable comiendo en calidad o que se evalúe si sos delgado/a por cuestiones genéticas.\";\n else if (thisBMI >= 18.5 && thisBMI <= 24.99)\n return thisBMI + \" - Tu peso es adecuado para tu altura. De todas formas, es necesario realizar comidas sanas para prevenir enfermedades y tener una buena calidad de vida.\";\n else if (thisBMI >= 25 && thisBMI <= 29.99)\n return thisBMI + \" - SOBREPESO - Es necesario realizar una consulta médica y nutricional para lograr descender unos kilogramos y mantener una buena calidad de vida. Existe también la posibilidad (si sos deportista) que esté aumentada tu masa muscular y por lo tanto sea algo saludable.\";\n else if (thisBMI >= 30 && thisBMI <= 39.99)\n return thisBMI + \" - OBESIDAD - Es necesario realizar una consulta médica - nutricional y comenzar un tratamiento de descenso de peso.\";\n else return \"Por favor, ingrese los valores correctamente :)\";\n}", "function calculateHeight(response) {\n\tvar height;\n\ttemperature = Math.round(response.current_observation.temp_f);\n\t \n\tif (temperature == 0) {\n\t\theight = 50;\n\t\treturn height;\n\t} else if (temperature > 0) {\n\t\theight = temperature * 2 + 50;\n\t\treturn height;\n\t} else {\n\t\theight = 50 + temperature * 2;\n\t\treturn height;\n\t}\n}", "height(e) {\n this.setState({ height: e.nativeEvent.text }, function () {\n this.bmi();\n });\n\n }", "function calculateResults() {\n //UI vars\n const height = document.querySelector('#height').value;\n const weight = document.querySelector('#weight').value;\n const age = document.querySelector('#age').value;\n const sex = document.querySelector('#sex').value;\n const activity = document.querySelector('#activity').value;\n\n //Output vars\n const dailyCalorieRequirements = document.querySelector('#dailyCalorie');\n const daliyProteinIntake = document.querySelector('#dailyProtein');\n const dailyCarbsIntake = document.querySelector('#dailyCarbs');\n const dailyFatIntake = document.querySelector('#dailyFat');\n\n //calculating basal metabolic rate\n const bmr = ((10 * weight) + (6.25 * height) - (5 * age)) + parseFloat(sex);\n \n if (isFinite(bmr)) {\n let dailyCalorie = bmr * parseFloat(activity);\n dailyCalorieRequirements.value = Math.round(dailyCalorie);\n daliyProteinIntake.value = getAmountOfMacronutrient(dailyCalorieRequirements.value, 25, 'p');\n dailyCarbsIntake.value = getAmountOfMacronutrient(dailyCalorieRequirements.value, 35, 'c');\n dailyFatIntake.value = getAmountOfMacronutrient(dailyCalorieRequirements.value, 40, 'f');\n displayResults();\n hideLoading();\n displayMacrosRatioChart();\n } else {\n showError('Please check your numbers');\n }\n}", "function beeStung(weight) {\n \n //calculate for bee stings\n var stings=8.666666667*weight\n \n //Return number of Bee stings\n return stings;\n}", "function calculateBonus() {\n return arguments[1] ? arguments[0] / 2 : 0;\n}", "function calculateBonus() {\n return arguments[1] ? arguments[0] / 2 : 0;\n}", "function calculateValues(age,weight){\n\t\tdocument.getElementById('headerAge').innerHTML = age + \" yrs\";\n\t\tdocument.getElementById('headerWt').innerHTML = weight + \" kg\";\n\t\t//Adenosine\n\t\t//first dose - dose\n\t\t\tvar adenosineDose1\n\t\t\tadenosineDose1 = 0.1 * weight;\n\t\t\tif (adenosineDose1>6){adenosineDose1 = 6;}\n\t\t\tadenosineDose1 = Number(adenosineDose1.toFixed(2));\n\n\t\t//first dose - volume\n\t\t\tvar adenosineVol1\n\t\t\tadenosineVol1 = adenosineDose1 / 3;\n\t\t\tadenosineVol1 = Number(adenosineVol1.toFixed(2));\n\t\t\tdocument.getElementById('adenosineDoseA').innerHTML = adenosineDose1 + \" mg\";\n\t\t\tdocument.getElementById('adenosineVolA').innerHTML = adenosineVol1 + \" mL\";\n\t\t\tdocument.getElementById('adenosineDoseAt').innerHTML = adenosineDose1 + \" mg\";\n\t\t\tdocument.getElementById('adenosineVolAt').innerHTML = adenosineVol1 + \" mL\";\n\t\t\t\n\t\t//second dose - dose\n\t\tvar adenosineDose2\n\t\tadenosineDose2 = 0.2 * weight;\n\t\tif (adenosineDose2>12){adenosineDose2 = 12;}\n\t\t\n\t\tadenosineDose2 = Number(adenosineDose2.toFixed(2));\n\n\t\t//second dose - volume\n\t\tvar adenosineVol2\n\t\tadenosineVol2 = adenosineDose2 / 3;\n\t\tadenosineVol2 = Number(adenosineVol2.toFixed(2));\n\t\tdocument.getElementById('adenosineDoseB').innerHTML = adenosineDose2 + \" mg\";\n\t\tdocument.getElementById('adenosineVolB').innerHTML = adenosineVol2 + \" mL\";\n\t\tdocument.getElementById('adenosineDoseBt').innerHTML = adenosineDose2 + \" mg\";\n\t\tdocument.getElementById('adenosineVolBt').innerHTML = adenosineVol2 + \" mL\";\n\t\tconsole.log(\"end\");\n\n\t}" ]
[ "0.8692557", "0.8671378", "0.82417744", "0.8227532", "0.82113725", "0.80049515", "0.7958297", "0.7917055", "0.7903408", "0.7867024", "0.7863569", "0.7852842", "0.7776798", "0.7669113", "0.7634484", "0.7546499", "0.7507121", "0.74953115", "0.7487137", "0.748536", "0.74080545", "0.7392515", "0.7392201", "0.736637", "0.733609", "0.72647333", "0.72337437", "0.71821153", "0.716917", "0.71535176", "0.7122775", "0.70944893", "0.70813346", "0.70440304", "0.7014483", "0.6964833", "0.6879755", "0.6858728", "0.6825267", "0.6809839", "0.6805703", "0.67977273", "0.67513806", "0.67294455", "0.66889167", "0.66807675", "0.6619802", "0.6584157", "0.6531834", "0.64744985", "0.64669466", "0.642658", "0.63761896", "0.6338669", "0.6323197", "0.62605363", "0.6256995", "0.6253238", "0.6228873", "0.6228873", "0.6187747", "0.6183232", "0.6137798", "0.61305857", "0.60978156", "0.60933256", "0.6092388", "0.6048018", "0.5997179", "0.5993405", "0.5992606", "0.5983199", "0.59370905", "0.59300506", "0.5879867", "0.585022", "0.5840093", "0.5837868", "0.5818316", "0.5812878", "0.5809661", "0.57794863", "0.5758448", "0.5756552", "0.56967187", "0.56759953", "0.56735426", "0.56687266", "0.5652265", "0.5646762", "0.5618404", "0.5614338", "0.5606773", "0.55722517", "0.55602705", "0.5555823", "0.5548267", "0.55173266", "0.55173266", "0.5511218" ]
0.78630936
11
This method will be invoked when the user enters his/her name
handleFullNameChange(event) { let processedData = event.nativeEvent.text; this.setState({ name: processedData }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateName() { changeTextField(name, nameLabel, isValidName()) }", "function updateName(event) {\r\n setUsername(event.target.value);\r\n }", "function tellName(name) {\n console.log('You have entered: ' + name);\n}", "function username(user_name){\n\tif( user_name === \"\" ){ \n\t\tuser_name = prompt(\"Your Name:\");\n\t\tusername(user_name);\n\t}\n\telse{\n\t\tsocket.emit(\"new_user\", user_name);\n\t}\n}", "function onChangeName(e) {\n setUserName(e.target.value);\n }", "changeNameClickHandler() {\n const playerName = prompt('Enter Player Name');\n const isValid = this.isNameValid(playerName);\n if (!isValid) {\n return;\n }\n\n this.newGame.setPlayerName(playerName);\n this.playerID.textContent = this.newGame.getPlayerName();\n }", "function loadNameEntry () {\n $('#name-entry').fadeIn();\n\n $('#name-entry input#username').keydown(function (event) {\n const $this = $(event.currentTarget);\n const val = $this.val().trim();\n if (event.keyCode === 13 && val) {\n socket.emit('enter username', val);\n }\n });\n\n socket.on('alternate name', function (message, altName) {\n $('#name-entry #name-message').text(message);\n $('#name-entry input').val(altName);\n });\n\n $('#name-entry input#username').focus();\n }", "function registerName(){\n\t//my_name declared in globals.js\n\tmy_name = prompt(\"Please enter a name:\"); //TODO: make this a GUI thing not a prompt\n\tif(my_name===\"\"){\n\t\tregisterName();\n\t\treturn;\n\t}\n\tif(!my_name){\n\t\tthrow new Error(\"Name entry canceled, leaving webpage blank\");\n\t}\n\n\tsocket.emit(\"new player\", my_name, function(success){\n\t\tconsole.log(\"Name registration success:\",success);\n\t\tif(!success){\n\t\t\talert(\"'\"+my_name+\"' is taken. Please choose another\");\n\t\t\tmy_name = undefined;\n\t\t\tregisterName();\n\t\t}\n\t});\n}", "function setName() {\n const input = document.querySelector(\"input[name='fullname']\");\n\n if (input) {\n input.value = username;\n clearInterval(interval);\n const button = document.querySelector(\"[type='submit']\");\n\n button.click();\n }\n }", "_setInputName(name){\n \t\t// It cThe login variable can be set to true\n \t\tthis.inputName = name;\n \t}", "function name (nameInput) {\n alert('The name you entered is: ' + nameInput);\n}", "function setUserName() {\n let myName = prompt('Please enter your name.');\n if(!myName) {\n setUserName();\n } else {\n localStorage.setItem('name', myName);\n myHeading.textContent = 'Mozilla is cool, ' + myName;\n }\n}", "function addUserName() {\n const username = document.getElementById(\"username\").value;\n if (username) {\n console.log(\"Hello\" + username);\n } else {\n console.log(\"user not found\");\n }\n const enteredName = document.getElementById(\"enteredName\");\n enteredName.innerText = username;\n}", "function showUserName() {\r\n userName = document.getElementById(\"user-input\").value;\r\n\r\n // Proceeding only after receiving the name as an input from the user:\r\n if (document.getElementById(\"user-input\").value == \"\") {\r\n alert(\"Please enter your name to continue.\");\r\n return false;\r\n }\r\n document.getElementById(\"list-name\").innerHTML = `Hi ${userName}! Start adding your items in the box below and create your list now!`;\r\n document.getElementById(\"head\").innerHTML = `${userName}'s todo list!`\r\n\r\n // Emptying the box to get a new name:\r\n document.getElementById(\"user-input\").value = \"\";\r\n\r\n}", "function enterCustomerName(){\n\t//check customer name for text only\n\t//pop up error message if non-alphabetical letters\n\t//delete extra spaces\n\t//change customer name to lower case\n\t//grab the value of the customerName then puts it back into the textbox\n}", "onFathersNameChange(text) {\n this.props.fathersNameChange(text);\n }", "function handleNameChange(e) {\n setName(e.target.value);\n }", "function tionName(UserPrompt) {\n \nvar valid;\n var input = prompt(\"What is your name?\");\n input = input.toLowerCase();\n if (input != \"chris\"){\n prompt(\"You did not get it, Please try again.\");\n }else{\n console.log(\"You put \"+input+\" Good Job!\");\n }\n}", "function setUserName() {\n let myName = prompt('Please enter your name.');\n if(!myName || myName === null) {\n setUserName();\n } else {\n localStorage.setItem('name', myName);\n myMessage.innerHTML = 'Isnt this is cool, ' + myName + '?';\n }\n}", "function userInput() {\n playButton.addEventListener('click', function() {\n let userInputName = document.getElementById('fname').value.trim();\n firstName = userInputName;\n if(!userInputName) {\n document.getElementById('message').innerHTML = '<span style=\"color:red\">Please enter your name to play!</span>';\n } else {\n gameSetUp();\n }\n });\n}", "onNameChange(text) {\n this.props.nameChanged(text);\n }", "function getName(){\n\tnameMenu.dialog({closeOnEscape: false, resizable: false, title: 'Enter a name for your player', buttons: {\"Start\": addName}, open: function(event, ui) {\n $(\".ui-dialog-titlebar-close\", ui.dialog | ui).fadeOut('slow');\n }});\n\n\t//Prevents user from pressing enter and refreshing the page\n\tnameMenu.keypress(function(event){\n\t\tif (event.keyCode === 13) //13 is enter\n \tevent.preventDefault();\n \t });\n\n\tnameMenu.show();\n}", "function set_user_name(new_name){\n //TODO Validate User String\n current_user_name = new_name\n nameSpace.innerHTML=(\"User: \" + current_user_name)\n \n}", "onGuardiansNameChange(text) {\n this.props.guardiansNameChange(text);\n }", "function getName() {\n getUseInput(function(name) {\n userName = name;\n deleteAllLines();\n displayString(\"Hello \" + userName, 'main');\n });\n }", "function submitName() {\n var name = document.getElementById(\"myText\").value;\n if (name == \"Enter your name here\" || name == \"\") {\n alert(\"Please enter a name.\");\n } else {\n var nameV2 = \", \" + name;\n runIntro(nameV2);\n }\n}", "firstNameInput()\n {\n let updatedName, uname\n console.log(\"Enter name to update\")\n uname=input.question()\n obPerson.setName(uname)\n updatedName=obPerson.getName()\n return updatedName\n }", "function handleChange(event){\r\n switch (event.target.name) {\r\n case \"userName\":\r\n setName(event.target.value)\r\n break;\r\n \r\n default:\r\n break;\r\n }\r\n }", "function user(){\r\n // var name = prompt(\"What's it's your frist name?\")\r\n document.getElementById('user').innerHTML = name\r\n}", "activateNameInput() {\n activateNameInput && activateNameInput()\n }", "function updateUser(){\n helpers.rl.question('\\nEnter user name to update: ', dealWithUserUpdate);\n}", "function nameSetup(){\n\tvar input = createInput(\"NAME THE PET\");\n\tinput.position(450, 100);\n}", "function askForName() {\n // drop down menu\n let input = document.createElement(\"input\");\n input.type = \"text\";\n // when the input field is unselected the popup will be closed\n input.addEventListener(\"blur\", (e) => {\n players.push(new Player(e.target.value));\n e.target.parentNode.style.display = \"none\";\n });\n createPopup(\"Enter Name:\", input);\n}", "function setUserName() { // creates function SetUserName in javascript. this can be anything you want\n var myName = prompt('Please enter your first name.'); // creates car named myName and assigns it whatever name the user inputs\n localStorage.setItem('name', myName);\n myHeading.textContent = 'Midiagirl is cool, ' + myName;\n}", "function setUsername () {\n username = cleanInput($usernameInput.val().trim());\n classRoom = cleanInput($classRoomInput.val().trim());\n\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('add user', username , classRoom);\n }\n }", "function enterName() {\n //connect the java script file with the input in the html\n var enterUsName = document.getElementById(\"userName\").value;\n //welcome the player to the game by using the entered name\n alert(\"Hello \" + enterUsName + \" Enjoy your game!\");\n}", "setStudentName () {\n this.studentName = prompt(\"What is your name, student?\"); // set the student name for the user to write!\n}", "function setUsername() {\n username = cleanInput($usernameInput.val().trim());\n\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.send('name', username);\n }\n }", "setName() {\n\n // get the nickname from the input.\n const name = $('#name-input').val();\n\n // set the name to a cookie\n Utils.setCookie('nickname', name, 14);\n\n // update the app state\n\t\tApp.state.name = name;\n\n\t\t// update the chat title\n\t\tApp.dom.updateName();\n\n // destroy the editor\n App.dom.destoryEditor();\n }", "function saveName(e) {\n e.preventDefault();\n var name = formInput.value.trim();\n if (name.length > 0) {\n device.classList.add('hasName');\n debugEl.classList.add('isDisplayed');\n formButton.disabled = true;\n formInput.readOnly = true;\n socket.emit(\"name\", name);\n }\n }", "function currentPlayerName() {\n playerName = userNameField.value;\n}", "function setUsername () {\n username = cleanInput($usernameInput.val().trim());\n\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('add user', username);\n }\n }", "function setUsername () {\n username = cleanInput($usernameInput.val().trim());\n\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('add user', username);\n }\n }", "function setName(e) {\n if (e.type === \"keypress\") {\n if (e.keyCode == 13) {\n localStorage.setItem('myName', e.target.innerHTML);\n name.blur();\n }\n } else {\n localStorage.setItem('myName', e.target.innerHTML);\n }\n}", "function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}", "function valSubmitted() {\n myName = document.querySelector('.input--user__name').value;\n if(myName) {\n updateLocalStorage();\n removeRegistrationOption();\n enableBtn();\n }\n }", "function askForName() \n{\n // TODO 1.1b: Ask for candidate's name //\n let candidateName = input.question(\"Enter your name: \");\n console.log('Welcome', candidateName);\n}", "function handleInputChange(e) {//cdo hay un cambio en el input, lo va renderizando\n e.preventDefault();\n console.log(name);\n setName(e.target.value);\n }", "function custom(){\n\tvar name = prompt(\"Enter your Name : \");\n\talert(\"Hope you are liking JavaScript \"+name+\" !\");\n}", "function getname(text){\n eel.take_input(text)(named)\n\n}", "nameChanger(){\n let setChangerName = prompt(`What is your correct name`);\n this.studentName = setChangerName;\n console.log(studentInfo1);\n }", "function _init_user_name_field(){\n try{\n var username_field = Titanium.UI.createTextField({\n hintText:'Username',\n width:240,\n height:40,\n top:(self.screen_height/2)-60,\n paddingLeft:10,\n value:_user_name,\n color:self.font_color,\n font:{\n fontSize:self.font_size,\n fontWeight:self.font_weight\n },\n keyboardType:Titanium.UI.KEYBOARD_EMAIL,\n returnKeyType: Ti.UI.RETURNKEY_NEXT,\n clearButtonMode:Titanium.UI.INPUT_BUTTONMODE_ONFOCUS,\n backgroundImage:self.get_file_path('image','inputfield.png')\n });\n win.add(username_field);\n username_field.addEventListener('change',function(e){\n _user_name = e.value;\n });\n username_field.addEventListener('return',function(){\n if((win.children[1] != undefined) && (win.children[1] != null)){\n win.children[1].focus();\n }\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_user_name_field');\n return;\n }\n }", "function setUserName() {\n var myName = prompt(\"please fill in your name\");\n localStorage.setItem('name', myName);\n myHeading.textContent = myName + \"! you are awesome!\"\n}", "function setName(){\r\n askForm=prompt('Enter your name here..','');\r\n}", "function setUsername () {\n username = cleanInput($usernameInput.val().trim());\n namecolor = getRandomColor();\n\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('add user', {username: username, \n namecolor: namecolor});\n }\n }", "function loadName() {\n const currentUser = localStorage.getItem('currentUser');\n if (currentUser === null) {\n form.addEventListener('submit', handleSubmit);\n } else {\n paintGreeting(currentUser);\n }\n}", "function setUsername() \n{\n\tvar name = prompt('Enter the name of a cutie:');\n\tlocalStorage.setItem('name', name);\n\theading.textContent = 'Hello cutie ' + name;\n}", "function askForName() {\n let name = input.question(\"Hello, what's your name? \");\n candidateName = name\n}", "function setUsername () {\n username = cleanInput($usernameInput.val().trim());\n localStorage.setItem(\"name\", username);\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('add user', username);\n }\n }", "function addNewUser() {\n console.log('\\nVery well, lets add a new user!');\n helpers.rl.question('\\nEnter user name (must be unique!): ', dealWithInputUSERNAME);\n}", "function myName() {\n var person = prompt(\"Please enter your name\");\n if (person !== \"\" && person !== null) {\n document.getElementById(\"person\").innerHTML = 'Yes <span class=\"name\">' + person + '</span>, you are with me !';\n } else {\n alert('Hummm! you need to put your name !');\n }\n}", "function askName() {\n var userName = prompt(\"Enter name\");\n}", "function setUserName()\n{\n soundtrack.play();\n socket.emit('setUsername', setUsernameInput.val());\n}", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "get nameInput() {\n return this._name;\n }", "function addName() {\n var textToChange = document.getElementById('name-change');\n\tvar textEntered = document.getElementById('input-text');\n if (textEntered.value.length > 0) {\n\t textToChange.innerHTML = textEntered.value;\n textEntered.classList.add('dog-name-input')\n textEntered.classList.remove('dog-name-noinput');\n } else {\n textEntered.classList.remove('dog-name-input')\n textEntered.classList.add('dog-name-noinput');\n }\n}", "function onNameChange(name) {\n\n\t\t// Save name to the store\n\t\tdispatch(SET_NAME(name));\n\t}", "onNameChange (text) {\n this.props.nameChanged(text)\n }", "function setUserName() {\n\n // Update on input\n $userName.change(function() {\n $welcomeText.html('Hello ' + $userName.val() + '!');\n console.log($welcomeText.html());\n\n // Reveal next profile question\n setTimeout(function() {\n $userProfile.filter('h3').filter(':nth-child(3)').fadeIn();\n $datePicker.fadeIn();\n },500);\n\n });\n\n}", "function submitName() {\n let nameElement = document.getElementById(\"name\");\n let name = nameElement.value;\n if (name === \"\") {\n alert(\"Enter a name\")\n return\n }\n localStorage.setItem(\"name\", name);\n showName();\n}", "function setUserName() {\n var myName = prompt('Please enter your name.');\n //setItem function stores data in the browser so we can later retrieve it\n localStorage.setItem('name', myName);\n //provide a welcome message\n myHeading4.textContent = 'Hi, ' + myName + '!';\n}", "function name(){\n var name = prompt(\"Enter your name?\")\n console.log(name)\n}", "function checkNameEntered(){\n startGame();\n \n if(isnameEntered){\n beginPlaying();\n }\n}", "function startAI() {\n if (nameInput.value !== \"\") {\n changeName();\n addRemoveEL(1);\n }\n}", "function setName(){\n $('#identity-frm').slideUp(200);\n $('#share-frm').slideDown(200);\n username = $('#username').val();\n $('#tracker_name').html(username + ' (you)');\n}", "function setName(e) {\n if (e.type === 'keypress') {\n if (e.which === 13 || e.keyCode === 13) {\n localStorage.setItem('name', e.target.innerText);\n name.blur();\n }\n } else {\n localStorage.setItem('name', e.target.innerText);\n }\n}", "function handleAddName () {\n\n // Set the name object for the db post transaction\n let newName = \n {\n // {id} for this name will be auto-created in SQL\n user_id: currentUser.id, \n family_id: currentUser.family_id,\n name: MyUtils.capitalizeFirstLetter(Name.current.value),\n gender: NameGender.current.value,\n type: NameType.current.value,\n user_rank: 1, // hard coded until I figure out how to use\n family_rank: 1, // hard coded until I figure out how to use\n is_visible: true\n };\n\n // If the required inputs are there, add the name to the db & update the state\n if (newName.name !==\"\" && newName.type!=null && newName.gender !=null) {\n API.createNewName(newName)\n .then(alert('New Name Added!'))\n .then(closeModal)\n .then(window.location.reload())\n .then(console.log('new state is', myNames))\n .catch(err => {\n console.log(err);\n alert('Oops! We were not able to add this name!');\n });\n }\n\n // If inputs are missing, alert the user to fill out required information\n else {\n alert(\"Please make sure you have entered or selected values for all required fields!\")\n };\n }", "changeName(event) {\n if (event.key === 'Enter') {\n if (event.target.value !== 'userUpdater' && event.target.value !== 'colorAssigner') {\n this.props.changeUser(event.target.value);\n event.target.value = '';\n }\n };\n console.log('key pressed: ', event.key);\n }", "function onUsernameChange(userName) {\n\n\t\t// Clear usernameTimeout when user types\n\t\tif (usernameTimeout) {\n\t\t\tclearTimeout(usernameTimeout);\n\t\t}\n\n\t\t// Regex for a valid username\n\t\tconst validUsername = new RegExp(LETTER_NUMBER_REGEX, 'i');\n\n\t\tif (validUsername.test(userName) || (userName && userName.length === 0)) {\n\n\t\t\t// Username is valid, hide error\n\t\t\tsetUsernameInvalid(false);\n\n\t\t} else {\n\n\t\t\t// Username is not valid, display an error\n\t\t\tsetUsernameInvalid(true);\n\t\t}\n\n\t\t// Set a timeout to check for username availability\n\t\tif (userName && userName.length > 0) {\n\t\t\tsetUsernameTimeout(setTimeout(\n\t\t\t\t() => processUsername(),\n\t\t\t\t1500\n\t\t\t));\n\t\t}\n\t}", "function askForName() {\n let name = \"\";\n\n // Ensure name is valid\n while(name === \"\" || name === null) {\n name = window.prompt(\"Please enter a display name.\", \"\");\n }\n\n console.log(\"Player name set to \" +name+ \".\");\n return name;\n }", "function validationBlogFullName(event, name) {\n let userNameValue = name.value;\n if (userNameValue === \"\") {\n alert(\"Please enter your Full Name!\");\n name.focus();\n event.preventDefault();\n return false;\n } else {\n return true;\n }\n}", "function setName(e) {\r\n if (e.type === 'keypress') {\r\n // checking that enter key is pressed\r\n if (e.keyCode == 13) {\r\n localStorage.setItem('name', e.target.innerText);\r\n // calling blur when enter key is press so that it prevents going to new line\r\n name.blur();\r\n }\r\n }\r\n else {\r\n localStorage.setItem('name', e.target.innerText);\r\n }\r\n}", "function setName() {\n var input = document.getElementById('name');\n skylink.setUserData({\n name: input.value\n });\n}", "function updateName() {\n console.log(nameInput.value());\n newName = nameInput.value();\n}", "function changeNameByEdit() {\n var name = $('#socketchatbox-txt_fullname').val();\n name = utils.cleanInput(name);\n name = $.trim(name);\n name = name.substring(0,15);\n // if (name === chatbox.username || name === \"\") {\n // ui.$username.text(chatbox.username);\n // return;\n // }\n // console.log('changing chatbox username');\n\n if (name === chatbox.username) {\n cancelNameEdit();\n return;\n }\n\n var config = chatbox.config;\n config.chatbox_username = name;\n chrome.storage.local.set({ chatbox_config: config });\n\n var payload = {\n 'uuid': chatbox.uuid,\n 'name': name\n }\n\n $.post(chatbox.inboxUrl + \"/db/user/change_name\", payload, function(resp) {\n console.log(resp);\n });\n\n //if (!sendingFile) {\n\n askServerToChangeName(name);\n \n }", "function getUserName() {\n userName = prompt('Identify yourself user.');\n}", "function setUsername () {\n username = cleanInput($usernameInput.val().trim());\n console.log(\"username\",username);\n // If the username is valid\n if (username) {\n $loginPage.fadeOut();\n $chatPage.show();\n $loginPage.off('click');\n $currentInput = $inputMessage.focus();\n\n // Tell the server your username\n socket.emit('add user', username);\n socket.emit(\"ack\",function(data){\n console.log(\"after add user \",data);\n });\n }\n }", "function onChangeUsername(e) {\n setUsername(e.target.value);\n }" ]
[ "0.74174935", "0.7250252", "0.7209219", "0.7139617", "0.71203375", "0.70737875", "0.70715994", "0.7069905", "0.7017755", "0.6987538", "0.6976898", "0.69501346", "0.69161755", "0.69114155", "0.69069356", "0.68964934", "0.68955547", "0.6879597", "0.68628234", "0.68170005", "0.6763012", "0.67427766", "0.672582", "0.67229176", "0.67168134", "0.67059505", "0.66937155", "0.66803515", "0.667795", "0.66720223", "0.6671103", "0.66451615", "0.66423124", "0.6637928", "0.6634793", "0.6632461", "0.66135573", "0.6608365", "0.6587342", "0.6574794", "0.6574633", "0.65732986", "0.65732986", "0.6571176", "0.6567927", "0.65641874", "0.65595984", "0.65557486", "0.655136", "0.6545588", "0.654424", "0.65403587", "0.6536247", "0.65354306", "0.653242", "0.6526575", "0.65195876", "0.6513668", "0.6509251", "0.6504897", "0.64985514", "0.64955634", "0.6482481", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.6481656", "0.64813334", "0.6475513", "0.6472247", "0.64704794", "0.64631456", "0.6459427", "0.6445458", "0.64365244", "0.64357054", "0.6433938", "0.64286214", "0.64283913", "0.6424465", "0.64211714", "0.6416247", "0.6409845", "0.6401328", "0.64009774", "0.63969606", "0.63910836", "0.6381503", "0.63678396", "0.6361478" ]
0.0
-1
This method will be invoked when the user enters his/her doctor's id
handleDocIDChange(event) { let processedData = event.nativeEvent.text; this.setState({ doctor: processedData }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doctorWasChanged(e) {\n console.log(e.target.value);\n set_selectedDocterId(e.target.value);\n }", "function goToAssessment(changerecordid) {\n boolAssessed = true;\n populateRecord(changerecordid);\n}", "function getIdFromInput() {\r\n\t\tlet id = document.getElementById(\"dateGet\").value;\r\n\t\tdisplayEvents(id);\r\n\t}", "function add_meds_handler(patient_id){\n\tconsole.log('button pressed from patient_id=' + patient_id);\n\tvar patients = get_ls_patients();\n\t$(\"#meds_input_\"+patient_id).val(patients[patient_id]['patient_meds']);\n}", "function update_patient(up)\n{\n\tif(up.patient_id.value==\"\")\n\t{\n\t\talert(\"enter patient-id\");\n\t\tup.patient_id.focus();\n\t\treturn false;\n\n\t}\n\treturn true;\n}", "function enterUserID(response) {\n\tvar users = response.payload;\n\tfor (var i = 0; i < users.length; i++) {\n\t\tvar user = users[i];\n\t\tif (user.username == managedUser) {\n\t\t\t// User ID has been found so enter it and lock the edit field, since we're certain that it's correct\n\t\t\tdocument.getElementById(\"user-id\").value = user.user_id;\n\t\t\tdocument.getElementById(\"user-id\").readOnly = true;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "typeLeadId(leadid){\n cy.sendKeys('input[name=\"id\"]',leadid)\n return this;\n }", "function grabRentalID(id, name) {\n\t\tsetRentalID(id);\n\t\tsetDisplayRental(name);\n\t\tsetRentalMutation(\"APPROVED\");\n\t}", "function enterID() {\n let discordUserID = document.getElementById(\"idEntry\").value;\n chrome.storage.sync.set({ discordUserID });\n getStorageData(\"discordUserID\");\n}", "function handleHelmetIdSelection(event){\n setHelmetId(event.target.value);\n }", "function handleDreamsEdit() {\n var currentDream = $(this)\n .parent()\n .parent()\n .parent()\n .data(\"dream\");\n window.location.href = \"/new-dream?dream_id=\" + currentDream.id;\n }", "getDoctor(id) {\n return axios.get('/api/doctors/' + id);\n }", "updateDoctor(id) {\n return axios.put('/api/doctors/' + id);\n }", "function __fNameClick(nBuyerId) {\n\t\tvar _id = parseInt(nBuyerId, 10);\n\t\t//if NFCid then\n\t\tif (isNaN(_id)) {\n\t\t\tbuyerView(nBuyerId);\n\t\t}\n\t\telse {\n\t\t\tCan.util.canInterface('personProfile', [2, nBuyerId]);\n\t\t}\n\t}", "function purposeUser() {\n\n // Displaying the patients.\n var p = displayPatients();\n\n // Asking the user to select the patient to change the appointment.\n r.question(\"Hello User! Choose a patient ID to set/change his/her appointment! \", (ans1) => {\n if (!isNaN(ans1.trim()) && ans1.trim() < p) {\n\n // Calling chooseDoctor() function to choose the doctor for appointment.\n chooseDoctor(Number(ans1.trim()));\n } else {\n\n // If the ID is invalid, trying again.\n console.log(\"INVALID! Choose a patient by ID only! Try again.\");\n purposeUser();\n }\n });\n}", "function DoctorRef(){\r\n var a_dept = $(\"#admit_department_id\").val();\r\n if(a_dept != ''){\r\n\t $.ajax({\r\n\t\t url: '../ajax/getroom.php',\r\n\t\t type: 'GET',\r\n\t\t data: 'admit_dept=' + a_dept + '&token=getrefdr',\r\n\t\t dataType: 'html',\r\n\t\t success: function(data) {\r\n\t\t\t if(data != '-99'){\r\n\t\t\t \t$(\"#ddldoctorname\").html(data);\r\n\t\t\t }\r\n\t\t\t else{\r\n\t\t\t \twindow.location.href = '../index.php';\r\n\t\t\t }\r\n\t\t }\r\n\t });\r\n \t}\r\n}", "function deletePopulateId(event) {\r\n event.preventDefault();\r\n\r\n var userId = $(this).data('id');\r\n\r\n $(\"#delete-form-employer-user-id\").val(userId);\r\n }", "function getActorById(){\r\n\tvar inputedId = $( hashSelector(idActorInput) ).val();\r\n\tif( inputedId === ''){\r\n\t\tapprise(\"Please enter actor ID\");\r\n\t\tafterLoadedInit();\r\n\t} else if( inputedId > 0 ) {\r\n\t\tdoAjaxQuery('actors/'+ inputedId, 'GET', handleActor);\r\n\t} else {\r\n\t\tapprise(\"ID contains only numbers!\");\r\n\t\tafterLoadedInit();\r\n\t}\r\n}", "function toPatientDetail(uid){\n document.getElementById('input_uid').value = uid;\n document.getElementById('patient_detail_form').submit();\n}", "function setMentorId(id){\n mentorId = id;\n getProfiles();\n }", "editTravel(id) {\n const index = this.travels.findIndex(\n (travel) => travel.id === id\n )\n this.travels[index].country = prompt(\"New country?\")\n }", "function editDog (event) {\n let dogId = parseInt(event.target.dataset.id); //grabs the dg's id from the dataset\n getDogs(dogId).then(data => { //fetch request was made for all the dogs\n let dog = data.find( dog => {return dog.id === dogId}) //returns the dog based on ID\n let name = dog.name;\n let breed = dog.breed;\n let sex = dog.sex;\n fillEditForm(name, breed, sex, dogId); //fills the dog forms with the dog values\n })\n}", "function onSelectAut1(event, ui){\n\t// Memorizes author id from the completer list in the hidden form field author1id\n\t$(\"#author1id\").val(ui.item ? ui.item.id : \"\");\n}", "function update(id) {\n \n $.ajax({\n type: 'GET',\n url: 'https://6008ad820a54690017fc2471.mockapi.io/api/v1/doctor/' + id,\n success: function(data) {\n\n $('#ideP').val(data.id);\n $('#nomP').val(data.nom);\n $('#emailP').val(data.email);\n $('#prenomP').val(data.prenom);\n $('#telP').val(data.tel);\n $('#cinP').val(data.cin);\n $('#passwordP').val(data.password);\n \n \n \n },\n error: function(error){\n alert(error);\n }\n })\n}", "function appointmentClicked(id) {\n\tconst url = baseURL + '/appointment/' + id;\n\t\n\t// set the global appointment id so that it can be used when updating \n\tappointmentId = id;\n\n\t$('#appointments li').removeClass('selected');\n\t\n\t$('#'+id).addClass('selected');\n\t\n\t// clear existing appointment dialog values \n\tclearAppointmentInput();\n\t\n\t// open dialog\n\t$('#appointmentDialog').dialog('open', true);\n\t$('#appointmentDialog').dialog({title: 'Update Appointment'});\n\t\n\t$('#saveAppointment').hide();\n\t$('#updateAppointment').show();\n\t$('#deleteAppointment').show();\n\t\n\t\t\n\t// retrieve appointment data for user given by id\n\t$.getJSON(url, function(jsonData) {\n\t\tvar owner = jsonData['owner'];\n\t\tvar description = jsonData['description'];\n\t\tvar date = new Date(jsonData['dateAndTime']);\n\t\tvar duration = jsonData['duration'];\n\t\t\n\t\tvar hours = date.getHours();\n\t\tvar minutes = ('0' + date.getMinutes()).slice(-2); // set to 2 decimal places \n\t\tvar startTime = hours + \":\" + minutes;\n\t\t\n\t\t// Append AM or PM to start time depending on the received value for dateAndTime \n\t\thours > 11 ? startTime += \" PM\" : startTime += \" AM\";\n\t\t\n\t\t// replace dash with slash for date value\n\t\tdate = replaceAll(date.toLocaleDateString(), '/', '-');\n\t\t\n\t\toldDate = date;\n\t\t\t\n\t\t// set values to retrieved values \n\t\t$('#owner').val(owner);\n\t\t$('#description').val(description);\n\t\t$('#addAppointmentDatepicker').val(date);\t\n\t\t$('#timepicker').val(startTime);\n\t\t$('#duration').val(duration);\n\t});\n}", "function joined(e) {\n userId = e.id;\n $('#controls').show();\n startPrompts();\n}", "function handleSelectPersonInSearch(id) {\n clearFields();\n setIdPeople(id);\n handleCloseModalSearchPersonEdit();\n inputFocusIdPerson();\n }", "function validateDiseaseIdInput(id) {\n // validating the field for user-entered disease id\n let valid = this.validateDefault();\n let errMsg = 'Enter a valid MONDO ID';\n\n if (valid) {\n if (id && id.length) {\n // Expect a semicolon (':') in the id and it is not at the start of the id string\n // Such as 'MONDO:0016587'\n if (id.indexOf(':') < 0 || id.match(/:/g).length > 1) {\n valid = false;\n this.setFormErrors('diseaseId', errMsg);\n }\n /**\n * Allow MONDO IDs only\n */\n let valid_pattern = /^mondo/i;\n let multi_instance_pattern = /mondo/ig;\n if (!id.match(valid_pattern) || id.match(multi_instance_pattern).length > 1) {\n valid = false;\n this.setFormErrors('diseaseId', errMsg);\n }\n } else {\n valid = false;\n this.setFormErrors('diseaseId', errMsg);\n }\n }\n\n return valid;\n}", "function selectLog(uid) {\n UserRecords.focusID(uid);\n }", "function editDepartment(deptId) {\n let match = departmentList.filter((Element) => {\n return deptId == Element.depT_ID;\n });\n match = match[0];\n $(Models.department_edit).modal('show');\n $(Inputs.department_tr_edt).val(match.department_tr);\n $(Inputs.department_en_edt).val(match.department_en);\n DeprtmentModel.depT_ID = match.depT_ID;\n}", "function selectID(belly) {\r\n return belly.id == userSelection;\r\n }", "function listenToUserId() {\n // On input, call userIdValidate()\n $('#user_id, #modalUserId').on(\"input\", () => {\n userIdValidate();\n });\n}", "elevatorDoorOpen(elevator_id){\n console.log(\"Elevator \", elevator_id, \" door open\");\n }", "function grabUserID(id, name) {\n\t\tsetUserID(id);\n\t\tsetDisplayUserName(name);\n\t}", "function edClientIdKeypress(event) {\n var keycode = event.which || event.keycode;\n if (keycode == 13) {\n switchToMainAfterAuth();\n }\n}", "addDoc(){\n \n let dname = readline.question('\\nEnter Doctor name : ');\n let specialization = readline.question('Enter patient Speciality : ');\n let availability = readline.question('Enter availability Type \"AM\", \"PM\" or \"Both : ');\n \n var doctor = {\n \"DoctorName\" :dname,\n \"DocID\" :this.docid,\n \"Specialization\" : specialization,\n \"Availability\" : availability\n }\n this.dfile.Doctors.push(doctor);\n this.saveDocData();\n }", "function GetUserID() {\n\n\n CreateDiv('Stage', 'TextBoxDiv');\n\t\n\tif(Language=='en'){\n var Title = '<H3 align = \"justify\">Before you start, please:<br><br>- maximize your browser window<br><br>- switch off phone/e-mail/music & anything else distracting<br><br>- and please enter your ID: <input type=\"text\" id = \"textbox_id\" name=\"ID\"></H3>';\n\t var Buttons = '<div align=\"center\"><input align=\"center\" type=\"button\" class=\"btn btn-default\" id=\"toConsent\" value=\"Next\" ></div>';\n\t}\n\telse if(Language=='fr'){\n\t var Title = '<H3>Veuillez choisir un identifiant: <input type=\"text\" id = \"textbox_id\" name=\"ID\"></H3>';\n\t var Buttons = '<div align=\"center\"><input align=\"center\" type=\"button\" class=\"btn btn-default\" id=\"toConsent\" value=\"Suivant\" ></div>';\n\t}\n\tvar TextInput = '';\n $('#TextBoxDiv').html(Title+TextInput);\n\n\n \n $('#Bottom').html(Buttons);\n\n $('#toConsent').click(function() {\n\n\t if(document.getElementById('textbox_id').value!=''){\n\t\t\n\t\tSubID = document.getElementById('textbox_id').value;\n\t\t$('#TextBoxDiv').remove();\n\t\t$('#Stage').empty();\n\t\t$('#Bottom').empty();\n\n\t\tConsent();\n\n\t }else{\n\t\talert('You must enter your ID.');\n\t }\n });\n }", "function logIncident(device_status_id) {\n\t$('#modalLogIncident').modal();\n\tdhChangeSelect('comment');\n\trenderDeviceStatuses(\"select#dhSelectStatus\", device_status_id);\n\treturn false;\n}", "function enterId(\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n /**\n * No argument. */\n)\n/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/\n{\n app.log(2, 'enterId');\n closeWindow();\n openWindow('#credentials2');\n if ('undefined' !== typeof(Storage)) {\n if (window.localStorage.gcpReloadNickName) {\n $('#name', '#credentials2').val(window.localStorage.gcpReloadNickName);\n $('#btn', '#credentials2').click();\n delete window.localStorage.gcpReloadNickName;\n }\n }\n}", "function relation(ID) {\r\n var elm = document.getElementById(\"Relation_Id\");\r\n elm.value = ID;\r\n}", "function enterDOI ( )\n {\n\tvar doi_value = edit_record['doi'] || '';\n\tsetInnerHTML('dar_doi', '<td><input type=\"text\" name=\"doi\" size=\"60\" value=\"' +\n\t\t doi_value + '\">');\n }", "handleChange(event) {\n const { setFortniteId } = this.props;\n //This function dispatches setUID action with the value passed\n setFortniteId(event.target.value);\n }", "function SelectDealer(dealerId)\n{\n\n\tselectedDealerId = dealerId;\n dealerLocatorViewModel.selectedDealerId(dealerId);\n\n var dealer = FindDealer(dealerId);\n\t//console.log(dealer);\n\t\n\t\n\t\n /*$('#directionsDealerName').text(dealer.Name);\n $('#directionsDealerStreetAddress').text(dealer.NVS.Address);\n $('#directionsDealerCityStateZip').text(dealer.NVS.City + ', ' + dealer.NVS.State + ' ' + dealer.NVS.Zip);*/\n}", "function dogEditBtnEventListener() {\n document.addEventListener('click', event => {\n if(event.target.className === 'edit-btn'){\n let dogId = parseInt(event.target.dataset.id)\n state.selectedDog = state.dogs.find( dog => dog.id === dogId)\n populateDogForm(state.selectedDog)\n }\n })\n}", "function modficarDistrito(id){\n idDistrito = id;\n}", "function handleInputChange(e) {\n setDoctor({ ...doctor, [e.target.name]: e.target.value })\n }", "onStaffSelect(event){\n let staffId = { key: \"staffMemberId\", value: event.target.value == '' ? -1 : event.target.value };\n this.onCheckoutEditorChange(staffId);\n }", "function newStaffTake() {\n newUrl = \"stafftake.html?dtID=\" + document.getElementById(\"dtID\").value\n document.location.href = newUrl;\n}", "function onSelectAut2(event, ui){\n\t// Memorizes author id from the completer list in the hidden form field author2id\n\t$(\"#author2id\").val(ui.item ? ui.item.id : \"\");\n}", "function handleSearchPerson(idPerson) {\n if (idPerson && !updateRegister) {\n loadDataPerson(idPerson);\n setUpdateRegister(false);\n setTitleUpdate(\"\");\n } else if (!updateRegister) {\n clearFields();\n }\n }", "function selectID(belly) {\r\n return belly.id == \"940\";\r\n }", "setDistrictInfo(id){\n var self = this;\n self.selected_district = id.replace(/-/g, \" \"); \n }", "function update_doctor_id() {\n\n const doctors = apiData.data[0].doctors\n\n for (let i = 0; i < doctors.length; i++) {\n apiData.data[0].doctors[i].id = i + 1;\n }\n\n}", "function perform(id){\n if ((id === \"name\") && (eleName(id)[0].value !== \"\")){\n person.name = eleName(id)[0].value;\n ele(\"type\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"type\") && (eleName(id)[0].value !== \"student\")){\n person.type = eleName(id)[0].value\n hideOthers(\"staff\", 0);\n hideOthers(\"student\", 0);\n ele(\"staffId\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"type\") && (eleName(id)[0].value !== \"staff\")) {\n person.type = eleName(id)[0].value\n hideOthers(\"student\", 0);\n hideOthers(\"staff\", 0);\n ele(\"matricNo\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"matricNo\") && (eleName(id)[0].value !== \"\")) {\n person.matricNo = eleName(id)[0].value\n hideOthers(person.type, 1);\n ele(\"faculty\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"staffId\") && (eleName(id)[0].value !== \"\")) {\n person.staffId = eleName(id)[0].value\n hideOthers(person.type, 1);\n ele(\"faculty\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"faculty\") && (eleName(id)[0].value !== \"\")) {\n performFaculty(person.type);\n }\n else if ((id === \"department\") && (eleName(id)[0].value !== \"\")) {\n person.dept = eleName(id)[0].value\n hideOthers(person.type, 3);\n ele(\"email\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"email\") && (eleName(id)[0].value !== \"\")) {\n person.email = eleName(id)[0].value\n hideOthers(person.type, 4);\n if(person.type === \"student\"){\n ele(\"gender\").setAttribute(\"class\", \"show\");\n }\n else{\n ele(\"maritalStat\").setAttribute(\"class\", \"show\");\n }\n }\n else if ((id === \"maritalStat\") && (eleName(id)[0].value !== \"\")) {\n person.maritalStatus = eleName(id)[0].value\n hideOthers(person.type, 5);\n if (person.maritalStatus !== \"single\") {\n hideOthers(person.type, 5);\n ele(\"numChild\").setAttribute(\"class\", \"show\");\n }\n else {\n hideOthers(person.type, 6);\n ele(\"gender\").setAttribute(\"class\", \"show\");\n }\n }\n else if ((id === \"numChild\") && (eleName(id)[0].value !== \"\")) {\n person.numberOfChildren = eleName(id)[0].value\n hideOthers(person.type, 6);\n ele(\"gender\").setAttribute(\"class\", \"show\");\n }\n else if ((id === \"gender\") && (eleName(id)[0].value !== \"\")) {\n if(person.type === \"staff\"){\n if(person.numberOfChildren !== \"\"){\n performGender(person.type, 7);\n }\n else{\n performGender(person.type, 6);\n } \n }\n else{\n performGender(person.type, 5);\n }\n }\n else if ((id === \"dob\") && (eleName(id)[0].value !== \"\")) {\n person.dob = eleName(id)[0].value\n ele(\"submit\").setAttribute(\"class\", \"show\");\n }\n else{\n hideOthers(person.type, 0);\n }\n\n console.log(person);\n}", "function personnelChanged(personnelId) {\n\t$(\"selectedPersonnelId\").value = personnelId;\n\tsubmitMyForm('insert');\n}", "handleEdit(id){\n window.location = '/journalists/edit/' + id\n }", "function select ( menuId ) {\r\n // self.selected = angular.isNumber(menuId) ? $scope.users[user] : user;\r\n self.toggleList();\r\n }", "handleOwnerSelection(event) {\n const selectedRecordId = event.detail;\n this.caseOwnerName = (this.caseOwnerSearchResult.find(item => item.Id === event.detail).Name);\n this.ownerData = true;\n this.caseOwnerId = event.detail;\n }", "function IdCuenta() {\n\n if (usuario.user.id) {\n console.log('entro')\n axios.get(`http://${URL}/api/account/?userId=${usuario.user.id}`)\n .then((resp) => {\n // console.log('LO QUE SERIA LA CUENTA', resp.data.data.id)\n setIdCuenta(resp.data.data.id)\n })\n .catch(error => {\n console.log(error.response)\n })\n\n }\n\n }", "setMvp(event){\n const username = event.currentTarget.id;//the the username of the realtors which is saved as id\n $.post('setMvp.php', {\n mvp : username \n },function(data,info){\n (info === 'success')? window.location.reload():alert(\"Service Failed Pls Try Again Later\");\n }) \n }", "function newDept() {\n inquirer.prompt(\n {\n name: \"newDept\",\n message: \"Name the new department\",\n type: \"input\",\n validate: userEntry => {\n // if user response is not nothing\n if(userEntry !== \"\"){\n return true;\n }\n return \"You have to enter some information!\"\n },\n default: \"\" \n }\n ).then(function ({ newDept }) {\n connection.query(`INSERT INTO department (name) VALUES ('${newDept}')`, function (err, data) {\n if (err) throw err;\n console.log('Inserted ' + newDept + ' into row ' + data.insertId)\n mainTasker();\n })\n })\n }", "function handleResponseEdit() {\n var currentResponse = $(this)\n .parent()\n .parent()\n .data(\"response\");\n window.location.href = \"/questionnaire?response_id=\" + currentResponse.id;\n }", "function agarrarProfesor() {\n const profesorId = document.getElementById(\"profesores\").value;\n document.getElementById(\"profesorId\").value = profesorId;\n}", "function openDESCRIPTION_Div(id)\n{\n\tif(confirm(\"Do you really want to unauthenticate this user? If so all the details related to this user wil get unauthenticated\"))\n\t{\n \n\t\tdocument.getElementById('userSID').value = id;\n\t\tPopup.show('user_status_desc');\n\t}\n}", "function go(id) \n\t\t\t{\n\t\t\t\tdocument.form.fill.value=id;\t\t\t\n\t\t\t}", "handleDiseaseIdChange(e) {\n if (this.refs['diseaseId']) {\n let tempResourceId = this.refs['diseaseId'].getValue();\n this.setState({diseaseId: tempResourceId, resourceFetched: false, tempResource: {}});\n if (tempResourceId.length > 0) {\n this.setState({queryResourceDisabled: false});\n } else {\n this.setState({queryResourceDisabled: true});\n }\n }\n }", "function travellerDetails()\n{\n// first name field\nvar element = document.getElementById(\"firstName\");\nif(element)\n{\nvar ev = new Event('input', { bubbles: true});\nev.simulated = true;\nelement.value = \"%1$@\";\nelement.style.background=\"#f19c4f\"\nelement.defaultValue = \"Something new\";\nelement.dispatchEvent(ev);\n}\n\n// middle name field\nvar element = document.getElementById(\"middleName\");\nif(element)\n{\nvar ev = new Event('input', { bubbles: true});\nev.simulated = true;\nelement.value = \"%11$@\";\nelement.style.background=\"#f19c4f\"\nelement.defaultValue = \"Something new\";\nelement.dispatchEvent(ev);\n}\n// last name field\nvar element = document.getElementById(\"lastName\");\nif(element)\n{\nvar ev = new Event('input', { bubbles: true});\nev.simulated = true;\nelement.value = \"%3$@\";\nelement.style.background=\"#f19c4f\"\nelement.defaultValue = \"Something new\";\nelement.dispatchEvent(ev);\n}\nvar letter = '%7$@';\nif(letter=='Male'){\nvar selectObj = document.querySelector('div[class=\"FormInput-wrapper FormInput-wrapper--toggle\"] label[for=\"gender\"]+ ul li button[type=\"button\"]');\nif(selectObj){\nselectObj.click();\n}\n}\nelse{\nvar selectObj = document.querySelector('div[class=\"FormInput-wrapper FormInput-wrapper--toggle is-correct\"] label[for=\"gender\"]+ul li[class=\"Toggle-listItem\"] button[class=\"Toggle-button Toggle-button--form\"]');\nif(selectObj){\nselectObj.click();\n}\n}\n// DOB\n\n// phone number field\n\n//Month\n var letter = '%4$@';\n var selectObj = document.querySelector('div[class=\"Dropdown FormInputDateDropdown-dropdown\"] select[name=\"bday bday-month\"]');\n fillDropDown(letter, selectObj);\n\n//Day\n var letter = '%5$@';\n var selectObj = document.querySelector('div[class=\"Dropdown FormInputDateDropdown-dropdown\"] select[name=\"bday bday-day\"]');\n fillDropDown(letter, selectObj);\n\n//Years\n var letter = '%6$@';\n var selectObj = document.querySelector('div[class=\"Dropdown FormInputDateDropdown-dropdown\"] select[name=\"bday bday-year\"]');\n fillDropDown(letter, selectObj);\n\nvar letter = '%8$@%9$@%10$@'; var selectObj = document.querySelector('div[class=\"FormInputPhone-input\"] input[type=\"number\"][id=\"phoneNumbers.phoneNumber0\"]');\nfillTextField(letter, selectObj);\n\n// email field\nvar letter = '%11$@'; var selectObj = document.querySelector('div[class=\"FormInput FormInput--large\"] input[id=\"email\"]');\nfillTextField(letter, selectObj);\n\n\n}", "function district_edit(rec_id){\n\t$.ajax({\n\t\turl:\"http://localhost/nps_logistic/api/get_district_edit.php\",\n\t\tdataType:\"JSON\",\n\t\ttype:\"POST\",\n\t\tdata:{rec_id:rec_id},\n\t\tsuccess:function(response){\n\t\t\t$(\"#country_drop_down_edit_district\").val(response.country_id);\n\t\t\t\n\t\t\t$(\"#state_drop_down_edit_district\").val(response.state_id);\n\t\t\t$(\"#district_edit_rec_id\").val(response.rec_id);\n\t\t\t$(\"#district_edit_name\").val(response.district_name);\n\t\t\t\n\t\t}\n\t});\n}", "onChangeCompany(event){\n return this.props.setUserCompoanyId(event.target.value);\n \n }", "function firstPerson() {\n firebase.auth().onAuthStateChanged(function(user) {\n if (user) {\n var userId = firebase.auth().currentUser.uid;\n var rootRef = firebase.database().ref().child(\"Users\");\n var usersRef = rootRef.child(userId);\n var other_id = other_id_1;\n usersRef.update({\n \"other_id\": other_id\n });\n }\n });\n }", "function setVisitor() {\n\n\n $rootScope.muser.visitorID = $scope.user.name+ $scope.user.surname;\n $rootScope.muser.name = $scope.user.name;\n $rootScope.muser.surname = $scope.user.surname;\n\n\n }", "function fill_teacher_fields()\r\n{\r\n const url = new URL(window.location.href);\r\n if ( url.searchParams.get('id'))\r\n\t\t{\r\n const id = url.searchParams.get('id');\r\n $.get('./api/teacher/'+id, (data) => {\r\n $('#id').val(id);\r\n $('#first_name').val(data.first_name);\r\n $('#last_name').val(data.last_name);\r\n $('#email').val(data.email);\r\n $('#phone_number').val(data.phone_number);\r\n \r\n }) \r\n }\r\n}", "deleteDoctor(id) {\n return axios.delete('/api/doctors/' + id);\n }", "function view(userID) {\n // Logger.log(userID);\n var curruser = userExists(userID);\n // Logger.log(curruser.firstName.length);\n if (!curruser.firstName) {\n sendText(\n userID,\n \"Hey there! We couldn't find you in our user database, join us using /register\"\n );\n } else {\n sendText(userID, 'Which session?', dayKeyboard('view-', curruser.zone));\n }\n }", "function attachNewUserToIncident() {\n attachNewUser = true;\n $(\"#user_add_username\").val($(\"#user_name\").val());\n openAddUser();\n }", "async function viewByDepartment() {\n clear();\n const departments = await connection.query(\"SELECT * FROM department\");\n const departmentOptions = departments.map(({ id, department_name }) => ({\n name: department_name,\n value: id,\n }));\n \n const { userDepartmentId } = await inquirer.prompt([\n {\n type: \"list\",\n message: \"Which department would you like to view?\",\n name: \"userDepartmentId\",\n choices: departmentOptions,\n },\n ]);\n\n const employees = await connection.query(employeesSQL + \" WHERE department.id = ?;\", userDepartmentId);\n\n log(\"\\n\");\n console.table(employees);\n mainMenu();\n}", "function mandal_edit(rec_id){\n\t$.ajax({\n\t\turl:\"http://localhost/nps_logistic/api/get_mandal_edit.php\",\n\t\tdataType:\"JSON\",\n\t\ttype:\"POST\",\n\t\tdata:{rec_id:rec_id},\n\t\tsuccess:function(response){\n\t\t\t$(\"#country_drop_down_edit_mandal\").val(response.country_id);\n\t\t\t\n\t\t\t$(\"#state_drop_down_edit_mandal\").val(response.state_id);\n\t\t\t$(\"#district_drop_down_edit_mandal\").val(response.district_id);\n\n\t\t\t$(\"#mandal_edit_rec_id\").val(response.rec_id);\n\t\t\t$(\"#mandal_edit_name\").val(response.mandal_name);\n\t\t}\n\t});\n}", "function actualizarCategoria(id) {\n event.preventDefault();\n if ($(\"#txtName\").val() === \"\") {\n alert('Ingrese el Nombre de la Categoría.');\n $(\"#txtName\").focus();\n } else if ($(\"#txtDescription\").val() === \"\") {\n alert('Ingrese la Descripción de la Categoría.');\n $(\"#txtDescription\").focus();\n } else {\n actualizarRegistro(\"Category\", id);\n }\n}", "saveDoctor(doctorData) {\n return axios.post('/api/doctors/', doctorData);\n }", "function deleteInstructor(record_id){\n $(\"#deleteform_instructor input[name=instructor_id]\").val(record_id);\n $(\"#deleteform_instructor\").submit();\n }", "function viewDetails(appointment_id) {\n console.log('view details clicked ', appointment_id);\n $http.get('/appointments/' + appointment_id).then(function(response) {\n appointment.selected = response.data;\n console.log('Apt & Client details back from db: ', appointment.selected);\n });\n }", "function makeFighter1 () {\n if ($('#input1').val() !== '' && $(this).text() !== \"I'm Too Lazy To Choose\"){\n let text = $(this).text();\n let userName1 = $('#input1').val();\n fighter1 = new Tuckhouse.Combatants[text](userName1);\n printFighter1Stats(fighter1);\n f1x = true;\n }\n\n//Make random type fighter 1 with user name\n\n else if ( $('#input1').val() !==''){\n let userName1 = $('#input1').val();\n console.log(userName1);\n var x = Tuckhouse.Combatants.Cat.randomize(userName1);\n fighter1 = x;\n printFighter1Stats(fighter1);\n f1x = true;\n\n }\n\n//Directive to at least enter a name before moving forward\n\n else {\n $('#fighter1stats').html(\"No can do, kitten. Enter a name for your first fighter and then select its type.\");\n }\n }", "function dishIdValidation(req, res, next) {\n const { dishId } = req.params;\n\tconst { data: { id } = {} } = req.body;\n\tif(!id || id === dishId) {\n\t\tres.locals.dishId = dishId;\n\t\treturn next();\n\t}\n\tnext({\n\t\tstatus: 400,\n\t\tmessage: `Dish id does not match route id. Dish: ${id}, Route: ${dishId}`\n\t});\n}", "function personChange (userinput) {\n var id; //attributes that will be displayed as part of person change\n var name; \n var blood;\n var condition \n this.userinput = userinput;\n\n var rootRef = firebase.database().ref().child('Patients').child(userinput); //reference to part of firebase\n\n rootRef.on('value',snap => {\n\n\n objectId.innerHTML = snap.val().ID;\n objectName.innerHTML = snap.val().name;\n objectAddress.innerHTML = snap.val().address;\n objectBlood.innerHTML = snap.val().blood;\n objectCondition.innerHTML = snap.val().condition;\n\n\n\n });\n\n}", "function optionChanged(patientID) {\n console.log(patientID);\n buildCharts(patientID);\n populateDemoInfo(patientID);\n}", "searchDoc(ch){\n switch (ch) {\n case 1:\n var j=1, key =-1, flag = false ;\n var dname = readline.question('Enter Doctor full name : ');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (this.dfile.Doctors[i].DoctorName == dname) {\n key = i;\n flag = true;\n }\n }\n if (flag) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[key].DoctorName+'\\t\\t|'+this.dfile.Doctors[key].Specialization+'\\t\\t|'+this.dfile.Doctors[key].Availability+'\\t\\t\\t|'+this.dfile.Doctors[key].DocID); \n \n }\n else{\n console.log('Doctor not found or please check input again.........');\n \n }\n break;\n \n case 2:\n var j=1;\n var speciality = readline.question('Enter Specialization : \\n');\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (speciality == this.dfile.Doctors[i].Specialization) {\n \n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n case 3:\n var j=1;\n var id = readline.question('Enter Doctor ID : \\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (id == this.dfile.Doctors[i].DocID) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n case 4:\n var j=1;\n var avail = readline.question('Enter Availablity Type \"AM, PM, or Both\" : \\n');\n for (let i = 0; i < this.dfile.Doctors.length; i++) {\n if (avail == this.dfile.Doctors[i].Availability) {\n console.log('\\nSr.NO. Doctor Name \\t\\t|Speciality \\t\\t|Availablity\\t\\t|DOC ID\\n');\n console.log(j+++'\\t'+this.dfile.Doctors[i].DoctorName+'\\t\\t|'+this.dfile.Doctors[i].Specialization+'\\t\\t|'+this.dfile.Doctors[i].Availability+'\\t\\t\\t|'+this.dfile.Doctors[i].DocID); \n }\n else{\n console.log('Doctor not found or please check input again.........');\n break;\n }\n }\n break;\n \n }\n\n }", "function editexpense(masterid)\n{\n var ID= masterid; \n window.location = 'edit-supplier-expense/' + ID;\n}", "updateID(event) {\n\t\tthis.setState({\n\t\t\tuserID: event.target.value\n\t\t});\n\t}", "function getIdOrden(){\n return orden_id;\n}", "function idAlumno() {\n const alumnoId = document.getElementById(\"alumnos\").value;\n document.getElementById(\"alumnoId\").value = alumnoId;\n}", "function callUser(id) {\n\tconsole.log('entered call user function ');\n\tvar connectToUser=document.getElementById(id).value;\n\tconsole.log('contact selected ='+connectToUser);\n\tvar answer = confirm('call '+connectToUser+'?');\n\tif (answer){\n\t\tconsole.log('calling '+connectToUser);\n\t\tsocket.emit('connectToUser',connectToUser);\n\t\t$calleeName.innerHTML = 'calling ' + connectToUser;\n\t\t$callee.style.display = 'block';\n\t}\n\telse{\n\t\tconsole.log('calling cancelled');\n\t}\n}", "function onQueryVATId() {\n var vatId = $(\"#query-vat-id\").val();\n console.log(\"Fetching data from\", vatId);\n showCompany(vatId);\n }", "function editBlog()\n{\n alert('to do: editBlog: ' + this.id.substring(6));\n return false;\n}", "function _edit(id) {\n vm.item.id;\n vm.item.userId = vm.item.id;\n //$window.location.href = \"/profile/\" + vm.item.id + \"/edit\";\n }", "function captureDogInputs(e) {\n let dogId = parseInt(e.currentTarget.dataset.editId);\n let name = document.querySelector(`[data-name-id=\"${dogId}\"]`).innerText;\n let breed = document.querySelector(`[data-breed-id=\"${dogId}\"]`).innerText;\n let sex = document.querySelector(`[data-sex-id=\"${dogId}\"]`).innerText;\n\n let nameInput = document.querySelector('#dogname');\n let breedInput = document.querySelector('#dogbreed');\n let sexInput = document.querySelector('#dogsex');\n\n nameInput.value = name;\n breedInput.value = breed;\n sexInput.value = sex;\n\n addSubmitEventListener(dogId);\n}", "function askID(type) {\n inquirer.prompt([\n {\n type: 'number',\n message: `What is their ID #?`,\n name: 'ID',\n },\n ]).then(({ID}) => {\n if(listID.includes(ID) || Number.isNaN(ID)) {\n if(Number.isNaN(ID)) {\n console.log(ck.red(`ERROR: Not a number!`)); } else {\n console.log(ck.red(`ERROR: ID#${ID} is already in use!`));\n }\n askID(type); //using recursion until a valid answer is given\n } else {\n listID.push(ID);\n switch (type) {\n case 'Manager':\n addManager(ID); \n break;\n case 'Engineer':\n addEngineer(ID); \n break;\n case 'Intern':\n addIntern(ID); \n break; \n default:\n break;\n }\n }\n });\n}", "function updateId(inputId){\n id=inputId;\n}", "function DoctorReference(){\r\n var a_dept = $(\"#ddlAppDept\").val();\r\n if(a_dept != ''){\r\n\t $.ajax({\r\n\t\t url: '../ajax/getroom.php',\r\n\t\t type: 'GET',\r\n\t\t data: 'appointment_department=' + a_dept + '&token=getrefdoctor',\r\n\t\t dataType: 'html',\r\n\t\t success: function(data) {\r\n\t\t\t if(data != '-99'){\r\n\t\t\t \t$(\"#reference_doctor\").html(data);\r\n\t\t\t }\r\n\t\t\t else{\r\n\t\t\t \twindow.location.href = '../index.php';\r\n\t\t\t }\r\n\t\t }\r\n\t });\r\n \t}\r\n}", "function update (dept){\n if (dept != 0){\n var text = prompt ('Update What ? : ')\n switch(text.toUpperCase()){\n case \"DEPARTMENT NAME\":\n var input = prompt (`ENTER ${text.toUpperCase()} : `)\n updatedata(dept,1,input);\n break\n default:\n alert (\"Be specific on your input.\\nExample: \\nPosition Name \\n NOTE : ID is CANNOT BE EDITED.\" );\n break\n } \n }else {\n alert ('Please Try Again..\\n Remember : ID is CANNOT BE Edited.');\n }\n}", "setId(id){\n this.id=id;\n }" ]
[ "0.7060893", "0.5625815", "0.5618982", "0.5578958", "0.5578911", "0.5560217", "0.5503399", "0.550325", "0.5499633", "0.54661685", "0.54436845", "0.5436915", "0.54277563", "0.5353894", "0.5350977", "0.5335725", "0.53324103", "0.5323441", "0.5316069", "0.5312465", "0.52975184", "0.5294962", "0.52766126", "0.5274408", "0.5241601", "0.5226672", "0.5215689", "0.5215618", "0.521113", "0.5208531", "0.51928526", "0.51915073", "0.5190518", "0.5179483", "0.5156709", "0.51557875", "0.5146656", "0.51381904", "0.512772", "0.5110193", "0.50809586", "0.507977", "0.5070884", "0.50698483", "0.50540155", "0.50389856", "0.50235337", "0.5002722", "0.49975973", "0.49964264", "0.4992188", "0.49891412", "0.49811512", "0.49785438", "0.49568954", "0.49551925", "0.4950294", "0.4944449", "0.4943571", "0.49394718", "0.49221572", "0.4908005", "0.4906561", "0.49011084", "0.48969555", "0.4885509", "0.48838198", "0.4878539", "0.4870887", "0.4867335", "0.48658115", "0.48631206", "0.4860925", "0.48591414", "0.485857", "0.48540905", "0.48518294", "0.4843024", "0.4841826", "0.48402506", "0.4839953", "0.48348084", "0.48321128", "0.48259425", "0.48207238", "0.48204604", "0.48199537", "0.48171684", "0.48156023", "0.4815023", "0.4812624", "0.48085254", "0.48082095", "0.48066044", "0.48037344", "0.480228", "0.4798704", "0.47970396", "0.47949374", "0.47901243" ]
0.5386754
13
This method will be invoked when the user enters the user's height
handleHeightChange(event) { let processedData = event.nativeEvent.text; this.setState({ height: processedData }) this.bmi(processedData, this.state.weight); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getHeight(v) {\n self = v;\n self.prompt({\n type: 'input',\n name: 'height',\n default: false,\n message: 'Max height? ',\n },\n function(result){\n if (result.height)\n height = result.height;\n doResize(self);\n });\n}", "function validate_height() {\n\tvar height_input = $('#height');\n\tvar height_val = parseInt(height_input.val());\n\tif(isNaN(height_val)) {\n\t\theight_val = 0;\n\t}\n\n\tif(height_val < height_input.data('min') || height_val > height_input.data('max')) {\n\t\tshow_input_error('height', true);\n var oConfig = $('div.configoption');\n oConfig.html('<div class=\"config-waiting\"><p>Enter your sizes to view further options</p></div>');\n reset_selected_options();\n\t\treturn false;\n\t} else {\n\t\tshow_input_error('height', false);\n\t\treturn true;\n\t}\n}", "set height(value) {\n if (value === this.heightIn) {\n return;\n }\n this.heightIn = value;\n this.notifyPropertyChanged('height');\n }", "set height(value) {}", "heightChanged(e) {\n this.setState({height: parseInt(e.target.value)});\n }", "function validateHeight(height) {\n var labelHeight = document.getElementById(\"informationLabelHeight\");\n\n if(measurementUnit === \"imperial\") {\n height = height * 2.54;\n }\n\n if(validateUserInput(height, 54.6, 251)) {\n labelHeight.classList.remove(\"statusAlert\");\n labelHeight.classList.add(\"statusSuccess\");\n labelHeight.innerHTML = \"<i class=\\\"iconSuccess\\\"></i> You have entered a valid height\";\n\n return true;\n }\n\n else {\n labelHeight.classList.remove(\"statusSuccess\");\n labelHeight.classList.add(\"statusAlert\");\n\n if(measurementUnit === \"metric\") {\n labelHeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your height must be between 54.6 and 251 cm\";\n }\n\n else {\n labelHeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your height must be between 21.5 and 99.2 in\";\n }\n\n return false;\n }\n}", "function getHeight() {\n var height = Number(document.getElementById(\"theheight\").value);\n return height;\n\n}", "handleHeightChange(e) {\n // console.log(e.target.value);\n this.setState({ 'height': e.target.value });\n \n }", "setHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"Height\")),t!==this.__height&&(this.__height=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"Height\"}),this.__processHeight())}", "setHeight(){\n var newHeight = prompt(\"Enter a new bitmap height: \", 8);\n if(newHeight != null){\n newHeight = parseInt(newHeight);\n if(newHeight != NaN){\n if(newHeight >= 1 && newHeight <= 40){\n this.ROW_COUNT = newHeight;\n this.updatePanelTitle();\n this.renderGrid();\n this.saveLocally();\n this.applyGridSize();\n return true;\n }else{\n alert(\"That height is too large (min: 1, max: 40)\")\n return false;\n }\n }\n }\n return false;\n }", "function setCameraHeightValue()\r\n{\r\n // Step 3: Set camera height\r\n \r\n // Prompt user for estimated height of camera\r\n var heightEstimate = prompt(\"Please input estimated height of phone to ground in metres\");\r\n \r\n // Check for invalid inputs such as\r\n // 1. No input at all\r\n // 2. Input less than zero (negative) or input greater than 3\r\n // 3. Input is not a number (NaN)\r\n // 4. Input is alphanumeric or alphabets\r\n \r\n if (heightEstimate == null)\r\n {\r\n // if user press cancel when set cam height\r\n // do nothing\r\n }\r\n else if(heightEstimate === \"\" || heightEstimate <= 0 || heightEstimate >= 3 || isNaN(heightEstimate) === true) \r\n {\r\n // alert user of invalid input\r\n alert(\"please input legit value\");\r\n }\r\n else\r\n {\r\n //store height estimate value to camera height value\r\n camHeight = heightEstimate;\r\n \r\n // Display estimated height of camera\r\n cameraVideoPage.displayMessage(\"Estimated height of camera is: \" + camHeight + \" metres\", 2000);\r\n \r\n // Check if camera height is updated after estimated distance is already calculated at least once\r\n checkValues();\r\n } \r\n \r\n}", "function _onValueChanged(event) {\n this._heightInvalidated = true;\n }", "setHeight(height) {\n this.height = height;\n }", "setHeightIfBigger(height) {\n if (height > this.height) this.height = height;\n }", "function displayHeight() {\n\n // set the content of desired element --------------- to the value of the height selector\n document.getElementById(\"height_display\").innerHTML = parseInt(document.getElementById(\"height\").value);\n}", "height(e) {\n this.setState({ height: e.nativeEvent.text }, function () {\n this.bmi();\n });\n\n }", "set minHeight(value) {}", "function DDLightbarMenu_SetHeight(pHeight)\n{\n\tif (typeof(pHeight) == \"number\")\n\t{\n\t\tif ((pHeight > 0) && (pHeight <= console.screen_rows))\n\t\t\tthis.size.height = pHeight;\n\t}\n}", "function heightChange(event,slider){\n $slider.css('height',slider.value + 'px');\n $('#higVal').text(slider.value + 'px');\n }", "function getHeight(){\n\tvar usersHeight = screen.height;\n\tvar uHeight = usersHeight - 300;\n\t\t\tdocument.getElementById('container').style.minHeight=uHeight+10+\"px\";\n}", "function displayHeight () {\n const sealevel = document.getElementById(\"sea-level\");\n sealevel.innerHTML = Math.floor(diveHeight);\n\n const conv = document.getElementById(\"conversion-rate\");\n conv.innerHTML = convRate;\n }", "function myheight(e){\r\n if(inputh.value<0 || inputh.value.length>4){\r\n alert(\"you have entered wrong value or enter two decimal point or enter all the fields\");\r\n inputh.value=\"\";\r\n }\r\n else if(exp.test(inputh.value) && event.key==\"Enter\"){\r\n inputHeight=inputh.value;\r\n BMI=inputWeight / (inputHeight ** 2);\r\n let heading=document.querySelector('.heading');\r\n const todayBmi = BMI.toFixed(2);\r\n heading.innerHTML=todayBmi;\r\n valueBmi.push(todayBmi);\r\n valueWeight.push(inputWeight);\r\n function ishealthy(){\r\n if(todayBmi>=30){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Obese : (\";\r\n }\r\n else if(todayBmi>25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Overweight : (\";\r\n }\r\n else if(todayBmi<19){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Underweight : (\";\r\n }\r\n else if(todayBmi>=19 || valueBmi<=25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Normal weight : )\";\r\n }\r\n }\r\n ishealthy();\r\n \r\n \r\n //local storage save function\r\n saveFunc= () =>{\r\n localStorage.setItem('valueOfWeight',JSON.stringify(valueWeight));\r\n localStorage.setItem('values',JSON.stringify(valueBmi));\r\n }\r\n }\r\n }", "_updateHeight () {\n const height = document.body.scrollHeight\n if (height === this._lastHeight) {\n return\n }\n \n this._lastHeight = height\n this._sendMessage('height', { height: height })\n }", "function setHeight(height)\n {\n _height = height;\n }", "function setBookshelfHeightUI(){\n\tvar hDiv = document.getElementById(\"heightOut\");\n\tvar inches = bookshelf.height/25.4;\n\thDiv.value = parseFloat(inches).toFixed(1);\n}", "set setHeight (height) {\n this.height = height;\n }", "changeHeight() {\n\n // Get a random height and store in variable\n this.height = Math.floor(Math.random() * 200);\n\n // Check if height is less then 30\n if(this.height < 30) {\n // Set the height to 30\n this.height = 30;\n }\n\n // Set the y value of the pipe\n this.y = board.height - this.height;\n\n // Store the y-value in variable\n y_value = this.y;\n\n }", "determineHeight()\n {\n // figure the min and max\n let min = Math.max(this.icePoint.height - this.searchRange, -this.totalRange),\n max = Math.min(this.icePoint.height + this.searchRange, this.totalRange);\n // pick a random int between those\n this.height = helper.getRandomIntegerBetween(min, max);\n // Make sure it's not the same as the icePoint\n if(this.height === this.icePoint.height)\n {\n if(this.height === this.totalRange)\n {\n // all we can do is shift it down\n this.height --;\n }\n else if (this.height === -this.totalRange)\n {\n // all we can do is shift it up\n this.height++;\n }\n else\n {\n // we can shift it either way\n let shift = helper.getRandomIntegerBetween(0, 1);\n this.height += shift?1:-1;\n }\n }\n }", "function acceptHeight(){\n clearTimerCheck();\n var tl = gsap.timeline();\n\n tl.to(\"#heightCheck\", {\n duration: 1,\n y: 300,\n opacity: 0\n })\n tl.set(\"#heightCheck\", {display: 'none'})\n tl.from(\"#difficultybox\", {\n display: 'block',\n duration: 1,\n y: 400,\n opacity: 0\n\n })\n tl.call(setTiplist)\n tl.set(\"#difficultybox\", {display: 'block'});\n\n return tl;\n}", "get height() {\n return this.heightIn;\n }", "get height() {\n return this.heightIn;\n }", "get heightChanged() {\n return (this.flags & 2 /* Height */) > 0;\n }", "set height(height) {\n // this._height = height;\n }", "set height(height) {\n // this._height = height;\n }", "function heightslider(val) {\n //show the selected height on the slider\n document.getElementById(\"showheight\").innerHTML = val;\n //retrieve the height and symbol\n bricksymbol = brickElem.value;\n heightStr = heightElem.value;\n height = parseInt(heightStr);\n //draw pyramid with these parameters\n drawPyramid(height,bricksymbol);\n}", "height() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "setHeight(height) {\n const realFeet = ((height * 3.93700) / 12);\n const feet = Math.floor(realFeet);\n const inches = Math.round((realFeet - feet) * 12);\n this.height = `${feet}' ${(`0${inches}`).substr(-2)}''`;\n }", "onChangeTotalHeight() {\n if (this.client.isEngineReady) {\n // redraw all dependencies if the height changes. Could be caused by resource add/remove.\n // in reality not all deps needs to be redrawn, those fully above the row which changed height could be left\n // as is, but determining that would likely require more processing than redrawing\n this.scheduleDraw(true);\n }\n }", "get height() {}", "set height(height) {\n this.instance.setHeight(height);\n }", "function height(param) {\n if (param) {\n return param.h;\n } else {\n return 0;\n }\n }", "getHeight() {\n console.log(this.height);\n }", "onChangeTotalHeight() {\n // redraw all dependencies if the height changes. Could be caused by resource add/remove.\n // in reality not all deps needs to be redrawn, those fully above the row which changed height could be left\n // as is, but determining that would likely require more processing than redrawing\n this.scheduleDraw(true);\n }", "get height() { return this._height; }", "function handleSize() {\n const height = document.getElementById('image').clientHeight\n console.log(height)\n setHeight(-height)\n }", "function rangeChange() {\n heightElem = document.getElementById(\"height\").value;\n drawPyramid(heightElem);\n}", "set heightType(value) {\n if (value === this.heightTypeIn) {\n return;\n }\n this.heightTypeIn = value;\n this.notifyPropertyChanged('heightType');\n }", "function heightDetect() {\n\t\t$(\".main_head\").css(\"height\", $(window).height());\n\t}", "trackHeight(height) {\n if ( this.maxUserHeight && height != this.prevUserHeight ) {\n var delta = height-this.prevUserHeight;\n //this.trackDelay = 1000/this.fps;\n //var speed = delta/this.trackDelay*1000; // speed in m/s\n var speed = delta*this.fps;\n if ( this.jumping ) {\n var delay = Date.now() - this.jumping;\n if ( height <= this.maxUserHeight && delay > 300 ) {\n this.standUp();\n this.jumping = null;\n this.log(\"jump stopped\")\n } else if ( delay > 500 ) {\n this.log(\"jump stopped - timeout\")\n this.standUp();\n this.jumping = null;\n } else {\n this.jump(height - this.maxUserHeight);\n }\n } else if ( height > this.maxUserHeight && Math.abs(speed) > 0.2 ) {\n // CHECKME speed is not really important here\n this.jump(height - this.maxUserHeight);\n this.jumping = Date.now();\n this.log(\"jump starting\")\n } else {\n // ignoring anything less than 1mm\n if ( delta > 0.001 ) {\n this.rise(delta);\n } else if ( delta < -0.001 ) {\n this.crouch(-delta);\n }\n }\n\n } else {\n this.maxUserHeight = height;\n }\n this.prevUserHeight = height;\n }", "function checkRectHeight() {\n if (rectangle.uCornerY < 0) {\n state = `level up`\n } else {\n state = `simulation`\n }\n}", "height() {\n return this.win.innerHeight;\n }", "handleShelfHeightChange( event ) {\n let [ stackIndex, shelfIndex, height ] = event.target.value.split( /,/ )\n this.props.setShelfHeight( Number( stackIndex ), Number( shelfIndex ), Number( height ))\n }", "get height() {\n return this._getOption('height');\n }", "function fullHeight() {\r\n let elements = document.querySelectorAll('.set-h'),\r\n innerInput = document.querySelector('.questions-section .drop-menu'),\r\n winHeight = window.innerHeight;\r\n if (winHeight <= 690 && winHeight > 550) {\r\n winHeight += 70;\r\n } else if (winHeight <= 550) {\r\n winHeight += 150;\r\n }\r\n for (let i = 0; i < elements.length; i++) {\r\n if (elements[i].classList.contains('full-h')) {\r\n elements[i].style.minHeight = winHeight + 'px';\r\n } else {\r\n elements[i].style.minHeight = (winHeight - 87) + 'px';\r\n }\r\n }\r\n // add space below questions\r\n if (window.innerHeight > 660) {\r\n innerInput.style.marginBottom = globalFun.animationSpeed([80,100,130,180], null) + \"px\";\r\n } else {\r\n innerInput.style.marginBottom = globalFun.animationSpeed([80,100,180,180], null) + \"px\";\r\n }\r\n }", "getHeight(){return this.__height}", "setHeightMode(valueNew){let t=e.ValueConverter.toSizeMode(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"HeightMode\")),t!==this.__heightMode&&(this.__heightMode=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"HeightMode\"}),this.__processHeightMode())}", "static keyboardListener(height) {\n const keyboardHeight = Platform.OS === 'android' ? height / PixelRatio.get() : height;\n RNKeyboard.callbacks.forEach(callback => {\n callback(keyboardHeight);\n });\n }", "set maxHeight(value) {}", "function getHeight(){\n let height = $('.accountOverview-content').height();\n $('.verticalMenu').css('height', height);\n}", "function updateWorldHeight() {\n const unit = document.querySelector(\"#options-height-unit\").value;\n const value = Math.max(0.000000001, document.querySelector(\"#options-height-value\").value);\n const oldHeight = config.height;\n\n setWorldHeight(oldHeight, math.unit(value, unit));\n}", "setHeightUnit(valueNew){let t=e.ValueConverter.toDimensionUnit(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"HeightUnit\")),t!==this.__heightUnit&&(this.__heightUnit=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"HeightUnit\"}),this.__processHeightUnit())}", "get height() {\n\t\treturn this._height;\n\t}", "get height() {\n\t\treturn this._height;\n\t}", "function playerHeight() {\n\treturn 30;\t\n}", "set pageHeight(value) {\n this.pageHeightIn = value;\n this.notifyPropertyChanged('pageHeight');\n }", "get height() { return 2.5; }", "setHeight() {\n if(this.props.height && Number.isInteger(this.props.height)) {\n this.setState({\n height: this.props.height\n });\n }\n }", "function heightDetect() {\n $(\".main_head\").css(\"height\", $(window).height());\n }", "get height() {\n return this.m_height;\n }", "function getHeight(){\n\tif( $(window).height() > MAXHEIGHT +100 ) return MAXHEIGHT;\n\treturn $(window).height() - 100;\n}", "function change_height() {\n\tvar w = document.getElementById(\"input_width\").value;\n\tvar h = document.getElementById(\"input_height\").value;\n\tvar dh = document.getElementById(\"input_dest_height\").value;\n\tvar dw = document.getElementById(\"input_dest_width\");\n\n\tdw.value = (w*dh/h)\n}", "function setHeight() {\n $('.voyage').css('height', 'auto');\n var maxHeight = Math.max.apply(null, $(\".voyage\").map(function() {\n return $(this).height();\n }).get());\n $('.voyage').height(maxHeight);\n }", "get heightType() {\n return this.heightTypeIn;\n }", "get height() {\n return this._height;\n }", "get height() {\n return this._height;\n }", "function handleToggleHeightProfile(e) {\n\t\t\tvar height = $('#heightProfile').get(0);\n\n\t\t\t//when calling this for the first time on page startup, style.display attribute will be empty which corresponds to the default case of \"not visible\"\n\t\t\tif (height.style.display == 'inline') {\n\t\t\t\t//height profile is visible, hide it\n\t\t\t\t$('#heightProfile').css('display', 'none');\n\t\t\t\t$('#map').css('bottom', '25px');\n\t\t\t\t$('#toggleHeightProfile').attr('class', 'heightProfileInvisible');\n\t\t\t\t//trigger map update\n\t\t\t\ttheInterface.emit('ui:mapPositionChanged');\n\t\t\t} else {\n\t\t\t\t//height profile is not visible, show it\n\t\t\t\t$('#heightProfile').css('display', 'inline');\n\t\t\t\t$('#map').css('bottom', '200px');\n\t\t\t\t$('#toggleHeightProfile').attr('class', 'heightProfileVisible');\n\t\t\t\t//trigger map update\n\t\t\t\ttheInterface.emit('ui:mapPositionChanged');\n\t\t\t}\n\t\t}", "getMaxHeight(){return this.__maxHeight}", "function setHeight(){\n\tvar h = document.body.clientHeight-8;\n\treturn h/2;\n}", "function setverticalBounds() {\n\n\tlet maxExpandingHeight = document.getElementById('expandingMax').value;\n\tlet minExpandingHeight = document.getElementById('expandingMin').value;\n\n\tdocument.getElementById('expandingTextArea').setAttribute('style', \n\t\t\t\t\t\t\t'max-height:' + maxExpandingHeight + 'em;' +\n\t\t\t\t\t\t\t'min-height:' + minExpandingHeight + 'em;'\n\t\t\t\t\t\t\t);\n\n}", "setMaxHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"MaxHeight\")),t!==this.__maxHeight&&(this.__maxHeight=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"MaxHeight\"}),this.__processMaxHeight())}", "get minHeight() {}", "_getGameHeight() {\n return this.scene.scene.manager.game.config.height;\n }", "function changeHeight() {\n var profileBox = $('.profile__item');\n var max = 0;\n profileBox.each(function() {\n if (max < $(this).outerHeight()) {\n max = $(this).outerHeight();\n }\n })\n profileBox.height(max);\n }", "function getHeight(elem, eventTarget) {\n if (eventTarget === 1) {\n elem.style.display = 'block';\n var height = elem.scrollHeight + 'px';\n elem.style.display = '';\n } else if (eventTarget === 2) {\n var height = headerHeight;\n } else if (eventTarget === 3) {\n var height = searchBarHeight;\n }\n return height;\n}", "function userInput (event) {\n\tif (height.value === \"\" || char.value === \"\") {\n\t\talert(\"Both fields require a value!\");\n\t} else {\n\t\ttree(event);\n\t}\n}", "function setHeroHeight() {\n var cars = document.querySelector('#cars');\n var personalTrucks = document.querySelector('#personalTrucks').offsetHeight;\n // var personalTrucks = document.querySelector('#personalTrucks');\n if(window.innerWidth >= 1024) { \n // cars.style.height = \"auto\";\n var carSelection = document.querySelector('#carSelection').offsetHeight;\n // var carSelection = document.querySelector('#carSelection').style.height;\n // console.log(carSelection+' is the car selection height');\n red.style.height = carSelection+'px';\n }\n else if(window.innerWidth >= 639 && window.innerWidth < 1024) {\n cars.style.height=personalTrucks+'px';\n }\n else if(window.innerWidth < 638) {\n cars.style.height = 'auto';\n }\n}", "getHeight() {\n return this.height;\n }", "getHeight() {\n return this.height;\n }", "get height() {\n return this.bottom - this.top;\n }", "function checkHeightAndReturn() {\n const iframe = d3Select(this.root).selectAll('iframe');\n lastHeight = height;\n height = parseInt(iframe.node().style.height.replace(\"px\", \"\"));\n if(height > 0 && heightStableSince > 3) {\n this.props.onLoadSuccess(height, this.props.item);\n window.clearInterval(this.heightCheckInterval);\n }\n\n if(height === lastHeight) \n heightStableSince += 1;\n else\n heightStableSince = 0;\n }", "function setHeight(value){\n var val = value || Math.min(textarea.scrollHeight, settings.maxHeight);\n textarea.style.height = val + 'px';\n\n //we store the height locally so that other pages can adjust to this height\n localStorage.setItem('height', val);\n }", "function taskPeak() {\n let height = document.getElementById('tasks').style.height;\n if (height == '0vh' || height == '') {\n document.getElementById('tasks').style.height = '2vh';\n }\n}", "function setBoxHeight() {\n var maxHeight = -1;\n\n $('.home_box').each(function() {\n maxHeight = maxHeight > $(this).height() ? maxHeight : $(this).height();\n });\n $('.home_box').each(function() {\n $(this).height(maxHeight);\n });\n }", "setMinHeight(valueNew){let t=e.ValueConverter.toNumber(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"MinHeight\")),t!==this.__minHeight&&(this.__minHeight=t,e.EventProvider.raise(this.__id+\".onPropertyChanged\",{propertyName:\"MinHeight\"}),this.__processMinHeight())}", "function awardsItemHei() {\n var awardsHei = $(window).height();\n orientHeight = $(window).height();\n orientWidth = $(window).width();\n if (orientWidth>orientHeight) { \n $('.awards_grid .grid__item').css('height', (+awardsHei/2.5)+'px');\n } else {\n $('.awards_grid .grid__item').css('height', (+awardsHei/4)+'px');\n }\n }", "function WinHeight(){\r\n\t\tvar heightWin = $(\".dhtmlx_window_active\").height();\r\n\t\tvar heightForm = $(\".dhxform_base\").height();\r\n\t\tif (heightWin == 0) {\r\n\t\t\tparseInt(document.getElementsByClassName(\"dhtmlx_wins_body_outer\")[0].style.height = heightForm+42);\r\n\t\t\t//console.log(\"Altura automatica\");\r\n\t\t} else {\r\n\t\t\t//console.log(\"Altura manual \"+heightWin);\r\n\t\t}\r\n\t}", "handleOnResize () {\n const contentHeight = this.contentNode.offsetHeight\n const minimumHeight = this.minimumLinesNode\n ? this.minimumLinesNode.offsetHeight\n : 0\n const newHeight = Math.max(contentHeight, minimumHeight)\n\n const { currentHeight, onResize } = this.props\n\n if (newHeight !== currentHeight) {\n onResize(newHeight)\n }\n }", "adjustUI() {\n this.calculateHeightOfCy(this);\n var _this = this;\n window.addEventListener(\n \"resize\",\n function() {\n _this.calculateHeightOfCy(_this)\n },\n true\n );\n }", "get height() {\n return this._height;\n }", "changeClosetHeight(height) {\n if (height > 0) {\n var axesHeight = height / 2;\n var heighpos = this.faces.get(FaceOrientation.TOP).Y()[4]; //TODO: Remove heighpos ?\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.TOP).Y()-this.faces.get(FaceOrientation.LEFT).height()/2)+axesHeight);\n this.faces.get(FaceOrientation.TOP).changeYAxis((this.faces.get(FaceOrientation.BASE).Y()+this.faces.get(FaceOrientation.LEFT).height()/2)-axesHeight);\n this.faces.get(FaceOrientation.LEFT).changeHeight(height);\n this.faces.get(FaceOrientation.RIGHT).changeHeight(height);\n this.faces.get(FaceOrientation.BACK).changeHeight(height);\n for(let closetSlot of this.getSlotFaces()){\n closetSlot.changeHeight(height);\n }\n }\n }" ]
[ "0.69657505", "0.6873752", "0.68288296", "0.6765178", "0.66402763", "0.65976703", "0.65873045", "0.6566793", "0.64935434", "0.6410726", "0.63767767", "0.6331607", "0.63315344", "0.6300445", "0.62113273", "0.619939", "0.61823785", "0.6180856", "0.6178543", "0.6177369", "0.61498934", "0.6146558", "0.6140886", "0.6119825", "0.6112461", "0.6112165", "0.6111576", "0.6106247", "0.6093583", "0.60724384", "0.60724384", "0.606125", "0.6032496", "0.6032496", "0.6027367", "0.6018324", "0.60085344", "0.6003839", "0.5972014", "0.5970863", "0.5937921", "0.59144765", "0.59115577", "0.59051263", "0.58931434", "0.58813524", "0.5879164", "0.5871852", "0.5871499", "0.58579826", "0.58471453", "0.5844862", "0.5844639", "0.5844638", "0.58318114", "0.5822889", "0.58220476", "0.58097434", "0.57987607", "0.5798139", "0.5776088", "0.57632715", "0.57632715", "0.57623124", "0.5761632", "0.5756617", "0.5741747", "0.57400775", "0.57352287", "0.5733156", "0.5728288", "0.57273513", "0.5726273", "0.57259065", "0.57259065", "0.57092935", "0.5709123", "0.5708622", "0.5703311", "0.57004637", "0.56973696", "0.56936026", "0.5683898", "0.5681387", "0.5675551", "0.5664738", "0.5653041", "0.5653041", "0.56449574", "0.5643035", "0.5642956", "0.5637808", "0.56362754", "0.56355447", "0.56277275", "0.56251884", "0.5624836", "0.56181675", "0.56094694", "0.5600108" ]
0.63257915
13
This method will be invoked when the user enters the user's weight
handleWeighttChange(event) { let processedData = event.nativeEvent.text; this.setState({ weight: processedData }) this.bmi(this.state.height, processedData); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleWeight(e) {\n e.preventDefault();\n dispatch(orderByWeight(e.target.value));\n setPagActual(1);\n }", "handleLetsGo(event) {\n event.preventDefault();\n const weight = this.element.value;\n if (this.state.accept) {\n //alert(\"start analysis your bmi ,wait\")\n this.setState({\n show: false\n })\n // console.log(weight);\n this.handleChangeWeight(weight);\n }\n }", "weightChanged(e) {\n this.setState({weight: parseInt(e.target.value)});\n }", "handleWeightChange(e) {\n this.setState({ 'weight': e.target.value });\n }", "function validateWeight(weight) {\n var labelWeight = document.getElementById(\"informationLabelWeight\");\n\n if(measurementUnit === \"imperial\") {\n weight = weight * 0.453592;\n }\n\n if(validateUserInput(weight, 2.1, 560)) {\n labelWeight.classList.remove(\"statusAlert\");\n labelWeight.classList.add(\"statusSuccess\");\n labelWeight.innerHTML = \"<i class=\\\"iconSuccess\\\"></i> You have entered a valid weight\";\n\n return true;\n }\n\n else {\n labelWeight.classList.remove(\"statusSuccess\");\n labelWeight.classList.add(\"statusAlert\");\n\n if(measurementUnit === \"metric\") {\n labelWeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your weight must be between 2.1 and 560 kg\";\n }\n\n else {\n labelWeight.innerHTML = \"<i class=\\\"iconAlert\\\"></i> Your weight must be between 4.7 and 1234.6 lb\";\n }\n\n return false;\n }\n}", "function getWeight() {\n var weight = Number(document.getElementById(\"theweight\").value);\n return weight;\n}", "weight(e) {\n this.setState({ weight: e.nativeEvent.text }, function () {\n this.bmi();\n });\n }", "function onType() {\n let weight = document.querySelectorAll(\".bmi .calc input\")[0].value;\n let height = document.querySelectorAll(\".bmi .calc input\")[1].value;\n if (weight != \"\" && height != \"\") {\n // document.querySelector(\".bmi .ans\").style.display = \"flex\";\n document.querySelector(\".bmi .ans\").innerHTML = (Number(weight) / (Math.pow(Number(height), 2))).toFixed(1);\n }\n else {\n document.querySelector(\".bmi .ans\").innerHTML = \"הכניסו נתונים\";\n }\n}", "setWeightFromEvent(e) {\n const value = parseFloat(e.target.value)\n const newValue = (Number.isNaN(value))? \"\" : value;\n this.props.setWeight(newValue)\n }", "changeWeight(weight) {\n this._currentWeight = weight\n }", "handleChange(event) {\r\n this.setState({ weight: event.target.value });\r\n }", "function checkweight(){\n let weight = prompt(\"How much do you weight\");\n if (weight > 170) { //then\n alert(\" Your to fat to be here go away\"); \n\n }\n if( weight < 170){ //then\n alert (\"You need some meat on your bones. Get food now!!!!! But read my story first this took me a lot of time todo. Then go get something to eat. Now\");\n }\n}", "set weight(value) {}", "function calculateWeight() {\n var theWeight = document.getElementById(\"user-weight\").value;\n var thePlanet = document.getElementById(\"planets\").selectedIndex;\n var theGravity = planets[thePlanet].gravity;\n var planetName = planets[thePlanet].planet;\n var results = theWeight * theGravity;\n var totalWeight = results;\n document.getElementById(\"output\").innerHTML= \"If you were on \" + planetName + \", you would weigh \" + totalWeight + \"lbs!\";\n\n}", "function updateWeight () {\n\n\tdocument.getElementById(\"weight_val\").value = document.getElementById(\"weight_val_selector\").value;\n}", "function setWeight(){\n\t //remove the old event listenner;\n\t if (window.removeEventListener) {\n\t\t\twindow.removeEventListener('click',clickHandler);\n\t }\t\n\t else if (window.detachEvent) {\n\t\t\twindow.detachEvent('click',clickHandler);\n\t }\n\t\n\t //restart the game;\n\t if(myStartBt.isStart)\n\t\tmyGameArea.stop();\n\t startGame();\n\t \n\t myBucket.weight=Number(document.getElementById(\"bucket\").value);\n\t mySlider.weight=Number(document.getElementById(\"slider\").value);\n\t myGameArea.frictionFactor=Number(document.getElementById(\"frictionFactor\").value);\n\t mySlider.gravity=myGameArea.frictionFactor*0.03;\n\t myBucket.gravity=(myBucket.weight-myGameArea.frictionFactor*mySlider.weight)/(myBucket.weight+mySlider.weight)*0.05;\n\t output.a=(myBucket.weight-myGameArea.frictionFactor*mySlider.weight)/(myBucket.weight+mySlider.weight)*output.g;\n\t //the animation will run very fast if myBucket.gravity==output.a\n}", "function calculateWeight(userWeight, planetName){\n var userWeight = document.getElementById(\"user-weight\").value;\n var planetName = document.getElementById(\"planets\").selectedIndex;\n var gravity = planets[planetName][1];\n var result = userWeight * gravity;\n return result;\n}", "function healthyWeight(){\n var hw = document.getElementById(\"hweight\").value;\n if (hw <= 18.5){\n return \"Underweight\";\n } else if (hw<=24.9){\n return \"Ideal\";\n } else if (hw <=29.9){\n return \"Overweight\";\n } else{\n return \"Obesity\";\n }\n\n}", "function showTextBox(text){\n weightChanged = false;\n $('#edgeWeight').val(text);\n $('#editEdgeWeightForm').modal('show');\n $('#edgeWeightSubmit').bind('click', function(){\n var newWeight = Number($('#edgeWeight').val());\n console.log(\"New weight: \"+newWeight);\n if (newWeight == NaN){\n alert(newWeight+ \" is not a number. \\nPlease\" \n + \"Enter a number between 0 and 1\");\n return;\n }\n updateWeight(newWeight);\n $(\"#editEdgeWeightForm\").modal('hide');\n return true;\n });\n}// end(showTextBox)", "function dateWeighting(){\n \n dateWeight = 1;\n \n }", "function bmiCalc() {\n //prompt whether user wants to use the imperial or metric system\n var type = parseInt(prompt(\"please chose your operation \\n\" + \"1 - Imperial (lb)\\n\" +\" 2 - Metric (kg)\"));\n // conditional if the type is imperial\n var weight, height, value_array;\n if (type == 1) {\n value_array = prompt_for_values(2,\"please enter your weight(lb)\",\"please enter your height(in)\");\n weight = value_array[0];\n height = value_array[1];\n // we carry out the imperial formula for BMI calculation\n return alert(\"Your BMI is :\" + (weight / Math.pow(height,2) * 703).toFixed(2));\n // conditional if the type is metric\n }else if(type == 2 ){\n value_array = prompt_for_values(2,\"please enter your weight(kg)\",\"please enter your height(m)\");\n weight = value_array[0];\n height = value_array[1];\n //we carry our the metric formula\n return alert(\"Your BMI is : \" + (weight / Math.pow(height,2).toFixed(2)).toFixed(2));\n }\n}", "displayWeight(){\n console.log(`${this.weight} pounds`);\n }", "activateUpdateHandler(item_id, inx, type){\n //implement\n if(type==\"input\"){\n try {\n var id = \"priority_\" + inx;\n var weight = document.getElementById(id).value;\n {weight==\"\"? this.setState({ alertopen: true }) : putUpdate(item_id, inx, Number(weight), this.props.updateWeight, this)}\n document.getElementById(id).value=\"\";\n }\n catch(error) {\n //not number value\n this.setState({ alertopen: true });\n }\n }\n else if(type==\"increase\"){\n putUpdate(item_id, inx, this.props.data.event_data[inx].weight + 1, this.props.updateWeight, this);\n }\n else if(type==\"decrease\"){\n putUpdate(item_id, inx, this.props.data.event_data[inx].weight - 1, this.props.updateWeight, this);\n }\n else if(type==\"top\"){\n putUpdate(item_id, inx, this.props.data.event_data[0].weight + 1, this.props.updateWeight, this);\n }\n else if(type==\"bottom\"){\n var len = this.props.data.event_data.length-1;\n var newWeight = this.props.data.event_data[len].weight==0? 0 : this.props.data.event_data[len].weight - 1\n putUpdate(item_id, inx, newWeight, this.props.updateWeight, this);\n }\n }", "function BMIcalculate()\n{\n //Getting the user input for weight //\n var weightofuser = document.getElementById(\"weight\").value;\n //Getting the user input for height //\n var heightofuser = document.getElementById(\"height\").value;\n \n// Calculating the BMI of user //\n \n var BMI = (weightofuser / (heightofuser*heightofuser));\n \n// If statement for BMI Under 18.5 ///\n if ( BMI > 0 && BMI < 18.5)\n {\n // Displaying the result for Underweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Underweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI between 18.5 & including 24.9 //\n else if ( BMI >= 18.5 && BMI <= 24.9)\n {\n // Displaying the result for Normal //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Normal.\"+\"</li>\";\n \n }\n\n// If statement for BMI between 25 & including 29.9 //\n else if ( BMI >= 25 && BMI <= 29.9)\n {\n // Displaying the result for Overweight //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Overweight.\"+\"</li>\";\n \n }\n \n// If statement for BMI over 30 //\n else \n {\n // Displaying the result for Obese //\n document.getElementById(\"BMIresult\").innerHTML =\"<li>\"+ \"Your BMI Measures :-\" +BMI+\".\"+\"</li>\"+\"<br>\"+\"<li>\"+\"You are Obese.\"+\"</li>\";\n \n } \n \n}", "function stealthWeapon() {\n var currentUnitPoints = parseInt(event.target.parentNode.childNodes[2].childNodes[0].innerHTML);\n var currentTotal = parseInt(totalPoints.innerText);\n if (event.target.value === \"Fusion Blaster - 4pt\") {\n totalPoints.innerText = currentTotal +4;\n event.target.parentNode.childNodes[2].childNodes[0].innerHTML = currentUnitPoints +4;\n } else {\n totalPoints.innerText = currentTotal -4;\n event.target.parentNode.childNodes[2].childNodes[0].innerHTML = currentUnitPoints -4;\n }\n}", "function heuristics(weight) {\n choice = 1;\n w = weight;\n}", "function bmiCalc(){\n let weight = $('#weight').val()\n let height = $('#height').val()\n let bmi = weight/(height**2)\n $('#bmi').val(bmi)\n}", "function calculateBmi() {\n\n let weight = document.getElementById(\"weight_input\").value;\n let height = document.getElementById(\"height_input\").value;\n bmi = weight / (height / 100) ** 2\n\n //if any input is empty, give message that you have to fill inn all of the inputs.\n if (weight == \"\" || height == \"\") {\n document.getElementById(\"bmi_output\").innerHTML = \"Please fill all of the inputs\";\n document.getElementById(\"bmi_output_def\").innerHTML = \"\";\n }\n //if all inputs is filled, run this else that runs some if statements, dependent on the bmi.\n else {\n document.getElementById(\"bmi_output\").innerHTML = \"Your BMI is: \" + parseFloat(bmi).toFixed(2);\n\n if (bmi < 18.4) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Underweight\";\n }\n else if (bmi < 24.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Normalweight\";\n }\n else if (bmi < 29.9) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Overweight\";\n }\n //a bmi over 100 doesn't make any sense.\n else if (bmi > 100) {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That can't be right, try again\";\n }\n else {\n document.getElementById(\"bmi_output_def\").innerHTML = \"That makes you: Obese\";\n }\n }\n}", "function checkNetWeight(itemW, itemWType, wtToCheck, wtToCheckType, focusId, panelName) {\r\n if (panelName == 'loanPanel') {\r\n alertMessage = 'Net Weight Exceeding Gross Weight!\\nPlease Enter Correct Net Weight!';\r\n }\r\n if (itemWType == wtToCheckType) {\r\n if (parseFloat(wtToCheck) > parseFloat(itemW)) {\r\n alert(alertMessage);\r\n document.getElementById(focusId).focus();\r\n }\r\n } else {\r\n if (itemWType == 'GM' && wtToCheckType == 'KG') {\r\n alert(alertMessage);\r\n document.getElementById(focusId).focus();\r\n } else if (itemWType == 'MG' && (wtToCheckType == 'GM' || wtToCheckType == 'KG')) {\r\n alert(alertMessage);\r\n }\r\n }\r\n return false;\r\n}", "onChangeWeight(value) {\n\n let ex = this.state.exercise;\n\n ex.weight = value;\n\n this.setState({exercise: ex});\n\n }", "function myheight(e){\r\n if(inputh.value<0 || inputh.value.length>4){\r\n alert(\"you have entered wrong value or enter two decimal point or enter all the fields\");\r\n inputh.value=\"\";\r\n }\r\n else if(exp.test(inputh.value) && event.key==\"Enter\"){\r\n inputHeight=inputh.value;\r\n BMI=inputWeight / (inputHeight ** 2);\r\n let heading=document.querySelector('.heading');\r\n const todayBmi = BMI.toFixed(2);\r\n heading.innerHTML=todayBmi;\r\n valueBmi.push(todayBmi);\r\n valueWeight.push(inputWeight);\r\n function ishealthy(){\r\n if(todayBmi>=30){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Obese : (\";\r\n }\r\n else if(todayBmi>25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Overweight : (\";\r\n }\r\n else if(todayBmi<19){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Underweight : (\";\r\n }\r\n else if(todayBmi>=19 || valueBmi<=25){\r\n var para=document.querySelector('.para');\r\n para.innerHTML=\"you're Normal weight : )\";\r\n }\r\n }\r\n ishealthy();\r\n \r\n \r\n //local storage save function\r\n saveFunc= () =>{\r\n localStorage.setItem('valueOfWeight',JSON.stringify(valueWeight));\r\n localStorage.setItem('values',JSON.stringify(valueBmi));\r\n }\r\n }\r\n }", "function userInput (event) {\n\tif (height.value === \"\" || char.value === \"\") {\n\t\talert(\"Both fields require a value!\");\n\t} else {\n\t\ttree(event);\n\t}\n}", "function computeBMI() {\r\n clearAll(true);\r\n\r\n // obtain user inputs\r\n var height = Number(document.getElementById(\"height\").value);\r\n var weight = Number(document.getElementById(\"weight\").value);\r\n var unittype = document.getElementById(\"unittype\").selectedIndex;\r\n\r\n if (height === 0 || isNaN(height) || weight === 0 || isNaN(weight)) {\r\n setAlertVisible(\"error-bmi-output\", ERROR_CLASS, true);\r\n document.getElementById(\"error-bmi-output\").innerHTML = errorString;\r\n } else { // convert\r\n // Perform calculation\r\n var BMI = calculateBMI(height, weight, unittype);\r\n\r\n // Display result of calculation\r\n var result = \" Your BMI index are <strong>\" + BMI + \"</strong>.\";\r\n var warning = true;\r\n if (BMI < BMI_LOWINDEX)\r\n result = \"<strong>Underweight!!</strong>\" + result + \" C'mon, McDonald is near by then.\";\r\n else if (BMI >= BMI_LOWINDEX && BMI <= BMI_HIGHINDEX) {\r\n warning = false;\r\n result = \"<strong>Normal!</strong>\" + result + \" Good exercises!\";\r\n }\r\n else // BMI > 25\r\n result = \"<strong>Overweight!!!</strong>\" + result + \" Recreation center welcome you !!\";\r\n\r\n // if we need to show warning so we show alert with warning, otherwise we show success message.\r\n if (warning) {\r\n setAlertVisible(\"warning-bmi-output\", WARNING_CLASS, true);\r\n document.getElementById(\"warning-bmi-output\").innerHTML = result;\r\n } else {\r\n setAlertVisible(\"normal-bmi-output\", SUCCESS_CLASS, true);\r\n document.getElementById(\"normal-bmi-output\").innerHTML = result;\r\n }\r\n }\r\n}", "function convertKg() {\n if (dropdown.value === 'pounds') {\n let weight = inputWeight.value;\n weight = (weight/2.2).toFixed(2)\n output.innerHTML = `${(weight)} kilograms`\n }\n if(dropdown.value ==='kg') {\n let weight = inputWeight.value;\n weight = (weight*2.2).toFixed(2)\n output.innerHTML = `${weight} pounds`\n }\n}", "function heuristics1(weight) {\n choice = 2;\n w = weight;\n}", "function bmi(name, weight, height) {\n \n// This is calculating the bmi and storing it into a variable. This is the set standard formula; it cannot be changed.\n var bmiResult = (weight / (height * height)) * 703;\n \n//These are the weight classification for bmi. Depending on the user's bmi, the corresponding message will be sent to the console and alerted to the user.\n if (bmiResult > 29.99) {\n console.log(\"The user is considered obese.\");\n alert(name + \", you are considered obese. \\n\\nYou should consult with your physician on a diet and exercise plan.\");\n } else if (bmiResult > 24.99) {\n console.log(\"The user is considered overweight.\");\n alert(name + \", you are considered overweight. \\n\\nYou should work on losing a few pounds.\");\n } else if (bmiResult > 18.49) {\n console.log(\"The user is considered at a normal weight.\");\n alert(name + \", you are considered normal weight. \\n\\nYou should continue to maintain your weight.\");\n } else {\n console.log(\"The user is considered underweight.\");\n alert(name + \", you are considered underweight. \\n\\nYou should probably bulk up a few pounds.\");\n }\n \n//This is returning the bmiResult outside of the function.\n return bmiResult;\n \n}", "function desirableWeight() {\n var desirableWeight = userInfo[\"desirable-weight\"];\n var weight = userInfo[\"weight\"];\n var step1 = weight - desirableWeight;\n var step2 = step1 * 0.32;\n var DW = step2 + desirableWeight;\n return DW;\n}", "function handleSortByWeight(e){\n e.preventDefault();\n dispatch(sortByWeight(e.target.value));\n setCurrentPage(1);\n setOrderW(`${e.target.value}`);\n e.target.value ='default';\n setOrder(`${e.target.value}`);\n\n}", "function lettersSCalc(weight) {\n\n var result;\n\n if(weight <= 1) {\n return result = 0.49;\n }\n else if (weight <= 2) {\n return result = 0.70;\n }\n else if (weight <= 3) {\n return result = 0.91;\n }\n else if (weight <= 3.5) {\n return result = 1.12;\n }\n else {\n return result = -1;\n }\n}", "function incrementWeight(numberInput) {\n\tif (Number(numberInput.value) < Number(numberInput.max)) {\n\t\tnumberInput.value = Number(numberInput.value) + 1;\n\t}\n}", "get weight() {}", "function CalcWeight()\n{\n if (disable_autocalc())\n return;\n\n var total = 0.0;\n var slots = document.getElementById(\"gear\").rows.length - 3;\n for (var i = 1; i <= slots; i++)\n {\n var num = parseFloat(sheet()[\"Gear\" + FormatNumber(i) + \"W\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n document.getElementById(\"bagWeight\").innerHTML = total.toFixed(1);\n\n // Add the armor weight.\n for ( var i = 1; i <= 4; i++ )\n {\n // If the armor is flagged as not carried, then don't add it to the weight.\n if ( !sheet()[\"Armor\" + i + \"Carried\"].checked )\n continue;\n\n var num = parseFloat(sheet()[\"Armor\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n\n // Add the weapon weight\n for ( var i = 1; i <= 4; i++ )\n {\n if ( sheet()[ \"Weapon\" + i + \"Carried\" ].checked )\n {\n var num = parseFloat(sheet()[\"Weapon\" + i + \"Weight\"].value);\n if (!isNaN(num))\n total += num;\n }\n }\n\n sheet().TotalWeight.value = total.toFixed(1);\n\n // Check to see if the character is encumbered. If so, then set the background\n // color of \"Total Weight\", Speed, and DexMod input fields to red.\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().LightLoad.value ) )\n {\n debug.trace(\"Character is encumbered.\");\n var maxDexMod = 99;\n\n if ( Clean( sheet().TotalWeight.value ) > Clean( sheet().MediumLoad.value ) )\n {\n maxDexMod = 1;\n sheet().TotalWeight.title = \"Check penalty of -6 while encumbered\";\n }\n else\n {\n maxDexMod = 3;\n sheet().TotalWeight.title = \"Check penalty of -3 while encumbered\";\n }\n\n debug.trace(\"MaxDexMod = \" + maxDexMod + \" DexMod = \" + Clean( sheet().DexMod.value ) );\n if ( Clean( sheet().DexMod.value ) > maxDexMod )\n {\n sheet().DexMod.title = \"Max dex bonus to AC is +\" + maxDexMod + \" while encumbered.\";\n sheet().DexMod.style.color = \"white\";\n sheet().DexMod.style.backgroundColor = \"red\";\n }\n else\n {\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n }\n\n sheet().TotalWeight.style.color = \"white\";\n sheet().TotalWeight.style.backgroundColor = \"red\";\n\n sheet().Speed.title = \"Max speed is reduced by roughly 1/3 due to encumbrance\";\n sheet().Speed.style.color = \"white\";\n sheet().Speed.style.backgroundColor = \"red\";\n\n ACCheckMaxDex(); // Check if the dex bonus to AC should be reduced.\n }\n else\n {\n sheet().TotalWeight.title = sheet().TotalWeight.value;\n sheet().TotalWeight.style.color = \"black\";\n sheet().TotalWeight.style.backgroundColor = \"white\";\n\n sheet().DexMod.title = sheet().DexMod.value;\n sheet().DexMod.style.color = \"black\";\n sheet().DexMod.style.backgroundColor = \"white\";\n\n sheet().Speed.title = sheet().Speed.value;\n sheet().Speed.style.color = \"black\";\n sheet().Speed.style.backgroundColor = \"white\";\n }\n\n\n SkillsUpdateCheckPen();\n\n debug.trace(\"Calculated total weight.\");\n}", "function createBasketWeightGuide(){\n // create the element for the guide\n $('.af__basket__weight-guide--label').after('<div class=\"js-af__weight-guide__wrapper\"></div>');\n $('.js-af__weight-guide__wrapper').append('<div class=\"js-af__weight-guide__meter\"></div>');\n \n $('.af__product__add-to-basket').submit(function(e){\n e.preventDefault();\n //var $multiplier=\n weightGuideListener();\n })\n}", "function calculateGradeNeeded(){\n\n var finalExamWeight = document.getElementById(\"examWeight\").value;\n var preferredScore = document.getElementById(\"preferredScore\").value;\n var gradeNeeded = \"\";\n if(finalExamWeight == \"\" || preferredScore == \"\"){\n document.getElementById(\"output1\").innerHTML = \"Please enter your your final weight and desired grade\"\n }else{\n gradeNeeded = ((preferredScore - ((100-(finalExamWeight))/100)*CurrentGrade) / finalExamWeight) *100;\n if(CurrentGrade == \"\"){\n document.getElementById(\"output1\").innerHTML = \"Please Calculate your Current Grade first!\"\n }else{\n document.getElementById(\"output1\").innerHTML = \"You will need to score at least \" + gradeNeeded + \"% on your final to get a \" + preferredScore + \"% overall.\";\n }\n\n }\n\n\n}", "function calculateCaloriesFromWeight() {\n var weight = userInfo[\"weight\"];\n var totalCalories = weight * 22;\n return totalCalories;\n}", "function getWeight(mat) {\n\n //if(buttonIsPressed) then set mat to 4\n if (document.getElementById(\"wheatIncrease\").checked && mat == 5) {\n console.log(\"Checked\")\n mat = 4\n }\n\n if (mat % 2 == 0) {\n return (1 / 3)\n }\n else {\n return (1 / 4)\n }\n}", "function setBMI() {\n document.querySelectorAll(\".bmi .calc input\")[0].addEventListener(\"input\", onType);\n document.querySelectorAll(\".bmi .calc input\")[1].addEventListener(\"input\", onType);\n}", "processHeuristicWeight(x,y, currentWeight) {\n this.field[x][y].weight = currentWeight + 5;\n }", "updateWeightIn(val) {\n this.setState({\n weightIn: val\n })\n }", "function bmiCalculator(weight, height) {\r\n var bmi = Math.round(weight / (height * height));\r\n var interpretation;\r\n\r\n if (bmi < 18.5) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are underweight.\"\r\n } else if (bmi >= 18.5 && bmi < 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you have a normal weight.\"\r\n } else if (bmi >= 24.9) {\r\n interpretation = \"Your BMI is \" + bmi + \", so you are overweight.\"\r\n }\r\n\r\n return interpretation;\r\n}", "function getVals() {\n\n //Get Current Grade\n var currentGrade = document.getElementById(\"currentGrade\").value;\n currentGrade /= 100;\n\n //Get Desired Grade\n var desiredGrade = document.getElementById(\"desiredGrade\").value;\n desiredGrade /= 100;\n\n //Get Weight\n var weight = document.getElementById(\"weight\").value;\n weight /= 100;\n\n //Calcuate Final Grade\n var finalGrade = (desiredGrade - (1-weight)*currentGrade) / weight;\n finalGrade = Math.round(finalGrade * 100)\n\n\n if(finalGrade > 90){\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Better start studying.\";\n } else if (finalGrade <= 90 && finalGrade > 80) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Could be worse.\";\n } else if (finalGrade <= 80 && finalGrade > 70) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. No sweat, you got this.\";\n } else if (finalGrade <= 70 && finalGrade > 60) {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. This'll be easy.\";\n } else {\n document.getElementById(\"result\").innerHTML = \"You need a \" + finalGrade + \"% on your final exam to get a \" + desiredGrade * 100 + \" in the class. Enjoy not studying!\";\n }\n\n\n }", "function weightSliderValueChange() {\n $('#sliderWeight').on('input', function () { //versions of IE < 9 do not support this event, they have proprietary onPropertyChange event\n $('.sliderWeightValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderSummation').val(0);\n $('.sliderSummationValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderWeightValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeight(value);\n displayModelsSelectedByWeight(value, selectedSolution);\n displayCurves();\n }, 10);\n });\n}", "function setConnectionWeight(weight) {\n\t\tthis.weight = eval(weight);\n\t\tif (document.getElementById(this.id) != null) {\n\t\t\tdocument.getElementById(this.id).strokeWeight = eval(weight);\n\t\t}\n\t}", "function bodyMassIndexCalculator(weight,height) {\n\tvar bmi = weight/(Math.pow(height,2));\n\tif (isNaN(bmi)) {\n\t\talert(\"You should type only numbers! (No commas allowed)\")\n\t} else if(bmi < 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are underweight.\");\n\t\t}\n\telse if(bmi < 24.9 && bmi > 18.5) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are a normal weight.\");\n\t\t}\t\n\telse if(bmi > 24.9) {\n\t\treturn (\"Your body mass index is \" + Math.round(bmi) + \". You are overweight.\");\n\t\t}\n}", "function setWeight( action, weight ) {\n\t\taction.enabled = true;\n\t\taction.setEffectiveTimeScale( 1 );\n\t\taction.setEffectiveWeight( weight );\n\t}", "function searchByWeight(people){\n let weightType = parseInt(promptFor('What do you want to search for:' +'\\n' +' 1 - Search people weighing below amount:' +'\\n'+ '2 - Search people weighing above amount: ',autoValid))\n let weightAmount = \"\"\n let searchResults\n\n if (weightType === 1)\n {\n weightAmount = parseInt(promptFor('Please enter the weight to search below:',autoValid))\n let foundPerson = people.filter(function(potentialMatch){\n if (potentialMatch.height <= weightAmount)\n {\n return true;\n }\n else{\n return false;\n }\n \n ;\n })\n searchResults = foundPerson\n }\n\n else{\n weightAmount = parseInt(promptFor('Please enter the weight to search above:',autoValid))\n let foundPerson = people.filter(function(potentialMatch)\n {\n if (potentialMatch.height >= weightAmount)\n {\n return true;\n }\n else{\n return false;\n }\n \n ;\n })\n searchResults = foundPerson\n }\n\n return searchResults\n}", "function sendGuess(firstName, lastName, weight) {\n channel.trigger('client-newGuess', {\n weight: weight,\n firstName: firstName,\n lastName: lastName\n });\n }", "function rateLetterStamped(weight) {\n if (weight <= 1.0) {\n return 0.50;\n } else if (weight <= 2.0) {\n return 0.71;\n } else if (weight <= 3.0) {\n return 0.92;\n } else if (weight <= 3.5) {\n return 1.13;\n } else {\n return rateLargeFlat(weight);\n }\n}", "onEntered() {\n if (this.state.carrating != 0) {\n let selector = this.state.carrating.toString();\n selector = selector.replace(\"0.5\", \"half\");\n selector = selector.replace(\".5\", \"half\");\n document.getElementById(\"star\" + selector).checked = true;\n }\n }", "function alertCheck(){\n spawnRate = document.getElementById('speed-input').value;\n console.log(\"speed: \"+spawnRate);\n if (spawnRate < 0.2){\n alert(\"TOO SMALL! Try something over or equal to 0.2\");\n }\n if (spawnRate > 4){\n alert(\"TOO BIG! Try something under or equal to 4\");\n }\n spawnRate = 1/spawnRate;\n console.log(spawnRate);\n}", "get weighting() { return this._weighting; }", "function bmiCalculator(height,weight){\n return(Math.round(weight/(height**2)));\n }", "function bmiCalculator (weight, height) {\n var message = \"\";\n var bmi = Math.round(weight /(Math.pow(height,2)));\n if (bmi < 18.5) {\n message = \"Your BMI is \"+bmi+\", so you are underweight.\";\n }\n if (bmi >= 18.5 && bmi <24.9) {\n message = \"Your BMI is \"+bmi+\", so you have a normal weight.\";\n }\n if (bmi > 24.9) {\n message = \"Your BMI is \"+bmi+\", so you are overweight.\";\n }\n return message;\n}", "bmi(height, weight) {\n if (height > 0 && weight > 0) {\n var bmi = 10000 * (weight / ((height) * (height)));\n bmi = Math.round(bmi * 100) / 100\n this.setState({ bmi: bmi })\n }\n }", "handleSubmit(event) { \n // console.log(this.state);\n let hinMeters;\n let winKg;\n let bmiCat;\n if(this.state.isCm)\n hinMeters = 0.01* this.state.height;\n else{\n console.log(this.state.height + this.state.height_in);\n hinMeters = 0.01*(this.state.height + this.state.height_in)*2.54; \n }\n \n if(this.state.isKg)\n winKg = this.state.weight;\n else\n winKg = this.state.weight*0.453592;\n event.preventDefault();\n console.log('hinm',hinMeters);\n // console.log('winK',winKg);\n let bMi = (winKg/(hinMeters*hinMeters)).toFixed(2);\n console.log(this.u_cat,this.h_cat,this.ov_cat);\n if(bMi<parseFloat(this.u_cat))\n bmiCat='Underweight';\n else if(bMi>=parseFloat(this.u_cat) && bMi<parseFloat(this.h_cat))\n bmiCat='Healthy';\n else if(bMi>=parseFloat(this.h_cat) && bMi<parseFloat(this.ov_cat))\n bmiCat='Overweight';\n else\n bmiCat='Obese';\n this.setState({'bmi':bMi,'cat':bmiCat});\n this.showModal();\n \n }", "function checkWeight(Weight) {\n\n if(Weight > 5000){\n var text=\"no free shipping for you\";\n console.log(text);\n }\n // console.log(text);\n\n}", "function bmiCalculator (weight, height) {\r\n var bmi = weight/(height * height);\r\n var interpretation = \"\";\r\n\r\n if(bmi < 18.5){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are underweight.\");\r\n }\r\n if(bmi >= 18.5 && bmi <= 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you have a normal weight.\");\r\n }\r\n if(bmi > 24.9){\r\n interpretation = (\"Your BMI is \"+ bmi +\", so you are overweight.\");\r\n }\r\n return interpretation;\r\n}", "function handleEnter() {\n // storing entered values as numbers\n let init = Number(ini.value);\n let num = Number(amt.value);\n let cur = Number(curr.value);\n // calculating profit(-ve or +ve)\n let profit = (cur - init) * num;\n // if there is a profit, print profit and also calculate % profit\n if (profit > 0) {\n let percent = (profit / init) * 100;\n message.innerHTML =\n \"profit of \" + profit + \"! and the percent is \" + percent + \"%\";\n }\n // when there is no profit or loss\n if (profit === 0) {\n message.innerHTML = \"no loss and no gain\";\n }\n // calculate loss and % loss\n if (profit < 0) {\n profit = -1 * profit;\n let percent = (profit / init) * 100;\n message.innerHTML =\n \"loss of \" + profit + \" and the percent is \" + percent + \"%\";\n }\n}", "function gunnerChange() {\n var currentUnitPoints = parseInt(event.target.parentNode.childNodes[2].childNodes[0].innerHTML);\n var currentTotal = parseInt(totalPoints.innerText);\n if (event.target.value === \"Ion Rifle - 3pt\" && currentUnitPoints === 12) {\n ionFromRail(event, currentTotal, currentUnitPoints);\n } else if (event.target.value === \"Ion Rifle - 3pt\") {\n ionFromCarbine(event, currentTotal, currentUnitPoints);\n } else if (event.target.value === \"Rail Rifle - 5pt\" && currentUnitPoints === 7) {\n railFromCarbine(event, currentTotal, currentUnitPoints)\n } else if (event.target.value === \"Rail Rifle - 5pt\") {\n railFromIon(event, currentTotal, currentUnitPoints);\n } else if (event.target.value === \"Pulse Carbine w/ ML\" && currentUnitPoints === 12) {\n carbineFromRail(event, currentTotal, currentUnitPoints);\n } else {\n carbineFromIon(event, currentTotal, currentUnitPoints);\n }\n}", "function calcGrade() {\n var hwCount = 0;\n var pointEarned = 0;\n var pointTotal = 0;\n var totalGrade = 0;\n hwCount = document.getElementById(\"liAssignments\").childElementCount;\n\n for (var i = 1; i <= hwCount; i++) {\n if (document.getElementById(\"weight\" + i).value != 0) {\n totalGrade += ((document.getElementById(\"hw\" + i).value) / (document.getElementById(\"total\" + i).value)) * (document.getElementById(\"weight\" + i).value);\n }\n\n }\n findLetterGrade(totalGrade);\n totalGrade = parseFloat(totalGrade).toFixed(2);\n document.getElementById(\"WHO\").value = totalGrade;\n\n}", "rating(event) {\n if (event.target.name === \"feedbackRating\") {\n this.feedbackRating = event.target.value;\n }\n }", "function AddWeight(){\n specAttribute.style.cssText = \"height: 85px;\";\n\n size.style.cssText = \"height:0; opacity:0;\";\n dimentions.style.cssText = \"height:0; opacity:0;\";\n weight.style.cssText = \"height: 85px; width:100%; opacity:1; overflow: visible;\";\n weight.getElementsByTagName(\"input\")[0].required = true; \n \n size.getElementsByTagName(\"input\")[0].required = false; \n size.getElementsByTagName(\"input\")[0].value= \"\"; \n for (let i=0; i<3; i++) {\n dimentions.getElementsByTagName(\"input\")[i].required = false; \n dimentions.getElementsByTagName(\"input\")[i].value= \"\"; \n }\n}", "function poundsConversion() {\n const pWeight = parseFloat(poundsInput.value); // turns the string into a number which is used for each conversion in this function\n const gWeight = pWeight / 0.0022046;\n const oWeight = pWeight * 16;\n const kWeight = pWeight * 0.45359;\n gramsInput.value = gWeight.toFixed(3); //sets values to DOM using a fixed decimal input\n ounceInput.value = oWeight.toFixed(3);\n kilogramInput.value = kWeight.toFixed(3);\n}", "function calculate(){\n\n \tvar\twtkg = document.getElementById('wtDrop').selectedIndex +1;\n \tvar wtlb = document.getElementById('wtDropLbs').selectedIndex;\n \tvar chk = document.getElementById('wtChk');\n \tvar weight;\n\n\n \t//checks which unit has been inputed by user then converts lbs to kg\n \tif(chk.checked == true){\n \t\tweight = wtkg.toFixed();\n \t}else if(chk.checked == false){\n \t\tweight = (wtlb*0.453592).toFixed();\n \t}\n\n \t//height function to check which height is used\n\n \tvar htf = document.getElementById('htDropF').selectedIndex -1;\n \tconsole.log(htf);\n \tvar hti = document.getElementById('htDropF2').selectedIndex-1;\n \tvar htC = (htf * 30.48) + (hti *2.54);\n \t\n\n \tvar htm = document.getElementById('htDropM').selectedIndex -1;\n \tvar htChk = document.getElementById('htChk');\n \t\n\n \tvar height;\n\n \tif(htChk.checked == true && hti >= 0){\n \t\theight = htC;\n \t}else if(htChk.checked == false){\n \t\theight = htm;\n \t}\n\n \t//gender\n \tvar r1 = document.getElementById('mRad');\n \tvar r2 = document.getElementById('fRad');\n \tvar gender;\n \tif(r1.checked == true){\n \t\tgender = 1.23;\n \t}else if(r2.checked == true){\n \t\tgender = 1.04;\n \t}\n \t\n \t//calculate height over 5 foot, IBW and ABW\n \tvar inchover5 = (height - 152.4)/2.54;\n \tvar mIBW = (inchover5 * 2.3) + 50;\n\tvar fIBW = (inchover5 * 2.3) + 45.5;\n\tvar mABW = mIBW + 0.4 * (weight - mIBW);\n\tvar fABW = fIBW + 0.4 * (weight - fIBW);\n\n\tvar modalWt = document.getElementById('modalWt');\n\tvar modalIBW = document.getElementById('modalIBW'); \n\tvar modalABW = document.getElementById('modalABW');\n\n\n\tif(gender == 1.23){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = mIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = mABW.toFixed(1) + \"kg\";\n\t}else if(gender == 1.04){\n\t\tmodalWt.innerHTML = weight + \"kg\";\n\t\tmodalIBW.innerHTML = fIBW.toFixed(1) + \"kg\";\n\t\tmodalABW.innerHTML = fABW.toFixed(1) + \"kg\";\n\n\t}\n\n\n\n\t//age and creatinine\n \tvar age = document.getElementById('ageDrop').selectedIndex -1;\n \tvar srcr = document.getElementById('creatDrop').selectedIndex -1;\n \tvar wtType = document.getElementById('wtType');\n\n \tvar CRCLAnswer = document.getElementById('ansDisplay');\n \tvar crcl = 0;\n \tif(gender == 1.23 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * mABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\n\t} else if(gender == 1.23 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender)/srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t\t\n\t} else if(gender == 1.04 && (weight > (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * fABW * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Adjusted body weight\";\n\t\t\t\n\t} else if(gender == 1.04 && (weight < (1.2 * mIBW))){\n\t\tcrcl = (((140 - age) * weight * gender) /srcr).toFixed(2);\n\t\tCRCLAnswer.innerHTML = crcl + \" ml/min\";\n\t\twtType.innerHTML = \" Actual patient weight\";\n\t}\n\n\n\t//displays answer jumbo if criteria matches\n\tif(weight >= 30 && inchover5 >= 0 && age >= 18 && srcr > 1 && gender > 1){\n\t\tconsole.log(\"criteria matches\");\n\t\tdocument.getElementById('ansJumbo').style.display = \"block\";\n\t\tdocument.getElementById('inputForm').style.display = \"none\";\n\t\tvar title = document.getElementById('title');\n\t\ttitle.innerHTML = \"Creatinine Clearance\"\n\t\ttitle.style.marginLeft = \"50px\";\n\t\tdocument.getElementById('backBtn').style.display = \"block\";\n\t\t\n\n\t}\n \tconsole.log(\"\\nweight: \" + weight + \"\\nHeight: \" + height +\"\\ninches over 5 foot: \" + inchover5 + \" \\nage: \" + age + \"\\nsrcr: \" + srcr + \" \\ngender: \" + gender);\n \treturn crcl;\n}", "function handle() {\n /*\n\t\t\tCalls the core function to set the volume to the computed value\n\t\t\tbased on the user's intent.\n\t\t*/\n Core.setVolume(this.value);\n\n /*\n Sync Mute Elements.\n */\n MuteElements.setMuted(config.volume == 0 ? true : false);\n\n /*\n\t\t\tSync the volume slider locations\n\t\t*/\n VolumeSliderElements.sync();\n }", "onClick() {\n this.validateInput('weight', (weightStatus) => {\n if (weightStatus) {\n this.validateInput('pantsSize', (pantsSizeStatus) => {\n if (pantsSizeStatus) {\n this.validateInput('chest', (chestStatus) => {\n if (chestStatus) {\n this.validateInput('waist', (waistStatus) => {\n if (waistStatus) {\n this.validateInput('biceps', (bicepsStatus) => {\n this.httpRequest();\n });\n }\n });\n }\n });\n }\n });\n }\n });\n }", "function amountsChanged()\r\n{\r\n //JQuery!!!\r\n var newWeights = [];\r\n $(\"input[name='ingredient-form']\").each(function() {\r\n newWeights.push($(this).val());\r\n });\r\n\r\n // console.log(\"New weights\",newWeights);\r\n // console.log(\"Orig weights\", origWeights);\r\n \r\n //multiplier to adjust mutrition info based off ingredient amount change\r\n multiplier = [];\r\n for(i=0;i<origWeights.length;i++) {\r\n if (origWeights[i] != 0) { \r\n var x = newWeights[i]/origWeights[i];\r\n multiplier.push(x);\r\n }\r\n\r\n else {multiplier.push(1);\r\n }\r\n }\r\n // console.log(\"multiplier\", multiplier);\r\n\r\n updatePlot();\r\n}", "function bmiCalculator(weight, height){\r\nvar bmi = weight / Math.pow(height, 2);\r\nreturn Math.round(bmi);\r\nconsole.log(`${bmi} is Calculator`);\r\n}", "function bmi(weight, height) {\n var bmi = weight / (height * height);\n console.log(bmi);\n switch (true) {\n case bmi < 15:\n console.log(\"Anorexic\");\n break;\n case bmi < 17.5 && bmi > 15:\n console.log(\"Starvation\");\n break;\n case bmi > 18.5 && bmi < 25:\n console.log(\"Ideal\");\n break;\n case bmi > 25 && bmi < 30:\n console.log(\"Overweight\");\n break;\n case bmi > 30 && bmi < 40:\n console.log(\"Obese\");\n break;\n case bmi > 40:\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "function calculateWeightsAndValues(value, weight){\r\n return(value * weight)\r\n}", "function userInputClick() {\n // Get input from user and store it in variable\n const age = parseInt(document.getElementById(\"age-entered\").value)\n const day = document.getElementById(\"day-entered\").value\n\n // Checks if user should go to the movies\n if ((day == \"tuesday\" || day == \"thursday\") || (age > 12 && age < 21)) {\n document.getElementById(\"output\").innerHTML = \"You should go to the museum because you will get a discount\"\n } else {\n document.getElementById(\"output\").innerHTML = \"You should not go to the museum today because you will not get a discount\"\n }\n}", "function foodValue(event){\n food = event.target.value;\n }", "function weightSumValueChange() {\n $('#sliderSummation').on('input', function () {\n $('.sliderSummationValue').text($(this).val() + \"%\");\n }).on('mouseup', function () {\n var value = $(this).val();\n\n //remove selected value on another slider\n $('#sliderWeight').val(0);\n $('.sliderWeightValue').text(\"-\");\n\n //show overlays\n $('#controls-panel-overlay').show();\n $('#best-results-table-overlay').show();\n\n $('.sliderSummationValue').text(value + \"%\");\n $('input[type=radio][name=select]:checked').prop('checked', false);\n setTimeout(function(){\n selectButtonsByWeightSummation(value, selectedSolution);\n displayModels();\n displayCurves();\n }, 10);\n });\n}", "function calcNumBeeStings (w){\n\n //declare and define a variable to calculate the total number of bee stings based on the input of the user.\n var totalBeeStings = w * 8.666666667;\n\n //return the total number of bee stings back to the main code.\n return totalBeeStings;\n }", "function handleInput() {\n\t\t\tif (onInput) {\n\t\t\t\tonInput(value);\n\t\t\t}\n\t\t}", "static isValidWeightInKg(weightInKg) {\n return (!Number.isNaN(weightInKg) && weightInKg > BMI.minWeightInKg && weightInKg <= BMI.maxWeightInKg)\n }", "function beeStung(weight) {\n \n //calculate for bee stings\n var stings=8.666666667*weight\n \n //Return number of Bee stings\n return stings;\n}", "function beeStingsNeeded(victimWeight)\n{\n var totalStings = 8.666666667 * victimWeight; // This is the code that will run in the function.\n\n return totalStings; // This is the code to return the total number of bee stings to the function.\n}", "function BuyBoost() {\n if (BoostLevel == 0){\n Score = Score - 10;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x2\";\n document.getElementById(\"boostcost\").innerHTML = \" 10\";\n BoostLevel++;\n }\n else if (BoostLevel == 1){\n Score = Score - 20;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x4\";\n document.getElementById(\"boostcost\").innerHTML = \" 20\";\n BoostLevel++;\n }\n else if (BoostLevel == 2){\n Score = Score - 30;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x6\";\n document.getElementById(\"boostcost\").innerHTML = \" 30\";\n BoostLevel++;\n }\n else if (BoostLevel == 3){\n Score = Score - 40;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x8\";\n document.getElementById(\"boostcost\").innerHTML = \" 40\";\n BoostLevel++;\n }\n else {\n Score = Score - 50;\n document.getElementById(\"score\").innerHTML = Score;\n document.getElementById(\"boostvalue\").innerHTML = \" x10\";\n document.getElementById(\"boostcost\").innerHTML = \" 50\";\n }\n}", "function updateSummationWeights(value) {\n total_weight += value;\n}", "function canBeWeighted(item, weight) {\n\t Object.assign(item, {\n\t weight: weight,\n\t examineWeight: examineWeight,\n\t pickUp: pickUp\n\t });\n\t\n\t function examineWeight() {\n\t if (item.weight > 50) {\n\t console.log(item.toString() + ' looks heavy');\n\t } else {\n\t console.log(item.toString() + ' looks light');\n\t }\n\t }\n\t function pickUp() {\n\t if (weight > 50) {\n\t console.log(item.toString() + ' is too heavy, you can\\'t pick it up');\n\t } else {\n\t console.log('You pick ' + item + ' up');\n\t }\n\t }\n\t}", "checkAge() {\n let messageField = document.getElementById('alertAge');\n\n let messageWeightField = document.getElementById('alertWeight');\n let inputAgeField = document.getElementById('donor-age').value;\n let inputWeightField = document.getElementById('donor-weight').value;\n if (inputAgeField < 16 || inputAgeField > 60) {\n messageField.textContent = \"your age is not eligible for Blood Donation\";\n messageField.style.color = 'red';\n messageField.style.fontSize = \"17px\";\n messageField.style.fontWeight = \"bold\"\n let btns = document.getElementById('btn1');\n btns.disabled = true;\n\n\n } else {\n messageField.textContent = \"\";\n\n let btnCheck = document.getElementById('btn1');\n btnCheck.disabled = false;\n\n }\n // Check for weight\n if (inputWeightField < 50) {\n messageWeightField.textContent = \"your Weight is not enough for Blood Donation\";\n messageWeightField.style.color = 'red';\n messageWeightField.style.fontSize = \"15px\";\n messageWeightField.style.fontWeight = \"bold\";\n let btns = document.getElementById('btn1');\n btns.disabled = true;\n\n } else {\n messageWeightField.textContent = \"\";\n let btns = document.getElementById('btn1');\n btns.disabled = false;\n }\n }", "renderSwitch(weight) {\n if(weight <= 200){\n return <span>$5</span>\n }else if(weight <= 500){\n return <span>$10</span>\n }else if(weight <= 1000){\n return <span>$15</span>\n }else if(weight <= 5000){\n return <span>$20</span>\n }else{\n return <span>$22</span>\n }\n }", "function handleInput() {\n const { checked: sortByRole } = this;\n if (sortByRole) {\n displayBandMembers(bandRoles);\n } else {\n displayBandMembers(bandYears);\n }\n}", "function bmi(weight, height) {\n var bmi = weight / (height * height)\n console.log(bmi)\n switch (true) {\n case (bmi < 15):\n console.log(\"Anorexic\");\n break;\n case (bmi < 17.5 && bmi > 15):\n console.log(\"Starvation\");\n break;\n case (bmi > 18.5 && bmi < 25):\n console.log(\"Ideal\");\n break;\n case (bmi > 25 && bmi < 30):\n console.log(\"Overweight\");\n break;\n case (bmi > 30 && bmi < 40):\n console.log(\"Obese\");\n break;\n case (bmi > 40):\n console.log(\"Morbidly\");\n break;\n default:\n console.log(\"bmi not in scope\");\n }\n}", "setrating() \n {\n this.rating = prompt(\"What is your rating from 0-10?\"); // whatever is passed into the parameter CHANGES the default parameter we set in the beginning\n }", "function calcPrice() {\n // alert(\"Calc Price\")\n let price = parseInt(elRankDesired.value) - parseInt(elRankCurrent.value);\n \n /* Increases price based on what mode they user selects. */\n let queue = elRankQueue.value;\n if (queue === '2v2') {\n price += (0.15 * price);\n } else if (queue === '3v3') {\n price += (0.25 * price);\n }\n\n /* Adds 50% to price if user selects the checkbox to play alongside. */\n if (isBoosted()) {\n price += (0.50 * price);\n }\n \n /* Convert to String Dollar Amount */\n price = price.toFixed(2);\n let text = \"Boost $\" + price + \" USD\";\n \n document.getElementById('price-text').innerHTML = text;\n }", "function changeMinimumEdgeWeight(event, ui) {\n graphControls.minimumEdgeWeight = ui.value;\n $('#updateGraphButton').attr('disabled', false);\n}", "function getAveWeight() {\n\tvar totalE=0\n\tfor (var i=0; i<weight.length; i++) {\n\t\ttotalE=totalE+weight[i]\n\t}\n\taveWeight=Math.round((totalE/5)*10)/10\n\t$(\"#aveWeight\").html(aveWeight)\n}", "function me(){\n if( principal.value === '' && time.value === '' && rate.value === '')\n {\n result.value = 'pls enter a valid number';\n }\n else \n {\n result.value = ((parseFloat(principal.value) * parseFloat(time.value) * parseFloat(rate.value))/100).toFixed(2);\n }\n\n }" ]
[ "0.69764465", "0.6958283", "0.6819909", "0.6757519", "0.67143446", "0.6710743", "0.66977143", "0.66195256", "0.6563841", "0.6562616", "0.65339017", "0.650378", "0.64817566", "0.64703846", "0.6451078", "0.6391222", "0.6355331", "0.6309383", "0.61765015", "0.6166209", "0.6102044", "0.6048808", "0.6026949", "0.5987883", "0.5948389", "0.5940583", "0.5928359", "0.59176016", "0.58787805", "0.5878199", "0.58660275", "0.5829381", "0.5816351", "0.5809436", "0.5809003", "0.57937956", "0.57510734", "0.57475597", "0.574735", "0.5740119", "0.57235557", "0.5707076", "0.56907856", "0.568588", "0.56793034", "0.5676165", "0.5660909", "0.56564486", "0.56528205", "0.56336904", "0.5633103", "0.5632835", "0.5613895", "0.5607844", "0.559863", "0.5597736", "0.5589462", "0.5572027", "0.5548278", "0.5540122", "0.5511728", "0.55114955", "0.5510565", "0.55038834", "0.549504", "0.5493547", "0.54887885", "0.5488306", "0.54860157", "0.548438", "0.5479903", "0.5466132", "0.5464678", "0.5458631", "0.5442727", "0.5442234", "0.54179394", "0.54155236", "0.5413116", "0.5406413", "0.5398095", "0.53948724", "0.5384915", "0.5383422", "0.53789294", "0.53750473", "0.5373565", "0.53709495", "0.5366422", "0.5365507", "0.53650576", "0.5360502", "0.5359148", "0.53550434", "0.5326838", "0.53256255", "0.5317614", "0.53163755", "0.5312455", "0.53089267" ]
0.65627146
9
This is used to submit the user's details to the server
submitUserDataToTheServer() { Keyboard.dismiss() this.setState({visible:true}) let that = this axios.post("/signUp", { email: this.props.userData.email, password: this.props.userData.password, patientId: this.props.userData.id, doctorId: this.state.doctor, name: this.state.name, height: this.state.height, weight: this.state.weight, image: this.state.base64 }).then((response) => { that.setState({visible: false}) that.props.dispatch(userData(response.data)); this.storeUserDataForLogin(); }).catch((error) => { that.setState({visible: false}) console.log(error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function userInformationSend() {\n let data = {\n email: document.getElementById('email').value,\n phoneNumber: document.getElementById('phoneNumber').value,\n bio: document.getElementById('bio').value\n }\n /* Use Fetch API */\n fetch(`/admin/mypage/${userId}/submit`, {\n method: 'POST',\n body: JSON.stringify(data),\n headers: new Headers({\n 'Content-type': 'application/json'\n })\n }).then(res => res.json()).then(data => {\n Swal.fire(\n 'Modification completed',\n '',\n 'success'\n )\n }).catch((err) => {\n Swal.fire(\n 'ERROR?',\n `${err}`,\n `error`\n )\n })\n}", "function submit(ev) {\n api.create_user(props.form);\n }", "function submitNewUser() {\n var json = `{\"username\": \"${username}\", \"email\": \"${email}\", \n \"password\": \"${password}\", \"role\":\"${role}\"}`;\n\n fetch('http://localhost:9090/users/add', {\n method: 'POST',\n body: json,\n headers: {\n 'Authorization': `bearer ${localStorage.getItem('access_token')}`,\n 'Content-Type': 'application/json'\n }})\n .then(res => res.json())\n .then(alert('New user added to system!'))\n .catch(console.error());\n }", "function signupDetails() {\n if(firstName && lastName && email && password){\n\n let data = {\n signupDetails: { firstName, lastName, email, password }\n }\n axios.post(`${serverURL.server_base_URL}/users/signup`, data)\n .then(signupDetails => {\n if (signupDetails.status) {\n dispatch({\n type: \"setUserId\",\n payload: signupDetails.data.user._id,\n })\n navigation.navigate(\"Signin\")\n }\n })\n .catch(err => {\n console.log(\"Error in creating account\", err)\n })\n }\n else{\n alert(\"Please fill out all the fields.\")\n }\n }", "function submit() {\n updateMember(props.match.params.id, {\n userid: values.userId,\n firstname: values.fName,\n lastname: values.lName,\n mobilenumber: values.mobNo,\n homeaddress: values.homeAddr,\n email: values.email,\n password: values.password,\n });\n\n setShow(false);\n }", "function postUser(user_data) {\n console.log(\"Hello Newman\")\n console.log(user_data)\n fetch(allUsersUrl, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'Accept': 'application/json'\n },\n body: JSON.stringify({\n \"name\": user_data.name.value,\n \"age\": user_data.age.value,\n \"gender\": user_data.gender.value,\n // \"user_id\": 1\n })\n })\n .then(resp => resp.json())\n .then(userObj => {\n renderNewUser(userObj)\n })\n }", "async function submitAccountInformation(event) {\n event.preventDefault();\n const { data } = await axios.put(\"me\", {\n firstName: firstName,\n lastName: lastName,\n email: email,\n image: image,\n roleId: 1 // TODO: Add DropDownlist to select a role\n });\n props.setUser(new User(\n data.id,\n data.firstName,\n data.lastName,\n data.email,\n data.role,\n data.image\n )); // Dispatch the chage event\n }", "function handleSubmit(e){\n e.preventDefault();\n\n const userData = {\n firstName: fName,\n lastName: lName, \n school: school,\n grade: grade, \n board: board, \n city: city, \n phone: phone, \n\n email: email, \n password: pass, \n securityQuestion: securityQuestion,\n securityAnswer: securityAnswer\n } \n\n fetch ('https://inypt-participant-dash.herokuapp.com/api/user/signup', {\n method: 'POST', \n headers: {\n 'Content-Type': 'application/json' \n }, \n body: JSON.stringify(userData)\n })\n .then(data=>data.json())\n .then(response => {\n console.log(response);\n if(response.message==='user-added'){\n setModalShow(true);\n }\n });\n \n }", "function submit() {\n console.log(buildUser())\n}", "function onSubmit(e) {\n // Prevent default submission\n e.preventDefault();\n\n // Create user object to save\n const newUser = {\n userName,\n skillLevel,\n image,\n email,\n };\n\n // Send to back-end to Update user, look at routes/books.js\n axios\n .post(`${API_URL}user/update/${userId}`, newUser)\n .then(res => {\n console.log(res.data);\n // Trigger the toast\n setShow(true);\n setToastStyle('display');\n setToastMessage('Changes Saved Successfully!');\n setTimeout(function() {\n setShow(false);\n setToastStyle('hide');\n }, 1500);\n })\n .catch(err => console.log(err));\n }", "function user_info_submit_handler(e){\n // Check the user input. Helper function defined in index.js\n if (check_user_personal_information(e) === 0){\n return; // Input failed test so do not continue\n }\n\n // Make the changes to the databse by making a request to server\n // Prepear to make the server call\n let data = {\n first_name: e.data.first_name.val(),\n last_name: e.data.last_name.val(),\n username: e.data.username.val(),\n password: e.data.password1.val(),\n email: e.data.email.val(),\n user_id: login_account.user_id\n }\n const request = new Request(\"/editUserInfo\", {\n method: \"post\",\n body: JSON.stringify(data),\n headers: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': 'application/json'\n }\n });\n\n // Now we make the request, the server will take care of this\n fetch(request).then((res) => {\n // We handle the response given back from the server\n if (res.status === 200){\n // Make the changes locally\n login_account.first_name = e.data.first_name.val();\n login_account.last_name = e.data.last_name.val();\n login_account.username = e.data.username.val();\n login_account.password = e.data.password1.val();\n login_account.email = e.data.email.val();\n alert(\"Your personal information has been saved.\");\n return;\n }else {\n alert(\"Something went wrong try again. There may be a problem with the server at this time.\");\n }\n })\n}", "userRegistration() {\n let regUserName = document.querySelector(\"#regUserName\").value;\n let regEmail = document.querySelector(\"#regEmail\").value;\n let regPassword = document.querySelector(\"#regPassword\").value; // let regConfirmPassword = document.querySelector(\"#regUserName\").value\n\n _nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"POST\",\n \"dataBaseObject\": {\n \"userName\": regUserName,\n \"email\": regEmail,\n \"password\": regPassword\n }\n }).then(_nomadData.default.connectToData({\n \"dataSet\": \"users\",\n \"fetchType\": \"GET\",\n \"embedItem\": `?userName=${regUserName}`\n }).then(user => {\n console.log(user);\n user.forEach(x => {\n sessionStorage.setItem(\"userId\", x.id); //hides NOMAD heading\n\n $(\".t-border\").hide(); //hides the form\n\n $(\".form\").hide(); //displays navigatin bar\n\n _dashboard.default.createNavBar();\n\n let userId = sessionStorage.getItem(\"userId\"); //console.log verifying that credentials match and user is logged in\n\n console.log(\"logged in as\" + \" \" + x.userName);\n console.log(\"your user ID is: \" + userId);\n });\n }));\n }", "function onSubmitRegister(event){\r\n fetch('/register_admin',{\r\n method: 'put',\r\n headers: {\r\n 'Content-Type':'application/json',\r\n 'Accept':'application/json'\r\n },\r\n body: JSON.stringify({\r\n userName: localStorage.getItem(\"Admin\"),\r\n name: userData.name,\r\n contactNumber: userData.contactNumber,\r\n adminEmail: userData.adminEmail,\r\n adharNumber: userData.adharNumber,\r\n category: userData.category,\r\n address: userData.address,\r\n pin: userData.pin,\r\n district: userData.district,\r\n state: userData.state,\r\n timingsopen: userData.timingsopen,\r\n timingsclose: userData.timingsclose,\r\n license: userData.license,\r\n jobdescription: userData.jobdescription,\r\n visitingCharges: userData.visitingCharges\r\n })\r\n }).then(res => res.json({\r\n Message: 'Successfully send the data'\r\n })) \r\n }", "function addUserToDB(id , name) {\n url = serverURL + \"/sendUserInfo\";\n sendPostRequest(url, {'id': id,'name': name});\n}", "function registor(e) {\n e.preventDefault();\n setloading(true);\n if (!userName == \"\") {\n auth\n .createUserWithEmailAndPassword(email, password)\n .then(async (user) => {\n var User = user.user;\n await db.ref(\"User/\" + User.uid).set({\n UserName: userName,\n Email: User.email,\n Code: generatedCode,\n Major: major,\n DoB: DoB,\n Phone: phone,\n });\n })\n .then(() => (window.location = \"/upload_image\"))\n .catch((error) => {\n alert(error.message);\n setloading(false);\n // ..\n });\n }\n\n setemail(\"\");\n setDoB(\"\");\n setMajor(\"\");\n setgeneratedCode(\"\");\n setpassword(\"\");\n setuserName(\"\");\n setcareer(\"\");\n setphone(\"\");\n }", "async function handleSubmit(event) {\n event.preventDefault();\n\n try {\n let createResponse = await fetch('/createPassport', {\n method: 'POST',\n headers: {'Content-Type': 'application/json'},\n body: JSON.stringify({\n authenticatedUser: sessionStorage.getItem(\"username\"),\n userID: fields.userID,\n owner: fields.owner,\n vaccineBrand: fields.vaccineBrand,\n vaccineSite: fields.vaccineSite,\n vaccineDate: fields.vaccineDate\n })\n });\n\n createResponse = await createResponse.text();\n console.log(createResponse);\n\n // Parse the server response\n if (createResponse.startsWith(\"Identity\") || createResponse.startsWith(\"{\\\"message\") ) {\n alert(\"Error: Identity for the given user already exists\");\n } else {\n let items = createResponse.split(\",\");\n items = JSON.parse(items);\n console.log('items: ', items);\n\n let id = items[\"ID\"];\n let owner = items[\"Owner\"];\n let vaccineBrand = items[\"VaccineBrand\"];\n let vaccinationSite = items[\"VaccinationSite\"];\n let dateOfFirstDose = items[\"DateOfFirstDose\"];\n \n // Create the alert for displaying the parsed passport fields\n let res = \"User ID: \" + id; \n res += \"\\n\" + \"Owner Name: \" + owner;\n res += \"\\n\" + \"Vaccine Brand: \" + vaccineBrand;\n res += \"\\n\" + \"Vaccination Site: \" + vaccinationSite; \n res += \"\\n\" + \"Date of First Dose: \" + dateOfFirstDose;\n alert(res);\n }\n } catch (e) {\n onError(e);\n }\n window.location.reload(false);\n }", "function handleSubmit() {\n //we call addUser function passed to this user form component\n //as a prop from the App component\n let userId = 10000 + Math.random() * 10000000;\n let user = { ...state, id: userId };\n props.addUserAction(user);\n setState({\n noteTitle: \"\",\n noteDate: \"\",\n noteText: \"\",\n });\n }", "setUser(_name, _surname, _em, _nhsN) {\n this.userDetails.name = _name\n this.userDetails.surname = _surname;\n this.userDetails.email = _em;\n this.userDetails.nhsNumber = _nhsN;\n }", "function submit(e) {\n e.preventDefault();\n const form = props.store.formToObject(e.target)\n props.store.api('/cabinet/user/update', form)\n //.then(setUser)\n }", "function getInputValues() {\n let usernameInput = document.querySelector(\".signup_form-username input\")\n .value;\n let emailInput = document.querySelector(\".signup_form-email input\").value;\n let passwordInput = document.querySelector(\".signup_form-password input\")\n .value;\n let countryInput = document.querySelector(\".signup_option_form-country\")\n .textContent;\n let ageInput = document.querySelector(\".signup_form-age input\").value;\n\n newUser.username = usernameInput;\n newUser.email = emailInput;\n newUser.password = passwordInput;\n newUser.country = countryInput;\n newUser.age = ageInput;\n\n postUser(newUser);\n}", "static async createUser(userDetails = {}) {\n // userDetails props: username, password, firstname, lastname, email, photo_url Opt: isAdmin\n let apiResponse = await JoblyApi.request(`users/`, userDetails, 'POST');\n return apiResponse.job;\n }", "function postNewUser(){\n\tfunction postUser(userData) {\n \t$.post(\"/api/\", userData)\n \t.then(login);\n \t}\n \t//verify user information is entered correectly\n \tif($('#newPassword').val() != $('#newPassword2').val()){\n \t\talert('Passwords do not match, please re-enter your password and try again');\n \t}else if($('#newfname').val() == \"\" || $('#newlname').val() == \"\" || $('#newEmail').val() == \"\" || $('#newPassword').val() == \"\" || $('#newCompany').val() == \"\"){\n \t\talert('Some information is missing from the form. Please make sure all information is filled out fully.');\n \t}else{\n\t\tpostUser({\n\t\t\taction: 'newUser',\n\t\t\tfName: $('#newfname').val(),\n\t\t\tlName: $('#newlname').val(),\n\t\t\temail: $('#newEmail').val(),\n\t\t\tpassword: $('#newPassword').val(),\n\t\t\tcompany: $('#newCompany').val()\n\t\t});\n\t\talert(\"New user has been created, please login.\");\n\t}\n}", "function submitCreateOrUpdateUser(e) {\n e.preventDefault();\n\n var form = document.getElementById('create_user_form');\n console.log('submitCreateUser');\n\n var name = form.elements['user_name'].value;\n var username = form.elements['user_username'].value;\n var user_id = parseInt(form.elements['user_id'].value);\n\n if (user_id === -1) {\n console.log('Creating a new user');\n createOrEditUser(null, username, name);\n } else {\n console.log('Editing user ' + user_id);\n createOrEditUser(user_id, username, name);\n }\n}", "function createUser(){\n var info = getUserInfo();\n if (info.user.name === \"\" || info.user.username === \"\" || info.user.password === \"\"){\n alert(\"Must enter a Name, Username and Password\");\n }else{\n createUserAjax(info);\n }\n }", "function submitUser(User) {\n $.post(\"/api/users/\", User, function() {\n window.location.href = \"/welcome\";\n });\n }", "function saveUser(name, surname, password, address, tel) {\n // save user code\n}", "function submitUser(user) {\n $.post(\"/api/users\", user, function() {\n window.location.href = \"/concerts\";\n });\n }", "function createProfile(e){\n e.preventDefault();\n\n fetch('http://localhost:8080/profile/' + `${usernameDisplay}`, {\n method: 'POST',\n headers: {\n 'Authorization': 'Bearer ' + localStorage.getItem('user'),\n 'Content-Type': 'application/json'},\n body: JSON.stringify({\n addtEmail: addEmail.value,\n mobile: mobile.value,\n address: addy.value})})\n\n .then((response) => {return response.json();})\n\n //CALLS UPDATEPROFILE FUNCTION TO SHOW NEW CHANGES FROM \"CREATE/UPDATE\" PROFILE FORM\n .then((response)=> {updateProfile(response);})\n\n //LOGS ERRORS TO CONSOLE\n .catch((error) => {console.log(error);})\n\n}", "function processUser(registeredUser) {\n fetch('/api/users',\n {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: \"POST\",\n body: JSON.stringify(registeredUser)\n })\n .then(response => {\n if (response.status === 201) {\n window.location.href = \"pick-goals.html\";\n \n }\n else {\n return response.json()\n }\n\n })\n // provides message when client doesn't enter First Name, Last Name, Username or password information according to specifications.\n .then(response => {\n $('.jSsignUP1').text(response.location + \": \" + response.message);\n })\n .catch(error => console.log('Something went wrong when trying to sign up'));\n}", "function registerUser(){\r\n let email=$(\"#txtEmail\").val();\r\n let pass=$(\"#txtPassword\").val();\r\n let firstName=$(\"#txtFirst\").val();\r\n let lastName=$(\"#txtLast\").val();\r\n let age=$(\"#txtAge\").val();\r\n let address=$(\"#txtAddress\").val();\r\n let phone=$(\"#txtPhone\").val();\r\n let payment=$(\"#selPayment\").val();\r\n let color=$(\"#txtColor\").val();\r\n let user = new User(email,pass,firstName,lastName,age,address,phone,payment,color);\r\n console.log(user);\r\n saveUser(user);// this function is on the storeManager\r\n clearForm();\r\n setNavInfo()\r\n\r\n}", "async function handleSubmitUser(evt) {\n evt.preventDefault();\n let data = new FormData();\n for (let key in formData){\n data.append(key, formData[key]);\n }\n\n try {\n await signUp(data);\n // history.push(\"/FriendsFinder\");\n setStep(\"step2\")\n } catch (err) {\n setFormErrors(err);\n }\n }", "function onSubmit() {\n\n\t\tif (submitButtonProcessing) {\n\t\t\treturn;\n\t\t}\n\n\t\t// set submit button to processing (prevent multiple clicks)\n\t\tsetSubmitButtonProcessing(true);\n\n\t\tconst userData = {\n\t\t\tusername: username,\n\t\t\tpassword: password,\n\t\t\temail: email,\n\t\t\tname: name\n\t\t};\n\n\t\tcreateUser(userData).then(function (response) {\n\n\t\t\tif (response.isAuthenticated) {\n\n\t\t\t\tconst authUserData = {\n\t\t\t\t\tusername: response.username,\n\t\t\t\t\temail: response.email,\n\t\t\t\t\tname: response.name,\n\t\t\t\t\tsignupDate: response.signupDate\n\t\t\t\t};\n\n\t\t\t\t// Save user data and authentication to the store\n\t\t\t\tdispatch(SET_USERDATA(authUserData));\n\t\t\t\tdispatch(SET_ISAUTH(true));\n\n\t\t\t\tauth.signin( () => {\n\t\t\t\t\thistory.push('/post-signup/rivals');\n\t\t\t\t});\n\n\t\t\t} else {\n\n\t\t\t\t// Login failed, reset processing\n\t\t\t\tsetSubmitButtonProcessing(false);\n\n\t\t\t\t// TODO: Show some type of error\n\t\t\t}\n\t\t});\n\t}", "function submitUser(){\n\t\tif(validateFormControls(\"adduser\")){\n\t\t\t$.ajax({\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: \"../UserServlet\",\n\t\t\t\tdata: {\n\t\t\t\t\t\taction:'addUser',\n\t\t\t\t\t\tusername: $('#username').val(),\n\t\t\t\t\t\temail: $('#email').val(),\n\t\t\t\t\t\tpassword:$('#password').val(),\n\t\t\t\t\t\tcontactno: $('#contactno').val(),\n\t\t\t\t\t\trole: $('#role').val(),\n\t\t\t\t\t\tboard:$('#board').val(),\n\t\t\t\t\t\tsuspended:$(\"input:radio[name='suspended']:checked\").val(),\n\t\t\t\t\t},\n\t\t\t\tsuccess: function(response) {\n\t\t\t\t\t\tif(response.status==\"success\"){\n\t\t\t\t\t\t\talert('User successfully added');\n\t\t\t\t\t\t\tclearForm();\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(response.status==\"failure\") {\n\t\t\t\t\t\t\talert(response.error);\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\tdataType: \"json\"\n\t\t\t});\n\t\t}\n\t\telse{\n\t\t\talert(\"Errors exist in form\");\n\t\t}\n\n\t}", "function signUp() {\n console.log(new User(txtEmail.value, txtPassword.value, null));\n let newUser = new User(txtEmail.value, txtPassword.value, null);\n localStorage.setItem(\"user\", JSON.stringify(newUser));\n\n fetch(\"https://acastore.herokuapp.com/users\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(newUser)\n }).then(response => {\n // response.then(data => {\n // console.log(data);\n // });\n console.log(\"response: \", response.json());\n });\n}", "function registerUser(ev) {\n\t\tev.preventDefault();\n\t\tlet registerForm = $('#registerForm');\n\t\tlet usernameInput = registerForm.find('input[name=\"username\"]');\n\t\tlet passInput = registerForm.find('input[name=\"password\"]');\n\t\tlet repeatPassInput = registerForm.find('input[name=\"repeatPass\"]');\n\t\tlet fullNameInput = registerForm.find('input[name=\"fullName\"]');\n\t\tlet addressInput = registerForm.find('input[name=\"address\"]');\n\t\tlet phoneInput = registerForm.find('input[name=\"phone\"]');\n\t\tlet emailInput = registerForm.find('input[name=\"email\"]');\n\t\tlet cityInput = registerForm.find('input[name=\"city\"]');\n\t\tlet profileImgInput = registerForm.find('input[name=\"profileImg\"]');\n\t\tlet websiteInput = registerForm.find('input[name=\"website\"]');\n\t\tlet infoInput = registerForm.find('input[name=\"info\"]');\n\n\n\t\tlet usernameVal = usernameInput.val();\n\t\tlet passVal = passInput.val();\n\t\tlet repeatPassVal = repeatPassInput.val();\n\t\tlet fullNameVal = fullNameInput.val();\n\t\tlet addressVal = addressInput.val();\n\t\tlet phoneVal = phoneInput.val();\n\t\tlet emailVal = emailInput.val();\n\t\tlet cityVal = cityInput.val();\n\t\tlet profileImgVal = profileImgInput.val();\n\t\tlet websiteVal = websiteInput.val();\n\t\tlet infoVal = infoInput.val();\n\n\t\tlet allIsValid = validateRegisterFields(usernameVal, passVal, repeatPassVal);\n\t\tif (allIsValid) {\n\t\t\tlet userData = {\n\t\t\t\tusername: usernameVal,\n\t\t\t\tpassword: passVal\n\t\t\t};\n\t\t\n\t\t\tauth.register(userData)\n\t\t\t\t.then((userInfo) => {\n\t\t\t\t\tconsole.log('after user register');\n\t\t\t\t\tconsole.log(userInfo);\n\t\t\t\t\tlet profileData = {\n\t\t\t\t\t\tuserId: userInfo._id,\n\t\t\t\t\t\tfullName: fullNameVal,\n\t\t\t\t\t\taddress: addressVal,\n\t\t\t\t\t\tphone: phoneVal,\n\t\t\t\t\t\temail: emailVal,\n\t\t\t\t\t\tcityId: cityVal,\n\t\t\t\t\t\tprofileImg: profileImgVal,\n\t\t\t\t\t\twebsite: websiteVal,\n\t\t\t\t\t\tinfo: infoVal\n\t\t\t\t\t};\n\t\t\t\t\tauthorService.createAuthor(profileData)\n\t\t\t\t\t\t.then(authorData => {\n\t\t\t\t\t\t\tconsole.log('after author register');\n\t\t\t\t\t\t\tconsole.log(authorData);\n\t\t\t\t\t\t\tusernameInput.val('');\n\t\t\t\t\t\t\tpassInput.val('');\n\t\t\t\t\t\t\trepeatPassInput.val('');\n\t\t\t\t\t\t\tfullNameInput.val('');\n\t\t\t\t\t\t\taddressInput.val('');\n\t\t\t\t\t\t\tphoneInput.val('');\n\t\t\t\t\t\t\temailInput.val('');\n\t\t\t\t\t\t\tcityInput.val('');\n\t\t\t\t\t\t\tprofileImgInput.val('');\n\t\t\t\t\t\t\twebsiteInput.val('');\n\t\t\t\t\t\t\tinfoInput.val('');\n\t\t\t\t\t\t\tuserInfo.authorId = authorData._id;\n\t\t\t\t\t\t\tsaveSession(userInfo);\n\t\t\t\t\t\t\tshowInfo('User registration successful.');\n\t\t\t\t\t\t});\n\n\t\t\t\t}).catch(handleError);\n\t\t}\n\t}", "function handleSubmit(e) {\n\te.preventDefault();\n\tsetUpUser(apiKey.value, region.value);\n}", "function Submit(){\n var database = firebase.database().ref('/users/' + usersId);\n \t//once the information is filled out on click of the submit button these varibales will..\n\tsubmit.addEventListener('click',e =>{\n \tconst name = txtName.value;\n \tconst user = txtUserName.value;\n \tconst phone = txtPhoneNumber.value;\n \tconst email = txtEmail.value;\n const password = txtPassword.value;\n const auth = firebase.auth();\n\n const promise = auth.createUserWithEmailAndPassword(email, password)\n window.alert(\"Account created, sign in!!!\")\n\n // ...then be submited and uploaded to the authentication and the database in case so i can call the variables later \n \tdatabase.push().set({ \n \tname: name,\n \tuserId: user,\n \tnumber: phone,\n \temail : email\n \t});\n\n \t//Sends user back to the sign up page ;\n\t $(\"#Login-Page\").show();\n $(\"#Survey-Page\").hide();\n $(\"#Account-Page\").hide(); \n\n \n\t});\n}", "function populateUserForm() {\n var cu = currentUser;\n enter.name.value = cu.name;\n enter.email.value = cu.email;\n enter.age.value = cu.age;\n enter.currentWeight.value = cu.currentWeight;\n enter.targetWeight.value = cu.targetWeight;\n}", "function UserCreate() {\n\n var firstName = $(\"#firstName\").val();\n var lastName = $(\"#lastName\").val();\n var nickName = $(\"#userName\").val();\n var mobileNumber = $(\"#mobileNumber\").val();\n var email = $(\"#email\").val();\n var password = $(\"#password\").val();\n var country = $(\"#country\").val();\n var gender = $(\"input[type='radio'][name='gender']:checked\").val();\n\n\n var jsonBody = JSON.stringify({\n \"emailId\" : email,\n \"firstName\" : firstName,\n \"lastName\" : lastName,\n \"nickname\" : nickName,\n \"password\" : password,\n \"cellPhoneNumber\" : mobileNumber,\n \"gender\" : gender,\n \"country\" : country\n });\n\n console.log('Body :',jsonBody);\n var requestUrl = url + \"usercreate\";\n var request = new Request(requestUrl, {method: 'POST', headers: headerData, body: jsonBody});\n console.log('request :', request);\n\n fetch(request)\n .then(response => response.json())\n .then(function (responseData) {\n\n if (responseData.response.errors.length === 0) {\n alert(\"Sucessfully Registered \");\n console.log('response :',responseData.response);\n window.location.replace(\"../login.html\");\n }\n else {\n alert(\"Error : \" + responseData.response.errors[0].reason);\n console.log(\"E\");\n }\n })\n .catch(function (error) {\n alert('Request Failed :' + error);\n console.log(\"fault\");\n\n });\n}", "function submitData(username, userEmail) {\n let formData = {\n name: username,\n email: userEmail\n };\n\n let configObj = {\n method: \"POST\", // Request with GET/HEAD method cannot have body while request with POST method can have body\n headers: {\n \"Content-Type\": \"application/json\",\n \"Accept\": \"application/json\"\n },\n body: JSON.stringify(formData) // data exchanged between a client and a server is sent as text; can be converted into object with key/value pairds\n };\n\n let content = document.body\n\n return fetch(\"http://localhost:3000/users\", configObj)\n .then(function(response) {\n return response.json();\n })\n .then(function(object) {\n let data = document.createElement('p')\n data.textContent = object.id;\n content.appendChild(data);\n })\n .catch(function(error) {\n let errorMessages = document.createElement('p')\n errorMessages.textContent = error.message;\n content.appendChild(errorMessages);\n });\n}", "function signUpUser(userInfo) {\n $.post(\"/api/signup\", {\n firstName: userInfo.firstName,\n lastName: userInfo.lastName,\n email: userInfo.email,\n password: userInfo.password\n }).then(function(data) {\n window.location.reload();\n console.log(\"signed up\");\n }).catch(handleLoginErr);\n }", "async function saveUser() {\n // searched the user first, send the login name and his url\n await handleSaveList(\"/githubSearch/save\", \"save\",\n validUserNameJason.login, validUserNameJason.html_url);\n // init json object for the next user to be search\n }", "function getFormValues(){\n\nsignupInfo.email = document.getElementById('email').value;\nsignupInfo.username = document.getElementById('username').value;\nsignupInfo.password = document.getElementById('password').value;\nsignupInfo.firstName = document.getElementById('firstName').value;\nsignupInfo.lastName = document.getElementById('lastName').value;\n\nsendToApi ();\n}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('useraddressdetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function onSubmitEditUser(e) {\r\n e.preventDefault();\r\n fetch(`https://contact-list-phase2-app.herokuapp.com/users/${id}`, {\r\n method: \"PATCH\",\r\n headers: {\r\n Accept: \"application/json\",\r\n \"content-Type\": \"application/json\",\r\n },\r\n body: JSON.stringify(formData),\r\n })\r\n .then((res) => res.json())\r\n .then((userData) => {\r\n setFormData(userData);\r\n });\r\n }", "function updateUserDetails(e){\n e.preventDefault();\n\n var userFormData = JSON.parse(queryStringToJsonString($(\"#admin-view-user\").serialize()));\n var userObj = {};\n for(var key in userFormData){\n if(key==\"projectName\")\n continue;\n userObj[key] = decodeURIComponent(userFormData[key]);\n }\n\n updateDetails(\"PUT\", baseURL + \"User\", JSON.stringify(userObj), \"Resource\", \"userViewForm\");\n}", "function saveNewUser() {\n let confirmation = confirm(\"Dont use a real password! If you did please change it! Press - Abbrechen\");\n if (confirmation == true) {\n let query = \"command=registerUser\";\n let inputs = document.getElementsByTagName(\"input\");\n console.log(inputs);\n if (inputs[0].value == \"\" || inputs[1].value == \"\" || inputs[2].value == \"\") {\n printError(\"Please fill in the form to create a new user\");\n return;\n }\n query += \"&name=\" + inputs[0].value;\n query += \"&username=\" + inputs[1].value;\n query += \"&password=\" + inputs[2].value;\n console.log(query);\n sendRequest(query, handleUserInsertResponse);\n }\n }", "submitUser(values) {\n const pageNumber = this.props.activePage;\n this.props.requestAddUsers(values, pageNumber);\n }", "function handleSubmitForm(e) {\n e.preventDefault();\n e.stopPropagation();\n console.log(\"In Handle form submit\");\n\n // Only process the form data if there are actual values in there\n if (\n userNameRef.current.value &&\n emailRef.current.value &&\n passwordRef.current.value\n ) {\n let User = {\n username: userNameRef.current.value.trim(),\n email: emailRef.current.value.trim(),\n password: passwordRef.current.value.trim(),\n };\n\n console.log(\"User : \", User);\n API.createNewUser(User)\n .then((newUser) => {\n console.log(\"Entered a new user (\", newUser, \") into the database!\");\n\n // Clear out the form fields -- not sure if we really need to do this\n userNameRef.current.value = \"\";\n emailRef.current.value = \"\";\n passwordRef.current.value = \"\";\n\n // redirect the user to the login page\n history.push(\"/login\");\n })\n .catch((err) => {\n //console.log(err);\n addToast('Enter a valid email', {\n appearance: 'error',\n autoDismiss: true,\n })\n });\n } // end of If Statement\n }", "onSubmit(e) {\n e.preventDefault();\n\n const newUser = {\n name: this.state.name,\n username: this.state.username,\n email: this.state.email,\n role: this.state.role,\n password: this.state.password,\n password2: this.state.password2\n };\n\n this.props.registerUser(newUser, this.props.history);\n }", "submitSignUpForm(e) {\n if (this.validateForm()) {\n let fields = {}\n fields[\"UserFName\"] = \"\"\n fields[\"UsersLName\"] = \"\"\n fields[\"UsersEmail\"] = \"\"\n fields[\"UsersPassword\"] = \"\"\n fields[\"UsersPhone\"] = \"\"\n\n //The controller and the request is fetched with the help of the link from the Url. The requested file is converetd with the help of json file\n fetch('http://localhost:4200/api/account', {\n method: 'post',\n headers: {'Content-Type':'application/json'},\n body: JSON.stringify({\n \"UsersFName\": this.UsersFName.value,\n \"UsersLName\": this.UsersLName.value,\n \"UsersEmail\": this.UsersEmail.value,\n \"UsersPassword\": this.UsersPassword.value,\n \"UsersPhone\": this.UsersPhone.value,\n })\n })\n console.log(\"The User has created an Account.\")\n //We are going to be displayed with a message telling us the form has been successfully submitted.\n alert(\"Form has been Submitted\")\n }\n }", "function handleSubmit(e){\n e.preventDefault()\n console.log(user)\n \n fetch('http://localhost:3000/users')\n .then(res => res.json())\n .then(users => setUser(users[0]))\n \n }", "onFormSubmit(evt) {\n\t\tevt.preventDefault()\n\t\thttpClient.signUp(this.state.fields).then(user => {\n\t\t\tthis.setState({ fields: { name: '', email: '', password: '' } })\n\t\t\tif (user) {\n\t\t\t\tthis.props.onSignUpSuccess(user)\n\t\t\t\tthis.props.history.push('/')\n\t\t\t}\n\t\t})\n\t}", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n userService\n .createUser(newUser)\n .then(function (userServerInfo) {\n users.push(userServerInfo);\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "handleSubmit(e) {\n e.preventDefault();\n console.log(\"this.state :\", this.state);\n const { first, last, email, password, cd } = this.state;\n const user = {\n first: first,\n last: last,\n email: email,\n password: password,\n cd: cd,\n };\n axios.post(\"/welcome\", user).then((resp) => {\n console.log(\" resp : \", resp);\n if (resp.data.error) {\n this.setState({ error: true });\n } else {\n console.log(\n \"userId from response in Registration.js\",\n resp.data.userId\n );\n location.replace(\"/\");\n }\n });\n }", "function showUserForm() {\n try {\n var user = JSON.parse(localStorage.getItem(\"user\"));\n } catch(e) {\n if (window.navigator.vendor === \"Google Inc.\") {\n if (e === DOMException.QUOTA_EXCEEDED_ERR) {\n alert(\"Error: Saving to local storage\");\n }\n } else if (e === QUOTA_EXCEEDED_ERR) {\n alert(\"Error: Saving to local storage.\");\n }\n \n console.log(e);\n }\n \n if(user != null) {\n $(\"#FirstName\").val(user.FirstName);\n $(\"#LastName\").val(user.LastName);\n $(\"#DOB\").val(user.DOB);\n $(\"#changePassword\").val(user.NewPassword);\n $(\"#height\").val(user.Height);\n $(\"#weight\").val(user.Weight);\n }\n }", "function postUser(user) {\n fetch(\"https://rpsexam-61a3.restdb.io/rest/registeredusers\", {\n method: \"post\",\n headers: {\n \"Content-Type\": \"application/json; charset=utf-8\",\n \"x-apikey\": \"5ddfb3cc4658275ac9dc201e\",\n \"cache-control\": \"no-cache\"\n },\n body: JSON.stringify(user)\n })\n .then(e => e.json())\n .then(newUser => {\n window.location.hash = \"#profile\";\n localStorage.setItem(\"RPSuser\", newUser._id);\n loggedUserID = localStorage.getItem(\"RPSuser\");\n document.querySelector(\".modal_winner_body_notlogged\").style.display =\n \"none\";\n document.querySelector(\".modal_winner_body_logged\").style.display =\n \"block\";\n document.querySelector(\".modal_start_body-trial\").style.display = \"none\";\n document.querySelector(\".modal_start_body-logged\").style.display =\n \"block\";\n document.querySelector(\".nav_user-link\").href = \"#profile\";\n document.querySelector(\"#review\").style.display = \"block\";\n document.querySelector(\"div.highscore_sorting\").style.display = \"block\";\n resetGame();\n fetchUser(newUser._id);\n });\n}", "async postUser(userInfo) {\n let user = {\n publicKey: userInfo.publicKey,\n requests: []\n }\n\n if(this.UserType == \"Patient\")\n user.treatments = [],\n user.redeemedTreatments = []\n\n await this.state.put(this.UserId, user);\n }", "function createUser(){\n let firstname = document.getElementById('firstname').value;\n let lastname = document.getElementById('lastname').value;\n let email = document.getElementById('email').value;\n let password = document.getElementById('password').value;\n let dateOfBirth = document.getElementById('dateOfBirth').value;\n\n // var userAge = calculteAge(dateOfBirth);\n\n // let userInfo = new User(firstname, lastname, email, dateOfBirth, password)\n // userInfo.calculateAge();\n // userInfo.createId();\n\n // localStorage.setItem('id', userInfo.userId)\n let userInfo = { firstname, lastname, email, dateOfBirth, password }; \n\n creatingUser(userInfo);\n\n\n// if (userInfo.age < 18){\n// alert(\"You must be 18 or older to create an account\");\n// return \n// } else {\n// creatingUser(userInfo);\n// // send user on to logged in page\n// }\n}", "function register() {\n\tvar data = {}\n\t\n\tif (form.email.value) data.email = form.email.value\n\tif (form.password.value) data.password = form.password.value\n\tif (form.name.value) data.name = form.name.value\n\t\n\t//take out later\n\tconsole.log(data)\n\n\tfetch('/register', {\n\t\theaders: {\n\t\t\t'Content-Type': 'application/json'\n\t\t},\n\t\tmethod: 'POST',\n\t\tbody: JSON.stringify(data)\n\t}).then(function(res) {\n\t\tres.json()\n\t\t.then(function(user){\n\t\t\talert(JSON.stringify(user))\n\t\t})\n\t}).catch(function(err) {\n\t\tconsole.error(err)\n\t})\n\t\n}", "function registerUser() {\n \n var data = $(\"#register_form\").serializeArray();\n var obj={};\n \n // Loop converts data serialized into an object.\n data.forEach(function(a){\n obj[a.name] = a.value;\n });\n \n for (var i in obj) {\n if (checkInput($(\"#\"+i))) {\n if (i === \"password\") {\n obj[i] = SHA256(obj[i]);\n } else if (i === \"email\") {\n data = JSON.stringify(obj);\n\n // Updates users.json file with a new user\n request(\"http://introtoapps.com/datastore.php?action=append&appid=215242834&objectid=users.json&data=\"+data, \"POST\", \"\", \"#register_error\", logOff);\n }\n } else {\n break;\n }\n } \n}", "function pinSubmit(e) {\n e.preventDefault();\n userDetails.style.display = \"none\";\n if (validation()) {\n disableButton();\n fetch(url + `/${pin.value}`)\n .then(resp => resp.json())\n .then(user => {\n enableButton();\n showSuccessMessage(\"Successfully fetched data!\");\n let newUser = {\n ...user[0]\n };\n showUserDetails(newUser);\n form.reset();\n })\n .catch(err => {\n enableButton();\n console.log(err);\n showErrorMessage(\"Unable to fetch data\");\n form.reset();\n });\n }\n}", "function signUpUser(e) {\n e.preventDefault();\n const bodyObj = {\n userType: 1,\n userName: userName,\n email: email,\n password: password\n }\n console.log(bodyObj);\n axios.post(\"/api/signup\", bodyObj)\n .then(res => {\n console.log(res);\n if (!res.data.errmsg) {\n console.log(\"success\");\n history.push(\"/\");\n } else {\n console.log(\"ERR\");\n }\n })\n .catch(err => {\n console.log(\"Signup Error: \");\n console.log(err);\n })\n }", "function signUpUser({\n firstName,\n lastName,\n email,\n password,\n intOne,\n intTwo,\n intThree\n }) {\n console.log(\"firstName:\", firstName);\n $.post(\"/api/signup\", {\n firstName: firstName,\n lastName: lastName,\n email: email,\n password: password,\n intOne: intOne,\n intTwo: intTwo,\n intThree: intThree\n })\n .then(res => {\n console.log(res);\n window.location.replace(\n \"/members/:\" + intOne + \"/:\" + intTwo + \"/:\" + intThree\n );\n // If there's an error, handle it by throwing up a bootstrap alert\n })\n .catch(handleLoginErr);\n }", "function save_user()\r\n {\r\n alertBox.hide();\r\n const username = Utils.getInput();\r\n if(Utils.isEmpty(username))\r\n return;\r\n\r\n\r\n fetch('./save', Utils.postUserParam(username)).then(function(response) { //posts request to the server\r\n if(response.status !== 200) {\r\n alertBox.show('Username already saved!', true);\r\n return;\r\n }\r\n\r\n response.json().then(function(data) {\r\n alertBox.show(data.msg, false);\r\n init_saved(); //updates saved list\r\n });\r\n });\r\n\r\n }", "updateUserData() {\n console.log(\"Creating profile\");\n var formData = $('#user-form').serializeArray();\n var firstName = formData[0].value;\n var lastName = formData[1].value;\n var email = formData[2].value;\n var country = formData[3].value;\n var state = formData[4].value;\n var city = formData[5].value;\n var dob = formData[6].value;\n\n var newUserInfo = {firstName: firstName, lastName: lastName, email: email, country: country, state: state, city: city, dob: dob};\n\n }", "onSubmit(newUserData) {\n signup(newUserData)\n .then(response => {\n generateSuccessDialog('Your account has been created!', 'Okay').then((result) => {\n // Log into the newly created account.\n (result.value) && this.handleSignIn();\n })\n }).catch(error => generateErrorDialog('There was a problem registering your account'))\n }", "function addUserToCustomerIO(){\n if (hasSignedUp()) return;\n\n var email = $(\"#cio-email\").val();\n var firstName = $(\"#cio-firstname\").val();\n var source = $(\"#cio-source\").val();\n var id = email.replace('@', '_');\n id = id.replace('.', '_');\n\n _cio.identify({\n // Required Items\n id: id,\n email: email,\n created_at: Math.round( new Date().getTime()/1000), // seconds since the epoch\n\n // Optional (these are examples. You can name attributes what you wish)\n type: 'lead',\n first_name: firstName,\n source: 'leads',\n referrer: document.referrer\n });\n\n setSignedUp();\n }", "handleNewUser(req, res) {\n self.services.saveNewUser(req.validBody)\n .then(data => {\n res.send({data}); \n })\n .catch(error => {\n self.sendError(res, self.CODES.INTERNAL_ERROR, \"An error occured trying to sign up\");\n });\n }", "async function signupUser() {\n const response = await fetchWithCSRF(`/api/users/`, {\n method: 'POST',\n headers: {\n \"Content-Type\": \"application/json\",\n },\n credentials: 'include',\n body: JSON.stringify({\n canfollow,\n email,\n username,\n fullname,\n password,\n password2\n })\n });\n\n const responseData = await response.json();\n if (!response.ok) {\n setErrors(responseData.errors);\n } else {\n setCurrentUserId(responseData.current_user_id)\n setCurrentUser(responseData.current_user);\n // history.push('/')\n // history.push('/users')\n }\n }", "onSubmit() {\n this.submitted = true;\n if (this.form.invalid) {\n return;\n }\n this.loading = true;\n let formData = {\n first_name: this.form.get('firstName').value,\n last_name: this.form.get('lastName').value,\n username: this.form.get('username').value,\n password: this.form.get('password').value\n };\n this.userService.register(formData).subscribe(u => {\n if (u == null) {\n console.log(\"not accepted\");\n }\n else {\n console.log(\"added user\");\n this.router.navigateByUrl('');\n }\n });\n }", "function submitHandler(e) {\n e.preventDefault();\n \n const validation = new Validation(form);\n validation.init();\n if (!validation.check()) return message.show({text: \"Fill in all marked fields correctly\", error: true});\n\n let newUser = {\n email: emailInput.value,\n password: passwordInput.value,\n nickname: nicknameInput.value,\n first_name: first_nameInput.value,\n last_name: last_nameInput.value,\n phone: phoneInput.value,\n gender_orientation: gender_orientationInput.value,\n city: cityInput.value,\n country: countryInput.value,\n date_of_birth_day: date_of_birth_dayInput.value,\n date_of_birth_month: date_of_birth_monthInput.value,\n date_of_birth_year: date_of_birth_yearInput.value\n }\n\n signUp.register(newUser)\n .then(res => {\n if(!res.error) {\n message.show({text: res.message, error: res.error});\n setTimeout(() => window.location = \"login.html\", 3000);\n } else {\n message.show({text: res.message, error: res.error});\n passwordInput.value = '';\n }\n })\n .catch((error) => {\n console.log(error);\n });\n }", "async postSave () {\n\t\t// save an invite code as a signup token for this user\n\t\tawait this.saveSignupToken();\n\n\t\t// grant the user access to their own me-channel, strictly for testing purposes\n\t\t// (since they are not confirmed yet)\n\t\tawait this.grantMeChannel();\n\t}", "function handleSubmit(event){\n event.preventDefault()\n \n //this is where I am calling the function above to submit the username/password\n registration()\n //setUserName(\"\")\n //setPassword(\"\")\n }", "async registerUser(userInfo) {}", "function submitUser() {\n var data = {}\n if (form.email.value) data.email = form.email.value\n if (form.password.value) data.password = form.password.value\n\n if (!data.email) return displayError('Must provide email')\n if (!data.password) return displayError('Must provide password')\n if (data.password !== form.confirm.value) return displayError('Passwords do not match')\n\n fetch('/register', {\n headers: {\n 'Content-Type': 'application/json',\n },\n method: 'POST',\n body: JSON.stringify(data)\n }).then(submitSuccess)\n .then(window.location = '/') //was /welcome before\n .catch(submitError)\n}", "function signUpUser(userName, passWord, firstName, lastName) {\n $.post(\"/api/signup\", {\n userName: userName,\n passWord: passWord,\n firstName: firstName,\n lastName: lastName\n }).then(function(data) {\n console.log(data);\n // If there's an error, handle it by throwing up a boostrap alert\n }).catch(handleLoginErr);\n\n }", "function handleRegister() {\n const userInformation = {\n email: emailInput.value,\n fullName: nameInput.value,\n password: passwordInput.value,\n };\n fetch('http://localhost:4000/userRegistration', {\n method: 'POST',\n body: JSON.stringify(userInformation),\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n },\n })\n .then((response) => response.json())\n .then((a) => console.log(a))\n .catch((err) => console.log(err));\n}", "function handleSubmit(event) {\n event.preventDefault();\n\n const tempStaffMember = [\n {\n firstName,\n lastName,\n address,\n username,\n password,\n staffType,\n advisorCode,\n commissionRate440,\n commissionRate420,\n commissionRate201,\n },\n ];\n\n const getLink = !props.isNew\n ? apiLinks.STAFFMEMBERS + '/' + props.match.params.id\n : null;\n console.log(getLink);\n\n props.isNew\n ? axios\n .post(apiLinks.STAFFMEMBERS, tempStaffMember)\n .then((response) => {\n console.log(response);\n alert('User Created');\n })\n : axios\n .put(getLink, tempStaffMember)\n .then((res) => {\n console.log(res);\n alert('User Updated');\n })\n .catch((err) => console.log('Error code: ', err));\n }", "function createUser() {\n\n //create a new form\n createForm();\n\n //remove the userid input from the view\n document.getElementById('invi').style.display = 'none';\n\n document.getElementById('inter-btn').addEventListener('click', function (e) {\n const name = document.getElementById('name').value;\n const website = document.getElementById('website').value;\n const companyName = document.getElementById('cmpName').value;\n const catchPhrase = document.getElementById('cmpCatch').value;\n\n let output = '';\n\n if (name !== '' && website !== '') {\n //create data to send to API\n const dat = {\n name: `${name}`,\n website: `${website}`,\n company: {\n name: `${companyName}`,\n catchPhrase: `${catchPhrase}`\n\n }\n }\n //Create Post Request\n http.post('https://jsonplaceholder.typicode.com/users', dat, function (err, posts) {\n if (err) {\n output = `<h5>${err}</h5>`;\n } else {\n posts = JSON.parse(posts);\n output = `\n <h5 class=\"mt-2\"> New user with id : ${posts.id} is created! </h5>\n <div class=\"card card-body mb-2\">\n <h5>Name : ${posts.name}</h4>\n <p>Id : ${posts.id}</p>\n <p>Website : ${posts.website}</p>\n <h6> Company: </h6>\n <ul>\n <li>Name : ${posts.company.name}</li>\n <li>Catchphrase : ${posts.company.catchPhrase}</li>\n </ul>\n </div>\n `;\n }\n document.getElementById('output').innerHTML = output;\n });\n }\n e.preventDefault();\n });\n}", "newUser(req, res, next) {\n // EXTRACT FORM DATA\n const { username, email, password } = req.body;\n\n // INSERT USER DATA INTO AN OBJECT\n let newUser = { username, email, password };\n\n // USE MODEL TO REGISTER A NEW USER\n User.addUser(newUser)\n .then(user => {\n res.status(201).json({\n success: true,\n message: 'User registered',\n user: {\n id: user.id,\n username: user.username,\n email: user.email\n }\n });\n })\n .catch(err => console.error(err));\n }", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('userloandetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "function resolveUserDetails(data){\n\t\t\tif(data == true){\n\t\t\t\t//$state.go('userloandetails');\n\t\t\t\t//data is posted successfully\n\t\t\t}\n\t\t}", "post(data, cb) {\n const { auditRequiredFields, hash } = helpers;\n const { \n payload: { \n firstName, \n lastName,\n phone,\n password,\n tosAgreement\n } \n } = data;\n \n const requiredFields = [\n { param: firstName, },\n { param: lastName },\n // @TODO: enforce stricter password rules \n { param: password },\n { \n param: phone,\n compareOptions: { \n requiredLength: 10,\n operator: '==' \n }\n },\n {\n param: tosAgreement,\n requiredDataType: 'boolean',\n compareOptions: null\n }\n ];\n // Make sure all required fields are valid\n const allRequiredFieldsPass = auditRequiredFields(requiredFields).auditPassed;\n\n if (allRequiredFieldsPass) {\n // Make sure that the user doesn't already exist\n _data.read('users', phone, (err, data) => {\n if (err) {\n // User doesn't exist\n // Hash the password\n const hashedPassword = hash(password);\n if (hashedPassword) {\n // Create the user object\n const userObject = {\n firstName,\n lastName,\n phone,\n hashedPassword,\n tosAgreement\n };\n // Store the user\n _data.create('users', phone, userObject, err => {\n if (!err) {\n cb(200);\n } else {\n console.error(err);\n cb(500, {Error: 'Could not create the new user'});\n }\n });\n } else {\n cb(500, {Error: 'Could not hash the user\\'s password'});\n }\n } else {\n // User already exists\n cb(400, {Error: 'A user with that phone number already exists'})\n }\n });\n\n } else {\n cb(400, {error: 'Missing required fields'});\n }\n }", "function postUser(username, pin) {\n newUser = {\n username: username,\n pin: pin,\n highScore: 0,\n };\n configObj = {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n },\n body: JSON.stringify(newUser),\n };\n fetch(userUrl, configObj)\n .then((response) => response.json())\n .then((user) => {\n exitSignIn(user);\n })\n .catch((error) => console.error(\"ERROR: \", error));\n }", "onFormSubmit(event) {\n event.preventDefault();\n const { email, password } = this.state;\n const formData = new FormData();\n formData.append('email', email);\n formData.append('password', password);\n this.props.signupUser(formData, this.props.history);\n }", "function signup({userName, userPassword, userEmail, userCity}) {\n\t//do some logic\n}", "function submit() {\n\t \tvm.successMessage = '';\n\t \tvm.errorMessage = '';\n\t \t\n\t \tif(vm.submitClicked) {\n\t \t\treturn;\n\t \t}\n\t \tvm.submitClicked = true;\n\t \t\n\t \tif(vm.state != \"userPage.home\") {\n\t \t\tUsersFactory.getUserProfile(vm.profileId).then(function(response) {\n\t \t\t\tvm.transferInfo.toUser = response.data;\n\t \t\t\tsendPoints();\n\t \t\t})\n\t \t} else {\n\t \t\tsendPoints();\n\t \t}\n\t }", "async function submitHandler(e){\n e.preventDefault();\n try {\n const res = await axios.post(\"http://localhost:3001/auth/signup\", details, {\n headers: {'Content-Type': 'application/json'},\n });\n setError(\"\");\n props.setCurrUser(res.data)\n history.push('/');\n } catch (error) {\n console.log(error.response)\n setError(error.response.data)\n }\n }", "function handleFormSubmit(event) {\n event.preventDefault();\n // Wont submit the user if we are missing a username or group\n if (!usernameInput.val().trim() || !groupSelect.val()) {\n return;\n }\n // Constructing a newUser object to hand to the database\n var newUser = {\n username: usernameInput\n .val()\n .trim(),\n GroupId: groupSelect.val()\n };\n \n // If we're updating a user run updateUser to update a user\n // Otherwise run submituser to create a whole new user\n if (updating) {\n newUser.id = userId;\n updateUser(newUser);\n }\n else {\n submitUser(newUser);\n }\n }", "function indivAdd() {\n \n if (selfRequest) {\n userFirst = respFirst;\n userLast = respLast;\n userEmail = respEmail;\n userOrg = respOrg;\n } else {\n userFirst = e.namedValues['User First Name'][0];\n userLast = e.namedValues['User Last Name'][0];\n userEmail = e.namedValues['User Email Address'][0];\n userOrg = e.namedValues['Organization Name'][0];\n }\n \n //check if the submission is a duplicate\n checkIndivDupe();\n \n //if the submission is not a duplicate, then...\n if (!isIndivDupe) {\n //save user information in two-dimensional array\n rawData = [ [], [userFirst, userLast, userEmail, userOrg]];\n //and store the number of users in the submission\n submitUsers = 1;\n }\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 }", "function registerUser(ev) {\n ev.preventDefault();\n let registerUsername = $('#registerUsername');\n let registerName = $('#registerName');\n let registerPassword = $('#registerPasswd');\n\n let usernameVal = registerUsername.val();\n let nameVal = registerName.val();\n let passVal = registerPassword.val();\n\n auth.register(usernameVal, passVal, nameVal)\n .then((userInfo) => {\n saveSession(userInfo);\n registerUsername.val(\"\");\n registerName.val(\"\");\n registerPassword.val(\"\");\n showInfo('User registration successful.');\n }).catch(handleError);\n }", "async function handleSubmit(event){\n event.preventDefault();\n\n const reponse = await api.post('/sessions', { email });\n\n const { _id } = reponse.data;\n\n localStorage.setItem('user' , _id); \n }", "function createUser(e) {\n e.preventDefault();\n let username = e.target.name.value;\n let pin = e.target.pin.value;\n console.log(username, pin);\n //check if user name is unique\n let x = sortedUsers.find((user) => user.username === username);\n if (x === undefined) {\n postUser(username, pin);\n } else {\n console.log(\"at else Create User\");\n alert(\"Username taken, Try again.\");\n form.reset();\n }\n }", "submitForm(){\n\t\tlet instance = this;\n\t\tconst\tdata = JSON.stringify({\n\t\t\tinterest: instance.dropdownData.interest,\n\t\t\tloan: instance.calculatorData,\n\t\t\tnumberOfMonths: instance.dropdownData.months,\n\t\t\ttotalDebt: instance.debt\n\t\t});\n\t\t\n\t\t\n\t\tfetch(instance.endpoint, {\n\t\t\tmethod: \"POST\",\n\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json, text/plain, */*',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t},\n\t\t\tbody: data\n\t\t}).then(resp => resp.json())\n\t\t\t.then(({status}) => instance.showFormMessage(status))\n\t\t\t.catch(err => instance.showFormMessage(`something wrong. Please contact the administrator.`, true))\n\t}", "function createNewUser(data){\n let msg = {\n jsonrpc: '2.0',\n id: '0',\n method: 'setUser',\n params: data,\n };\n console.log(\"Making new user request\" )\n doSend(msg); \n}" ]
[ "0.707641", "0.70558834", "0.69420993", "0.6927481", "0.6854565", "0.6768359", "0.67116916", "0.66895527", "0.6684485", "0.6659695", "0.65590906", "0.65555555", "0.65481216", "0.653912", "0.6536494", "0.65220237", "0.64642054", "0.64473015", "0.6443442", "0.6438073", "0.64317864", "0.64236003", "0.6393722", "0.6392757", "0.63920325", "0.6386874", "0.6371712", "0.637166", "0.63702786", "0.63598996", "0.6345873", "0.63435304", "0.6333488", "0.6331595", "0.6318439", "0.63154954", "0.6311133", "0.63069403", "0.6301594", "0.6284854", "0.6283692", "0.627924", "0.6277952", "0.6268632", "0.6268632", "0.6268632", "0.6268632", "0.6268632", "0.6267004", "0.6266925", "0.6258586", "0.6251027", "0.6250518", "0.62479955", "0.6237377", "0.6235383", "0.6234181", "0.62338334", "0.62335485", "0.6233001", "0.6228811", "0.62272036", "0.62231994", "0.6220365", "0.62186915", "0.6216617", "0.6214112", "0.6210069", "0.61999047", "0.6197187", "0.6196078", "0.6194366", "0.61909014", "0.61904466", "0.61821055", "0.6172079", "0.61574984", "0.61574256", "0.61501455", "0.61467034", "0.6146181", "0.61402166", "0.613854", "0.6137098", "0.6136818", "0.6135883", "0.6135883", "0.6134861", "0.61348295", "0.6134448", "0.6133299", "0.61317146", "0.61307174", "0.6125974", "0.61229414", "0.61205804", "0.6116616", "0.6116027", "0.6114765", "0.61096084", "0.61085343" ]
0.0
-1
This is invoked to set the Firebase Storage URI of the image
setImageURI(result){ if (!result.cancelled) { this.setState({ base64: result.base64.replace(/(?:\r\n|\r|\n)/g, '') }) this.setState({ image: result.uri }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "uploadImage(e, method) {\n let imageObj = {};\n\n\n if (method === \"firebase\") {\n\n // // ===========FIREBASE=================\n let currentImageName = \"firebase-image-\" + Date.now();\n\n let uploadImage = storage.ref(`images/${currentImageName}`).put(e.target.files[0]);\n\n uploadImage.on('state_changed',\n (snapshot) => { },\n (error) => {\n alert(error);\n },\n () => {\n storage.ref('images').child(currentImageName).getDownloadURL().then(url => {\n\n this.setState({\n firebaseImage: url\n });\n\n //store image object in the database\n imageObj = {\n imageName: currentImageName,\n imageData: url\n };\n console.log(\"TCL: MarketplaceModal -> uploadImage -> imageObj\", imageObj);\n\n\n // axios.post(`${API_URL}/image/uploadbase`, imageObj)\n // .then((data) => {\n // if (data.data.success) {\n // alert(\"Image has been successfully uploaded using firebase storage\");\n // this.setDefaultImage(\"firebase\");\n // }\n // })\n // .catch((err) => {\n // alert(\"Error while uploading image using firebase storage\")\n // this.setDefaultImage(\"firebase\");\n // });\n })\n })\n }\n\n\n\n //==========this works================\n let file = e.target.files[0];\n\n let storageRef = storage.ref('photos/' + file.name);\n this.setState({ imgUrl: storageRef.location.path }, () => {\n console.log(this.state.imgUrl);\n\n });\n\n\n let task = storageRef.put(file);\n\n // file.on('state_changed',\n // (snapshot) => { },\n // (error) => {\n // alert(error);\n // },\n // () => {\n // storage.ref('photos/').child(file.name).getDownloadURL().then(url => {\n // this.setState({\n // firebaseImage: url\n\n // });\n // })\n // }\n // )\n\n\n\n\n\n }", "fileChange(event) {\n let name = event.target.files[0].name;\n let file = event.target.files[0];\n // Create a new child reference (on storage) for the image using its name\n let imgRef = this.storageRef.child(name);\n // `put` the file contents. then()\n // get the URL of snapshot\n // then() push a new element into \n // the database `img` reference\n // and update state.img's value: the \n // url of the img\n imgRef.put(file).then((snapshot) => {\n return snapshot.ref.getDownloadURL()\n }).then((snapshot) => {\n let img = {\n url: snapshot\n }\n this.dataRef.push(img);\n this.props.callBack(\"img\", snapshot)\n })\n }", "function uploadImage(fileName){\n\t // Create a root reference\n\t var ref = firebase.storage().ref();\n\n\t const file = fileName.get(0).files[0]\n\t const name = (+new Date()) + '-' + file.name\n\t const metadata = {\n\t \tcontentType: file.type\n\t }\n\t const task = ref.child(name).put(file, metadata)\n\n\t var image_url = '';\n\t task\n\t .then(snapshot => snapshot.ref.getDownloadURL())\n\t .then(url => {\n\n\t \timage_url = url ;\n\t \tconsole.log('image name : ' + name)\n\t \tconsole.log('image url : ' + image_url );\n\t \t$('#showimg').attr('src',image_url)\n\t })\n\n\n\t }", "async uploadImageToFirebase(imageData, imgTypeName, ID) {\n return new Promise(async (resolve) => {\n let date = moment(new Date()).format(\"YYYYMMDDHHmmss\");\n const storageRef = storage()\n .ref(imgTypeName + \"-\" + ID + \"-\" + date)\n .putFile(imageData);\n storageRef.on(\n `state_changed`,\n (snapshot) => {\n this.uploadValue =\n (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n },\n (error) => {\n console.log(error.message);\n },\n async () => {\n this.uploadValue = 100;\n storageRef.snapshot.ref.getDownloadURL().then((url) => {\n resolve(url);\n });\n }\n );\n });\n }", "async uploadImage(currentBook) {\n const { imageFile } = this.state\n debugger\n const storageRef = storage.ref();\n const fileRef = storageRef.child(imageFile.name);\n await fileRef.put(imageFile);\n currentBook.image = await fileRef.getDownloadURL();\n // const fileUrl = await fileRef.getDownloadURL();\n // this.setState(currentBook);\n }", "function uploadFile(){\n\t\nvar filename = selectedFile.name;\n\nvar storageRef = firebase.storage().ref('/images/' + filename);\n\nvar uploadTask = storageRef.put(selectedFile);\n\nuploadTask.on('state_changed',function(snapshot){\n\n},function(error){\n\n},function() {\n // Handle successful uploads on complete\n // For instance, get the download URL: https://firebasestorage.googleapis.com/...\n uploadTask.snapshot.ref.getDownloadURL().then(function(downloadURL) {\n console.log('File available at', downloadURL);\n \n });\n});\n}", "function onSuccess(imageURI) {\n var image = document.getElementById('myImage');\n image.src = imageURI;\n $$('#cuenta-img').attr('src', imageURI);\n console.log(imageURI);\n\n\n storageRef.put(imageURI)\n\n let task = storageRef.put(imageURI)\n task.on('state_changed', function (snapshot) {\n let percentaje = (snapshot.bytesTransferred / snapshot.totalBytes) * 100\n console.log(percentaje)\n\n },\n function (err) {\n console.log(err)\n },\n function () {\n console.log(task.snapshot.downloadURL)\n }\n )\n\n }", "function uploadToFirebase(image, name){\n var storageRef = firebase.storage().ref('images/' + app.blgName + \"/\"+ name);\n storageRef.put(image).then(function(snapshot){\n storageRef.getDownloadURL().then(function(url) {\n var arg = {\n \"url\": url,\n \"filename\": name\n };\n firebaseUrls.push(arg);\n }).catch(function(error) {\n switch (error.code) {\n case 'storage/object-not-found':\n // File doesn't exist\n console.log(\"File doesn't exist\")\n return false;\n break;\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n console.log(\"User doesn't have permission to access the object\")\n return false;\n break;\n case 'storage/canceled':\n // User canceled the upload\n console.log(\"User canceled the upload\")\n return false;\n break;\n case 'storage/unknown':\n // Unknown error occurred, inspect the server response\n console.log(\"Unknown error occurred, inspect the server response\");\n return false;\n break;\n }\n });\n });\n}", "function uploadImage(){\n var d = new Date();\n var n = d.getTime();\n ImgName = n\n var uploadTask = firebase.storage().ref('Images/' +ImgName+\".jpg\").put(files[0]);\n uploadTask.on('state_changed',function(snapshot){\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes)*100;\n }, \n function(error){\n alert('error in saving the image');\n }, \n function(){\n uploadTask.snapshot.ref.getDownloadURL().then(function(url){\n ImgUrl = url;\n photoLink = ImgUrl;\n console.log(photoLink);\n\n });\n \n });\n}", "function uploadImage(values, Uri, Filename, userKey, mime = 'image/jpeg') {\n return new Promise((resolve, reject) => {\n const uploadUri = Uri;\n let uploadBlob = null;\n\n // Creates the reference to where the image will be stored in Firebase storage\n const imageRef = Firebase.storage()\n .ref('images/' + userKey)\n .child(Filename);\n\n // Converts the Uri of the image selected into file type that can\n // be uploaded to Firebase \n fs.readFile(uploadUri, 'base64')\n .then(data => {\n return Blob.build(data, {type: `${mime};BASE64`});\n })\n .then(blob => {\n uploadBlob = blob;\n return imageRef.put(blob, {contentType: mime});\n })\n .then(() => {\n uploadBlob.close();\n // Once image is uploaded, a download url is created\n return imageRef.getDownloadURL();\n })\n .then(function(downloadURL) {\n console.log('File available at', downloadURL);\n // download url captured in const so this info can be added to post table\n const url = downloadURL;\n\n AddPost({\n heading: values.heading,\n description: values.description,\n location: selectedValue,\n uri: Uri,\n filename: Filename,\n userkey: userKey,\n url: url,\n });\n })\n .then(url => {\n resolve(url);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "function addImage(postId) {\r\n // upload the file\r\n const storage = firebase.storage();\r\n const user = firebase.auth().currentUser;\r\n const ref = storage.ref('posts').child(postId).child('post-image');\r\n \r\n const promise = ref.put(file);\r\n\r\n promise.then(function(image) {\r\n return image.ref.getDownloadURL();\r\n }).then(function(url) {\r\n postsRef.child(postId).update({ imageURL: url });\r\n });\r\n}", "storeImage () {\n // get input element user used to select local image\n var input = document.getElementById('files');\n // have all fields in the form been completed\n if (this.newImageTitle && input.files.length > 0) {\n var file = input.files[0];\n // get reference to a storage location and\n storageRef.child('images/' + file.name)\n .put(file)\n .then(snapshot => this.addImage(this.newImageTitle, snapshot.downloadURL));\n // reset input values so user knows to input new data\n input.value = '';\n }\n }", "function set_image_src(image_ref, image_element) {\n image_ref.getDownloadURL()\n .then( function(url) {\n image_element.src = url;\n })\n .catch( function (error) {\n console.log(error.message);\n })\n}", "getImage (image) {\n let imageRef = storageRef.ref(image);\n imageRef.getDownloadURL()\n .then((url) => {\n this.setState({\n ImageURL:url,\n })\n console.log('Image URL:'+ url);\n })\n .catch ((error)=>{\n console.log('Error in getIamge: ' + error)\n })\n }", "function retrieveImageUrl(memoizeRef, filename){\n /*\n var storageRef = firebase.storage().ref();\n var spaceRef = storageRef.child('images/photo_1.png');\n var path = spaceRef.fullPath;\n var gsReference = storage.refFromURL('gs://test.appspot.com')\n */\n memoizeRef.child(filename).getDownloadURL().then(function(url) {\n var test = url;\n console.log(test)\n var imageLoaded = document.createElement(\"img\");\n imageLoaded.src = test;\n imageLoaded.className = \"w3-image w3-padding-large w3-hover-opacity\";\n document.getElementById(\"chatDisplay\").prepend(imageLoaded);\n\n imageLoaded.setAttribute(\"onclick\", \"onClick(this)\");\n }).catch(function(error) {\n\n });\n}", "function uploadToStorage(file, storageLocation, databaseLocation) {\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = storageLocation.put(file, metadata);\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n function (snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n },\n function (error) {\n console.log('照片上傳失敗:', error.message);\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n },\n function () {\n console.log('照片成功上傳');\n // Upload completed successfully, now we can get the download URL\n var downloadURL = uploadTask.snapshot.downloadURL;\n // add gallery URL to database\n databaseLocation.set(downloadURL)\n .then(function () {\n console.log(\"Picture added to database: \", downloadURL);\n })\n .catch(function (error) {\n console.log(\"Error adding picture to database: \", error);\n });\n });\n}", "function readURL() {\n const database = firebase.database();\n var fileupload = $(\"#FileUpload1\");\n var filePath = $(\"#spnFilePath\");\n var button = $(\"#btnFileUpload\");\n fileupload.click();\n fileupload.change(function () {\n var file = document.getElementById('FileUpload1').files[0];\n // some stuff that doesn't work\n //imgData = getBase64Image(file);\n //localStorage.setItem(\"imgData\", imgData);\n console.log(file);\n if (file) {\n // create reader\n var reader = new FileReader();\n reader.onload = function(e) {\n // storing e.target.result, whatever that is\n localStorage.setItem(\"image\",e.target.result);\n const user = localStorage.getItem('curUser');\n const userRef = 'users/' + user;\n database.ref(userRef).update({img: e.target.result});\n // browser completed reading file - display it\n $('#testImage')\n .attr('src', e.target.result)\n .width(75)\n .height(100);\n $('#testImage').show();\n };\n reader.readAsDataURL(file);\n }\n // this displays the file name\n var fileName = $(this).val().split('\\\\')[$(this).val().split('\\\\').length - 1];\n filePath.html(\"<b>Selected File: </b>\" + fileName);\n });\n}", "handleUpdateProfile() {\n let storageRef = this.props.firebase\n .storage()\n .ref(this.props.auth.uid + \"/\" + \"profilepic\");\n storageRef.getDownloadURL().then(url => this.setState({ source: url }));\n }", "function uploadPortraitToStorage(file, location, userId) {\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = location.put(file, metadata);\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n function(snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n }, function(error) {\n console.log('照片上傳失敗:', error.message);\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n }, function() {\n console.log('照片成功上傳');\n // Upload completed successfully, now we can get the download URL\n var downloadURL = uploadTask.snapshot.downloadURL;\n // add galleryPic1 url to database\n firebase.database().ref('spPublic/' + userId + '/gallery').update({\n galleryPic1: downloadURL\n })\n .then (function() {\n console.log(\"galleryPic1 added to database: \", downloadURL);\n })\n .catch(function(error) {\n console.log(\"Error adding galleryPic1 to database: \", error);\n });\n });\n}", "function uploadImage(imageName, image) {\n // Create a root reference\n var storageRef = firebase.storage().ref();\n\n // File or Blob named mountains.jpg\n var file = image;\n imageKeepName = file.name;\n\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = storageRef.child('images/' + file.name).put(file, metadata);\n\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, function (snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n }, function (error) {\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n }, function () {\n // Upload completed successfully, now we can get the download URL\n downloadURL = uploadTask.snapshot.downloadURL;\n globals.uploaded = true;\n updateImage(downloadURL);\n firebase.database().ref('sessions/' + sessionName).update({\n image: downloadURL\n });\n });\n\n}", "function setImageURL(imageURL) {\n model.imageURL = $scope.selectedInst.instType + \"/\" + imageURL;\n }", "function uploadToStorage(file, location, userId) {\n // Create the file metadata\n var metadata = {\n contentType: 'image/jpeg'\n };\n // Upload file and metadata to the object 'images/mountains.jpg'\n var uploadTask = location.put(file, metadata);\n // Listen for state changes, errors, and completion of the upload.\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n function(snapshot) {\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n }, function(error) {\n console.log('照片上傳失敗:', error.message);\n // A full list of error codes is available at\n // https://firebase.google.com/docs/storage/web/handle-errors\n switch (error.code) {\n case 'storage/unauthorized':\n // User doesn't have permission to access the object\n break;\n\n case 'storage/canceled':\n // User canceled the upload\n break;\n\n case 'storage/unknown':\n // Unknown error occurred, inspect error.serverResponse\n break;\n }\n }, function() {\n console.log('照片成功上傳');\n // Upload completed successfully, now we can get the download URL\n var downloadURL = uploadTask.snapshot.downloadURL;\n // add icURL to database\n firebase.database().ref('spPrivate/' + userId).update({\n icURL: downloadURL\n })\n .then (function() {\n console.log(\"icURL added to database: \", downloadURL);\n })\n .catch(function(error) {\n console.log(\"Error adding icURL to database: \", error);\n });\n });\n}", "function uploadUserProfilePic() {\n // Let's assume my storage is only enabled for authenticated users \n // This is set in your firebase console storage \"rules\" tab\n firebase.auth().onAuthStateChanged(function (user) {\n // get Elements \n var uploader = document.getElementById('uploader-progress');\n var fileButton = document.getElementById(\"fileButton\");\n\n // listen for file selection\n fileButton.addEventListener('change', function (e) {\n var file = e.target.files[0]; // Get file with file browser\n var storageRef = firebase.storage().ref(\"images/\" + user.uid + \".jpg\"); // Get reference\n storageRef.put(file); // Upload file\n\n // storage bucket plus folder plus image name, which is the user's doc id\n //var picref = \"gs://mango-smoothie.appspot.com/images/\"+user.uid + \".jpg\";\n\n storageRef.getDownloadURL()\n .then(function(url){ // Get URL of the uploaded file\n console.log(url); // Save the URL into users collection\n db.collection(\"users\").doc(user.uid).update({\n \"profilePic\": url\n })\n })\n })\n })\n}", "function setImageURL(img, photo, asClone) {\n var oldURL = img.dataset.src;\n if (oldURL) {\n if (!asClone) {\n window.URL.revokeObjectURL(oldURL);\n }\n img.dataset.src = '';\n }\n if (photo) {\n try {\n img.dataset.src = window.URL.createObjectURL(photo);\n } catch (err) {\n // Warn, but do nothing else. We cleared the old URL above.\n console.warn('Failed to create URL for contacts image blob: ' + photo +\n ', error: ' + err);\n }\n }\n }", "async E_Upload_Image(Img) {\n console.log(\"image for firebaseImg\", Img);\n this.setState({ EProgressBar: !this.state.EProgressBar })\n // const uploadTask = await firebase.storage().ref(`/Images/${Img.name}`).put(Img);\n this.setState({\n EuploadTask: this.state.EstorageRef.child(`Images/${Img.name}`).put(Img)\n },\n () => {\n this.state.EuploadTask.on(\n 'state_changed',\n snap => {\n const EpercentUploaded = Math.round((snap.bytesTransferred / snap.totalBytes) * 100);\n this.setState({ EpercentUploaded });\n },\n err => {\n console.error(err);\n },\n () => {\n this.state.EuploadTask.snapshot.ref.getDownloadURL().then(downloadUrl => {\n console.log('this is the image url', downloadUrl);\n let { Edit_ProductData } = this.state;\n Edit_ProductData.Image_Name1 = downloadUrl;\n this.setState({ Edit_ProductData, EProgressBar: !this.state.EProgressBar }, () => console.log(\"1\", this.state.Edit_ProductData.Image_Name1))\n\n })\n .catch(err => {\n console.error(err);\n })\n }\n )\n }\n )\n }", "handleUpload () {\n var uploadTask = storage.ref(`images/${this.state.image.name}`).put(this.state.image);\n uploadTask.on(\n \"state_changed\",\n snapshot => {\n var progress = Math.round(\n (snapshot.bytesTransferred / snapshot.totalBytes) * 100\n );\n this.setState({\n progress:progress})\n },\n error => {\n console.log(error);\n },\n () => {\n storage\n .ref(\"images\")\n .child(this.state.image.name)\n .getDownloadURL()\n .then(url => {\n this.setState({\n url : url\n })\n });\n }\n );\n }", "function insertImageInDB(productID, index, fileData, callback) {\n // console.log(\"insertImageInDB\");\n let storageRef = firebase\n .storage()\n .ref()\n .child(`${generateID(30)}.jpg`);\n storageRef.put(fileData).then((snapshot) => {\n // console.log(snapshot);\n snapshot.ref.getDownloadURL().then((url) => callback(url));\n // callback(snapshot.errorCode.);\n });\n // let storageRef = firebase.storage().ref().child(`asd.jpg`);\n // storageRef.put(fileData).then((snapshot) => {\n // // console.log(snapshot);\n // snapshot.ref.getDownloadURL().then((url) => callback(url));\n // // callback(snapshot.errorCode.);\n // });\n}", "setUri(value) {\n return super.put(\"uri\", value);\n }", "function storeImage(imageData,a,b){\n var max = 4;\n var name = a.toString().replace(/\\./g,'x')+\"and\"+ b.toString().replace(/\\./g,'y');\n console.log(\"in store image:\"+imageData)\n var storageRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage().ref(name+\"/\");\n // Create a root reference\n\n var imageName = Date.now()+\".image\";\n var uploadTask = storageRef.child(imageName).putString(imageData, 'data_url');\n uploadTask.on('state_changed', function(snapshot){\n // Observe state change events such as progress, pause, and resume\n // code snippet from firebase documentation adapted\n switch (snapshot.state) {\n case __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage.TaskState.PAUSED: // or 'paused'\n console.log('Upload is paused');\n break;\n case __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage.TaskState.RUNNING: // or 'running'\n console.log('Upload is running');\n break;\n }\n}, function(error) {\n // Handle unsuccessful uploads\n}, function() {\n console.log(\"sucess!\")\n var hash = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_2__backend_js__[\"c\" /* getHash */])(a,b);\n var firebaseRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].database().ref(\"info\"); //top level <info>\n var infoRef = firebaseRef.child(hash);\n var src = infoRef.child(\"url\");\n src.set(uploadTask.snapshot.downloadURL);\n\n});\n}", "async setImage() {\n try {\n if (this.hasProperty(this.parsedMessage, \"metadata\")) {\n const metadata = this.parsedMessage.metadata;\n const injectedObject = metadata[\"@injected\"];\n if (\n injectedObject &&\n this.hasProperty(injectedObject, \"extensions\")\n ) {\n const extensionsObject = injectedObject[\"extensions\"];\n if (\n extensionsObject &&\n this.hasProperty(extensionsObject, \"thumbnail-generation\")\n ) {\n const thumbnailGenerationObject =\n extensionsObject[\"thumbnail-generation\"];\n\n const imageToDownload = this.chooseImage(\n thumbnailGenerationObject\n );\n\n try {\n const response = await this.downloadImage(imageToDownload);\n const url = URL.createObjectURL(response);\n let img = new Image();\n img.src = url;\n img.onload = () => (this.imageUrl = img.src);\n } catch (error) {\n logger(\"error\", error);\n }\n }\n }\n } else {\n let img = new Image();\n img.src = this.parsedMessage.data.url;\n img.onload = () => (this.imageUrl = img.src);\n }\n } catch (error) {\n logger(\"error\", error);\n }\n }", "function updateImage() {\n // console.log($scope)\n return $q(function(resolve, reject) {\n // if there is no image tell the user to add one\n if (fileName === undefined) {\n return alert(\"Please upload or take an image of the tool.\")\n } else {\n let uploadTask = storageRef.child(fileName).put(imageBlob);\n\n // Register three observers:\n // 1. 'state_changed' observer, called any time the state changes\n // 2. Error observer, called on failure\n // 3. Completion observer, called on successful completion\n uploadTask.on('state_changed', function(snapshot) {\n // Observe state change events such as progress, pause, and resume\n }, function(error) {\n // Handle unsuccessful uploads\n alert(error.message)\n _callback(null)\n }, function() {\n // Handle successful uploads on complete\n // For instance, get the download URL: https://firebasestorage.googleapis.com/...\n // let toolImage = ;\n // alert(toolImage)\n resolve(uploadTask.snapshot.downloadURL)\n\n // when done pass back information on the saved image\n // _callback(uploadTask.snapshot)\n })\n }\n })\n }", "upload () {\n return this.loader.file.then(async file => {\n try {\n const format = file.name.split('.')[1]\n const filePath = `images/${new Date().getTime()}.${format}`\n const fileSnapshot = await firebase\n .storage()\n .ref(filePath)\n .put(file)\n const url = await fileSnapshot.ref.getDownloadURL()\n console.log('url: ', url)\n return { default: url }\n } catch (error) {\n console.error(error)\n }\n })\n }", "async function readURL(input){\n var file = input.files[0]\n imageRef = storageRef.child('officeView/officeView')\n await imageRef.put(file).then(function(snapshot) {\n console.log('Uploaded a blob or file!');\n });\n loadImg()\n}", "function changeAvatar(file) {\n let storageRef = firebase.storage().ref();\n\n // Create the file metadata\n let metadata = {\n contentType: 'image/jpeg'\n };\n\n // Upload file and metadata to the object 'images/mountains.jpg'\n let uploadTask = storageRef.child('users_avatars/' + file.name).put(file, metadata);\n\n // Listen for state changes, errors, and completion of the upload.\n return new Promise(function (resolve, reject) {\n uploadTask.on(firebase.storage.TaskEvent.STATE_CHANGED, // or 'state_changed'\n null,\n error => reject(error.code),\n () => {\n // Upload completed successfully, now we can get the download URL\n uploadTask.snapshot.ref.getDownloadURL().then(function (downloadURL) {\n resolve(downloadURL);\n });\n })\n })\n}", "function uploadPhoto() {\n // event listener when the html file input is changed (to upload image/photo)\n document.getElementById('photo').addEventListener('change', event => {\n console.log('log event');\n\n // Selected File Image is the event target files\n let selectedImgFile = event.target.files[0]\n console.log(selectedImgFile);\n\n // Create a unique file name to pass the reference\n let fileName = 'mePlant' + Date.now() + '.png'\n\n // Assign a metadata (which will show as image/jpeg in storage)\n let metadata = { contentType: 'image/jpeg' }\n\n // Create reference to the firebase app storage\n let storage = getStorage(firebaseApp)\n // Create reference to storage images/ folder and add the unique file name for the images ref\n let imagesRef = ref(storage, 'images/' + fileName)\n // upload to the storage images folder the selected image file and show the metadata\n let uploadTask = uploadBytesResumable(imagesRef, selectedImgFile, metadata)\n\n // Register three observers:\n // 1. 'state_changed' observer, called any time the state changes\n // 2. Error observer, called on failure\n // 3. Completion observer, called on successful completion\n uploadTask.on('state_changed',\n (snapshot) => {\n // Observe state change events such as progress, pause, and resume\n // Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded\n const progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n let uploader = document.getElementById('uploader')\n uploader.value = progress\n\n switch (snapshot.state) {\n case 'paused':\n console.log('Upload is paused');\n break;\n case 'running':\n console.log('Upload is running');\n break;\n }\n },\n (error) => {\n // Handle unsuccessful uploads\n console.log(err)\n },\n () => {\n // Handle successful uploads on complete\n // get the download URL: https://firebasestorage.googleapis.com/...\n getDownloadURL(uploadTask.snapshot.ref).then((downloadURL) => {\n console.log('File available at', downloadURL);\n imgUrl = downloadURL\n });\n }\n );\n })\n}", "async uploadImageAsync(uri, spot_id) {\n console.log(\"URI\", uri);\n const response = await fetch(uri);\n const blob = await response.blob();\n const ref = firebase\n .storage()\n .ref()\n .child(`lot_images/${current_spot.owner}/${current_spot.key}/lot.jpg`);\n await ref.put(blob).then(() => {\n console.log(\"in the async action\");\n self.props.navigation.navigate(\"MySpots\");\n });\n }", "function imagePrepare(imageURI,a,b){\n var imageName;\n // var storageRef = firebase.storage().ref(\"images\");\n getFileAsBase64(imageURI,function(base64Img){\n // storageRef.child(getHash(a,b)).putString(base64Img);\n imageName = storeImage(base64Img,a,b);\n console.log(\"WOW! \" + base64Img)\n });\n // var childRef = storageRef.child(getHash(a,b)).putString();\n\n\n function getFileAsBase64(path, callback){\n\n document.addEventListener(\"deviceready\",onDeviceReady,false);\n\n // Cordova is ready to be used!\n //\n function onDeviceReady() {\n\n window.resolveLocalFileSystemURL(path,gotFile,fail);\n\n }\n\n\n function fail(e){\n alert(\"bad path, can't find file\" + e)\n }\n\n function gotFile(fileEntry){\n fileEntry.file(function(file){\n var reader = new FileReader();\n reader.onloadend = function(e){\n var content = this.result;\n callback(content);\n };\n\n reader.readAsDataURL(file);\n });\n\n }\n\n }\n\n return imageName;\n}", "async uploadImage(context, { file, name }) {\n const storage = firebase.storage().ref();\n const doc = storage.child(`uploads/${name}`);\n\n await doc.put(file);\n const downloadURL = await doc.getDownloadURL();\n return downloadURL;\n }", "async Upload_Image(Img) {\n console.log(\"image for firebaseImg\", Img);\n this.setState({ ProgressBar: !this.state.ProgressBar })\n // const uploadTask = await firebase.storage().ref(`/Images/${Img.name}`).put(Img);\n this.setState({\n uploadTask: this.state.storageRef.child(`Images/${Img.name}`).put(Img)\n },\n () => {\n this.state.uploadTask.on(\n 'state_changed',\n snap => {\n const percentUploaded = Math.round((snap.bytesTransferred / snap.totalBytes) * 100);\n this.setState({ percentUploaded });\n },\n err => {\n console.error(err);\n },\n () => {\n this.state.uploadTask.snapshot.ref.getDownloadURL().then(downloadUrl => {\n console.log('this is the image url', downloadUrl);\n let { Add_productData } = this.state;\n Add_productData.Image_Name1 = downloadUrl;\n this.setState({ Add_productData, ProgressBar: !this.state.ProgressBar }, () => console.log(\"1\", this.state.Add_productData.Image_Name1))\n\n })\n .catch(err => {\n console.error(err);\n })\n }\n )\n }\n )\n }", "function uploadPic() {\n document.getElementById(\"submit_btn\").disabled = true;\n pic = this.files[0];\n console.log(\"success\");\n var uploadTask = storage.ref().child(\"magary/\" + new Date()+'.jpg').put(pic);\n\n uploadTask.on('state_changed', function (snapshot) {\n var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n console.log('Upload is ' + progress + '% done');\n document.getElementById(\"bar\").style.width = progress + '%';\n }, function (error) {\n console.log(error.message);\n }, function () {\n uploadTask.snapshot.ref.getDownloadURL().then(function (downloadURL) {\n console.log('File available at', downloadURL);\n document.getElementById('url').value = downloadURL;\n\n var myimg = document.getElementById(\"myimg\");\n myimg.src = downloadURL;\n\n document.getElementById(\"submit_btn\").disabled = false;\n\n\n });\n });\n\n}", "function saveToFirebase(_imageBlob, _filename) {\n // Create a root reference to the firebase storage\n var storageRef = firebase.storage().ref();\n // pass in the _filename, and save the _imageBlob\n return storageRef.child('images/' + _filename).put(_imageBlob);\n }", "function uploadImage(loc, img, callback = undefined) {\n var storageRef = firebase.storage().ref(loc).put(img, { contentType: 'image/jpeg' });\n storageRef.on(firebase.storage.TaskEvent.STATE_CHANGED, function (snapshot) {\n //var progress = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n switch (snapshot.state) {\n case firebase.storage.TaskState.PAUSED: // or 'paused'\n break;\n case firebase.storage.TaskState.RUNNING: // or 'running'\n app.showIndicator();\n break;\n }\n }, function (error) {\n app.hideIndicator();\n app.alert('There was an error attempting to upload the image.', 'Error');\n return;\n }, function () {\n // Upload completed successfully, now we can get the download URL\n app.hideIndicator();\n if (typeof callback !== 'undefined') {\n callback(storageRef.snapshot.downloadURL);\n }\n });\n}", "function setImage() {\n\n var file = document.querySelector('input[type=file]').files[0];\n var reader = new FileReader();\n\n reader.onloadend = function () {\n\t$('#thumbnail').attr('src',reader.result);\n\tsaved.setItem('image', reader.result);\n }\n\n if (file) {\n\treader.readAsDataURL(file);\n } else {\n $('#preview').attr('src','...');\n }\n}", "async function saveImage(uploadUri, filename, barcode){\n ref.add({\n Name: filename, \n URI: uploadUri,\n Latitude: latitude,\n Longitude: longitude,\n BarcodeData: barcode,\n\n })\n }", "function setImageStorage (array, service) {\n array.forEach(async (el, i) => {\n // console.log(array)\n Promises.push(new Promise(async (resolve, reject) => {\n const imageExt = el.name.slice(el.name.lastIndexOf('.'))\n const fileData = await fb.storage().ref(`services/${service}/image${i}${imageExt}`).put(el)\n const img = await fb.storage().ref().child(fileData.ref.fullPath).getDownloadURL()\n resolve({ img: img })\n }))\n })\n }", "function previewFile(){\n var storage = firebase.storage();\n\n var file = document.getElementById(\"files\").files[0];\n console.log(file);\n \n var storageRef = firebase.storage().ref();\n \n //dynamically set reference to the file name\n var thisRef = storageRef.child(file.name);\n\n //put request upload file to firebase storage\n thisRef.put(file).then(function(snapshot) {\n console.log('Uploaded a blob or file!');\n});\n \n //get request to get URL for uploaded file\n thisRef.getDownloadURL().then(function(url) {\n console.log(url);\n })\n\n }", "function previewFile(){\n var storage = firebase.storage();\n\n var file = document.getElementById(\"files\").files[0];\n console.log(file);\n \n var storageRef = firebase.storage().ref();\n \n //dynamically set reference to the file name\n var thisRef = storageRef.child(file.name);\n\n //put request upload file to firebase storage\n thisRef.put(file).then(function(snapshot) {\n console.log('Uploaded a blob or file!');\n});\n \n //get request to get URL for uploaded file\n thisRef.getDownloadURL().then(function(url) {\n console.log(url);\n })\n\n }", "function MediaUploader() {\n\t// const allInputs = { imgUrl: '' };\n\t// const allInputs = '';\n\n\tconst [ imageAsFile, setImageAsFile ] = useState('');\n\tconst [ imageAsUrl, setImageAsUrl ] = useState('');\n\n\tconsole.log(imageAsFile);\n\tconst handleImageAsFile = (e) => {\n\t\te.preventDefault();\n\t\tconst image = e.target.files[0];\n\t\tsetImageAsFile((imageFile) => image);\n\t};\n\n\tconst handleFireBaseUpload = (e) => {\n\t\te.preventDefault();\n\t\tconsole.log('start of upload');\n\n\t\t//---------error handling------\n\t\tif (imageAsFile === '') {\n\t\t\tconsole.error(`not an image, the image file is a ${typeof imageAsFile}`);\n\t\t}\n\n\t\t//------uploadTask variable-----\n\t\tconst uploadTask = storage.ref(`/images/${imageAsFile.name}`).put(imageAsFile);\n\n\t\t//----grab the image from firebase as an imageUrl---\n\t\tuploadTask.on(\n\t\t\t'state_changed',\n\t\t\t(snapShot) => {\n\t\t\t\t//takes a snap shot of the process as it is happening\n\t\t\t\tconsole.log('snapshot in the next line !');\n\t\t\t\tconsole.log(snapShot);\n\t\t\t},\n\t\t\t(err) => {\n\t\t\t\t//catches the errors\n\t\t\t\tconsole.log(err);\n\t\t\t},\n\t\t\t() => {\n\t\t\t\t// gets the functions from storage refences the image storage in firebase by the children\n\t\t\t\t// gets the download url then sets the image from firebase as the value for the imgUrl key:\n\t\t\t\tstorage.ref('images').child(imageAsFile.name).getDownloadURL().then((fireBaseUrl) => {\n\t\t\t\t\tsetImageAsUrl((fbUrl) => fireBaseUrl);\n\t\t\t\t\tconsole.log(imageAsUrl);\n\t\t\t\t});\n\t\t\t}\n\t\t);\n\t};\n\n\t// useEffect(() => {\n\n\t// });\n\n\treturn (\n\t\t<div className=\"mediaUpload\">\n\t\t\t{/* form for handling file upload */}\n\t\t\t<form>\n\t\t\t\t<input type=\"file\" onChange={handleImageAsFile} />\n\t\t\t\t{/* // allows you to reach into your file directory and\n upload image to the browser */}\n\t\t\t\t<button onClick={handleFireBaseUpload}>upload to firebase</button>\n\t\t\t\t{/* <input></input> */}\n\t\t\t</form>\n\t\t</div>\n\t);\n}", "function setURI(uri) {\n localStorage.setItem(\"uri\", uri);\n}", "uploadProfileImage(callback=()=>{}) {\n const state = Store.getState().profile;\n if (!state.selectedImage) { callback(); return; }\n const imageFile = Backend.auth.user().email+\"-\"+Date.now()+\".jpg\";\n let previousImageFile = decodeURIComponent(state.image).split(\"/\").pop().split(\"?\").shift();\n Backend.storage.deleteFile(previousImageFile, () => {\n Store.changeProperty(\"profile.image\",Backend.storage.getFileUrl(imageFile));\n Backend.storage.putFile(imageFile,state.selectedImage,() => {\n callback();\n })\n })\n }", "handleUpload (event) {\n const file = event.target.files[0];\n const storageRef = firebase.storage().ref(`photos/${file.name}`);\n const task = storageRef.put(file);\n\n task.on('state_changed', snapshot => {\n let percentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\n this.setState({\n uploadValue: percentage\n })\n }, error => {\n console.error(error.message);\n }, () => {\n // Upload complete\n const record = {\n photoURL: this.state.user.photoURL,\n displayName: this.state.user.displayName,\n image: task.snapshot.downloadURL\n }\n const dbRef = firebase.database().ref('pictures');\n const newPicture = dbRef.push();\n newPicture.set(record);\n });\n }", "function setImage()\n {\n var img = getId(\"captured_image\");\n \n var path = \"file:\" + Native.getImagePath();\n \n img.setAttribute(\"src\", path);\n }", "onSubmit() {\r\n console.log('picture: ' + this.state.Picture)\r\n let imageRef = storageRef.child('images/' + this.state.Picture)\r\n var metadata = {\r\n contentType : 'image/jpeg'\r\n }\r\n imageRef.put(this.state.imageFile[0], metadata).then((snapshot) => {\r\n fetch('/addProduct', {\r\n method : 'post',\r\n headers : {\r\n Accept : 'application/json',\r\n 'Content-type' : 'application/json'\r\n },\r\n body : JSON.stringify({\r\n Name : this.state.Name,\r\n Price : this.state.Price,\r\n Stock : this.state.Stock,\r\n Picture : this.state.Picture,\r\n Description : this.state.Description,\r\n Discount : this.state.Discount,\r\n Category : this.state.Category\r\n })\r\n }).then((res) => {\r\n if (res.status === 200) {\r\n alert('Tuote Lisätty')\r\n }\r\n })\r\n })\r\n }", "function setCategoryImage(category) {\n pexelsClient.search(category, 1, 1)\n .then(function (result) {\n let imgUrl = result.photos[0].src.small;\n firebase.database().ref('categories/' + category + '/img').set({\n img: imgUrl\n });\n }).\n catch(function (e) {\n console.err(e);\n });\n}", "function uploadImage(event){\n console.log(event.target.files)\n const file = event.target.files[0];\n this.uploadImageForm.reset();\n\n // Check if the file is an image.\n if (!file.type.match(\"image.*\")) {\n var error = {\n message: \"You can only share images\",\n timeout: 2000,\n };\n alert(data.message);\n return;\n }\n if( checkSignedIn.bind(this)() ){\n let metadata ={\n contentType : file.type\n }\n let currentUser = this.auth.currentUser;\n let message = {\n userName: currentUser.displayName || currentUser.email,\n userId: currentUser.uid,\n imageUrl: LOADING_IMAGE,\n photoUrl: currentUser.photoURL || \"/img/profile_placeholder.png\",\n };\n this.messagesRef.push(message)\n .then(( messageSnapshot )=>{\n this.storageRef.child(`${currentUser.uid}/${Date.now()}/${file.name}`)\n .put(file,metadata)\n .then( ( imgSnapshot ) =>{\n \n let filePath = imgSnapshot.metadata.fullPath;\n messageSnapshot.update({\n imageUrl:this.storage.ref(filePath).toString()\n }) \n })\n .catch(function(error) {\n console.error('There was an error uploading a file to Firebase Storage:', error);\n });\n })\n }\n}", "async function uploadImageAsync(uri) {\n\tconst blob = await new Promise((resolve, reject) => {\n\t\tconst xhr = new XMLHttpRequest();\n\t\txhr.onload = function() {\n\t\t\tresolve(xhr.response);\n\t\t};\n\t\txhr.onerror = function(e) {\n\t\t\tconsole.log(e);\n\t\t\treject(new TypeError('Network request failed'));\n\t\t};\n\t\txhr.responseType = 'blob';\n\t\txhr.open('GET', uri, true);\n\t\txhr.send(null);\n\t});\n\n\tconst ref = \"\"\n\t\t.storage()\n\t\t.ref()\n\t\t.child(uuid.v4());\n\tconst snapshot = await ref.put(blob);\n\n\tblob.close();\n\n\treturn await snapshot.ref.getDownloadURL();\n}", "imageWatcher(newValue) {\n if (newValue) {\n if (newValue.originalname) {\n this.imagePath = newValue.path;\n } else {\n this.imagePath = window.URL.createObjectURL(newValue);\n }\n }\n }", "setImgUrl(url) {\n this.setState({ imageurl: url });\n}", "setImageUrl(imageUrl) {\n if(imageUrl === this.imageUrl) { return; /* nop */ }\n\n this.imageUrl = imageUrl;\n this.imageElement.src = imageUrl;\n }", "async function DB_changeAvatar(file, userId) {\n const storageRef = storage.ref();\n const fileRef = storageRef.child(file.name);\n await fileRef.put(file);\n const fileURL = await fileRef.getDownloadURL();\n return db.collection(\"users\").doc(userId).set({\n id: userId,\n avatar: fileURL,\n });\n }", "function setSrc(url){\r\n\r\n if (typeof(Storage) !== \"undefined\") {\r\n window.localStorage.setItem(\"img_url\",url[0]);\r\n window.localStorage.setItem(\"img_url_living\",url[1]);\r\n window.localStorage.setItem(\"img_url_dining\",url[2]);\r\n window.localStorage.setItem(\"img_url_living_2\",url[3]);\r\n }\r\n\r\n}", "onImageLoaded(image) {\n\n this.imageRef = image;\n\n }", "function storeDataInFirebase() {\r\n var FirstName = $(\"#fname\").val();\r\n var Email = $(\"#email\").val();\r\n var Phone = $(\"#phone\").val();\r\n var Registration_Number = $(\"#reg\").val();\r\n var Age_Above_Sixteen = !document.getElementById(\"age1\").checked;\r\n\r\n\t\r\n\tvar image = document.getElementById(\"fileUpload\").files[0];\r\n\tconsole.log(image);\r\n\tvar imageName = image.name;\r\n\tvar storageRef = storage.ref(\"/images/\" + imageName);\r\n\tvar uploadTask = storageRef.put(pic);\r\n\r\n db.collection(\"users\")\r\n .doc()\r\n .set({\r\n FirstName: FirstName,\r\n Email: Email,\r\n Phone: Phone,\r\n Registration_Number: Registration_Number,\r\n Age_Above_Sixteen: Age_Above_Sixteen,\r\n })\r\n\r\n .then(() => {\r\n\t\tImageSelection();\r\n\t\tuploadTask.snapshot.ref.getDownloadURL().then(\r\n\t\t\tfunction(downloadURL) {\r\n\t\t console.log(downloadURL);\r\n\t\t}).catch(err => console.log(err));\r\n\r\n console.log(\"document written successfully\");\r\n\t\tdocument.cookie = \"name=\" + FirstName;\r\n\t\tdocument.cookie = \"email=\" + Email;\r\n\t var date = new Date();\r\n\t\tdate.setTime(date.getTime() + (30 * 24 * 60 * 60 * 1000));\r\n\t\tdocument.cookie = \"expires=\" + date + \";\"\r\n $(\".loader\").hide();\r\n window.location.href = \"thankyouPage.html\";\r\n $(\"#memoForm\").trigger(\"reset\");\r\n })\r\n .catch((error) => {\r\n console.error(\"Error writing document: \", error);\r\n });\r\n }", "function addImageURI(name, imageURI) {\n\n var arrayList = getListFromStorage();\n arrayList\n\n var getProduct = arrayList.map(function (item) {\n return item.name;\n }).indexOf(name);\n if (getProduct > -1) {\n arrayList[getProduct].imageUrl += imageURI;\n }\n var JSONArray = JSON.stringify(arrayList);\n window.localStorage.setItem(nickname, JSONArray);\n writeListToPage();\n\n\n}", "setImageDisplayUrl(url) {\n dispatch({type : constants.SET_IMAGE_DISPLAY_URL, value : url})\n }", "function onPhotoDataSuccess(imageData) {\n pictureURI = imageData;\n console.log(pictureURI);\n}", "function setCategoryImageById(category) {\n pexelsClient.getPhoto(708488)\n .then(function (result) {\n let imgUrl = result.src.small;\n firebase.database().ref('categories/' + category + '/img').set({\n img: imgUrl\n });\n }).\n catch(function (e) {\n console.err(e);\n });\n}", "function setImage(stream, fMakeBlobFirst, contentType) {\n logMessage(\"Setting image src\");\n\n var img = \"imageBox\" + imgCount;\n logMessage(img);\n\n var imgTag = document.getElementById(img);\n\n if (fMakeBlobFirst) {\n logMessage(\"Creating blob\");\n var blob = MSApp.createBlobFromRandomAccessStream(contentType, stream);\n imgTag.src = URL.createObjectURL(blob, { oneTimeOnly: true });\n } else {\n imgTag.src = URL.createObjectURL(stream, { oneTimeOnly: true });\n }\n imgTag.onerror = function (evt) {\n logMessage(\"Image on error fired\");\n };\n imgCount++;\n}", "uploadPic(e){e.preventDefault();this.disableUploadUi(true);var imageCaption=this.imageCaptionInput.val();this.generateImages().then(pics=>{// Upload the File upload to Firebase Storage and create new post.\nfriendlyPix.firebase.uploadNewPic(pics.full,pics.thumb,this.currentFile.name,imageCaption).then(postId=>{page(`/user/${this.auth.currentUser.uid}`);var data={message:'New pic has been posted!',actionHandler:()=>page(`/post/${postId}`),actionText:'View',timeout:10000};this.toast[0].MaterialSnackbar.showSnackbar(data);this.disableUploadUi(false)},error=>{console.error(error);var data={message:`There was an error while posting your pic. Sorry!`,timeout:5000};this.toast[0].MaterialSnackbar.showSnackbar(data);this.disableUploadUi(false)})})}", "changePhoto() {\n var options = {\n title: 'Select Avatar',\n storageOptions: {\n skipBackup: true,\n path: 'images'\n }\n };\n ImagePicker.showImagePicker(options, (response) => {\n if (response.didCancel) {}\n else if (response.error){}\n else if (response.customButton){}\n else {\n let source = { uri: response.uri };\n this.setState({\n avatarSource: source\n });\n }\n });\n }", "function changeProfilePic(file) {\r\n if (file.target.files[0].type == 'image/jpeg' || file.target.files[0].type == 'image/png') {\r\n const currentUserEmail = authentication.currentUser.email;\r\n const targetFile = file.target.files[0];\r\n const storageRef = storage.ref(USER_PROFILE_PICTURE_FOLDER + currentUserEmail + '.jpeg');\r\n const task = storageRef.put(targetFile);\r\n\r\n const profilePicUploadProgressContainer = document.getElementById('profile-pic-upload-progress-container');\r\n const profilePicUploadProgressBar = document.getElementById('profile-pic-upload-progress-bar');\r\n profilePicUploadProgressContainer.setAttribute('style', 'display: block');\r\n\r\n task.on('state_changed', function progress(snapshot) {\r\n const uploadPercentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\r\n profilePicUploadProgressBar.style.width = uploadPercentage + '%';\r\n }, function error(error) {\r\n displayErrorAlert(error.message);\r\n }, function complete() {\r\n savePicUrl();\r\n });\r\n } else {\r\n displayErrorAlert('Select Image File First');\r\n }\r\n}", "function retrieveImage(imageName,a,b){\n var imageName = imageName || ''\n\n // var storage = firebase.storage()\n // var imageBase64;\n console.log(b);\n var name = a.toString().replace(/\\./g,'x')+\"and\"+ b.toString().replace(/\\./g,'y');\n\n\n\n if(imageName == ''){\n imageName = getFileNames(a,b);\n var location = name+\"/\"+imageName[0];\n console.log(location);\n var downloadRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage().ref().child(location);\n\n var path = downloadRef.getPath();\n downloadRef.getDownloadURL().then(function(url){\n\n // console.log(url.toString());\n document.querySelector(\"div.photo img\").src = url;\n // return url;\n // callback(url);\n // var img = document.querySelector('img');\n // img.src = url;\n // x = url;\n });\n }\n\n var location = name+\"/\"+imageName;\n console.log(location);\n var downloadRef = __WEBPACK_IMPORTED_MODULE_2__backend_js__[\"e\" /* firebase */].storage().ref().child(location);\n downloadRef.getDownloadURL().then(function(url){\n\n // console.log(url.toString());\n var Image =document.querySelector(\"div.photo img\")\n Image.src = url;\n Image.style.display = 'inline';\n // return url;\n // callback(url);\n // var img = document.querySelector('img');\n // img.src = url;\n // x = url;\n });\n\n // firebase.auth().signInAnonymously().then(function(){\n\n // }).catch(function(err){\n // console.error(err);\n // });\n\n // downloadRef.getDownloadURL().then(function(url){\n // // Get the download URL\n // // This can be downloaded directly:\n // var xhr = new XMLHttpRequest();\n // xhr.responseType = 'blob';\n // xhr.onload = function(event) {\n // var data = xhr.responseText;\n // var jsonResponse = JSON.parse(data);\n // console.log(jsonResponse[\"Data\"]);\n\n // };\n // xhr.open('GET', url);\n // xhr.send();\n // }).catch(function(error) {\n\n // // A full list of error codes is available at\n // // https://firebase.google.com/docs/storage/web/handle-errors\n // console.log(error);\n // switch (error.code) {\n // case 'storage/object_not_found':\n // console.log(\"file does not exist\"+error);\n // // File doesn't exist\n // break;\n\n // case 'storage/unauthorized':\n // console.log(\"no permission for this file\");\n // // User doesn't have permission to access the object\n // break;\n\n // case 'storage/canceled':\n // console.log(\"cancled\");\n // // User canceled the upload\n // break;\n\n // case 'storage/unknown':\n // console.log(\"unknown error\");\n // // Unknown error occurred, inspect the server response\n // break;\n // }\n // });\n // console.log(x);\n // return x;\n}", "addSpot(spot) {\n self = this;\n async function uploadImageAsync(uri, spot_id) {\n const response = await fetch(uri);\n const blob = await response.blob();\n const ref = firebase\n .storage()\n .ref()\n .child(`lot_images/${spot.owner}/${spot_id}/lot.jpg`);\n const snapshot = await ref.put(blob).then(() => {\n \n self.props.navigation.navigate(\"MySpots\");\n });\n }\n if (this._isMounted) {\n firebase\n .database()\n .ref(\"spots\")\n .push(spot)\n .then(data => {\n //success callback\n spot_id = data.path.pieces_[1];\n uploadImageAsync(this.state.image, spot_id);\n alert(\"Post Successful!\");\n })\n .catch(error => {\n //error callback\n console.log(\"error \", error);\n });\n }\n }", "function setImgFilepath(){\n Item.imgEl1.src = Item.objStore[Item.prevNum[0]].filepath;\n Item.imgEl1.alt = Item.objStore[Item.prevNum[0]].name;\n Item.imgEl2.src = Item.objStore[Item.prevNum[1]].filepath;\n Item.imgEl2.alt = Item.objStore[Item.prevNum[1]].name;\n Item.imgEl3.src = Item.objStore[Item.prevNum[2]].filepath;\n Item.imgEl3.alt = Item.objStore[Item.prevNum[2]].name;\n}", "function onSuccess(imageURI, name) {\n addImageURI(name,imageURI);\n}", "ImageOnPress(uri) {\n this.props.navigation.navigate(\"Image\", {\n path: uri\n });\n }", "didSnap(dataUri) {\n Ember.debug('didSnap', arguments);\n this.set('isFrozen', false);\n this.set('dataUri', dataUri);\n\n const now = new Date();\n const timestamp = +now;\n const captureImage = Ember.Object.create({\n 'name': `${timestamp}.jpg`,\n 'content_type': 'image/jpg',\n 'data': dataUri\n // 'data': btoa(dataUri) // base64-encoded `String`, or a DOM `Blob`, or a `File`\n });\n\n this.get('model.newCapture.images').addObject(captureImage)\n }", "SetUserData(user) {\n const countRef = this.afs.doc(`users/userCount`);\n const userRef = this.afs.doc(`users/${user.uid}`);\n const countData = {\n numberUsers: firebase__WEBPACK_IMPORTED_MODULE_2__[\"firestore\"].FieldValue.increment(1)\n };\n countRef.set(countData, {\n merge: true\n }).then(r => { });\n this.storage.ref('Users/Default_ProfilePicture/default_pic.png').getDownloadURL().toPromise().then(url => {\n this.defaultPhotoURL = url;\n const userData = {\n countId: ++this.userCount,\n uid: user.uid,\n email: user.email,\n description: this.description ? this.description : '',\n displayName: user.displayName ? user.displayName : this.firstname + ' ' + this.lastname,\n photoURL: this.providerId ? user.photoURL : this.defaultPhotoURL,\n emailVerified: user.emailVerified,\n job: this.job ? this.job : 'Project starter',\n firstname: this.firstname ? this.firstname : 'First Name',\n lastname: this.lastname ? this.lastname : 'Last Name'\n };\n if (typeof this.profilePicture !== 'undefined') {\n const uploadTask = firebase__WEBPACK_IMPORTED_MODULE_2__[\"storage\"]().ref(`Users/${user.uid}/profilePic/profilePic`).put(this.profilePicture);\n uploadTask.on('state_changed', (snapshot) => {\n }, (error) => {\n console.log(error);\n }, () => {\n uploadTask.snapshot.ref.getDownloadURL().then((url) => {\n firebase__WEBPACK_IMPORTED_MODULE_2__[\"auth\"]().currentUser.updateProfile({\n photoURL: url\n }).then(() => {\n this.afs.collection('users').doc(user.uid).update({\n photoURL: url,\n });\n });\n });\n });\n }\n userRef.set(userData, {\n merge: true\n }).then(r => { console.log(r); });\n });\n }", "async setImage(id) {\n const reminder = await Storage.getReminder(id);\n if(reminder && reminder.img){\n Score.updatePenalties(id, 'imgHint'); \n return reminder.img; \n }else{\n return false; \n } \n }", "function sendImage() {\n console.log(\"attempting upload\");\n console.log($('#imgInp'));\n\n if ($('#imgInp')[0].files[0]) {\n var file = $('#imgInp')[0].files[0];\n targetFileRef.put(file).then(function (snapshot) {\n console.log('Uploaded.');\n });\n } else {\n console.log(\"No new image to upload.\");\n }\n\n}", "componentDidMount() {\n if (!this.props.isCreate) {\n // retireves image from storage\n this.props.firebase.findImage(this.props.dbLocation, this.props.name)\n .then(url => {\n this.setState({ imageURL: url });\n })\n // catches error for when the file does not exist\n .catch(error => {\n console.log(error);\n })\n\n }\n\n }", "async getLocalUriForImage() {\n const { image } = this.props.route.params;\n\n // Make sure the directory exists, and create the uri for the image in that directory\n await this.ensureDirExists();\n const localFileUri = this._imageDirectory + `${uuidv4()}.jpeg`;\n console.log(localFileUri);\n\n // Get data pertaining to the image if it already exists in the directory\n const fileInfo = await FileSystem.getInfoAsync(localFileUri);\n if (!fileInfo.exists) {\n await FileSystem.downloadAsync(image.downloadURL, localFileUri);\n }\n return localFileUri;\n }", "function setImageUrl(imageUrl)\n{\n // handle the returned image URL\n var imgUrl = document.getElementById(imageTagId);\n imgUrl.value = imageUrl;\n}", "async takePicture() {\n var photoLoc = `${FileSystem.documentDirectory}photos/Photo_${\n this.state.photoId\n }_Base64`;\n if (this.camera) {\n let photo = await this.camera.takePictureAsync({ base64: true });\n FileSystem.moveAsync({\n from: photo.uri,\n to: photoLoc\n }).then(() => {\n this.setState({\n photoId: this.state.photoId + 1\n });\n this.sendToImgur(photoLoc);\n });\n }\n }", "function saveImageMessage(file) {\n // 1 - We add a message with a loading icon that will get updated with the shared image.\n firebase.firestore().collection('messages').add({\n name: getUserName(),\n imageUrl: LOADING_IMAGE_URL,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).then(function (messageRef) {\n // 2 - Upload the image to Cloud Storage.\n var filePath = firebase.auth().currentUser.uid + '/' + messageRef.id + '/' + file.name;\n return firebase.storage().ref(filePath).put(file).then(function (fileSnapshot) {\n // 3 - Generate a public URL for the file.\n return fileSnapshot.ref.getDownloadURL().then((url) => {\n // 4 - Update the chat message placeholder with the image's URL.\n return messageRef.update({\n imageUrl: url,\n storageUri: fileSnapshot.metadata.fullPath\n });\n });\n });\n }).catch(function (error) {\n console.error('There was an error uploading a file to Cloud Storage:', error);\n });\n}", "processImageURL(e, item, value = undefined) {\n let self = this;\n let input = null;\n\n if (e) {\n input = e.target;\n value = input.value;\n }\n\n if (value === item.fakeUrl && !item.isPreset) return;\n\n if (input && input.files) {\n\n let reader = new FileReader();\n reader.onload = function(e) {\n loadImage(e.target.result, function() {\n self.setImageProps(item, this);\n item.fakeUrl = value.replace(/^.*fakepath[\\/\\\\]?/, '');\n item.img.url = e.target.result;\n });\n };\n reader.readAsDataURL(input.files[0]);\n\n } else {\n\n loadImage(value, function() {\n self.setImageProps(item, this);\n item.fakeUrl = value;\n item.img.url = this.src;\n });\n }\n }", "getImage(self, index, listEvents, listURLS, endLength) {\n firebase.storage.ref('Images').child(listEvents[index].imgid + '.jpg').getDownloadURL().then((url) => { \n listURLS[index] = url;\n if (endLength == listURLS.length) {\n self.group.notify(function() {\n self.setState({ events: listEvents, originalEvents: listEvents, urls: listURLS, originalURLS: listURLS, hidden: \"hidden\" });\n self.filterEvents(self.state.searchText, listEvents, listURLS);\n });\n }\n }).catch((error) => {\n // Handle any errors\n });\n }", "async uploadFile(file, createdId){ \n \n let fileName = file.name\n let ext = fileName.slice( fileName.lastIndexOf('.') ) \n \n // -- Add Original file in firebase storage -- //\n let storageRef = firebase.storage().ref()\n let imagesRef = storageRef.child('gallery/'+createdId+ext) \n\n let uploadState = await imagesRef.put(file).then( function(snapshot) { \n console.log('Uploaded !'); \n return true \n }).catch( (error) => {\n console.log(error)\n return false\n });\n \n return uploadState;\n\n // -- //\n \n }", "uploadPDF(e) {\n if (e.target.files[0] !== null) {\n const uploadTask = storage\n .ref(`users/${e.target.files[0].name}`)\n .put(e.target.files[0]);\n uploadTask.on(\n \"state_changed\",\n snapshot => {},\n error => {\n //error function\n console.log(error);\n },\n () => {\n //complete function\n storage\n .ref(\"users\")\n .child(e.target.files[0].name)\n .getDownloadURL()\n .then(url => {\n this.setState({ notice_attachments: url });\n console.log(\"Hello \" + url);\n });\n }\n );\n } else {\n }\n }", "onImageChange (e) {\n this.setState({ file: e.target.files[0] })\n // let url = URL.createObjectURL(e.target.files[0])\n // this.setState({ BlogImage: url })\n }", "function handleFile(files_arr, node) {\n var file = files_arr[0];\n var imagified = node.id.split('F')[0] + 'Image';\n if (!files_arr[0].type.match('image/.*')) {\n alert('You can only add images at the moment.');\n return;\n }\n var filePath = auth.currentUser.uid + '/' + imagified + '/' + file.name;\n return storage\n .ref(filePath)\n .put(file)\n .then(function(snapshot, node) {\n var fullPath = snapshot.metadata.fullPath; //TIP: snapshot.metadata.downloadURLs[0] <-- Gets the viewable image link\n document.getElementById(fullPath.split('/')[1]).innerHTML = fullPath;\n });\n}", "deleteImage() {\n const { image } = this.props.route.params;\n var imgRef = firebase.storage().refFromURL(image.downloadURL);\n imgRef.delete().then(() => {\n this.deleteRefFromFirestore();\n this.props.navigation.goBack(\"My Images\");\n }).catch(() => {\n Alert.alert(\"Could Not Delete\", \"There was an error deleting this image. Please Try again.\");\n });\n }", "function _defaultImage() {\n if (vm.user) {\n vm.user.imageUrl = defaultImageUrl\n vm.imagePreview = defaultImageUrl\n vm.useFile = false\n }\n }", "async savePicture(uri) {\n const img = await ImageManipulator.manipulate(uri, [], { compress: 0.2 });\n const assetImg = await MediaLibrary.createAssetAsync(img.uri);\n return assetImg.uri;\n }", "function saveImageMessage(file) {\n // 1 - We add a message with a loading icon that will get updated with the shared image.\n firebase.firestore().collection('sports').add({\n name: getUserName(),\n imageUrl: LOADING_IMAGE_URL,\n profilePicUrl: getProfilePicUrl(),\n timestamp: firebase.firestore.FieldValue.serverTimestamp()\n }).then(function(messageRef) {\n // 2 - Upload the image to Cloud Storage.\n var filePath = firebase.auth().currentUser.uid + '/' + messageRef.id + '/' + file.name;\n return firebase.storage().ref(filePath).put(file).then(function(fileSnapshot) {\n // 3 - Generate a public URL for the file.\n return fileSnapshot.ref.getDownloadURL().then((url) => {\n // 4 - Update the chat message placeholder with the image's URL.\n return messageRef.update({\n imageUrl: url,\n storageUri: fileSnapshot.metadata.fullPath\n });\n });\n });\n }).catch(function(error) {\n console.error('There was an error uploading a file to Cloud Storage:', error);\n });\n}", "function saveUserPhoto(base64) {\n var urlvariable = \"/rest/update/picture\";\n var URL = \"https://voluntier-317915.appspot.com\" + urlvariable; //LookUp REST URL\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"POST\", URL, false);\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n var userId = localStorage.getItem(\"email\"), token = localStorage.getItem(\"jwt\");\n var ItemJSON = '{\"email\": \"' + userId +\n '\", \"token\": \"' + token +\n '\", \"data\": \"' + 'data:image/'+imgext+';base64,' + base64 + '\"}';\n xmlhttp.send(ItemJSON);\n if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n document.getElementById(\"user64img\").src = ('data:image/' + imgext + ';base64,' + base64);\n const obj = JSON.parse(xmlhttp.responseText);\n let cloudURL = obj.url;\n sendFile(cloudURL, fileData);\n return false;\n }\n console.log(\"update request: \" + xmlhttp.status);\n}", "function getImageUrl(context) {\n let imageName =\n context.animalHead +\n '_' +\n context.animalBody +\n '_' +\n context.animalLegs +\n '_render.gif';\n let imageUrl = `https://storage.googleapis.com/${\n firebaseConfig.storageBucket\n }/gifs/${imageName}`;\n return imageUrl;\n}", "handleImageUrlChange(event) {\n const { value } = event.target;\n this.setState({ imageUrl: value });\n }", "function loadImage(fileName){\n\talert(\"This is the page to load a saved Project but I only save an image to the users progfile right now. :(\");\n\tvar user = firebase.auth().currentUser;\nvar name, email, photoUrl, uid, emailVerified;\n name = user.displayName;\n email = user.email;\n photoUrl = user.photoURL;\n alert(email+\" \"+name+\" \"+photoUrl);\n user.updateProfile({\n photoURL: \"'../images/test.GIF'\"\n})\n photoUrl = user.photoURL;\n alert(photoUrl);\n}", "function onImageLoaded (image) {\n setImageRef(image)\n }" ]
[ "0.6930999", "0.66453564", "0.65653354", "0.65113467", "0.6494439", "0.64326835", "0.6365292", "0.63399875", "0.63270897", "0.6274557", "0.620569", "0.61372507", "0.6120579", "0.6118924", "0.61176103", "0.6092282", "0.60861295", "0.6057386", "0.603521", "0.60290104", "0.6006272", "0.59893596", "0.598617", "0.5980923", "0.5978514", "0.597814", "0.5971125", "0.59696966", "0.596461", "0.5960834", "0.593764", "0.59089464", "0.58977544", "0.58788276", "0.5857952", "0.5857621", "0.5846056", "0.5838406", "0.5821706", "0.58135533", "0.5796634", "0.578393", "0.5759203", "0.5741067", "0.5724946", "0.5712658", "0.5712658", "0.5709251", "0.56933385", "0.56878424", "0.567939", "0.5644309", "0.55812234", "0.55770344", "0.55746585", "0.5561838", "0.5546553", "0.553928", "0.5510996", "0.5500556", "0.5490115", "0.5465757", "0.546345", "0.54593855", "0.5450661", "0.5444755", "0.5444512", "0.54310566", "0.54309833", "0.54158396", "0.54153395", "0.5411927", "0.5407937", "0.5389724", "0.5388091", "0.5383494", "0.5375428", "0.53573126", "0.53417945", "0.53277993", "0.532725", "0.53116316", "0.530012", "0.5297155", "0.5294931", "0.5279792", "0.52795815", "0.5274849", "0.52603054", "0.5252032", "0.5246697", "0.5232414", "0.52279264", "0.52272946", "0.52269626", "0.5219511", "0.52002084", "0.5193191", "0.5187616", "0.51861906" ]
0.5769155
42
private functions called when closing the function edit popup
function AddFunctionOnClose(radWin) { var refresh = false; if (radWin != null && typeof (radWin.IsDirty) == 'boolean') { refresh = radWin.IsDirty; } else { // if for some reason we dont get a rad window then assume we should refresh refresh = true; } if (refresh && refreshButtonId != null) $(refreshButtonId).click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "function editCancelFunc(){\n setEdit(null);\n }", "function pageEditClose() {\n return PageService.pageEditClose();\n }", "function closePriviousEdit() {\n if (openedEditForm) {\n openedEditForm.value ? openedEditForm.value.html(openedEditForm.html) : '';\n openedEditForm = null;\n }\n }", "function handleClose() {\n setOpen(false)\n setEditItem(null)\n }", "function closeEditDialog() {\n // Hide the dialog \n overlay.classList.add('visibility');\n // Re-enable the scrollbar\n document.body.classList.remove('model-open');\n // Deleting the inputs in the fields\n editDialogUid.value = \"\";\n editDialogUsername.value = \"\";\n editDialogEmail.value = \"\";\n editDialogMobile.value = \"\";\n editDialogAddress.value = \"\";\n editDialogPassword.value = \"\";\n editDialogConfirmPassword.value = \"\";\n}", "function editThis() {\n // If the EditorViewModel's activeWorkflow is null, make the popup not visible\n if (!editor.viewModel.activeWorkFlow) {\n view.popup.visible = false;\n // Call the Editor update feature edit workflow\n\n editor.startUpdateWorkflowAtFeatureEdit(\n view.popup.selectedFeature\n );\n view.ui.add(editor, \"bottom-right\");\n view.popup.spinnerEnabled = false;\n }\n\n // We need to set a timeout to ensure the editor widget is fully rendered. We\n // then grab it from the DOM stack\n setTimeout(function() {\n // Use the editor's back button as a way to cancel out of editing\n let arrComp = editor.domNode.getElementsByClassName(\n \"esri-editor__back-button esri-interactive\"\n );\n if (arrComp.length === 1) {\n // Add a tooltip for the back button\n arrComp[0].setAttribute(\n \"title\",\n \"Cancel edits, return to popup\"\n );\n // Add a listerner to listen for when the editor's back button is clicked\n arrComp[0].addEventListener(\"click\", function(evt) {\n // Prevent the default behavior for the back button and instead remove the editor and reopen the popup\n evt.preventDefault();\n view.ui.remove(editor);\n view.popup.open({\n features: features\n });\n });\n }\n }, 150);\n }", "function on_finish_edit()\n {\n if (edit_window.closed)\n {\n //\n //Stop polling by the timer\n clearInterval(timer);\n //\n //Reset the last tr visited using the unique id set in the editor \n //window\n window.localStorage.last_tr_id = edit_window.unique_id;\n //\n //Do a refresh of parent sqlEdit edit window\n window.location.reload(true);\n }\n }", "function closeEditor(event) {\n event.preventDefault();\n var edit_window = document.getElementById('table_editor');\n edit_window.classList.remove('active');\n //edit_window.style.display = 'none';\n document.getElementsByClassName('sales-data')[0].style.opacity = 1;\n}", "function editzselex_cancel()\n{\n Element.update('zselex_modify', '&nbsp;');\n Element.show('zselex_articlecontent');\n editing = false;\n return;\n}", "function EditModeFunctions() {\r\n embedEditButtonClick();\r\n AddEditModeStyleSheet();\r\n}", "function popupClose(e) {\n\n // Grab form field data\n e.target.properties.title = L.DomUtil.get(`popup_title_${e.target.properties.id}`).value;\n\n // Save the editor contents into the\n // the geoJSONMarker's properties\n e.target.properties.content = quill.getContents();\n quill = null;\n\n // Save marker data\n saveMarkers();\n\n}", "function edit() {\n $('#productInfo').trigger('close');\n show(\"editProduct\");\n}", "onCloseEditDialog() {\n this.setState({ isEditDialogOpen: false });\n }", "_closeEdit() {\n\t\tthis.setState({ layerOn: false });\n\t}", "function closeEditBox()\n{\n //disable edit box display\n document.getElementById(\"edit-box-bg\").style.display = \"none\";\n}", "function closeEditModal() {\n editTodoModal.style.display = \"none\";\n console.log(\"fired\");\n }", "static popup_close() {\n const context = Utils.popup_context.pop();\n if (typeof AGGrid !== 'undefined')\n AGGrid.popGridContext();\n Utils.popEnterContext();\n $('#' + context.id).hide();\n Utils.globalEnterHandler(context.globalEnterHandler);\n Utils.popup_zindex -= 2;\n if (Utils.popup_zindex < 10)\n Utils.popup_zindex = 10;\n }", "function ToggleEdit(){\n\t\n}", "function Swall_Edit(){\n\n\n}", "close() {\n\t\tthis.model.save({ content: this.input.val() });\n\t\tthis.$el.removeClass('editing');\n\t}", "onEditComplete() {\n super.onEditComplete();\n this.autoClosePicker();\n }", "function closeModalEdit(){\n modalEdit.style.display = \"none\"\n modalFormEdit.reset()\n }", "onTabChange_() {\n this.updateTree_();\n this.onEditComplete_();\n Controller.closeExprWindow_();\n }", "function editClicked() {\n edit = true;\n}", "edit() {\n }", "function outsideClickEdit(e) {\n if(e.target == modalEdit) closeModalEdit()\n }", "function closeContentEditor(){\n $.PercBlockUI();\n cancelCallback(assetid);\n dialog.remove();\n $.unblockUI();\n $.PercDirtyController.setDirty(false);\n }", "function openModalEditor(par) {\n var nameView = par.mainFiltersEdit.dataEdit;\n var modal = document.getElementById(\"modal\" + nameView);\n modal.style.display = \"block\";\n var span = document.getElementsByClassName(\"modalEdit-close\")[0];\n span.onclick = function () {\n modal.style.display = \"none\";\n span.parentNode.parentNode.remove();\n }\n window.onclick = function (event) {\n getObjectEdit\n if (event.target == modal) {\n modal.style.display = \"none\";\n }\n }\n}", "function endEdit(){\n // Reset task form and update UI\n displayTaskForm();\n updateUI()\n}", "function editCloseout(source_id) {\n if (source_id) prepareCloseout(source_id);\n document.getElementById('projectManager').style.display = 'none';\n EDIT_INTENTION = true;\n getProjectEnums_CLOSEOUT(true);\n currentDivLocation = 'closeoutData';\n document.getElementById('closeoutData').style.display = 'inline';\n}", "function editingCanceled() {\n\tlocation.reload();\n}", "function closeCodeDescriptionPopUp(){\r\n $('#code_desc_popup').css('display','none'); \r\n}", "modalCancel(){\n\t\t// save nothing\n this.setValues = null;\n\t\t// and exit \n this.modalEXit();\n }", "handleCloseEditEndPt(){\n this.setState({openBackendList: false});\n }", "edit() {\n this.saveInterfaceParams();\n var event = new CustomEvent(\"codeeditevent\");\n document.dispatchEvent(event);\n this.deleteFaustInterface();\n this.moduleView.textArea.style.display = \"block\";\n this.moduleView.textArea.value = this.moduleFaust.fSource;\n Connector.redrawInputConnections(this, this.drag);\n Connector.redrawOutputConnections(this, this.drag);\n this.moduleView.fEditImg.style.backgroundImage = \"url(\" + Utilitary.baseImg + \"enter.png)\";\n this.moduleView.fEditImg.addEventListener(\"click\", this.eventCloseEditHandler);\n this.moduleView.fEditImg.addEventListener(\"touchend\", this.eventCloseEditHandler);\n this.moduleView.fEditImg.removeEventListener(\"click\", this.eventOpenEditHandler);\n this.moduleView.fEditImg.removeEventListener(\"touchend\", this.eventOpenEditHandler);\n }", "function editEvent(){\n\t\n}", "onAddUpdateDataModalClose() {\n this.setState({ addNewDataModal: false, editData: null });\n }", "closePopup() {\n this.setState({\n edit: true,\n delete: false,\n userDelete: \"\"\n })\n }", "closeOverlay() {\n this.setState({\n showAddEditOverlay: false,\n showDeleteOverlay: false,\n editData: {},\n modeEdit: false,\n projectId: null\n });\n }", "function fhArrival_close() {\n\t\n\tif (fhArrival_data.currentMode == \"EDIT\") {\n\t\tif (!confirm(\"Sei sicuro di uscire senza salvare?\")) {\n\t\t\treturn false;\n\t\t}\n\t} \n\t\n\twindow.location = 'index.php?controller=arrival';\n\t\t\n}", "function Edit_NotifyPopupDestruction()\n{\n\t//no way our matchcode (if any) is showing anymore\n\tthis.STATES_MATCHCODE = false;\n}", "function onModalVisibilityChange( event ) {\n if ( !event.newVal ) {\n Y.log( 'Closing WYSWYG editor modal.', 'debug', NAME );\n markdownEditorViewModel.wyswygButtons.destroy();\n }\n }", "function closeEditWindow() {\n\t$('#accountEditModalWindow, .window').hide(0);\n\t$('.popupContent').find('input:text').val('');\n\t$('.popupContent').find('input:password').val('');\n\t$('.popupAlertmsg').html('');\n\n}", "function engageEditMode() {\n\tMainwinObj.engageEditMode(exitEditMode, update);\n}", "handleClose() {\n console.log('in insert_field_edit_modal, handleClose, this.props.showInsertFieldEdit: ', this.props.showInsertFieldEdit);\n\n // if (this.props.showInsertFieldEdit) {\n this.props.showInsertFieldEditModal();\n this.props.selectedInsertFieldId('');\n // this.props.insertFieldToEditId('');\n this.setState({ editInsertFieldCompleted: false });\n // }\n }", "function editButton() {\r\n\ttrace(\"editButton()\");\r\n\tswitch(GM_getValue(\"popup_mode\", 1)) {\r\n\tcase 1: // in normal mode\r\n\t\tGM_setValue(\"popup_mode\",2);\r\n\t\tupdatePopup();\r\n\t\tbreak;\r\n\t\t\r\n\tcase 0: // popup closed\r\n\tcase 2: // in edit mode\r\n\t\tGM_setValue(\"popup_mode\",1); \r\n\t\tupdatePopup();\r\n\t\tbreak;\r\n\t\t\r\n\tdefault:\r\n\t\ttrace(\"ERROR: popup_mode=\" + GM_getValue(\"popup_mode\", 1));\r\n\t\talert(\"Error !!! popup_mode unknown.\");\r\n\t\treturn;\r\n\t}\r\n}", "doEditMode() {\n\n }", "_closeEditItem() {\n this.$scope.editItemModal.hide();\n }", "function processVariableEditButtonCallback() { \n \n }", "function clearEdits(){\n\n}", "closeRuleTab(){\n this.setState({showRuleWindow:{status:false}});\n let currentIfElseBlock = this.getCurrentBLock();\n currentIfElseBlock.conditionType=this.state.conditionType;\n console.log(\"Modal Closed, editor DATA\", this.state.editorData);\n document.getElementById('ruleEditorModel').style.display=\"none\";\n if(document.getElementById(\"ruleEditor\").classList.contains('viewActive')){\n document.getElementById(\"ruleEditor\").classList.remove('viewActive');\n }\n }", "function showEditFlyout() {\n showFlyout(confirmFlyout, edit, \"left\");\n }", "onClose(){\n this.setState({\n edit:false,\n adaptationVisited:getParsed('visited'),\n })\n \n }", "function cancelEditOpp() {\n clearEditOppForm();\n}", "function closeEditRolePopUp() {\n\tdocument.getElementById(\"txtEditRoleName\").value='';\n\tobjCommon.removePopUpStatusIcons('#txtEditRoleName');\n\tdocument.getElementById(\"editPopupRoleErrorMsg\").innerHTML = \"\";\n\t$('#roleEditModalWindow, .window').hide(0);\n}", "onEditComplete() {}", "onEditComplete() {}", "@action closeEditingCategoryDialog() {\n this.isEditingCategory = false;\n this.editingCategoryData = {\n name: '',\n id: null,\n parentId: null,\n };\n }", "handleCancel(event){\n this.showMode=true;\n this.hideButton=false;\n this.setEdit = true;\n this.hideEdit=false; \n }", "function btnEditBec() {\n\t$(\"#becAlm\").modal('hide');\n}", "endSessionDom() {\n var elementDom = $('#'+this.parameterId);\n $(elementDom).find('label').text('Edit'); // TODO: i18n this and also specific text\n $(this.editorButton).find('span.icon').removeClass('icon-checkmark').addClass('icon-pencil');\n $('body').removeClass('text-edit');\n $('div.textEdit').addClass('hide');\n }", "function handleListClose(){\n setListOpen(false);\n dispatch(editTodo({name:current},{name:titleEdit,description:descriptionEdit,team:teamEdit}));\n }", "function endChange()\n{\n window.close();\n}", "function _exitEditingMode() {\n delete cmsobj.editingmode;\n\n $('body').removeClass('editmode');\n $('#global-substitutions').remove(); // Not sure why, but this is needed otherwise it ends up with multiple instances\n \n if( _$smSaveAsPanel.hasClass(\"active\") ) {\n // Close the SaveAs RHS dialog if it's open\n _toggleSmSaveAsPanelVisibility();\n $('#sm-ninja-editor-requested-content').remove();\n }\n\n $(\"#image_preview_container\").remove();\n\n $(\"#ckeditor_toolbar\").remove();\n $('#ckedit').remove(); // Remove the ckeditor\n\n mov.section.cms.hideSmSidebarRight(); // hide the right sidebar\n mov.section.cms.showSmSidebarLeft(); // And show the left one\n\n $('#sm_overlay').remove();\n }", "function closeEdit(cancel) {\n var $card = $board.$(\".card\" + \".\" + \"edit\").eq(0), value;\n \n $editbar.detach();\n\n $body.add($card.drop()).removeClass(\"edit\"); // .removeClass\n value = cancel ? $card.data(\"value\") : $card.$(\".text\").html();\n $card.saveText(value)\n .$(\".text\")\n .attr(\"contentEditable\", FALSE) // cannot remove the attr because Firefox is complaining\n .blur();\n $document.unbind(\"keydown\");\n save();\n}", "function exitSrchBtnHdlr() {\n\tvar dirtyCells = $(\"tbody input[type=text][data-changed=true]\").length;\n\tif ( ( dirtyCells > 0 ) && ( !confirm( _alertUnsaved ) ) ) return;\n\t\n\tloadTblData( _tblName, 1, 30, ( ( _icoName != null ) ? _icoName : _sessUsr ), \"tabDataFrame\" );\n}", "handleCloseEdit(){\n this.setState({ \n showEdit: false,\n }); \n }", "closeFilterEditor() {\n const me = this; // Must defer the destroy because it may be closed by an event like a \"change\" event where\n // there may be plenty of code left to execute which must not execute on destroyed objects.\n\n me.filterEditorPopup && me.filterEditorPopup.setTimeout(me.filterEditorPopup.destroy);\n me.filterEditorPopup = null;\n }", "function cancelEdit(){\r\n\t//clears fields\r\n\t$(\"#edt-g-name\").val(\"\");\r\n\t$(\"#edt-g-time\").val(\"\");\r\n\t$(\"#auto-input-1\").val(\"\");\r\n\tvar selMin = $('#selEdtMin');\r\n\tselMin.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMin.selectmenu(\"refresh\", true);\r\n\tvar selMax = $('#selEdtmax');\r\n\tselMax.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMax.selectmenu(\"refresh\", true);\r\n\t//hides edit fields and shows games list\r\n\t$(\"#editList\").show();\r\n\t$(\"#editBlock\").hide();\r\n\t$(\"#frm1\").show();\r\n\t$(\"#para1\").show();\r\n\t//takes save function off button\r\n\tvar savBtn = $('#editSave');\r\n\tsavBtn.removeAttr('onClick');\r\n\t}", "OnClickEditClosingBalance() {\n this.props.setCurrentPopup(\n SessionHelper.isEnableCashControl() ?\n SessionConstant.POPUP_CLOSE_SESSION_CASH_CONTROL : SessionConstant.POPUP_CLOSE_SESSION\n );\n }", "close() {\n\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._screen.scrollTop(0).hide();\n\n // Hide the content behind the placeholders\n $(\"#page--info .ph-hidden-content\").hide();\n\n // Stop the placeholders animation\n this._placeholders.removeClass(\"ph-animate\").show();\n\n // Hide the delete button\n $(\"#info-delete\").hide();\n\n // Hide the info button\n $(\"#info-edit\").hide();\n\n // Show all the fields\n $(\".info-block\").show();\n\n // Delete the content of each of the fields\n $(\"#info-createdAt .info-content\").html(\"\");\n $(\"#info-updatedAt .info-content\").html(\"\");\n $(\"#info-coordinates .info-content\").html(\"\");\n $(\"#info-coordinatesAccuracy .info-content\").html(\"\");\n $(\"#info-altitude .info-content\").html(\"\");\n $(\"#info-altitudeAccuracy .info-content\").html(\"\");\n $(\"#info-type .info-content\").html(\"\");\n $(\"#info-materialType .info-content\").html(\"\");\n $(\"#info-hillPosition .info-content\").html(\"\");\n $(\"#info-water .info-content\").html(\"\");\n $(\"#info-vegetation .info-content\").html(\"\");\n $(\"#info-mitigation .info-content\").html(\"\");\n $(\"#info-mitigationsList .info-content\").html(\"\");\n $(\"#info-monitoring .info-content\").html(\"\");\n $(\"#info-monitoringList .info-content\").html(\"\");\n $(\"#info-damages .info-content\").html(\"\");\n $(\"#info-damagesList .info-content\").html(\"\");\n $(\"#info-notes .info-content\").html(\"\");\n\n // Show the image placeholder\n $(\"#info-photo-preview\").attr(\"src\", \"img/no-img-placeholder-200.png\");\n\n }", "function DisplayFunctionOnClose(radWin) {\n var refresh = false;\n if (radWin != null && typeof (radWin.IsDirty) == 'boolean') {\n refresh = radWin.IsDirty;\n }\n else {\n // if for some reason we dont get a rad window then assume we should refresh\n refresh = true;\n }\n if (refresh && refreshButtonId != null)\n $(refreshButtonId).click();\n }", "function AccountNotesPopupClose() {\n AccountNotesPopup.Hide();\n}", "function edit() {\r\n\tthis.style.display = \"none\";\r\n}", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function edit() {\n\tthis.style.display = \"none\";\n}", "function displayDetailClose()\n{\n RMPApplication.debug(\"begin displayDetailClose\");\n c_debug(dbug.detail, \"=> displayDetailClose\");\n id_search_filters.setVisible(true);\n id_search_results.setVisible(true);\n id_ticket_details.setVisible(false);\n $(\"#id_number_detail\").val (\"\");\n $(\"#id_correlation_id_detail\").val (\"\");\n $(\"#id_caller_detail\").val (\"\");\n $(\"#id_contact_detail\").val (\"\"); \n $(\"#id_company_detail\").val (\"\");\n $(\"#id_country_detail\").val (\"\");\n $(\"#id_affiliate_detail\").val (\"\");\n $(\"#id_location_detail\").val (\"\");\n $(\"#id_city_detail\").val (\"\");\n $(\"#id_opened_detail\").val (\"\");\n $(\"#id_priority_detail\").val (\"\");\n $(\"#id_state_detail\").val (\"\");\n $(\"#id_closed_detail\").val (\"\");\n $(\"#id_category_detail\").val (\"\");\n $(\"#id_product_type_detail\").val (\"\");\n $(\"#id_problem_type_detail\").val (\"\");\n $(\"#id_short_description_detail\").val (\"\");\n $(\"#id_description_detail\").val (\"\");\n $(\"#id_attachment\").html (\"\");\n clearTaskDataTable();\n $(\"#id_rowProgression\").hide();\n RMPApplication.debug(\"end displayDetailClose\");\n}", "edit() {\n this.saveInterfaceParams();\n var event = new CustomEvent(\"codeeditevent\");\n document.dispatchEvent(event);\n this.deleteFaustInterface();\n this.moduleView.textArea.style.display = \"block\";\n //this.moduleView.textArea.value = this.MIDIcontrol.;\n Connector.redrawInputConnections(this, this.drag);\n Connector.redrawOutputConnections(this, this.drag);\n this.moduleView.fEditImg.style.backgroundImage = \"url(\" + Utilitary.baseImg + \"enter.png)\";\n this.moduleView.fEditImg.addEventListener(\"click\", this.eventCloseEditHandler);\n this.moduleView.fEditImg.addEventListener(\"touchend\", this.eventCloseEditHandler);\n this.moduleView.fEditImg.removeEventListener(\"click\", this.eventOpenEditHandler);\n this.moduleView.fEditImg.removeEventListener(\"touchend\", this.eventOpenEditHandler);\n }", "function endEditAboutMe() {\n $save_or_cancel_edit_about_me.css(\"display\", \"none\");\n $link_edit_about_me.css(\"display\", \"inline\");\n $edit_about_me.css(\"display\", \"none\");\n $about_me.css(\"display\", \"block\");\n\n return false;\n }", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "function CloseERisk() {\n\tdocument.getElementById(\"EditRisk\").style.display = \"none\";\n\tdocument.getElementById(\"EditRiskName\").value = \"\";\n}", "function editExit() {\r\n /** @function editExit\r\n * @memberof module:GUI Construction\r\n * @desc Removes any edition UI. Adds new element buttons.\r\n */\r\n scene.remove(dragAndDrop); //In case of being present\r\n var editGUI = document.getElementById('editGUI');\r\n editGUI.innerHTML = \"\"\r\n\r\n\r\n var newfiberbutton = document.createElement(\"BUTTON\");\r\n newfiberbutton.style.float = \"right\";\r\n newfiberbutton.innerHTML = \"New Fiber\";\r\n newfiberbutton.className = \"w3-btn w3-hover-green w3-border-top w3-border-bottom w3-border-left w3-border-white\"\r\n newfiberbutton.onclick = function() {\r\n newFiberClick()\r\n };\r\n\r\n var newregionbutton = document.createElement(\"BUTTON\");\r\n newregionbutton.style.float = \"right\";\r\n newregionbutton.innerHTML = \"New Region\";\r\n newregionbutton.className = \"w3-btn w3-hover-green w3-border w3-border-white\"\r\n newregionbutton.onclick = function() {\r\n newIsotropicRegionClick()\r\n };\r\n\r\n // As style is float, must be appended from right to left\r\n editGUI.appendChild(newregionbutton);\r\n editGUI.appendChild(newfiberbutton);\r\n}", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "function update_and_clean() {\n get_open_tasks();\n\n clean_modal();\n}", "closeFilterEditor() {\n const me = this;\n\n // Must defer the destroy because it may be closed by an event like a \"change\" event where\n // there may be plenty of code left to execute which must not execute on destroyed objects.\n me.filterEditorPopup && me.filterEditorPopup.setTimeout(me.filterEditorPopup.destroy);\n me.filterEditorPopup = null;\n }", "handleEditClose() {\n this.setState({ \n showEditModal: false,\n newListEdit: false,\n mainListOrderIndex: this.state.mainListOrderIndex \n });\n }", "handleModalClose() {}", "function closeEvent(){\n document.getElementById('eventTextArea').style.display = 'block';\n document.getElementById('editEvent').hidden = true;\n document.getElementById('editEventBtn').style.display = 'inline-block';\n document.getElementById('deleteEvent').style.display = 'inline-block';\n document.getElementById('eventPopUp').hidden = true;\n document.getElementById('eventTextArea').innerHTML='';\n}", "function addEditWorkoutFunctionality(workoutIndex) {\n\tvar workoutTitleBar = content.dataDisplayer('getDataBox', workoutIndex).find('.bigButton');\n\tvar workoutTitle = workoutTitleBar.children('.bigButtonText');\n\tworkoutTitle.removeClass('leftCenterAlignment');\n\tworkoutTitle.css('padding-top','1%');\n\n\t// Add edit button\n\tvar editButton = $('<img class=\"editImage\" src=\"images/CrossFitTracker/pen.png\"/>');\n\tworkoutTitle.before(editButton);\n\n\t// Initialize titleInput\n\tvar titleInput = $('<input type=\"text\" class=\"titleInput\" value=\"' + workoutTitle.text() + '\">');\n\n\teditButton.click(function() {\n\t\t// Set delete image\n\t\tvar deleteButton = $('<img class=\"editImage\" src=\"images/CrossFitTracker/erase.png\"/>');\n\t\teditButton.replaceWith(deleteButton);\n\n\t\t// Set title as an input box\n\t\tworkoutTitle.replaceWith(titleInput);\n\t\ttitleInput.focus();\n\n\t\tvar deleteFlag = false;\n\t\t// Add Listener for delete button\n\t\tdeleteButton.on('mousedown', function() {\n\t\t\tdeleteFlag = true;\n\n\t\t\t$.prompt('Are you sure you want to delete the workout?', {\n\t\t\t\tbuttons: { \"Yes\": true, \"No\": false },\n\t\t\t\tposition: { container: '#titleBar' + workoutIndex, x: 30, y: 0, width: 300, arrow: 'lt' },\n\t\t\t\tsubmit: function(event, answer, message, form) {\n\t\t\t\t\t// If the user chooses yes delete the exercise\n\t\t\t\t\tif(answer == true) {\n\t\t\t\t\t\t// Call dataDisplayer to delete innerDataBox at workoutIndex\n\t\t\t\t\t\tcontent.dataDisplayer('deleteDataBox', workoutIndex);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// Give focus back to titleInput\n\t\t\t\t\t\ttitleInput.focus();\n\t\t\t\t\t\tdeleteFlag = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\t// Prevent toggle of workout dataBox when delete button is pressed\n\t\t\tevent.stopPropagation();\n\t\t});\n\n\t\t// Prevent toggle of workoutDataBox when titleInput is pressed\n\t\ttitleInput.click(function() {\n\t\t\tevent.stopPropagation();\n\t\t});\n\n\t\t// When the user clicks away from the titleInput remove \"edit\" mode\n\t\ttitleInput.focusout(function() {\n\t\t\tif(!deleteFlag) {\n\t\t\t\t// Set title\n\t\t\t\tworkoutTitle.text(titleInput.val());\n\t\t\t\ttitleInput.replaceWith(workoutTitle);\n\t\t\t\taddEditWorkoutFunctionality(workoutIndex);\n\n\t\t\t\tdeleteButton.remove();\n\t\t\t}\n\t\t});\n\n\t\t// Remove edit mode if user pressed enter\n\t\t$(document).keypress(function(e) {\n\t\t\tvar focused= $(':focus');\n\t\t if(e.which == 13 && focused.attr('class') == 'titleInput') {\n\t\t focused.focusout();\n\t\t }\n\t\t});\n\n\t\tevent.stopPropagation();\n\t});\n}", "function closeInput() {\n document.getElementById('editForm').style.display = 'none';\n}", "function makePopupSolicitud(){ \n\n}", "function editNotes2(notesID){\n\tvar notesEditID = \"edit_\" + notesID;\n\t\n\tvar notes = document.getElementById(notesEditID);\n\n\t\n\tdocument.getElementById(\"PopUpText\").style.display = \"none\";\n\t\n\t//new method\n\tvar el, x, y;\n\n\tel = document.getElementById(notesEditID);\n\tif (window.event) {\n\t\tx = window.event.clientX + document.documentElement.scrollLeft\n\t\t+ document.body.scrollLeft;\n\t\ty = window.event.clientY + document.documentElement.scrollTop +\n\t\t+ document.body.scrollTop;\n\t}\n\telse {\n\t\tx = event.clientX + window.scrollX;\n\t\ty = event.clientY + window.scrollY;\n\t}\n\tx -= 100; y -= 2;\n\ty = y+15\n\tel.style.left = x + \"px\";\n\tel.style.top = y + \"px\";\n\tel.style.display = \"flex\";\n\t\n\tdocument.getElementById('editNotesText').innerHTML = notesEditID.innerHTML;\n\t\n\t//close the dropdown box when clicked outside\n\t/*window.addEventListener('click', function(e){ \n\t\tif (document.getElementById('editNotesText').contains(e.target)){\n \t\t// Clicked in box\n \t\talert(\"inside box\");\n\t\t}\n\t\telse{\n \t\t// Clicked outside the box\n \t\talert(\"function called\");\n \t\tdocument.getElementById('editNotesText').style.display = \"none\";\n\t\t}\n\t}); */\n}", "onClose() {\n\t\t}", "function closeDPEntryPopup(){\r\n\t// remove overlay div to enable the parent page\r\n\t$(\"div\").removeClass(\"modalOverlay\");\r\n\t\r\n\tif ($('#dp_entry_validation').css('display') == 'block')\r\n\t\t$('#dp_entry_validation').css('display','none');\r\n\t\t\r\n\t$('#dp_code_section_page_change').css('display','none');\r\n}", "function ClosePopup() {\n document.getElementById('popup').style.display='none'; \n document.getElementById('shadow').style.display='none';\n \n setSquareNums();\n saveSudoku();\n}", "escFunction(e){\r\n if (this.state.editMode) {\r\n if(e.keyCode === 27) {\r\n this.cancelEdits(e);\r\n }\r\n }\r\n }", "function icl_editor_popup(e) {\n\n // Toggle\n icl_editor_toggle(e);\n \n // Set popup\n icl_editor_resize_popup(e);\n \n // TODO Scroll window if popup title is out of screen\n // Not sure why other elements fail for\n // offset()\n // var t = e.parents('ul').one().offset();\n // alert(t.top);\n // if (e.parents('ul').one().is(':icl_offscreen')) {alert('off screen');\n // jQuery('html, body').animate({\n // scrollTop: title.offset().top\n // }, 2000);\n // }\n \n // Bind window click to auto-hide\n icl_editor_bind_auto_close();\n}", "function EventEditOnClose(radWin) {\n var refresh = false;\n if (radWin != null && typeof(radWin.IsDirty) == 'boolean') {\n refresh = radWin.IsDirty;\n }\n else {\n // if for some reason we dont get a rad window then assume we should refresh\n refresh = true;\n }\n if (refresh && RefreshButtonId != null)\n $(RefreshButtonId).click();\n }", "close_dataInspector(){\n iziToast.hide({transitionOut: 'flipOutX',onClosed:() => {iziToast.busy = false;}}, document.getElementById(\"dataEditor\") ); // hide HTML data Inspector\n $stage.interactiveChildren = true;\n }" ]
[ "0.74142206", "0.7197586", "0.69760484", "0.69574535", "0.6905619", "0.68475544", "0.67945045", "0.6736883", "0.66694677", "0.6661249", "0.6629173", "0.66277254", "0.65984076", "0.6548648", "0.6526721", "0.6526353", "0.65108955", "0.6509066", "0.6504956", "0.65037054", "0.6502884", "0.6494219", "0.64873666", "0.6464401", "0.64480376", "0.644726", "0.64470625", "0.64437675", "0.64416504", "0.6437821", "0.642771", "0.6424484", "0.64207244", "0.64051855", "0.6395379", "0.63834155", "0.6333837", "0.63324237", "0.6331393", "0.6322524", "0.631841", "0.6312166", "0.63078624", "0.62911147", "0.6290473", "0.6287587", "0.6277577", "0.627634", "0.6267726", "0.62667435", "0.6254601", "0.6230078", "0.6221662", "0.62203485", "0.6213417", "0.62038374", "0.62028646", "0.62028646", "0.6189938", "0.6188484", "0.6187943", "0.61858565", "0.618513", "0.61819416", "0.61725616", "0.61646485", "0.6164107", "0.61573964", "0.61504465", "0.61469173", "0.6145299", "0.61451143", "0.6129664", "0.6121952", "0.6121591", "0.6120339", "0.6120339", "0.61156946", "0.6113986", "0.6111822", "0.611134", "0.6108631", "0.6105546", "0.6095517", "0.6094567", "0.60901564", "0.6089795", "0.6088233", "0.6087568", "0.6084605", "0.6083866", "0.6082379", "0.60807085", "0.60796005", "0.6079011", "0.60747886", "0.6074319", "0.6070789", "0.60668314", "0.6060209", "0.6058685" ]
0.0
-1
called when closing the function display popup
function DisplayFunctionOnClose(radWin) { var refresh = false; if (radWin != null && typeof (radWin.IsDirty) == 'boolean') { refresh = radWin.IsDirty; } else { // if for some reason we dont get a rad window then assume we should refresh refresh = true; } if (refresh && refreshButtonId != null) $(refreshButtonId).click(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static popup_close() {\n const context = Utils.popup_context.pop();\n if (typeof AGGrid !== 'undefined')\n AGGrid.popGridContext();\n Utils.popEnterContext();\n $('#' + context.id).hide();\n Utils.globalEnterHandler(context.globalEnterHandler);\n Utils.popup_zindex -= 2;\n if (Utils.popup_zindex < 10)\n Utils.popup_zindex = 10;\n }", "closeCleanup() {\n this.hide();\n this.addPopUpListener();\n }", "close() {\n this._showPopup = false;\n }", "function closePopup() {\n\tpopup.style.display = \"none\";\n}", "function ClosePopup() {\n document.getElementById('popup').style.display='none'; \n document.getElementById('shadow').style.display='none';\n \n setSquareNums();\n saveSudoku();\n}", "function closePopup() {\r\n \"use strict\";\r\n popup.style.display = \"none\";\r\n}", "function closeSetupClickHandler() {\n closePopup();\n }", "function closeCodeDescriptionPopUp(){\r\n $('#code_desc_popup').css('display','none'); \r\n}", "function Cancelpopup()\n{\n\twindow.close();\n}", "function closePopup() {\n $modalInstance.dismiss();\n }", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "closeWindow() {\r\n\r\n }", "onClose() {\n\t\t}", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "close(){\n isfull = false;\n myWindow.close();\n return \"bye\";\n }", "static close() {\n store.closePopup();\n }", "function close_popup() {\n\twindow.close();\n}", "function closePopUp() {\n popUpSection.style.display = \"none\";\n }", "function closePopup() {\n\t\t$('.overlay-bg, .overlay-content').hide(); // hide the overlay\n\t}", "function gfont_close_popup() {\n var popup = $('ja-popup-gfont');\n var display = popup.getStyle('display');\n if (display == 'block') {\n popup.setStyle('display', 'none');\n }\n}", "close() {\n super.close();\n this._popupForm.reset();\n }", "function closePop() {\n document.querySelector('#popupImage').onclick = function closeView() {\n popupWindow.style.display = 'none';\n document.querySelector('#popupbg').style.visibility = 'hidden';\n };\n\n document.querySelector('#popupbg').onclick = function closeView() {\n popupWindow.style.display = 'none';\n document.querySelector('#popupbg').style.visibility = 'hidden';\n };\n }", "function onPopupClose(evt) {\r\n /*\r\n // 'this' is the popup.\r\n var feature = this.feature;\r\n if (feature.layer) { // The feature is not destroyed\r\n selectControl.unselect(feature);\r\n } else { // After \"moveend\" or \"refresh\" events on POIs layer all \r\n // features have been destroyed by the Strategy.BBOX\r\n this.destroy();\r\n }\r\n */\r\n }", "function closePopup()\n{\n\tconsole.log(\"closing popup\");\n\ttau.closePopup();\n\tstopService();\n\ttizen.application.getCurrentApplication().exit();\n}", "function AccountNotesPopupClose() {\n AccountNotesPopup.Hide();\n}", "function close_pop() {\n join_room.css(\"display\", \"none\");\n $(\".join_room_popup_content\").css(\"height\",\"10em\");\n $(\"#pop_message\").html(\"\");\n }", "function handlePopupClose() {\n setModalMessage('')\n setActionCode('')\n setConfirmationModalShow(false)\n }", "function dohide(){\t\t\n\t\t\tsetTimeout(function(){\n\t\t\t $( \"#popupMenu\" ).popup( \"close\" );\n\t\t },1);\n\t}", "function handleCloseClick(){\n handleClose()\n }", "function handleFeaturePopupClose(event) {\t\t\t\n select_feature_control.unselect(environment.active_feature);\t\t\t\t\n\t\tconsole.log(\"closing popup..\" + environment.active_feature);\t\t\t\n }", "function closePopUp(){\n $('#popup').fadeOut();\n}", "function exitPopup(){\n\t\t//console.log(\"You have clicked the exit button\");\n\t\tpopwrap.classList.add(\"no-read\");\n\t\tlocalStorage.visits = 1; //After the popup has been closed once, the visit is logged and it should not appear again.\n\t}", "function popup_close(wloc){\n document.getElementById('popupper').style.display = 'none'\n if (wloc) {\n location.href = wloc\n }\n}", "function closePopups() {\n timeBox = $(\"#time-box\");\n $(\".backdrop\").css(\"display\", \"none\");\n $(\"#info-box\").css(\"display\", \"none\");\n $(\"#host-box\").css(\"display\", \"none\");\n $(\"#round-end-box\").css(\"display\", \"none\");\n }", "function sleepScoreCalculatorPopupClose() {\n $('.sleep-score-calculator-popup--close-button').on('click', function (e) {\n e.preventDefault();\n $(this).closest('.sleep-score-calculator-popup').fadeOut(500);\n $('.body-overlay').removeClass('sleep-score-popup--visible');\n\n $(\"body\").removeClass('sleep-score-popup-open-scroll-lock');\n }); \n }", "function hide_popupwindowbox(){\n\n\t\t\tvar container=$('#foodpress_popup');\n\t\t\tvar clearcontent = container.attr('clear');\n\n\t\t\tif(container.hasClass('active')){\n\t\t\t\tcontainer.animate({'margin-top':'70px','opacity':0},300).fadeOut().\n\t\t\t\t\tremoveClass('active')\n\t\t\t\t\t.delay(300)\n\t\t\t\t\t.queue(function(n){\n\t\t\t\t\t\tif(clearcontent=='true'){\n\t\t\t\t\t\t\t$(this).find('.foodpress_popup_text').html('');\n\t\t\t\t\t\t}\n\t\t\t\t\t\tn();\n\t\t\t\t\t});\n\t\t\t\t$('#fp_popup_bg').fadeOut();\n\t\t\t}\n\t\t}", "function closePopup()\n{\n modal.style.display = \"none\";\n pagecontent.className = pagecontent.className.replace(\n \" de-emphasized\", \"\");\n}", "function closePopup(){\n $('.overlay-bg, .overlay-content, #loader').hide();\n }", "function closeStatsPopup(){\n\tstatsBackgroundImage.transform = SCALE_ZERO;\n\tdestroyStatsPopup();\n}", "function allPopupCloseFunctionality() {\n $('.body-overlay').on('click', function () {\n $('.offer-popup').fadeOut(500);\n $('.sleep-score-calculator-popup').fadeOut(500);\n $('.know-measure-size-popup').removeClass('active');\n $('.know-mattress-size-popup-block').fadeOut(500);\n\n $(this).removeClass('offer-popup-block--visible know-mattress-size-popup--visible know-measure-size-popup--visible sleep-score-popup--visible');\n\n $(\"body\").removeClass('offer-popup-block-open-scroll-lock sleep-score-popup-open-scroll-lock know-measure-size-popup-open-scroll-lock know-mattress-size-popup-block-open-scroll-lock');\n });\n }", "function closeFilterPopup() {\n properties.screen.closePopup(properties.filterPopupName);\n }", "function closePopUp(){\n\n\t// remove image src\n\tdocument.getElementById('mainPopImage').src = \"\";\n\n\t// close the popup\n\tdocument.getElementById('vis-popup').style.display = \"none\";\n}", "function closePopup(){\n\t//window.alert('ClosePopup');\n\tclearTimeout( timer_8sec );\n\tclearTimeout( timer_3sec );\n\n\t// detach events\n\tvar popup = document.getElementById('cart_popup');\n\t//removeEvent(document,\"click\",watchClick);\n\tremoveEvent(popup,\"mouseover\",watchMouseOver);\n\tremoveEvent(popup,\"mouseout\",watchMouseOut);\n\n\t// hide popup\n $('.cart-popover').hide();\n\n\tclicked=false;\n}", "function closePopup() {\n\twindow.close();\n}", "function closePopUp () {\n if ( event.target == bell.querySelector('.icon')) {\n list.style.display = 'none'\n }}", "onClose(){}", "function popupClose(e) {\n\n // Grab form field data\n e.target.properties.title = L.DomUtil.get(`popup_title_${e.target.properties.id}`).value;\n\n // Save the editor contents into the\n // the geoJSONMarker's properties\n e.target.properties.content = quill.getContents();\n quill = null;\n\n // Save marker data\n saveMarkers();\n\n}", "function closePopup() {\n\t$('.popup__close, .sf-btn-finish').on('click', function (e) {\n\t\te.preventDefault();\n\t\t$('html').removeClass('lock');\n\t\t$('.popup-container').addClass('popup-hide')\n\t\t$('.popup-backdrop').addClass('popup-hide')\n\t\t$('.popup').addClass('popup-hide')\n\t})\n}", "function CloseDeviceDetectionPopup() \n{\n ClosePopup('CovRDMDeviceDetection.html');\n}", "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function closePopupWindow() {\r if ($('.popupWrapper').css('display') !== 'none') {\r $('.popupWrapper').fadeOut('600','swing');\r $('.charForm').hide();\r // $('INPUT').val('');\r $('[class~=\"invalidField\"]').removeClass('invalidField');\r $('.addCharSubmit').removeClass('submitEnabled');\r valid = true;\r }\r }", "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "function onPopupClose(evt) {\r\n // 'this' is the popup.\r\n var feature = this.feature;\r\n if (feature.layer) { // The feature is not destroyed\r\n selectControl.unselect(feature);\r\n } else { // After \"moveend\" or \"refresh\" events on POIs layer all\r\n // features have been destroyed by the Strategy.BBOX\r\n this.destroy();\r\n }\r\n}", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "function onPopupClose(evt) {\n // 'this' is the popup.\n var feature = this.feature;\n if (feature.layer) { // The feature is not destroyed\n selectControl.unselect(feature);\n } else { // After \"moveend\" or \"refresh\" events on POIs layer all\n // features have been destroyed by the Strategy.BBOX\n this.destroy();\n }\n}", "function modalClose() {\t\t\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif($('mb_Error')) $('mb_Error').remove();\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\n\t\t$('mb_center').style.display = 'none';\n\t\t\n\t\t$('mb_contents').getChildren()[0].remove();\n\t\t$('mb_overlay').setStyle('opacity',0);\n\t\t$('mb_frame').setStyle('opacity',0);\n\t\twindow.location.reload(true); \n}", "function close_popup(p, view) {\n if (p !== null) {map.closePopup(p);}\n if (view === null) {view = next_view();}\n CANCEL_REQUEST = false;\n map.fitBounds(view, ANIM_OPTIONS);\n if ($('.leaflet-popup-content-wrapper').length === 0) {\n $('.leaflet-draw-section').show();\n map.dragging.enable();\n $('#done-ctn').show();\n }\n has_given_all_answers();\n}", "function closePopup() {\r\n popup.style.display = \"none\";\r\n blur.classList = \"\";\r\n}", "onClose() {}", "onClose() {}", "closeSelf() {\n const popupDiv = document.getElementById('popup-block');\n popupDiv.innerHTML = '';\n }", "function closeBfModal(){\n butterFinger.style.display = 'none';\n }", "function slide_closeMsgBox() {\n slide_hideExifInfos();\n slide_hideOptions();\n slide_hideHelp();\n slide_addBinds();\n return true;\n}", "close() {\n\n // Pop the activity from the stack\n utils.popStackActivity();\n\n // Hide the screen\n this._screen.scrollTop(0).hide();\n\n // Hide the content behind the placeholders\n $(\"#page--info .ph-hidden-content\").hide();\n\n // Stop the placeholders animation\n this._placeholders.removeClass(\"ph-animate\").show();\n\n // Hide the delete button\n $(\"#info-delete\").hide();\n\n // Hide the info button\n $(\"#info-edit\").hide();\n\n // Show all the fields\n $(\".info-block\").show();\n\n // Delete the content of each of the fields\n $(\"#info-createdAt .info-content\").html(\"\");\n $(\"#info-updatedAt .info-content\").html(\"\");\n $(\"#info-coordinates .info-content\").html(\"\");\n $(\"#info-coordinatesAccuracy .info-content\").html(\"\");\n $(\"#info-altitude .info-content\").html(\"\");\n $(\"#info-altitudeAccuracy .info-content\").html(\"\");\n $(\"#info-type .info-content\").html(\"\");\n $(\"#info-materialType .info-content\").html(\"\");\n $(\"#info-hillPosition .info-content\").html(\"\");\n $(\"#info-water .info-content\").html(\"\");\n $(\"#info-vegetation .info-content\").html(\"\");\n $(\"#info-mitigation .info-content\").html(\"\");\n $(\"#info-mitigationsList .info-content\").html(\"\");\n $(\"#info-monitoring .info-content\").html(\"\");\n $(\"#info-monitoringList .info-content\").html(\"\");\n $(\"#info-damages .info-content\").html(\"\");\n $(\"#info-damagesList .info-content\").html(\"\");\n $(\"#info-notes .info-content\").html(\"\");\n\n // Show the image placeholder\n $(\"#info-photo-preview\").attr(\"src\", \"img/no-img-placeholder-200.png\");\n\n }", "function closePopup() {\r\n checkoutSequenceContainer.classList.remove('show');\r\n showCheckoutSequenceBtn.parentElement.classList.remove('hide');\r\n overlay.classList.remove('active');\r\n }", "function close_popup_premises(){\r\n\tdocument.getElementById('popup_premises').className=\"inactive\";\r\n\t}", "function closeDltEmpModal() {\n document.getElementById('dlt-pop-screen').style.display = \"none\";\n}", "function closePopup(){\r\n\tpopup.children.forEach(function (x) { delete roomObjects[roomObjects.indexOf(x)]; });\r\n\tdelete roomObjects[roomObjects.indexOf(popup)];\r\n\tpopup = false;\r\n\tLAYER = 0;\r\n}", "close() {\n if (this._windowRef != null) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "function makePopupSolicitud(){ \n\n}", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeDialog () {\n controls.validator.resetValidationErrors();\n table.clearHighlight();\n popup.hide();\n window.scrollTo(permissionManager.bookmark.scrollX, permissionManager.bookmark.scrollY);\n }", "function closeList() {\n\tif (iPopupOpen) {\n\t\tofVBAISpan.style.display=\"none\";\n\t\tiPopupOpen=false;\n\t\t}\n\t}", "closeDialog() {\n // Trigger the popup to close\n tableau.extensions.ui.closeDialog();\n }", "function hidePopup(){\n\t\t\t$(\"#popup-background\").fadeOut(500);\n\t\t\t$(\".popup\").fadeOut(500);\n\t\t}", "function close_popup(id)\n {\n for(var iii = 0; iii < popups.length; iii++)\n {\n if(id == popups[iii])\n {\n Array.remove(popups, iii);\n \n document.getElementById(id).style.display = \"none\";\n \n calculate_popups();\n \n return;\n }\n } \n }", "function DonefbgnPopUp(){\r\n\t\t$(\"#popUpFBGN\").html(\"<h2>Info</h2><p style='color:blue; text-align: center;'><b>FBGN games added!</b></p>\"\r\n\t\t+'<a href=\"#add-new\" data-rel=\"back\" class=\"ui-btn ui-btn-right ui-btn-inline ui-icon-delete ui-btn-icon-notext ui-btn-a\"></a>').popup(\"open\"); \r\n\t\tsetTimeout(function(){ $(\"#popUpFBGN\").popup(\"close\"); }, 5000);\r\n\t}", "function closePreviewPopup() {\n /* hide popup, by adding hide class */\n removeClass(\"preview-popup\", \"show-preview-popup\");\n\n /* show button, by removing the hide class */\n removeClass(\"preview-button\",\"preview-button-expand\");\n removeClass(\"preview-button-icon\", \"hide-me\");\n\n}", "function closeDPEntryPopup(){\r\n\t// remove overlay div to enable the parent page\r\n\t$(\"div\").removeClass(\"modalOverlay\");\r\n\t\r\n\tif ($('#dp_entry_validation').css('display') == 'block')\r\n\t\t$('#dp_entry_validation').css('display','none');\r\n\t\t\r\n\t$('#dp_code_section_page_change').css('display','none');\r\n}", "function closePopup() {\n $('.popup__close, .sf-btn-finish').on('click', function (e) {\n e.preventDefault();\n $('html').removeClass('lock');\n $('.popup-container').addClass('popup-hide')\n $('.popup-backdrop').addClass('popup-hide')\n $('.popup').addClass('popup-hide')\n })\n}", "close() {\n if (this._windowRef) {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'aria-describedby');\n this._popupService.close();\n this._windowRef = null;\n this.hidden.emit();\n this._changeDetector.markForCheck();\n }\n }", "function close(){\n document.body.removeChild(document.getElementById(\"pop_container\"));\n}", "closePopVertexInfo() {\n\t\tconst options = { popupId: `${HTML_VERTEX_INFO_ID}_${this.svgId}` };\n\t\tPopUtils.metClosePopup(options);\n\t}", "function closePopUp() {\n\tdocument.getElementById(\"playTime\").style.display=\"none\";\n\tdocument.getElementById(\"yesno\").style.display=\"block\";\n}", "function closeCVVPopup() {\n\tactivateCheckoutPayButton(); \n\t$('#cvvValue').val('');\n\tcloseAnimatedPopup('cvvFill', 'mainContainIdNewPop');\n}", "function closePopUpImage(){\n popUpBackground.classList.remove('active-background');\n setTimeout(function(){ \n popupContainer.remove();\n }, 300);\n }", "function closefeesModal2() {\n document.getElementById('fees-pop-screen').style.display='none';\n}", "function Close() {\n } // Close", "function cancelPopup() {\n window.close()\n}", "function closePopup(e) {\n $('#OverlayPopup').hide();\n return false;\n}", "function close() {\n $modalInstance.dismiss();\n }", "function unload (ctx) {\n if (ctx.popup.isOpen()) {\n ctx.popup.remove()\n }\n}", "function ui_popupExit(str_url){\n\tvar FULL=\"toolbar,directories,resizable,status,scrollbars,menubar,location,\";\n\tvar screen_ht=screen.availHeight;\n\tvar screen_wd=screen.availWidth;\n\tw_top = Math.round((screen_ht-300)*0.5);\n\tw_left= Math.round((screen_wd-460)*0.5);\n\twinparms = \"width=460,height=200,\";\n\twinparms += \"left=\" + w_left + \",top=\" + w_top;\n\texitWin=window.open('../mcc/exit.htm', 'cs_exist_warning_win', winparms);\n\tui_popupPage(str_url,\"X\",\"noncs\",FULL);\n\texitWin.focus();\n}", "function close_popup_organisation(){\r\n\t\tdocument.getElementById('popup_organisation').className=\"inactive\";\r\n\t}", "static onPopupClose(e) {\n const container = e.popup.getContent()\n /**\n * setTimeout hack to get around this current issue with React:\n * https://github.com/facebook/react/issues/3298\n */\n setTimeout(() => {\n unmountComponentAtNode(container)\n }, 10)\n }", "function returntomeni() {\r\n if ($(\".overlay-content\").css(\"display\", \"none\")) {\r\n $(\".closebtn\").removeAttr(\"onclick\");\r\n $(\".closebtn\").click(function () {\r\n $(\".newcntnt\").fadeOut(400);\r\n $(\".overlay-content\").show(500);\r\n $(\".overlay-content\").css(\"display\", \"block\");\r\n if ($(\".overlay-content\").css(\"display\", \"block\")) {\r\n $(\".closebtn\").attr(\"onClick\", \"fclose()\");\r\n }\r\n });\r\n }\r\n}", "function cust_ChildWindowClosed(){\n \n}", "function Closing() {\n\tvar el = document.getElementById(\"MainOverlay\");\n\tvar box = document.getElementById(\"popup\");\n\tel.classList.add(\"Hidden\");\n\tbox.classList.add(\"Hidden\");\n\tconsole.log(\"closed\");\n\tdocument.getElementById(\"Pop1\").classList.add(\"Hidden\");\n\tdocument.getElementById(\"Pop2\").classList.add(\"Hidden\");\n\tdocument.getElementById(\"Pop3\").classList.add(\"Hidden\");\n\tdocument.getElementById(\"Pop4\").classList.add(\"Hidden\");\n\n}", "w3_close() {\n\t\tthis.mySidenav.style.display = \"none\";\n\t\tthis.overlayBg.style.display = \"none\";\n\t}", "function ForceClose() {\r\n}", "function closePopup () {\n winGame.setAttribute('style', 'display: none');\n}" ]
[ "0.796916", "0.78591967", "0.78101265", "0.74291205", "0.74081683", "0.72970194", "0.7294586", "0.72763556", "0.72682285", "0.7247461", "0.7233407", "0.7229911", "0.7227244", "0.720264", "0.720264", "0.7195839", "0.71790797", "0.716668", "0.7161987", "0.71552444", "0.71318", "0.7123487", "0.712241", "0.7117076", "0.7116449", "0.71069777", "0.70847124", "0.70823634", "0.70692176", "0.70646906", "0.706419", "0.705368", "0.70492464", "0.70473224", "0.7001984", "0.6997183", "0.6997155", "0.6983642", "0.6979429", "0.6972794", "0.6970739", "0.69608754", "0.69588727", "0.69564885", "0.6955914", "0.6944952", "0.6937729", "0.69274896", "0.69253516", "0.6923292", "0.69217575", "0.69120544", "0.69000256", "0.6898745", "0.6894343", "0.68899983", "0.6888734", "0.6885679", "0.68711543", "0.68711543", "0.6865986", "0.6852469", "0.6840619", "0.6830334", "0.68236804", "0.6805213", "0.6804", "0.6796798", "0.6795664", "0.6782411", "0.6779961", "0.6779961", "0.67786866", "0.67743564", "0.6774284", "0.6767328", "0.67613715", "0.6761007", "0.6750062", "0.6749366", "0.67467165", "0.6742235", "0.67418104", "0.67410684", "0.6739051", "0.6735755", "0.67291254", "0.6727974", "0.67270607", "0.6725969", "0.67165977", "0.6710404", "0.67082965", "0.67073464", "0.67030793", "0.66989", "0.66975313", "0.66890574", "0.6688104", "0.66865486", "0.667957" ]
0.0
-1
disable the add/remove registration/itinerary hyperlinks in the program listing permanently disables them, the page must postback in order for them to be restored
function DisableRegisterFunctionHyperLinks() { jQuery("." + registerFunctionHyperlinkMarkerClass).removeAttr("href").css("color", "#bebebe"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisableDataEntryPage()\n{ \n var preventDisableAttr = 'preventModifyDisable';\n\n $(\"input\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"select\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"textarea\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n $(this).attr(\"disabled\", \"disabled\");\n });\n\n $(\"a\").not(\"[\" + preventDisableAttr + \"=true]\").each(function() {\n if ($(this).css('visibility') == 'hidden' || $(this).css('display') == 'none')\n $(this).attr('keephidden', 'true');\n else {\n var tempAnchor = $(this).clone();\n tempAnchor.attr('id', $(this).attr('id') + 'tmp').attr('href', 'javascript:void(null);');\n tempAnchor.attr('onclick', '').unbind('click').attr('onmouseover', '').unbind('mouseover');\n tempAnchor.attr('removeOnModify', 'true');\n $(this).attr('showOnModify', 'true').css('display', 'none').before(tempAnchor);\n }\n });\n \t\n HideApplets();\t\t\t\n}", "function disableLinksAndButtons(){\r\n\t$(':button').prop('disabled', true); // Disable all the button\r\n\tvar disableLink = function(){ return false;};\r\n\t$('a').bind('click', disableLink); // Disable all the links\r\n}", "function disableLoadOrderButton() {\n document.getElementById(\"welcome_load\").disabled = true;\n}", "function disableSteps() {\n $(\"#swish-button\").removeAttr(\"href\");\n $(\"#step2\").css(\"opacity\",0.5);\n $(\"#step3\").css(\"opacity\",0.5);\n $(\"#plusButtons\").css(\"opacity\",0.5);\n $(\"#plusSwish\").css(\"opacity\",0.5);\n $(\"#plusButtons span.button\").removeAttr(\"style\");\n}", "function disableForms() {\r\n IELinkClicks = new Array();\r\n for (var h = 0; h < frames.length; h++) {\r\n for (var i = 0; i < frames[h].document.forms.length; i++) {\r\n for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) {\r\n frames[h].document.forms[i].elements[j].disabled = true;\r\n }\r\n }\r\n IELinkClicks[h] = new Array();\r\n for (i = 0; i < frames[h].document.links.length; i++) {\r\n IELinkClicks[h][i] = frames[h].document.links[i].onclick;\r\n frames[h].document.links[i].onclick = deadend;\r\n }\r\n }\r\n}", "function desabilitaCrianca() {\n if(document.getElementById('standard')){\n crianca= document.getElementById('listaCriancas');\n crianca.disabled=true;\n }\n }", "function onLoadHandler()\n{ \n button_save.disabled = true\n button_harden.disabled = true\n button_retrieve.disabled = true\n button_next.disabled = true\n}", "function EnableDisableExtensionFields()\n{\n\tvar ERLinks = document.getElementById(\"mastercontrol.links.simplert\");\n\tvar SimpleCounter_num = document.getElementById(\"mastercontrol.task.mapped.launch.simplert\");\n\tvar btnViewRequests = document.getElementById(\"mastercontrol.links.view.simplert\");\n\tvar SCounter = document.getElementById(\"SimpleCounter_num\");\n\n\t\n\tif(document.getElementById(\"mastercontrol.route.stepduedate\").value != \"\")\n\t{\n\t\tbtnSLaunch.disabled = false;\n\t}\n\telse\n\t{\n\t\tbtnSLaunch.disabled = true;\n\t}\n\t\n\tif(SCounter.value > 0)\n\t{\n\t\tbtnViewRequests.disabled = false;\n\t}\n\telse\n\t{\n\t\tbtnViewRequests.disabled = true;\n\t}\n}", "function disableEnableLink() {\n var linkButton = document.getElementById('linkButton');\n linkButton.disabled = document.getElementById('format').value === 'Manual';\n}", "function nextPageButtonDisabled(){\n\n}", "function EnableDataEntryPage()\n{\n $('iframe').width(694);\n\t\n\t$(\"input\").not('[keepDisabled=\"true\"]').each(function() {\n $(this).removeAttr('disabled')\n });\n\t \n\t$(\"select\").not('[keepDisabled=\"true\"]').each(function() {\n\t $(this).removeAttr('disabled')\n\t});\n\t \n\t$(\"textarea\").not('[keepDisabled=\"true\"]').each(function() {\n\t $(this).removeAttr('disabled')\n\t});\n\n $('a[removeOnModify=true]').each(function() {\n $(this).remove();\n });\n \n $('a[showOnModify=true]').each(function() {\n $(this).css('display', '');\n });\n\t \t\n ShowApplets();\n\n CloseCenteredDiv('eSigsWarning');\n}", "function disableOpener() \n{ \n IEOpenerLinkClicks = new Array()\n if (frames.length > 0)\n { \n for (var h = 0; h < frames.length; h++) \n {\n for (var i = 0; i < frames[h].document.forms.length; i++) \n {\n for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) \n {\n frames[h].document.forms[i].elements[j].disabled = true\n }\n }\n IEOpenerLinkClicks[h] = new Array()\n for (i = 0; i < frames[h].document.links.length; i++) \n {\n IEOpenerLinkClicks[h][i] = frames[h].document.links[i].onclick\n frames[h].document.links[i].onclick = AlertDeadend\n }\n }\n }\n else\n {\n for (var i = 0; i < document.forms.length; i++) \n {\n for (var j = 0; j < document.forms[i].elements.length; j++) \n {\n document.forms[i].elements[j].disabled = true\n }\n }\n\tfor (i = 0; i < document.links.length; i++) \n {\n IEOpenerLinkClicks[i] = document.links[i].onclick\n document.links[i].onclick = AlertDeadend\n }\n }\n}", "function disable() {\n enabled = false;\n }", "function urlenable()\n {\n document.getElementById('postrollnf').style.display='none';\n document.getElementById('postrollurl').style.display='';\n }", "function enable_buttons()\r\n{\r\n try\r\n {\r\n\t document.options_sys_ap_excl.Change.disabled =\r\n\t document.options_sys_ap_excl.Remove.disabled = document.options_sys_ap_excl.Exclusions.options.selectedIndex < 0;\r\n }\r\n catch (err)\r\n {\r\n\t g_ErrorHandler.DisplayException (err);\r\n\t return;\r\n }\r\n}", "function disable(){\r\n\treturn;\r\n}", "function disableme(obj,callfunction) {\n var isproceed = true;\n try{\n Page_ClientValidate();\n isproceed = Page_IsValid;\n }\n catch(e){}\n if (!isproceed)\n {//handling the validation error messages and the control focus on the click of the error message links\n setdisplay(tdinfoid);\n var objVS=getelement(Page_ValidationSummaries[0].id);\n if(objVS!=null)\n {\n var objPV=null, childNodes=objVS.childNodes[1].childNodes;//first child (objVS.childNodes[0]) will be displaying the header text\n for(ix=0;ix<Page_Validators.length;ix++)\n {\n objPV=getelement(Page_Validators[ix].id);\n for(iy=0;iy<childNodes.length;iy++)\n if(childNodes[iy].innerText == objPV.getAttribute(ctlerrormsg))\n childNodes[iy].innerHTML = \"<a class='Error' href='#' onclick='setfocus(\"\n +doublequote+objPV.getAttribute(ctlvalidate)+doublequote+\")'>\" + childNodes[iy].innerText + \"</a>\";\n }\n }\n }\n if(isproceed && callfunction!=null)\n isproceed= (eval(callfunction)==false)?false:true; \n \n if(obj!=null && isproceed) \n {//when the instance of the button is available and all the validators have return the result as true or there is no validators available in the page\n obj.disabled=true;\n __doPostBack(obj.getAttribute(attrname)); \n }\n return isproceed;\n}", "function limparLista(){\r\n while(listaTarefas.firstChild){\r\n listaTarefas.removeChild(listaTarefas.firstChild);\r\n}\r\nlet atributo = document.createAttribute(\"disabled\");\r\nlimparBtn.setAttributeNode(atributo);\r\nlocalStorage.clear();\r\n}", "function enableForms() {\r\n for (var h = 0; h < frames.length; h++) {\r\n for (var i = 0; i < frames[h].document.forms.length; i++) {\r\n for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) {\r\n frames[h].document.forms[i].elements[j].disabled = false;\r\n }\r\n }\r\n for (i = 0; i < frames[h].document.links.length; i++) {\r\n frames[h].document.links[i].onclick = IELinkClicks[h][i];\r\n }\r\n }\r\n}", "function disableAll()\n{\nvar frmIndex=0;\nfor(var i=0;i<document.forms[frmIndex].length;i++)\n{\n\tfor(var i=0;i<document.forms[0].length;i++)\n{\n\tif(document.forms[0].elements[i].value != 'Save & Forward' && document.forms[0].elements[i].value != 'Approve'\n\t\t&& document.forms[0].elements[i].value != 'Reject' && document.forms[0].elements[i].value != 'Cancel' && document.forms[0].elements[i].value != 'Forward'\n\t\t\t&& document.forms[0].elements[i].value != 'Revert for Rectification' && document.forms[0].elements[i].value != 'Proceed' \n\t\t\t&& document.forms[0].elements[i].value != 'Checked and Proceed' \n\t\t\t\t&& document.forms[0].elements[i].name!='struts.token.name' && document.forms[0].elements[i].name!='struts.token'){\n\t\tdocument.forms[frmIndex].elements[i].disabled =true; \n\t}\t\t\t\t\t\t\n}\t\n}\ndisableYUIAddDeleteButtons(true);\ndocument.getElementById(\"closeButton\").disabled=false; \n}", "function disableButtons()\n {\n $.PercDataList.disableButtons(container);\n }", "function discourage_edit(){\n var count = document.getElementById('usercount');\n if (count != undefined){\n alert(\"There are people using this stage -- don't edit it now!\");\n\n var elements = document.forms[0].elements;\n var i, e;\n for (i = 0; i < elements.length; i++){\n e = elements[i];\n e.disabled = true;\n }\n var enable = document.createElement(\"a\");\n enable.href = \"#\";\n enable.innerHTML = \" <b>Ignore users and edit this stage</b>\";\n enable.onclick = function(){\n for (i = 0; i < elements.length; i++){\n e = elements[i];\n e.disabled = false;\n }\n enable.style.display = 'none';\n return false;\n }\n count.appendChild(enable);\n }\n}", "function disabledLink(){\n\tvar aaa = document.body.getElementsByTagName(\"a\");\n\tvar sk = document.body.getElementsByTagName(\"span\");\n\tvar uuu = document.body.getElementsByTagName(\"u\");\n\tvar tables = document.body.getElementsByTagName(\"table\");\n\tvar inputs = document.body.getElementsByTagName(\"INPUT\");\n\tvar imgs = document.body.getElementsByTagName(\"img\");\n\tvar selects=document.body.getElementsByTagName(\"select\");\n\tvar textareas=document.body.getElementsByTagName(\"TEXTAREA\");\n\tvar tds = document.body.getElementsByTagName(\"td\");\n\tvar objects = document.body.getElementsByTagName(\"OBJECT\");\n\tvar hidenBoderStyle = \"border-left:0px;border-top:0px;border-right:0px;border-bottom:0px solid #ff0000\";\n\t for(var i=0;i<aaa.length;i++){\n\t \t aaa[i].target=\"_self\";\n\t aaa[i].style.color = \"#000000\";\n\t aaa[i].onclick=\"\";\n\t\t aaa[i].href=\"###\";\n\t\t //aaa[i].style.display = \"none\";\n\t\t aaa[i].style.textDecoration=\"none\";\n\t\t aaa[i].style.cursor=\"default\";\n\t }\n\t for(var i=0;i<sk.length;i++){\n\t\t var styleText = sk[i].style.cssText;\n//\t\t if(styleText == \"\"){\n//\t\t\t styleText = hidenBoderStyle;\n//\t\t }else{\n//\t\t\t styleText = styleText + \";\" + hidenBoderStyle;\n//\t\t }\n\t\t sk[i].style.cssText = styleText;\n\t\t sk[i].onmouseout = \"\";\n\t\t sk[i].onmouseover = \"\";\n\t\t sk[i].onclick=\"\";\n\t }\n\t for(var i=0;i<uuu.length;i++){\n\t uuu[i].onclick= function(){\n\t \talert(_('printLang.print_preview_link_alert'));\n\t }\n\t }\n\t for(var i=0;i<tables.length;i++){\n\t\t tables[i].onclick=\"\";\n\t }\n\t \n\t for(var i = inputs.length -1; i >= 0;i--){\n\t \t if(inputs[i].type == 'checkbox'){\n\t \t \tif(inputs[i].parentNode.parentNode.id == \"checkOption\" || inputs[i].id == \"printall\") {//\\u4fdd\\u7559\\u4e0a\\u65b9\\u53ef\\u9009\\u7684\\u6309\\u94ae\n\t \t \t\tcontinue;\n\t \t \t}\n\t \t }\n\t\t else if(inputs[i].type==\"text\"){\n\t\t \tif(inputs[i].id != \"print8\" && inputs[i].style.display!='none'){\n\t\t \t\tvar styleText = inputs[i].style.cssText;\n\t\t \t\tvar breakStyle=\"WORD-WRAP: break-word;TABLE-LAYOUT: fixed;word-break:break-all\";\n\t\t\t if(styleText == \"\"){\n\t\t\t\t\tstyleText = breakStyle;\n\t\t\t\t}else{\n\t\t\t\t\tstyleText = styleText + \";\" + breakStyle;\n\t\t\t\t}\n\t\t \t\tinputs[i].outerHTML= \"<span id=\\\"\"+inputs[i].id+\"\\\" class=\\\"\" + inputs[i].className + \"\\\" style=\\\"\" + styleText + \"\\\">\" + inputs[i].value.escapeSameWidthSpace() + \"</span>\" ;\n\t\t \t\tcontinue;\n\t\t \t} \n\t\t }\n\t\t var isStr = \"print1 print2 print3 print4 print5 print6 print7 print8 dataNameBox0 dataNameBox1 dataNameBox2 dataNameBox3 dataNameBox4 dataNameBox5 printall\";\n\t\t if(isStr.indexOf(inputs[i].id)==-1){\n\t\t\t inputs[i].disabled = \"\";\n\t\t\t inputs[i].onkeypress=\"\";\n\t\t\t inputs[i].onchange=\"\";\n\t\t\t inputs[i].onclick=\"\";\n\t\t\t inputs[i].onmouseout = \"\";\n\t\t\t inputs[i].onmouseover = \"\";\n\t\t\t inputs[i].onfocus=\"\" ;\n\t\t\t inputs[i].onblur=\"\" ;\t\n\t\t\t if(!v3x.isMSIE){\n\t\t\t \t inputs[i].disabled = \"disabled\";\n\t\t\t }\n\t\t }\n\t }\n\t\t//\\u5982\\u679c\\u6253\\u5370\\u5185\\u5bb9\\u4e3a\\u8868\\u5355\\u65f6\\uff0c\\u53bb\\u6389\\u8868\\u5355\\u4e2d\\u63a7\\u4ef6\\u7684\\u56fe\\u7247\n\t for(var i=0;i<imgs.length;i++){\n\t\t imgs[i].onkeypress=\"\";\n\t\t imgs[i].onchange=\"\";\n\t\t imgs[i].onclick=\"\";\n\t\t imgs[i].style.cursor=\"default\";\n\t\t imgs[i].alt = \"\" ;\n\t\t imgs[i].title = \"\" ;\n\t\t var imgsrc = imgs[i].src.toString();\n\t\n\t\t if(imgsrc.indexOf(\"form/image/selecetUser.gif\") !=-1 || imgsrc.indexOf(\"form/image/date.gif\") !=-1 || imgsrc.indexOf(\"form/image/add.gif\") !=-1 \n\t\t \t\t|| imgsrc.indexOf(\"form/image/addEmpty.gif\") !=-1 || imgsrc.indexOf(\"form/image/delete.gif\") !=-1 || imgsrc.indexOf(\"handwrite.gif\") !=-1 \n\t\t \t\t|| imgsrc.indexOf(\"seeyon/apps_res/v3xmain/images/message/16/attachment.gif\")!= -1 || imgsrc.indexOf(\"seeyon/apps_res/form/image/quoteform.gif\")!=-1 \n\t\t \t\t|| imgsrc.indexOf(\"form/image/deeSelect.png\")!= -1 || imgsrc.indexOf(\"form/image/deeSearch.png\")!= -1){\n\t\t \t imgs[i].outerHTML = \"&nbsp;&nbsp;&nbsp;\";\n\t\t \t i--;\n\t\t }\n\t\t //\\u7b7e\\u7ae0\\u5728\\u6253\\u5370\\u65f6\\u4e0d\\u80fd\\u4fee\\u6539\n\t\t if(imgsrc.indexOf(\"handwrite.gif\") !=-1){\t\t \t\n\t\t \t for(var a=0;a<objects.length;a++){\n\t\t \t if(objects[a].innerHTML.indexOf(\"Enabled\")!=-1) \n\t\t \t objects[a].Enabled = false;\n\t\t }\n\t\t }\t \n\t\t}\n\t\tfor(var j = selects.length -1; j >= 0; j--)\n\t\t{\n\t\t\tvar styleText = selects[j].style.cssText;\n\t\t\ttry{\n\t\t\t\tvar childs = selects[j].parentNode.childNodes;\n\t\t\t\tfor(var c=0;c<childs.length;c++){\n\t\t\t\t\t//\\u9488\\u5bf9\\u8868\\u5355\\u4e2d \\u7528input\\u6a21\\u62df\\u4e0b\\u62c9\\u6846\\u5bfc\\u81f4\\u7236\\u8282\\u70b9\\u9690\\u85cf\\u7684\\u95ee\\u9898\n\t\t\t\t\t//\\u7528input\\u6a21\\u62df\\u6846\\u7684\\u6837\\u5f0f\n\t\t\t\t\tif(childs[c].id == selects[j].id+\"_autocomplete\"){\n\t\t\t\t\t\tstyleText = childs[c].style.cssText;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}catch(e){}\n\t\t\tselects[j].parentNode.outerHTML= \"<span class=\\\"\" + selects[j].className + \"\\\" style=\\\"\" + styleText + \"\\\">\" + selects[j].options[selects[j].selectedIndex].text + \"</span>\" ;\n\t\t}\n\t\tfor(var i=0;i<textareas.length;i++)\n\t\t{\n\t\t\ttry{\n\t\t\t\tvar disBorderStyle=\"overflow-y:visible;overflow-x:visible;\";\n\t\t\t var styleText = textareas[i].style.cssText;\n\t\t\t if(styleText == \"\"){\n\t\t\t\tstyleText = disBorderStyle;\n\t\t\t }else{\n\t\t\t\tstyleText = styleText + \";\" + disBorderStyle;\n\t\t\t }\n\t\t\t var _wwwww = parseInt(textareas[i].clientWidth);\n\t\t\t if(_wwwww-35>0){\n\t\t\t \tstyleText+=\"width:\"+(_wwwww-35)+\"px;\"\n\t\t\t }\n\t\t\t textareas[i].style.cssText = styleText;\n\t\t\t textareas[i].onclick=\"\";\n\t\t\t textareas[i].onkeypress=\"\";\n\t\t\t textareas[i].onchange=\"\";\n\t\t\t textareas[i].onmouseout = \"\";\n\t\t\t textareas[i].onmouseover = \"\";\n\t\t\t textareas[i].onfocus=\"\" ;\n\t\t\t textareas[i].onblur=\"\" ;\t\n\t\t\t}catch(e){}\n\t\t\ttextareas[i].readOnly = \"readOnly\";\n\t\t}\n\t\tfor(var i=0;i<tds.length;i++){\n\t\t tds[i].onclick=\"\";\n\t }\n\t}", "function toogleList(value) {\n document.getElementById('textbox-parse-sites-list').disabled = !(value == 'list');\n}", "function preventQuestionSkip_partB(){\r\n $('#next').attr('disabled', false); \r\n}", "function disableNewOrderButton() {\n document.getElementById(\"welcome_new\").disabled = true;\n}", "function Disable() {\n\tmainMenuElements.SetActive(false);\n\tsingleplayerElements.SetActive(false);\n\tmultiplayerElements.SetActive(false);\n\toptionsElements.SetActive(false);\n}", "function disableButtons() {\r\n onsubmit = this.elements['save'].disbled = true;\r\n onsend = this.elements['submit'].disabled = true;\r\n}", "function parentheadDisableButton() {\n\n $(\"#parentheadSaveandUpdateButton\").attr('disabled', true);\n $(\"#parentheadResetButton\").attr('disabled', true);\n}", "function noLink(){\nreturn false;\n}", "function forbiden(){\n\tdocument.getElementById(\"sub\").disabled = true;\n\tdocument.getElementById(\"A_choice\").disabled = true;\n\tdocument.getElementById(\"B_choice\").disabled = true;\n\tdocument.getElementById(\"C_choice\").disabled = true;\n\tdocument.getElementById(\"D_choice\").disabled = true;\n}", "function EnableDisabletAttribute(attribute, enable) {\n Xrm.Page.getControl(attribute).setDisabled(enable);\n}", "function enableAllfield() {\r\n\tdocument.getElementById('attrDescInptId').removeAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById('attrFullDescInptId').removeAttribute(\"disabled\", \"true\");\r\n\t//document.getElementById('attrOrderInptId').removeAttribute(\"disabled\", \"true\");\r\n}", "function DisableButton(){\n document.getElementById('DownloadFirmware').disabled=true;\n}", "function disableBtn() {\n // document.getElementById(idElement).disabled = true;\n $uWbuttonEdit.disabled = true;\n $uWbuttonEditUser.disabled = true;\n $uWbuttonEditEmail.disabled = true;\n $uWbuttonEditPassword.disabled = true;\n $uWbuttonEditRegion.disabled = true;\n}", "function setEnabledBT(){\r\n $('#age').removeAttr('readonly');\r\n $('#syEntered').removeAttr('readonly');\r\n $('#yrLevel').removeAttr('readonly');\r\n $('#genAverage').removeAttr('readonly');\r\n $('#btn-sub-fees').removeAttr('readonly');\r\n $('#btn-fee-full-back').removeAttr('disabled');\r\n $('#btn-fee-full-next').removeAttr('disabled');\r\n $('#btn-fee-MS-back').removeAttr('disabled');\r\n $('#btn-fee-MS-next').removeAttr('disabled');\r\n}", "function enablePatientClaimFields() {\n\n var modalClass = $('.phoneDiv');\n modalClass.removeClass('numberModalDiv');\n\n var modalClass = $('.EmailDiv');\n modalClass.removeClass('importEmailToModal'); \n\n $(\".claimDropDListBeforeEditDisabled\").closest(\".ui-widget\").find(\"input, button\").prop(\"disabled\", false);\n $(\".claimSelect_tab .custom-combobox-input\").autocomplete(\"option\", { disabled: false });\n $(\"#webPageOnNextTab\").attr(\"disabled\", false);\n $('.patientClaimInfoTxtField').attr('disabled', false);\n $('#webPageOnNextTab').attr('onClick', 'openUrlOnTab()');\n $(\".sidenav-trigger\").attr(\"disabled\", false);\n $('#btnPatientClaimInfo').attr(\"disabled\", false);\n}", "function preventQuestionSkip_partA(){\r\n $('#next').attr('disabled', true); \r\n}", "function disable()\n {\n browser.bookmarks.onRemoved.removeListener(update_in_active_tabs);\n browser.tabs.onActivated.removeListener(on_tab_activated);\n browser.tabs.onUpdated.removeListener(on_tab_updated);\n browser.tabs.onRemoved.removeListener(on_tab_removed);\n\n hide_in_all_tabs();\n }", "function disablePrivateFeatures() {\n // TODO Update the login status\n}//disablePrivateFeatures()", "function disableButtons(){\n $(\"#new-contact\").attr(\"disabled\", \"true\");\n}", "function disablePreviewLinks() {\n\n var anchors = toArray(document.querySelectorAll('a'));\n\n anchors.forEach(function (element) {\n if (/^(http|www)/gi.test(element.getAttribute('href'))) {\n element.removeEventListener('click', onPreviewLinkClicked, false);\n }\n });\n\n }", "function enableButtons(){\n $(\"#new-contact\").removeAttr(\"disabled\");\n}", "function enableOpener() \n{\n if (frames.length > 0)\n {\n for (var h = 0; h < frames.length; h++) \n {\n for (var i = 0; i < frames[h].document.forms.length; i++) \n {\n for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) \n {\n frames[h].document.forms[i].elements[j].disabled = false\n }\n }\n for (i = 0; i < frames[h].document.links.length; i++) \n {\n frames[h].document.links[i].onclick = IEOpenerLinkClicks[h][i]\n }\n }\n }\n else\n {\n for (var i = 0; i < document.forms.length; i++) \n {\n for (var j = 0; j < document.forms[i].elements.length; j++) \n {\n document.forms[i].elements[j].disabled = false\n }\n }\n\tfor (i = 0; i < document.links.length; i++) \n {\n document.links[i].onclick = IEOpenerLinkClicks[i]\n }\n }\n}", "function toggleBlacklistDomains()\r\n{\r\n var objBlacklistDomains = document.getElementById(\"ext-etheraddresslookup-blacklist_domains\");\r\n var intBlacklistDomains = objBlacklistDomains.checked ? 1 : 0;\r\n localStorage.setItem(\"ext-etheraddresslookup-blacklist_domains\", intBlacklistDomains);\r\n\r\n refreshBlacklistDomains();\r\n}", "function EnableDisableAttribute(attribute, enable) {\n Xrm.Page.getControl(attribute).setDisabled(enable);\n}", "function desactiva_enlace(enlace) {\n enlace.disabled = 'disabled';\n}", "function disableDomainControls() {\n document.getElementById(\"domains\").disabled = true;\n document.getElementById(\"removedomains\").disabled = true;\n document.getElementById(\"togglecurrentdomain\").disabled = true;\n document.getElementById(\"domains\").style.opacity = .4;\n document.getElementById(\"removedomains\").style.opacity = .4;\n document.getElementById(\"togglecurrentdomain\").style.opacity = .4;\n}", "function enableGoToNext( enable )\n{\n\tif( enable ) \tdocument.getElementById('cmd_ple_goToNext').removeAttribute('disabled');\n\telse \t\t\tdocument.getElementById('cmd_ple_goToNext').setAttribute('disabled','true');\n}", "function DisabledAllRecording() {\n var controls = Xrm.Page.ui.controls.get();\n for (var i in controls) {\n var control = controls[i];\n if (!control.getDisabled()) {\n control.setDisabled(true);\n }\n }\n}", "function disableButtons() {\r\n voyageDetailsBtn.disabled = true;\r\n newRecordBtn.disabled = true;\r\n shipDetailsBtn.disabled = true;\r\n}", "function setPostButton() \n{\n\tdocument.addpost.newpost.disabled=false;\n}", "function enable() {\n buttonReservation.removeAttribute(\"disabled\");\n }", "function disableLink() {\n $('.right-menu__content a').addClass('isDisabled');\n}", "function lockDisableAll(lBl,oBl)\n{\n if((lBl == 'true') && (oBl =='false'))\n {\n document.getElementById(\"seSaveonly\").disabled = true;\n document.getElementById(\"seSaveReload\").disabled = true;\n document.getElementById(\"seDelete\").disabled = true;\n document.getElementById(\"seClearS\").disabled = true;\n document.getElementById(\"AvatarUnAssign\").disabled = true;\n document.getElementById(\"PropUnAssign\").disabled = true;\n document.getElementById(\"BackdropUnAssign\").disabled = true;\n document.getElementById(\"AudioUnAssign\").disabled = true;\n document.getElementById(\"onstagelist\").disabled = true;\n document.getElementById(\"debug\").disabled = true;\n document.getElementById(\"cantaccess\").disabled = true;\n document.getElementById(\"canaccess\").disabled = true;\n document.getElementById(\"stageaccess\").disabled = true;\n }\n}", "function enableCheck ()\n\t{\n\tvar disObj = document.getElementById ('isDisable');\n\tif(disObj.value == \"1\")\n\t\tfieldStateChangeWr ('','disablePage','','');\n\t}", "function _setDataModifiedFlagForNavigation()\r\n{\t\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\t//alert(\"htmlAreaObj=\"+htmlAreaObj);\r\n\tif(htmlAreaObj)\r\n\t{\r\n\t\thtmlAreaObj.setDataModifiedForNavigation(false);\r\n\t}\r\n}", "disable() { }", "function decreaseRequestAllDisabledCounter() {\n requestAllDisabledCounter -= 1;\n if (requestAllDisabledCounter == 0) {\n document.getElementById(\"defaultdatabutton\").disabled = false;\n }\n}", "function enableAllFields(){\r\n\tdocument.getElementById(\"inputUserGroupInpt\").removeAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"manual\").removeAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"csv\").removeAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"inputNoOFUser\").removeAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"expiryDuration\").removeAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"paymentModeInd\").removeAttribute(\"disabled\", \"true\");\r\n\t//document.getElementById(\"noOfUser1\").removeAttribute(\"disabled\", \"true\");\r\n}", "function disableForm() {\n getFormControls().prop('disabled', true).addClass('disabled');\n cancelButton.hide().prop('disabled', true);\n submitButton.prop('disabled', true);\n editButton.prop('disabled', false).show();\n disableFormPassword();\n passwordToggleButton.prop(\"disabled\", true);\n //location.reload(); //the loser's choice\n }", "function unblockEvents() {\r\n if (Nav4) {\r\n window.releaseEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS);\r\n window.onclick = null;\r\n window.onfocus = null;\r\n } else {\r\n enableForms();\r\n }\r\n}", "function enablePatientPIFields() {\n\n var modalClass = $('.phoneDiv');\n modalClass.removeClass('numberModalDiv');\n\n var modalClass = $('.EmailDiv');\n modalClass.removeClass('importEmailToModal'); \n\n $(\".PIDropDListBeforeEditDisabled\").closest(\".ui-widget\").find(\"input, button\").prop(\"disabled\", false);\n $(\".piSelect_tab .custom-combobox-input\").autocomplete(\"option\", { disabled: false });\n $(\"#PIattorneyWebBtn\").attr(\"disabled\", false);\n\n $('.patientPITxtField').attr('disabled', false);\n $('#PIattorneyWebBtn').attr('onClick', 'openPiUrlOnTab()');\n $(\".sidenav-trigger\").attr(\"disabled\", false);\n $('#btnPatientPI').attr(\"disabled\", false);\n}", "function disableFieldsOnLoad(){\r\n\tdocument.getElementById(\"inputUserGroupInpt\").setAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"manual\").setAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"csv\").setAttribute(\"disabled\", \"true\");\r\n\t//document.getElementById(\"noOfUser1\").setAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"inputNoOFUser\").setAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"expiryDuration\").setAttribute(\"disabled\", \"true\");\r\n\tdocument.getElementById(\"paymentModeInd\").setAttribute(\"disabled\", \"true\");\r\n}", "disable() {\n\t // leave empty in Widget.js\n\t }", "function disableBt(obj){\r\n\t$(obj).fadeTo(\"fast\", 0.3);\r\n\t$(obj).attr(\"href\",\"javascript:;\");\r\n\t$(obj).unbind(\"click\");\r\n}", "function disableSaveTransfers(){\n\tdocument.getElementById('savetransfers').disabled = true;\n\tdocument.getElementById('savetransfers').style.background = 'gray';\n}", "function h_disableActionButtons()\n{\n\tdocument.getElementById(\"choose_buyd\").disabled = true;\t\t// disable buy button\n\tdocument.getElementById(\"choose_selld\").disabled = true;\t// disable sell shark\n\tdocument.getElementById(\"choose_city\").disabled = true;\t\t// disable travel button\n\tdocument.getElementById(\"choose_loan\").disabled = true;\t\t// disable loan shark\n}", "function showNext() {\r\n document.getElementById(\"next\").disabled = false;\r\n}", "function enablePatientCollectionFields() {\n\n var modalClass = $('.phoneDiv');\n modalClass.removeClass('numberModalDiv');\n\n var modalClass = $('.EmailDiv');\n modalClass.removeClass('importEmailToModal'); \n\n $(\".CollectionDropDListBeforeEditDisabled\").closest(\".ui-widget\").find(\"input, button\").prop(\"disabled\", false);\n $(\".collectionSelect_tab .custom-combobox-input\").autocomplete(\"option\", { disabled: false });\n $(\"#collectionFormWebsite\").attr(\"disabled\", false);\n\n $('.patientCollectionTxtField').attr('disabled', false);\n $('#collectionFormWebsite').attr('onClick', 'openColUrlOnTab()');\n $(\".sidenav-trigger\").attr(\"disabled\", false);\n $('#btnPatientCollection').attr(\"disabled\", false);\n\n}", "function disable() {\n\thideIcon(false);\n\thideLabel(false);\n\thideArrow(false);\n}", "function disable_buttons()\n {\n \n $('#step').prop('disabled', true);\n $('#run').prop('disabled', true);\n $('#finish').prop('disabled', true);\n $('#tape_input').prop('disabled', true);\n }", "function disable_buttons_prod_ret()\n {\n $('#new_prod_ret').attr('disabled', true);\n $('#modify_prod_ret').attr('disabled', true);\n \n $('.button').removeClass('enable_button');\n $('.button').addClass('disable_button');\n }", "onDisable() {}", "function enableRegister() {\n $('#register-submit').prop( \"disabled\", false );\n }", "function handlClickLinks(ev) {\r\n ev.preventDefault();\r\n \r\n}", "function disablePageEvents()\n{\n $(\"#navbar\").addClass(\"disabled\");\n $(\"#table-container\").addClass(\"disabled\");\n $(\"#table-title\").addClass(\"disabled\");\n}", "function disableautoserveraddress() {\n $(\"#fulladdress\").removeAttr(\"disabled\");\n $(\"#serverport\").removeAttr(\"disabled\");\n $(\"#altfulladdress\").removeAttr(\"disabled\");\n\n configdata[\"Connection\"][\"UseURLAddress\"] = false;\n}", "function disableButtons(){\n document.getElementById(\"pedir\").setAttribute(\"disabled\",\"disabled\");\n document.getElementById(\"plantarse\").setAttribute(\"disabled\",\"disabled\");\n}//disableButtons()", "function enableRemoveButtonsIfNecessary() {\n document.getElementById(\"removedomains\").disabled = true;\n document.getElementById(\"removetrustedsources\").disabled = true;\n document.getElementById(\"removeuntrustedsources\").disabled = true;\n \n var select = document.getElementById(\"domains\");\n for (var idx = 0; idx < select.length; idx++) {\n if (select.options[idx].selected) {\n document.getElementById(\"removedomains\").disabled = false;\n }\n }\n \n var trusted = document.getElementById(\"trustedsources\");\n for (var idx = 0; idx < trusted.length; idx++) {\n if (trusted.options[idx].selected) {\n document.getElementById(\"removetrustedsources\").disabled = false;\n }\n }\n \n var untrusted = document.getElementById(\"untrustedsources\");\n for (var idx = 0; idx < untrusted.length; idx++) {\n if (untrusted.options[idx].selected) {\n document.getElementById(\"removeuntrustedsources\").disabled = false;\n }\n }\n}", "function hundleEdit() {\n let elements = document.getElementsByTagName(\"input\");\n for (var i = 0; i < elements.length; i++) {\n elements[i].disabled = false;\n }\n }", "function button2Disable() {\n add1.setAttribute(\"disabled\", \"\");\n\n}", "function enableSaveButton() {\n $('#save-changes').attr('disabled', false);\n }", "function set_allBtn_disable(){\n $(\"#fmTgl\").prop(\"disabled\", true);\n $(\"#fmBln\").prop(\"disabled\", true);\n }", "function resetDisabled() {\n var lists = that.data.lists;\n for (var i = 0, len = lists.length; i < len; i++) {\n setDisabled(true, lists[i]);\n }\n }", "function desabilitarTecla(){\n\tdocument.getElementById(\"division\").disabled = true;\n\tdocument.getElementById(\"multiplicacion\").disabled = true;\n\tdocument.getElementById(\"resta\").disabled = true;\n\tdocument.getElementById(\"suma\").disabled = true;\n\tdocument.getElementById(\"aPesetas\").disabled = true;\n\tdocument.getElementById(\"aEuros\").disabled = true;\n\tdocument.getElementById(\"exp\").disabled = true;\n}", "function enableBackButton() {\n $(\"#back-button\").prop(\"disabled\", false);\n }", "function quitarantespdf(){\r\n document.getElementById(\"btndosEntradas\").setAttribute('disabled','disabled');\r\n}", "function toggleBlockPunycodeDomains()\r\n{\r\n var objBlockPunycodeDomains = document.getElementById(\"ext-etheraddresslookup-block_punycode_blacklist_domains\");\r\n var intBlockPunycodeDomains = objBlockPunycodeDomains.checked ? 1 : 0;\r\n localStorage.setItem(\"ext-etheraddresslookup-block_punycode_blacklist_domains\", intBlockPunycodeDomains);\r\n\r\n refreshBlacklistDomains();\r\n}", "function disableButtons(){\n\n\t\t// item navigation\n\t\tif( itemNav ){\n\n\t\t\tvar isFirstItem = rel.activeItem === 0,\n\t\t\t\tisLastItem = rel.activeItem >= items.length-1;\n\n\t\t\tif( $prevButton.is('button,input') ){\n\t\t\t\t$prevButton.prop('disabled', isFirstItem);\n\t\t\t}\n\n\t\t\tif( $nextButton.is('button,input') ){\n\t\t\t\t$nextButton.prop('disabled', isLastItem);\n\t\t\t}\n\n\t\t\t$prevButton[ isFirstItem ? 'removeClass' : 'addClass'](o.disabledClass);\n\t\t\t$nextButton[ isLastItem ? 'removeClass' : 'addClass'](o.disabledClass);\n\n\t\t}\n\n\t\t// pages navigation\n\t\tif( $pages.length ){\n\n\t\t\tvar isStart = pos.cur <= pos.min,\n\t\t\t\tisEnd = pos.cur >= pos.max;\n\n\t\t\tif( $prevPageButton.is('button,input') ){\n\t\t\t\t$prevPageButton.prop('disabled', isStart);\n\t\t\t}\n\n\t\t\tif( $nextPageButton.is('button,input') ){\n\t\t\t\t$nextPageButton.prop('disabled', isEnd);\n\t\t\t}\n\n\t\t\t$prevPageButton[ isStart ? 'removeClass' : 'addClass'](o.disabledClass);\n\t\t\t$nextPageButton[ isEnd ? 'removeClass' : 'addClass'](o.disabledClass);\n\n\t\t}\n\n\t}", "function toggle3rdPartyBlacklistDomains()\r\n{\r\n var obj3rdPartyBlacklists = document.getElementById(\"ext-etheraddresslookup-3rd_party_blacklist_domains\");\r\n var intBlacklistDomains = obj3rdPartyBlacklists.checked ? 1 : 0;\r\n localStorage.setItem(\"ext-etheraddresslookup-3rd_party_blacklist_domains\", intBlacklistDomains);\r\n\r\n refreshBlacklistDomains();\r\n}", "function formLock() {\r\n disableWidget('newButton');\r\n disableWidget('newButtonList');\r\n disableWidget('saveButton');\r\n disableWidget('printButton');\r\n disableWidget('printButtonPdf');\r\n disableWidget('copyButton');\r\n disableWidget('undoButton');\r\n hideWidget('undoButton');\r\n disableWidget('deleteButton');\r\n disableWidget('refreshButton');\r\n showWidget('refreshButton');\r\n disableWidget('mailButton');\r\n disableWidget('multiUpdateButton');\r\n disableWidget('indentDecreaseButton');\r\n disableWidget('changeStatusButton');\r\n disableWidget('subscribeButton');\r\n}", "function button_disable_and_reenable(){\n $('#prev, #next').off();\n setTimeout(function(){\n $('#prev').click(get_prev_screen);\n $('#next').click(get_next_screen);\n }, 1000);\n}", "function enableButtonsLoading() {\n var cancelButton = document.getElementById(\"cancelButton\");\n var submitButton = document.getElementById(\"loginButton\");\n cancelButton.disabled = false;\n submitButton.disabled = false; \n}", "function unFreezeSite(){\n if(this.verbose)console.log('navigation_unFreezeSite');\n\n if (oblio.sections[sectionID].unfreeze) {\n oblio.sections[sectionID].unfreeze();\n }\n }", "function setDisabled() {\n\t\t\t\tif (quickMenuObject.searchTerms.trim().indexOf(\" \") !== -1 || quickMenuObject.searchTerms.indexOf(\".\") === -1) {\n\t\t\t\t\ttile.dataset.disabled = true;\n\t\t\t\t} else {\n\t\t\t\t\ttile.dataset.disabled = false;\n\t\t\t\t}\n\t\t\t}", "function removeLinksTabIndex() {\n menuLinks.forEach((link) => {\n link.setAttribute(\"tabindex\", \"-1\");\n link.setAttribute(\"aria-hidden\", \"true\");\n });\n }", "function disableButtonsLoading() {\n var cancelButton = document.getElementById(\"cancelButton\");\n var submitButton = document.getElementById(\"loginButton\");\n cancelButton.disabled = true;\n submitButton.disabled = true;\n}", "function enable() {\n document.removeEventListener(\"click\", handler,true);\n function handler(e){\n e.stopPropagation();\n }\n}", "function enableButtons() {\n\tvar buttons = document.getElementsByTagName(\"li\");\n\n\tfor (var i = 0; i < buttons.length; i++) {\n\t\tif (buttons[i].className.indexOf(\"clicked\") == -1) {\n\t\t\tEventUtil.addHandler(buttons[i], \"click\", buttonFunc);\n\t\t\tbuttons[i].className = buttons[i].className.replace(\"disabled\", \"\");\n\t\t}\n\t}\n}" ]
[ "0.7131124", "0.6503595", "0.63933545", "0.63676035", "0.632956", "0.62893784", "0.6275987", "0.6263074", "0.62627476", "0.62507725", "0.6219726", "0.6200648", "0.61180675", "0.6100978", "0.60971737", "0.6054644", "0.6044146", "0.6030859", "0.5998932", "0.597162", "0.59482604", "0.593813", "0.59334344", "0.5925379", "0.5913167", "0.5906788", "0.59046566", "0.58997816", "0.58855146", "0.5883279", "0.58789617", "0.58774155", "0.5859123", "0.5859084", "0.5849142", "0.5841484", "0.58404964", "0.58402956", "0.5839565", "0.5833528", "0.58326685", "0.5823242", "0.5818414", "0.58008206", "0.5790605", "0.57884735", "0.5777235", "0.57704026", "0.57674867", "0.57544506", "0.5743067", "0.5733361", "0.57329124", "0.57280236", "0.5707588", "0.5706615", "0.5703271", "0.5699708", "0.5699377", "0.56980824", "0.56978303", "0.56916404", "0.5689684", "0.56832427", "0.5682546", "0.56806964", "0.56801015", "0.56790364", "0.5678764", "0.567849", "0.5678265", "0.5676417", "0.56756157", "0.5672351", "0.566949", "0.5669181", "0.5662428", "0.5661578", "0.565912", "0.5651428", "0.5650174", "0.56418955", "0.56345016", "0.5631631", "0.5626044", "0.5625857", "0.56246763", "0.56218505", "0.5611876", "0.56117904", "0.5606179", "0.5605366", "0.5598521", "0.55827713", "0.558268", "0.5573459", "0.5573454", "0.5569169", "0.5565685", "0.5565383" ]
0.6523637
1
Primed effect, ready to invoke
function Aff(tag, _1, _2, _3) { this.tag = tag; this._1 = _1; this._2 = _2; this._3 = _3; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runEffect() {\n var effectArray = [\"blind\", \"clip\", \"drop\", \"explode\", \"fold\", \"puff\"];\n var effectNumber = Math.floor(Math.random() * 6) + 1;\n effectNumber--;\n effect = effectArray[effectNumber];\n $(\"#gamerules\").effect(effect, 750);\n $(\"#start\").effect(effect, 750);\n setTimeout(function() {\n mpopup.style.display = \"none\";\n }, 749);\n }", "effect (prm) {\n try {\n return this.frame().effect(prm);\n } catch (e) {\n console.error(e.stack);\n throw e;\n }\n }", "act() {\n this.cooldown();\n loopOver(this.particles);\n }", "CrossFadeQueued() {}", "applyEffect() {\n\t\treturn this._effect();\n\t}", "applyEffect (effect, source) {}", "function runEffect() {\r\n\t\t// get effect type from\r\n\t\tvar selectedEffect = $(\"#panel\");\r\n\r\n\t\t// most effect types need no options passed by default\r\n\r\n\t\t// run the effect\r\n\t\t// $( \"#trigger2\" ).effect( selectedEffect, options, 500, callback );\r\n\t}", "function runEffect(event) {\n //Page Id\n var pgId = $(this).data(\"info\");\n $('.page:not(#' + pgId + ')').slideUp(300, function () {\n setTimeout(function () {\n $('#' + pgId).slideDown('slow');\n }, 300);\n });\n }", "function runEffect() {\r\n // get effect type from\r\n var selectedEffect = $(\"#effectTypes\").val();\r\n\r\n // Most effect types need no options passed by default\r\n var options = {};\r\n // some effects have required parameters\r\n if (selectedEffect === \"scale\") {\r\n options = { percent: 50 };\r\n } else if (selectedEffect === \"transfer\") {\r\n options = { to: \"#button\", className: \"ui-effects-transfer\" };\r\n } else if (selectedEffect === \"size\") {\r\n options = { to: { width: 200, height: 60 } };\r\n }\r\n\r\n // Run the effect\r\n $(\"#effect\").effect(selectedEffect, options, 500, callback);\r\n }", "function runEffect() {\r\n // get effect type from\r\n var selectedEffect = $(\"#effectTypes\").val();\r\n\r\n // Most effect types need no options passed by default\r\n var options = {};\r\n // some effects have required parameters\r\n if (selectedEffect === \"scale\") {\r\n options = { percent: 50 };\r\n } else if (selectedEffect === \"transfer\") {\r\n options = { to: \"#button\", className: \"ui-effects-transfer\" };\r\n } else if (selectedEffect === \"size\") {\r\n options = { to: { width: 200, height: 60 } };\r\n }\r\n // } else if(selectedEffect === \"explode\") {\r\n // options = { pieces: 100};\r\n // }\r\n\r\n // Run the effect\r\n $(\"#testImg\").effect(selectedEffect, options, 1000, callback);\r\n}", "function runEffect() {\n // get effect type from\n var selectedEffect = \"clip\";\n \n // most effect types need no options passed by default\n var options = {};\n // some effects have required parameters\n if ( selectedEffect === \"scale\" ) {\n options = { percent: 100 };\n } else if ( selectedEffect === \"size\" ) {\n options = { to: { width: 280, height: 185 } };\n }\n \n // run the effect\n $( \"#effect\" ).show( selectedEffect, options, 500, callback );\n }", "function runEffect() {\n // get effect type from\n var selectedEffect = 'blind';\n\n // most effect types need no options passed by default\n var options = {};\n // some effects have required parameters\n if (selectedEffect === \"scale\") {\n options = {\n percent: 0\n };\n } else if (selectedEffect === \"size\") {\n options = {\n to: {\n width: 200,\n height: 60\n }\n };\n\n }\n\n // run the effect\n $(\"#effect\").toggle(selectedEffect, options, 500);\n\n }", "function runEffect() {\n // get effect type from\n var selectedEffect = \"scale\";\n // most effect types need no options passed by default\n var options = {percent: 0};\n // run the effect\n $( \"#pop-up-window\" ).hide( selectedEffect, options, 1000);\n }", "pulse(){\n this.size += 2;\n }", "function runModifierEffects(){state.orderedModifiers.forEach(function(_ref3){var name=_ref3.name,_ref3$options=_ref3.options,options=_ref3$options===void 0?{}:_ref3$options,effect=_ref3.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});}", "function runModifierEffects(){state.orderedModifiers.forEach(function(_ref3){var name=_ref3.name,_ref3$options=_ref3.options,options=_ref3$options===void 0?{}:_ref3$options,effect=_ref3.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});}", "function runModifierEffects(){state.orderedModifiers.forEach(function(_ref3){var name=_ref3.name,_ref3$options=_ref3.options,options=_ref3$options===void 0?{}:_ref3$options,effect=_ref3.effect;if(typeof effect==='function'){var cleanupFn=effect({state:state,name:name,instance:instance,options:options});var noopFn=function noopFn(){};effectCleanupFns.push(cleanupFn||noopFn);}});}", "function runEffect() {\n// get effect type from\nvar selectedEffect = $( \"#effectTypes\" ).val();\n\n// most effect types need no options passed by default\nvar options = {};\n// some effects have required parameters\nif ( selectedEffect === \"scale\" ) {\n options = { percent: 0 };\n} else if ( selectedEffect === \"transfer\" ) {\n options = { to: \"#button\", className: \"ui-effects-transfer\" };\n} else if ( selectedEffect === \"size\" ) {\n options = { to: { width: 200, height: 60 } };\n}\n\n// run the effect\n$( \"#effect\" ).effect( selectedEffect, options, 500, callback );\n}", "function markForPostEffect(workInProgress) {\n // Schedule a side-effect on this fiber, AFTER the children's side-effects.\n if (workInProgress.lastEffect) {\n workInProgress.lastEffect.nextEffect = workInProgress;\n } else {\n workInProgress.firstEffect = workInProgress;\n }\n workInProgress.lastEffect = workInProgress;\n }", "function effectSlide () {\n pauseSlideshow();\n effect = 2;\n runSlideshow();\n }", "constructor() {\n this.effectsPool = {};\n }", "kill(){\n $(this.content).effect('puff');\n }", "function PostFX(){\r\n}", "function runEffect() {\n\t\t// run the effect\n\t\t$( \"#effect\" ).show( \"drop\", 500, callback );\n\t}", "consume(Consumable) {\n Consumable.effect(this);\n }", "use(Usable) {\n Usable.effect(this.Target);\n }", "function currCb(res,isErr){if(effectSettled){return;}effectSettled=true;cb.cancel=_chunk_e922c950_js__WEBPACK_IMPORTED_MODULE_4__[\"x\"];// defensive measure\nif(env.sagaMonitor){if(isErr){env.sagaMonitor.effectRejected(effectId,res);}else{env.sagaMonitor.effectResolved(effectId,res);}}if(isErr){setCrashedEffect(effect);}cb(res,isErr);}// tracks down the current cancel", "function preload() {}", "function runEffect() {\n // get effect type from\n var selectedEffect = $( \"#effectTypes\" ).val();\n\n // most effect types need no options passed by default\n var options = {};\n // some effects have required parameters\n if ( selectedEffect === \"scale\" ) {\n options = {\n percent: 0\n };\n } else if ( selectedEffect === \"size\" ) {\n options = {\n to: {\n width: 200,\n height: 60\n }\n };\n }\n\n $( \"#effect\" ).toggle( selectedEffect, options, 500 );\n }", "playEffect (state) {\n const discarded = state.allowDiscard(state.current, Infinity);\n\n state.current.drawCards(discarded.length);\n }", "function preload(){\n\n\n\n}", "function runEffect() {\r\n\t\t\t// get effect type from \r\n\t\t\tvar selectedEffect = $( \"#effectTypes\" ).val();\r\n\r\n\t\t\t// most effect types need no options passed by default\r\n\t\t\tvar options = {};\r\n\t\t\t// some effects have required parameters\r\n\t\t\tif ( selectedEffect === \"scale\" ) {\r\n\t\t\t\toptions = { percent: 100 };\r\n\t\t\t} else if ( selectedEffect === \"size\" ) {\r\n\t\t\t\toptions = { to: { width: 280, height: 185 } };\r\n\t\t\t}\r\n\r\n\t\t\t// run the effect\r\n\t\t\t$( \"#effect\" ).show( selectedEffect, options, 500, callback );\r\n\t\t}", "function preload(){\n}", "function runEffect() {\n\n\t\t// run the effect\n\t\t$( \"#effect\" ).hide( \"drop\", 1000, callback );\n\t}", "function preload() {\r\n\r\n}", "preload () {}", "function jParticleEffect(){\r\n\t$(\".particle-effect\").jParticle({\r\n\t\tbackground: \"rgba(0, 0, 0, 0) none repeat scroll 0 0\",\r\n\t\tcolor: \"rgba(243, 204, 41,0.5)\"\r\n\t});\r\n}", "effect(){\n return(player.points.pow(0.25).times(0.5).plus(1))\n }", "function runEffect() {\r\n // get effect type from\r\n var selectedEffect = $( \"#effectTypes1\" ).val();\r\n \r\n // most effect types need no options passed by default\r\n var options = {};\r\n // some effects have required parameters\r\n if ( selectedEffect === \"scale\" ) {\r\n options = { percent: 0 };\r\n } else if ( selectedEffect === \"size\" ) {\r\n options = { to: { width: 200, height: 60 } };\r\n }\r\n \r\n // run the effect\r\n $( \"#effect\" ).toggle( selectedEffect, options, 500 );\r\n }", "function startDamage(){\n\ttoggletoDamage();\n}", "function effectSnap () {\n pauseSlideshow();\n effect = 0;\n runSlideshow();\n }", "queueVisualEffect(action, isAnimated) {\n if (this.isInAnimation) {\n // queue\n this.visualEffectQueue.push({\n isAnimated: isAnimated,\n action: action,\n });\n } else {\n // execute\n this.isInAnimation = isAnimated;\n action();\n }\n }", "function preload()\n{\n\t\n}", "apply(){\n super.apply();\n this.effect.connect(this.wet)\n }", "runEffects(x) {\n return f(x);\n }", "reproduceAndPause() {\n this.activator();\n\n if (this.audioPlayer === null) {\n this.audioPlayer = new AudioPlayer(this.audioFile);\n }\n\n const time = this.centralTime();\n if (!this.isPlaying) {\n this.isPlaying = true;\n this.audioPlayer.reproduce(time, () => {\n this.animatedMotion(time);\n });\n } else if (this.isPlaying) {\n this.isPlaying = false;\n this.stopReproduction();\n }\n }", "function effectFade () {\n pauseSlideshow();\n effect = 1;\n runSlideshow();\n }", "function ParticleHit (attacker : int, parTran : Transform) {\n\tfor(var i : int = 0; i < 2; i++)\t{\n\t\tif(i == 0) {\n\t\t\tif(currentHealths[currentTargets[attacker]] < 1) { i = 100; break; }\n\t\t\tvar target : int = currentTargets[attacker];\n\t\t\ttry {\t\t\t\t\n\t\t\t\tif(target > 36) { i = 3; break; }\n\t\t\t//\tDebug.Log(\"Target = \" + targetObjects[target].tag);\n\t\t\t//\tDebug.Log(\"Particle = \" + parTran);\n\t\t\t//\tDebug.Log(\"Particle parent = \" + parTran.parent);\t\t\t\n\t\t\t\tparTran.parent = targetObjects[target].transform;\n\t\t\t\tif(target < 3 || (target > 6 && target < 37)) {\n\t\t\t\t\tparTran.localPosition = parTran.parent.Find(\"Poison\").transform.localPosition;\n\t\t\t\t}\n\t\t\t\telse if(target < 37) { parTran.position = targetObjects[target].collider.ClosestPointOnBounds(targetObjects[target].transform.TransformPoint(Vector3.up*5)); }\n\t\t\t\tparTran.particleSystem.Play();\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch (e) { Debug.LogError(targetObjects[attacker].tag + \" has no particle.\" + \" Error : \" + e); i = 100; }\n\t\t\tif((attacker == 1 && characterSelected[1] == 2) || (attacker == 2 && characterSelected[2] == 2)) { yield WaitForSeconds(0.3); }\n\t\t\telse { yield WaitForSeconds(0.43); }\n\t\t}\n\t\telse {\n\t\t\tparTran.particleSystem.Stop();\n\t\t\tparTran.particleSystem.Clear();\n\t\t\tparTran.parent = targetObjects[attacker].transform;\n\t\t}\n\t}\n}", "@action act() {\n this.clearHit()\n this.handleEffects()\n }", "function runEffect(effect) {\n // get effect type from\n var selectedEffect = \"blind\";\n \n // Most effect types need no options passed by default\n var options = {};\n // some effects have required parameters\n if ( selectedEffect === \"scale\" ) {\n options = { percent: 50 };\n } else if ( selectedEffect === \"size\" ) {\n options = { to: { width: 200, height: 60 } };\n }\n \n // Run the effect\n effect.toggle( selectedEffect, options, 500 );\n // $( \"#effect\" ).toggle( selectedEffect, options, 500 );\n }", "function sideEffect(data, chain){\n console.log('side effect');\n var text = JSON.stringify(data, null, 4),\n div = document.createElement('div');\n div.innerText = text;\n document.body.appendChild(div);\n chain.next(data);\n}", "function produce(id, loaded) {\n\tif (id == game.production && (!game.options.locked_bits_production || game.production != \"bits\" || can_produce(\"bits\")) && !loaded) id = null\n\tif (game.production) document.getElementById(\"produce_\"+game.production).textContent = \"Produce\"\n\tgame.production = id\n\tif (id && can_produce(id)) document.getElementById(\"produce_\"+id).textContent = \"Producing\"\n}", "function run() {\r\nsetTimeout(run, 150);\r\nact();\r\n}", "updateEffects(){\n for (let i = 0; i < this.actions.length; i++) {\n\t\t\tlet action = this.actions[i];\n\n\t\t\tif (action.hasBeenTaken()) {\n\t\t\t\tthis.effects.addAction(this.actions[i]);\n\t\t\t\taction.toggleTaken();\n\t\t\t}\n\t\t}\n }", "function runEffect() {\r\n // get effect type from\r\n var selectedEffect = $( \"#effectTypes\" ).val();\r\n \r\n // most effect types need no options passed by default\r\n var options = {};\r\n // some effects have required parameters\r\n if ( selectedEffect === \"scale\" ) {\r\n options = { percent: 0 };\r\n } else if ( selectedEffect === \"size\" ) {\r\n options = { to: { width: 200, height: 60 } };\r\n }\r\n \r\n // run the effect\r\n $( \"#effect1\" ).toggle( selectedEffect, options, 500 );\r\n }", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n}", "function preload() {\n\n}", "function preload() {\n\n}", "function preload() {\n\n}", "function preload() {\n\n}", "function preload() {\n\n}", "function preload() {\n\n}", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n var noopFn = function noopFn() {};\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function AtomicInvoke() {\r\n}", "function pulse_flash() {\n $('.flash, .flash p').effect('highlight', {}, 3000)\n}", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function runEffect() {\r\n // get effect type from\r\n var selectedEffect = $(\"#effectTypes\").val();\r\n\r\n // Most effect types need no options passed by default\r\n var options = {};\r\n // some effects have required parameters\r\n if (selectedEffect === \"scale\") {\r\n options = { percent: 50 };\r\n } else if (selectedEffect === \"size\") {\r\n options = { to: { width: 200, height: 60 } };\r\n }\r\n\r\n // Run the effect\r\n $(\"#effect\").hide(selectedEffect, options, 1000, callback);\r\n }", "function EffectClass () {}", "Invoke() {\n\n }", "Invoke() {\n\n }", "function start() {\n action(1, 0, 0);\n}", "function runModifierEffects() {\n state1.orderedModifiers.forEach(function(_ref3) {\n var name = _ref3.name, _ref3$options = _ref3.options, options = _ref3$options === void 0 ? {\n } : _ref3$options, effect = _ref3.effect;\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state1,\n name: name,\n instance: instance,\n options: options\n });\n var noopFn = function noopFn() {\n };\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function run(process) {\n if (process.paused == false) {\n process.counter++;\n if (process.counter == process.max) {\n process.method();\n process.counter = 0;\n }\n }\n }", "function preload() {\n \n}", "_postProcessing() {\n // None yet...\n }", "function callNextPukiAction(act){\n\tpukiInteract=true;\n\tif(nextPukiAction != ''){\n\t\tpukiAction = nextPukiAction;\n\t\tnextPukiAction='';\n\t}else{\n\t\tpukiAction = act;\t\n\t}\n}", "[globalTypes.mutations.startProcessing] (state) {\n state.processing = true;\n }", "preload() {\n \n }", "produce() {}", "timeStepFireEffect() {\n if (this.fireEffect.animationCounter > 0) {\n this.fireEffect.fireEffectSound.play()\n let fireEffectLocationHash = this.fireEffect.fireLocation(this.dino)\n this.fireEffect.killCrates(this.cratesArray, fireEffectLocationHash, this.newScore)\n this.canvasContext.drawImage(this.fireEffect.returnImage(), fireEffectLocationHash['xLoc'], fireEffectLocationHash['yLoc'], fireEffectLocationHash['xSize'], fireEffectLocationHash['ySize'])\n }\n }", "__init3() {this._numProcessing = 0;}", "__init3() {this._numProcessing = 0;}", "__init3() {this._numProcessing = 0;}", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "PlayQueued() {}", "preload() {\n\n }", "function reflow(pulse, _) {\n return pulse.reflow(_.modified()).modifies('opacity');\n }", "CrossFade() {}", "run() {\n this.packedRun();\n }", "@autobind\n triggerQuestionEffect(color) {\n this.questionDisplayParticleStart = 0;\n switch (color) {\n case \"green\":\n this.questionDisplayParticleStart = this.particleCount * 0.25;\n break;\n case \"blue\":\n this.questionDisplayParticleStart = this.particleCount * 0.5;\n break;\n case \"yellow\":\n this.questionDisplayParticleStart = this.particleCount * 0.75;\n break;\n }\n\n if (color != this.currentColor) {\n this.currentColor = color;\n this.questionDisplayParticleEnd = this.questionDisplayParticleStart + this.questionParticleMin + Math.round(Math.random()*this.quesitonParticleVariable);\n\n for (var i = 0, i3 = 0, l = this.particleCount2; i < l; i ++, i3 += 3 ) {\n this.scaleArray2[i] = 0;\n this.scaleOriginArray2[i] = 0;\n this.scaleTargetArray2[i] = 0;\n }\n\n for (var i =0, i3 = 0, l = this.particleCount; i < l; i++, i3 += 3){\n this.scaleOriginArray[i] = this.scaleArray[i];\n this.scaleTargetArray[i] = 0;\n this.opacityArray[i] = 1.0;\n\n if ( i/l < 0.25 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][0].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][0][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][0][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][0][this.a][2];\n } else if ( i/l < 0.5 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][1].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][1][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][1][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][1][this.a][2];\n } else if ( i/l < 0.75 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][2].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][2][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][2][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][2][this.a][2];\n } else if ( i/l < 1 ) {\n this.a = Math.floor(Math.random() * this.colors[this.colorSet][3].length);\n this.colorsTargetArray[ i3 + 0 ] = this.colors[this.colorSet][3][this.a][0];\n this.colorsTargetArray[ i3 + 1 ] = this.colors[this.colorSet][3][this.a][1];\n this.colorsTargetArray[ i3 + 2 ] = this.colors[this.colorSet][3][this.a][2];\n }\n }\n\n for(var i = this.questionDisplayParticleStart, i3 = this.questionDisplayParticleStart*3, l = this.particleCount; i<this.questionDisplayParticleEnd; i++, i3 +=3){\n\n this.scaleTargetArray [ i ] = 10 + Math.random()*60;\n\n this.translateArray[i3 + 0] = Math.random()*8 - 4;\n this.translateArray[i3 + 1] = Math.random()*4 - 2;\n this.translateArray[i3 + 2] = Math.random()*4 - 2;\n this.opacityArray[i] = 1.0;\n\n switch (color) {\n case \"red\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][0][0][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][0][0][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][0][0][2];\n } else {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][0][1][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][0][1][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][0][1][2];\n }\n break;\n case \"green\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][1][0][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][1][0][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][1][0][2];\n } else {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][1][1][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][1][1][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][1][1][2];\n }\n break;\n case \"blue\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = 0.243;\n this.colorsArray[i3 + 1] = 0.509;\n this.colorsArray[i3 + 2] = 0.968;\n } else {\n this.colorsArray[i3 + 0] = 0.729;\n this.colorsArray[i3 + 1] = 0.87;\n this.colorsArray[i3 + 2] = 0.988;\n }\n break;\n case \"yellow\":\n if( Math.round(Math.random()) ) {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][3][0][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][3][0][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][3][0][2];\n } else {\n this.colorsArray[i3 + 0] = this.colors[this.colorSet][3][1][0];\n this.colorsArray[i3 + 1] = this.colors[this.colorSet][3][1][1];\n this.colorsArray[i3 + 2] = this.colors[this.colorSet][3][1][2];\n }\n break;\n }\n\n }\n\n }\n this.geometry.getAttribute( 'opacity' ).needsUpdate = true;\n\n this.tweenContainer.time = 0;\n\n TweenMax.to(this, 1, {fadeDistance: 300});\n\n TweenMax.to(this.camera.position, 3, {x:0, y:0, z:1000, ease: Power2.easeOut});\n TweenMax.to(this.camera.rotation, 3, {z: 0, x: 0, y: 0});\n\n TweenMax.to(this.mesh.position, 3, {x: 200, y:0, z:0, ease: Power2.easeOut});\n TweenMax.to(this.mesh2.position, 3, {x: 200, y:0, z:0, ease: Power2.easeOut});\n TweenMax.killTweensOf(this.tweenContainer);\n TweenMax.to(this.tweenContainer, 1, {time:1, ease:Power2.easeOut});\n\n this.geometry.getAttribute( 'translate' ).needsUpdate = true;\n this.geometry.getAttribute( 'scale' ).needsUpdate = true;\n\n this.material.uniforms[ 'mode' ].value = 3.0;\n }", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }", "function runModifierEffects() {\n state.orderedModifiers.forEach(function (_ref3) {\n var name = _ref3.name,\n _ref3$options = _ref3.options,\n options = _ref3$options === void 0 ? {} : _ref3$options,\n effect = _ref3.effect;\n\n if (typeof effect === 'function') {\n var cleanupFn = effect({\n state: state,\n name: name,\n instance: instance,\n options: options\n });\n\n var noopFn = function noopFn() {};\n\n effectCleanupFns.push(cleanupFn || noopFn);\n }\n });\n }" ]
[ "0.6503705", "0.63226336", "0.6289637", "0.62135917", "0.6164148", "0.6048795", "0.60197866", "0.6010513", "0.59172696", "0.59116167", "0.5897953", "0.5859561", "0.58467215", "0.57882816", "0.5788027", "0.5788027", "0.5788027", "0.57869935", "0.5724118", "0.5718581", "0.5707823", "0.56864244", "0.56831163", "0.56803364", "0.56720364", "0.5656887", "0.5650979", "0.5641043", "0.5638993", "0.5637592", "0.56203586", "0.5618671", "0.5568983", "0.5560912", "0.5551348", "0.55303085", "0.5529685", "0.5521657", "0.5518974", "0.5517069", "0.55140233", "0.5508964", "0.54871446", "0.5484791", "0.54844016", "0.5482675", "0.54821014", "0.547994", "0.54732955", "0.54714954", "0.54671997", "0.546494", "0.5459047", "0.54471207", "0.54450303", "0.5439374", "0.5439374", "0.5439374", "0.5439374", "0.5439374", "0.5439374", "0.5439374", "0.5438638", "0.5438638", "0.5438638", "0.5438638", "0.5438638", "0.5438638", "0.5438361", "0.5434212", "0.54278255", "0.54266053", "0.54266053", "0.54243416", "0.54234827", "0.5417493", "0.5417493", "0.54062897", "0.5394818", "0.53887534", "0.5386605", "0.5385538", "0.5374594", "0.5371914", "0.5369779", "0.53670174", "0.53597677", "0.53550875", "0.53550875", "0.53550875", "0.5336339", "0.5314131", "0.5312974", "0.53123033", "0.53095555", "0.53047216", "0.5274811", "0.5269879", "0.5269879", "0.5269879", "0.5269879" ]
0.0
-1
The entire fiber has completed.
function Fiber(util, supervisor, aff) { // Monotonically increasing tick, increased on each asynchronous turn. var runTick = 0; // The current branch of the state machine. var status = SUSPENDED; // The current point of interest for the state machine branch. var step = aff; // Successful step var fail = null; // Failure step var interrupt = null; // Asynchronous interrupt // Stack of continuations for the current fiber. var bhead = null; var btail = null; // Stack of attempts and finalizers for error recovery. Every `Cons` is also // tagged with current `interrupt` state. We use this to track which items // should be ignored or evaluated as a result of a kill. var attempts = null; // A special state is needed for Bracket, because it cannot be killed. When // we enter a bracket acquisition or finalizer, we increment the counter, // and then decrement once complete. var bracketCount = 0; // Each join gets a new id so they can be revoked. var joinId = 0; var joins = null; var rethrow = true; // Each invocation of `run` requires a tick. When an asynchronous effect is // resolved, we must check that the local tick coincides with the fiber // tick before resuming. This prevents multiple async continuations from // accidentally resuming the same fiber. A common example may be invoking // the provided callback in `makeAff` more than once, but it may also be an // async effect resuming after the fiber was already cancelled. function run(localRunTick) { var tmp, result, attempt; while (true) { tmp = null; result = null; attempt = null; switch (status) { case STEP_BIND: status = CONTINUE; try { step = bhead(step); if (btail === null) { bhead = null; } else { bhead = btail._1; btail = btail._2; } } catch (e) { status = RETURN; fail = util.left(e); step = null; } break; case STEP_RESULT: if (util.isLeft(step)) { status = RETURN; fail = step; step = null; } else if (bhead === null) { status = RETURN; } else { status = STEP_BIND; step = util.fromRight(step); } break; case CONTINUE: switch (step.tag) { case BIND: if (bhead) { btail = new Aff(CONS, bhead, btail); } bhead = step._2; status = CONTINUE; step = step._1; break; case PURE: if (bhead === null) { status = RETURN; step = util.right(step._1); } else { status = STEP_BIND; step = step._1; } break; case SYNC: status = STEP_RESULT; step = runSync(util.left, util.right, step._1); break; case ASYNC: status = PENDING; step = runAsync(util.left, step._1, function (result) { return function () { if (runTick !== localRunTick) { return; } runTick++; Scheduler.enqueue(function () { // It's possible to interrupt the fiber between enqueuing and // resuming, so we need to check that the runTick is still // valid. if (runTick !== localRunTick + 1) { return; } status = STEP_RESULT; step = result; run(runTick); }); }; }); return; case THROW: status = RETURN; fail = util.left(step._1); step = null; break; // Enqueue the Catch so that we can call the error handler later on // in case of an exception. case CATCH: if (bhead === null) { attempts = new Aff(CONS, step, attempts, interrupt); } else { attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt); } bhead = null; btail = null; status = CONTINUE; step = step._1; break; // Enqueue the Bracket so that we can call the appropriate handlers // after resource acquisition. case BRACKET: bracketCount++; if (bhead === null) { attempts = new Aff(CONS, step, attempts, interrupt); } else { attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt); } bhead = null; btail = null; status = CONTINUE; step = step._1; break; case FORK: status = STEP_RESULT; tmp = Fiber(util, supervisor, step._2); if (supervisor) { supervisor.register(tmp); } if (step._1) { tmp.run(); } step = util.right(tmp); break; case SEQ: status = CONTINUE; step = sequential(util, supervisor, step._1); break; } break; case RETURN: bhead = null; btail = null; // If the current stack has returned, and we have no other stacks to // resume or finalizers to run, the fiber has halted and we can // invoke all join callbacks. Otherwise we need to resume. if (attempts === null) { status = COMPLETED; step = interrupt || fail || step; } else { // The interrupt status for the enqueued item. tmp = attempts._3; attempt = attempts._1; attempts = attempts._2; switch (attempt.tag) { // We cannot recover from an unmasked interrupt. Otherwise we should // continue stepping, or run the exception handler if an exception // was raised. case CATCH: // We should compare the interrupt status as well because we // only want it to apply if there has been an interrupt since // enqueuing the catch. if (interrupt && interrupt !== tmp && bracketCount === 0) { status = RETURN; } else if (fail) { status = CONTINUE; step = attempt._2(util.fromLeft(fail)); fail = null; } break; // We cannot resume from an unmasked interrupt or exception. case RESUME: // As with Catch, we only want to ignore in the case of an // interrupt since enqueing the item. if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) { status = RETURN; } else { bhead = attempt._1; btail = attempt._2; status = STEP_BIND; step = util.fromRight(step); } break; // If we have a bracket, we should enqueue the handlers, // and continue with the success branch only if the fiber has // not been interrupted. If the bracket acquisition failed, we // should not run either. case BRACKET: bracketCount--; if (fail === null) { result = util.fromRight(step); // We need to enqueue the Release with the same interrupt // status as the Bracket that is initiating it. attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp); // We should only coninue as long as the interrupt status has not changed or // we are currently within a non-interruptable finalizer. if (interrupt === tmp || bracketCount > 0) { status = CONTINUE; step = attempt._3(result); } } break; // Enqueue the appropriate handler. We increase the bracket count // because it should not be cancelled. case RELEASE: attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt); status = CONTINUE; // It has only been killed if the interrupt status has changed // since we enqueued the item, and the bracket count is 0. If the // bracket count is non-zero then we are in a masked state so it's // impossible to be killed. if (interrupt && interrupt !== tmp && bracketCount === 0) { step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2); } else if (fail) { step = attempt._1.failed(util.fromLeft(fail))(attempt._2); } else { step = attempt._1.completed(util.fromRight(step))(attempt._2); } fail = null; bracketCount++; break; case FINALIZER: bracketCount++; attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt); status = CONTINUE; step = attempt._1; break; case FINALIZED: bracketCount--; status = RETURN; step = attempt._1; fail = attempt._2; break; } } break; case COMPLETED: for (var k in joins) { if (joins.hasOwnProperty(k)) { rethrow = rethrow && joins[k].rethrow; runEff(joins[k].handler(step)); } } joins = null; // If we have an interrupt and a fail, then the thread threw while // running finalizers. This should always rethrow in a fresh stack. if (interrupt && fail) { setTimeout(function () { throw util.fromLeft(fail); }, 0); // If we have an unhandled exception, and no other fiber has joined // then we need to throw the exception in a fresh stack. } else if (util.isLeft(step) && rethrow) { setTimeout(function () { // Guard on reathrow because a completely synchronous fiber can // still have an observer which was added after-the-fact. if (rethrow) { throw util.fromLeft(step); } }, 0); } return; case SUSPENDED: status = CONTINUE; break; case PENDING: return; } } } function onComplete(join) { return function () { if (status === COMPLETED) { rethrow = rethrow && join.rethrow; join.handler(step)(); return function () {}; } var jid = joinId++; joins = joins || {}; joins[jid] = join; return function() { if (joins !== null) { delete joins[jid]; } }; }; } function kill(error, cb) { return function () { if (status === COMPLETED) { cb(util.right(void 0))(); return function () {}; } var canceler = onComplete({ rethrow: false, handler: function (/* unused */) { return cb(util.right(void 0)); } })(); switch (status) { case SUSPENDED: interrupt = util.left(error); status = COMPLETED; step = interrupt; run(runTick); break; case PENDING: if (interrupt === null) { interrupt = util.left(error); } if (bracketCount === 0) { if (status === PENDING) { attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt); } status = RETURN; step = null; fail = null; run(++runTick); } break; default: if (interrupt === null) { interrupt = util.left(error); } if (bracketCount === 0) { status = RETURN; step = null; fail = null; } } return canceler; }; } function join(cb) { return function () { var canceler = onComplete({ rethrow: false, handler: cb })(); if (status === SUSPENDED) { run(runTick); } return canceler; }; } return { kill: kill, join: join, onComplete: onComplete, isSuspended: function () { return status === SUSPENDED; }, run: function () { if (status === SUSPENDED) { if (!Scheduler.isDraining()) { Scheduler.enqueue(function () { run(runTick); }); } else { run(runTick); } } } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function complete() {\n\tconsole.log('Completed');\n}", "finishProcessing() {\n this.busy = false;\n this.successful = true;\n }", "complete() {}", "finish() {\n this.done = true;\n }", "function complete() {\n\t\t\tcallbackCount++;\n\t\t\tif(callbackCount >= 1) {\n\t\t\t\t//console.log(context);\n\t\t\t\tres.render('UpdateCoach', context);\n\t\t\t}\n\t\t}", "function done() {\n\tupdateProgressById(\"uploadProgress\", 95)\n\n\t// console.log('finished');\n}", "function _complete() {\n\t\t\tif (_errorState) {\n\t\t\t\t_eventDispatcher.sendEvent(events.ERROR, {message: _errorMessage});\n\t\t\t} else if (!_iscomplete) {\n\t\t\t\t_iscomplete = true;\n\t\t\t\t_status = utils.loaderstatus.COMPLETE;\n\t\t\t\t_eventDispatcher.sendEvent(events.COMPLETE);\n\t\t\t}\n\t\t}", "function done() {}", "_complete() {\n this._resetCurrent(true);\n\n super._complete();\n }", "function completelyDone() {\n _rdbConn.close();\n console.log(\"ALL DONE\");\n}", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function complete() {\n Y.log('complete');\n }", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function complete() {\n Y.log('complete');\n }", "function complete(){\r\n console.log(context.pokemon);\r\n callbackCount++;\r\n if(callbackCount >= 1){\r\n res.render('update-discord', context);\r\n }\r\n\r\n }", "completed(data) {}", "function stateSetComplete()\n\t\t{\n\t\t\t_cb();\n\t\t}", "static complete() {\n\t\tconsole.log('Animation.complete()')\n\t\tVelvet.capture.adComplete()\n\n\t}", "function _complete() {\n\t if (!_iscomplete) {\n\t _iscomplete = true;\n\t _status = scriptloader.loaderstatus.COMPLETE;\n\t _this.trigger(events.COMPLETE);\n\t }\n\t }", "async end() {\n return;\n }", "function AllDone(){\n \n}", "function complete()\n\t{\n\t\t_queryInProgress = false;\n\t\t_dispatcher.trigger(_options.completeEvent);\n\t}", "function finished(err){\n }", "done() {}", "async end() { }", "function fileUploadDone() {\n signale.complete('File upload done');\n}", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "function doDone() {\r\n // in FF this is empty.\r\n\r\n }", "_done() {\n this.worker = this.task = -1;\n this.callbacks = []; this.callback = 0;\n }", "complete() {\n\t\tthis._subscriber.complete(this._type);\n\t}", "transitionCompleted() {\n // implement if needed\n }", "done() {\n assert_equals(this._state, TaskState.STARTED)\n this._state = TaskState.FINISHED;\n\n let message = '< [' + this._label + '] ';\n\n if (this._result) {\n message += 'All assertions passed. (total ' + this._totalAssertions +\n ' assertions)';\n _logPassed(message);\n } else {\n message += this._failedAssertions + ' out of ' + this._totalAssertions +\n ' assertions were failed.'\n _logFailed(message);\n }\n\n this._resolve();\n }", "_onComplete() {\n // Ensure worker queues for all paths are stopped at the end of the query\n this.stop();\n }", "function checkFinished() {\n if (!inflight) resolve(fetchedData);\n }", "async onFinished() {}", "function async_completed() {\n\tasync_completions += 1;\n\tD.log(\"completions: \" + async_completions + \" out of \" + async_completions_waiting);\n\tif ( async_completions == async_completions_waiting ) {\n\t completion();\n\t}\n }", "function requestCompleted(){\n\t\twriteStream.emit(\"requestCompleted\");\n\t}", "end() {\n this.status = 'finished';\n }", "finish() {\n\t\tthis.IS_STARTED = false;\n\t}", "chunkComplete() {\n this.isChunkComplete = true;\n }", "chunkComplete() {\n this.isChunkComplete = true;\n }", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n done(err);\n }\n }", "function complete() {\n // Play the animation and audio effect after task completion.\n\n setProperty(\"isComplete\", true);\n\n // Set distanceProgress to be at most the distance for the mission, subtract the difference from the offset.\n if (getProperty(\"missionType\") === \"audit\") {\n var distanceOver = getProperty(\"distanceProgress\") - getProperty(\"distance\");\n var oldOffset = svl.missionContainer.getTasksMissionsOffset();\n var newOffset = oldOffset - distanceOver;\n svl.missionContainer.setTasksMissionsOffset(newOffset);\n }\n\n // Reset the label counter\n if ('labelCounter' in svl) {\n labelCountsAtCompletion = {\n \"CurbRamp\": svl.labelCounter.countLabel(\"CurbRamp\"),\n \"NoCurbRamp\": svl.labelCounter.countLabel(\"NoCurbRamp\"),\n \"Obstacle\": svl.labelCounter.countLabel(\"Obstacle\"),\n \"SurfaceProblem\": svl.labelCounter.countLabel(\"SurfaceProblem\"),\n \"NoSidewalk\": svl.labelCounter.countLabel(\"NoSidewalk\"),\n \"Other\": svl.labelCounter.countLabel(\"Other\")\n };\n svl.labelCounter.reset();\n }\n\n if (!svl.isOnboarding()){\n svl.storage.set('completedFirstMission', true);\n }\n }", "function loadDone() {\n return true;\n }", "_finished( ) { \n\n\t\tif( this.verbose ) { this.log( \"All stages finished.\" ); }\n\n\t\tif( this.rollback ) {\n\t\t\tif( this.verbose ) { this.log( \"Processing failed.\" ); }\n\t\t\tthis.callback.failure( \"failed because of stage \\\"\" + this.failed + \"\\\"\" );\n\t\t} else {\n\t\t\tif( this.verbose ) { this.log( \"Processing succeeded.\" ); }\n\t\t\tthis.callback.success( this.results ); \n\t\t}\n\t\t\n\t}", "onTaskDone() {\n assertFalse(this.isDone_);\n this.isDone_ = true;\n\n // Function to run the next task in the queue.\n const runNextTask = this.taskQueue_.runNextTask.bind(\n this.taskQueue_, Array.prototype.slice.call(arguments));\n\n // If we need to start the next task asynchronously, we need to wrap\n // it with the test framework code.\n if (this.completeAsync_) {\n window.setTimeout(\n NetInternalsTest.activeTest.continueTest(\n WhenTestDone.EXPECT, runNextTask),\n 0);\n return;\n }\n\n // Otherwise, just run the next task directly.\n runNextTask();\n }", "onAllCompleted() {\n this.clearRefresher();\n }", "end(){\n this.request({\"component\":this.component,\"method\":\"end\",\"args\":[\"\"]})\n this.running = false\n }", "finish()\n {\n console.log({status: \"done\"});\n\n // Close the process so we don't have anything left hanging\n process.exit();\n }", "function handleFinished() {\n resolve(Buffer.concat(_this.buffers));\n cleanup();\n }", "function complete(){\n callbackCount++;\n if(callbackCount >= 1){\n // console.log(context)\n res.render('users', context);\n }\n }", "function waitForDone() {\r\n \t\r\n \tif(loaderState !== 4) {\r\n \t\tsetTimeout(waitForDone,1000);\r\n \t}\r\n \telse {\r\n \t\tsetTimeout(function() {\r\n \t\t\t$('#coreloader').fadeOut(300, function(){\r\n \t\t\t\t$(this).delay(20).remove();\r\n \t\t\t});\r\n \t\t},500);\r\n \t}\r\n }", "function animcompleted() {\n\t\t\t\t\t\t}", "function TweenComplete() {\n tweenSlide.eventComplete(function () {\n // Reset 'style' & 'transform' for slide\n that.ResetTFSlideCss();\n // Update the variable in toggle-end\n that.TOSLIDE.End();\n fxCSS.status = null;\n });\n }", "_onEnd() {}", "function final() { console.log('Done and Final'); process.exit() ; }", "function onProcessFinal() {\n chai_1.expect(loopResult, 'LoopResult should contain 10').to.contain(10);\n chai_1.expect(loopResult, 'LoopResult should contain 5').to.contain(5);\n chai_1.expect(loopResult, 'LoopResult should contain 1').to.contain(1);\n done();\n }", "function timerComplete () {\n\t\tcurrentStack = [];\n\t\ttimer = undefined;\n\t}", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function done() {\n if (!(draining--)) _exit(code);\n }", "function complete() {\n callbackCount++;\n if(callbackCount >= 2) {\n res.render('charactersInFilms', context);\n }\n }", "function tryOnComplete() {\n if (numCallbacks == numComplete && allCallbacksCreated) {\n onComplete();\n }\n }", "doneTask () {\n this.currentTask.isDone = true;\n fireDataBase.setTask(this.currentTask.id, this.currentTask);\n }", "function complete(){\r\n callbackCount++;\r\n if(callbackCount >= 1){\r\n res.render('browsecustomerorders', context);\r\n }\r\n\r\n }", "function completed() {\n\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\tif (document.addEventListener || window.event.type === \"load\" || document.readyState === \"complete\") {\n\n\t\t\tdetach();\n\t\t\tjQuery.ready();\n\t\t}\n\t}", "function end(done) {\n done();\n}", "function completed() {\r\n\r\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\r\n\t\tif (document.addEventListener ||\r\n\t\t\twindow.event.type === \"load\" ||\r\n\t\t\tdocument.readyState === \"complete\") {\r\n\r\n\t\t\tdetach();\r\n\t\t\tjQuery.ready();\r\n\t\t}\r\n\t}", "function onFinish() {\n console.log('finished!');\n}", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function tellMeWhenDone(callback) {\n\tconsole.log('I\\'m done, now let\\'s run the call back!');\n\tconsole.log('------');\n\n\tcallback();\n}", "function finish (err) {\n if (!calledDone) {\n calledDone = true;\n finalize(err, resolve, reject, done);\n }\n }", "onFinish() {}", "_taskComplete() {\n //\n }", "function completed() {\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\tif ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n\t\t\tdetach();\n\t\t\tjQuery.ready();\n\t\t}\n\t}", "function completed() {\n\t\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\t\tif ( document.addEventListener || event.type === \"load\" || document.readyState === \"complete\" ) {\n\t\t\tdetach();\n\t\t\tjQuery.ready();\n\t\t}\n\t}", "finish() {}", "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "end() {\n this.log('end');\n }", "function _callComplete(){\n if( this.callback ){\n this.callback( this.response );\n }\n }", "complete() {\n if (this.time === undefined) {\n this.computeTime();\n }\n if (!this.fieldsComputed) {\n this.computeFields();\n }\n }", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}", "function completed() {\n\n\t// readyState === \"complete\" is good enough for us to call the dom ready in oldIE\n\tif ( document.addEventListener ||\n\t\twindow.event.type === \"load\" ||\n\t\tdocument.readyState === \"complete\" ) {\n\n\t\tdetach();\n\t\tjQuery.ready();\n\t}\n}" ]
[ "0.6859057", "0.6632369", "0.6494636", "0.63940823", "0.6317801", "0.6276546", "0.626198", "0.6189001", "0.61740786", "0.615315", "0.6152703", "0.6152703", "0.6152703", "0.6152703", "0.6145352", "0.61139035", "0.60773313", "0.6077231", "0.6074972", "0.6058745", "0.60489327", "0.60219264", "0.60212564", "0.60034037", "0.59945387", "0.59699816", "0.59577197", "0.59408385", "0.5940101", "0.5940101", "0.5935391", "0.5924863", "0.5923855", "0.5908764", "0.59021264", "0.5887703", "0.586523", "0.5853212", "0.5846604", "0.582118", "0.58024234", "0.58007884", "0.58007884", "0.57884616", "0.5780041", "0.5768336", "0.57583535", "0.5757317", "0.5755942", "0.573313", "0.5730908", "0.5729446", "0.5725527", "0.5722208", "0.5716025", "0.5707295", "0.57018894", "0.5694021", "0.5683195", "0.568076", "0.5679459", "0.56716925", "0.5671065", "0.56682765", "0.56627", "0.5662614", "0.5661765", "0.5656738", "0.5654542", "0.56535125", "0.5652947", "0.5652947", "0.56508106", "0.56501883", "0.56501293", "0.56478244", "0.5641993", "0.5641993", "0.56345356", "0.5627816", "0.5625804", "0.5625221", "0.5622159", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626", "0.5621626" ]
0.0
-1
Each invocation of `run` requires a tick. When an asynchronous effect is resolved, we must check that the local tick coincides with the fiber tick before resuming. This prevents multiple async continuations from accidentally resuming the same fiber. A common example may be invoking the provided callback in `makeAff` more than once, but it may also be an async effect resuming after the fiber was already cancelled.
function run(localRunTick) { var tmp, result, attempt; while (true) { tmp = null; result = null; attempt = null; switch (status) { case STEP_BIND: status = CONTINUE; try { step = bhead(step); if (btail === null) { bhead = null; } else { bhead = btail._1; btail = btail._2; } } catch (e) { status = RETURN; fail = util.left(e); step = null; } break; case STEP_RESULT: if (util.isLeft(step)) { status = RETURN; fail = step; step = null; } else if (bhead === null) { status = RETURN; } else { status = STEP_BIND; step = util.fromRight(step); } break; case CONTINUE: switch (step.tag) { case BIND: if (bhead) { btail = new Aff(CONS, bhead, btail); } bhead = step._2; status = CONTINUE; step = step._1; break; case PURE: if (bhead === null) { status = RETURN; step = util.right(step._1); } else { status = STEP_BIND; step = step._1; } break; case SYNC: status = STEP_RESULT; step = runSync(util.left, util.right, step._1); break; case ASYNC: status = PENDING; step = runAsync(util.left, step._1, function (result) { return function () { if (runTick !== localRunTick) { return; } runTick++; Scheduler.enqueue(function () { // It's possible to interrupt the fiber between enqueuing and // resuming, so we need to check that the runTick is still // valid. if (runTick !== localRunTick + 1) { return; } status = STEP_RESULT; step = result; run(runTick); }); }; }); return; case THROW: status = RETURN; fail = util.left(step._1); step = null; break; // Enqueue the Catch so that we can call the error handler later on // in case of an exception. case CATCH: if (bhead === null) { attempts = new Aff(CONS, step, attempts, interrupt); } else { attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt); } bhead = null; btail = null; status = CONTINUE; step = step._1; break; // Enqueue the Bracket so that we can call the appropriate handlers // after resource acquisition. case BRACKET: bracketCount++; if (bhead === null) { attempts = new Aff(CONS, step, attempts, interrupt); } else { attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt); } bhead = null; btail = null; status = CONTINUE; step = step._1; break; case FORK: status = STEP_RESULT; tmp = Fiber(util, supervisor, step._2); if (supervisor) { supervisor.register(tmp); } if (step._1) { tmp.run(); } step = util.right(tmp); break; case SEQ: status = CONTINUE; step = sequential(util, supervisor, step._1); break; } break; case RETURN: bhead = null; btail = null; // If the current stack has returned, and we have no other stacks to // resume or finalizers to run, the fiber has halted and we can // invoke all join callbacks. Otherwise we need to resume. if (attempts === null) { status = COMPLETED; step = interrupt || fail || step; } else { // The interrupt status for the enqueued item. tmp = attempts._3; attempt = attempts._1; attempts = attempts._2; switch (attempt.tag) { // We cannot recover from an unmasked interrupt. Otherwise we should // continue stepping, or run the exception handler if an exception // was raised. case CATCH: // We should compare the interrupt status as well because we // only want it to apply if there has been an interrupt since // enqueuing the catch. if (interrupt && interrupt !== tmp && bracketCount === 0) { status = RETURN; } else if (fail) { status = CONTINUE; step = attempt._2(util.fromLeft(fail)); fail = null; } break; // We cannot resume from an unmasked interrupt or exception. case RESUME: // As with Catch, we only want to ignore in the case of an // interrupt since enqueing the item. if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) { status = RETURN; } else { bhead = attempt._1; btail = attempt._2; status = STEP_BIND; step = util.fromRight(step); } break; // If we have a bracket, we should enqueue the handlers, // and continue with the success branch only if the fiber has // not been interrupted. If the bracket acquisition failed, we // should not run either. case BRACKET: bracketCount--; if (fail === null) { result = util.fromRight(step); // We need to enqueue the Release with the same interrupt // status as the Bracket that is initiating it. attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp); // We should only coninue as long as the interrupt status has not changed or // we are currently within a non-interruptable finalizer. if (interrupt === tmp || bracketCount > 0) { status = CONTINUE; step = attempt._3(result); } } break; // Enqueue the appropriate handler. We increase the bracket count // because it should not be cancelled. case RELEASE: attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt); status = CONTINUE; // It has only been killed if the interrupt status has changed // since we enqueued the item, and the bracket count is 0. If the // bracket count is non-zero then we are in a masked state so it's // impossible to be killed. if (interrupt && interrupt !== tmp && bracketCount === 0) { step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2); } else if (fail) { step = attempt._1.failed(util.fromLeft(fail))(attempt._2); } else { step = attempt._1.completed(util.fromRight(step))(attempt._2); } fail = null; bracketCount++; break; case FINALIZER: bracketCount++; attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt); status = CONTINUE; step = attempt._1; break; case FINALIZED: bracketCount--; status = RETURN; step = attempt._1; fail = attempt._2; break; } } break; case COMPLETED: for (var k in joins) { if (joins.hasOwnProperty(k)) { rethrow = rethrow && joins[k].rethrow; runEff(joins[k].handler(step)); } } joins = null; // If we have an interrupt and a fail, then the thread threw while // running finalizers. This should always rethrow in a fresh stack. if (interrupt && fail) { setTimeout(function () { throw util.fromLeft(fail); }, 0); // If we have an unhandled exception, and no other fiber has joined // then we need to throw the exception in a fresh stack. } else if (util.isLeft(step) && rethrow) { setTimeout(function () { // Guard on reathrow because a completely synchronous fiber can // still have an observer which was added after-the-fact. if (rethrow) { throw util.fromLeft(step); } }, 0); } return; case SUSPENDED: status = CONTINUE; break; case PENDING: return; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static deferredRun(...args) {\n var reactive, cb;\n if (args.length == 2) {\n reactive = args[0];\n cb = args[1];\n } else {\n reactive = this._internal[0];\n cb = args[0];\n }\n // Once executed the first time, call the callback\n var autorun = 0;\n var computation = Tessel.autorun(() => {\n var val = reactive.get();\n if (autorun > 0) {\n cb(val);\n } else {\n autorun++;\n }\n });\n return computation;\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n try {\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n } catch (e) {\n status = RETURN;\n fail = util.left(e);\n step = null;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an unmasked interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n try {\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n } catch (e) {\n status = RETURN;\n fail = util.left(e);\n step = null;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an unmasked interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n try {\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n } catch (e) {\n status = RETURN;\n fail = util.left(e);\n step = null;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an unmasked interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n try {\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n } catch (e) {\n status = RETURN;\n fail = util.left(e);\n step = null;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an unmasked interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item.\n if (interrupt && interrupt !== tmp) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an unmasked interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item.\n if (interrupt && interrupt !== tmp) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0;\n\n // The current branch of the state machine.\n var status = SUSPENDED;\n\n // The current point of interest for the state machine branch.\n var step = aff; // Successful step\n var fail = null; // Failure step\n var interrupt = null; // Asynchronous interrupt\n\n // Stack of continuations for the current fiber.\n var bhead = null;\n var btail = null;\n\n // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n var attempts = null;\n\n // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n var bracketCount = 0;\n\n // Each join gets a new id so they can be revoked.\n var joinId = 0;\n var joins = null;\n var rethrow = true;\n\n // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item.\n if (interrupt && interrupt !== tmp) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n\n return function() {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function (/* unused */) {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n run(runTick);\n break;\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n status = RETURN;\n step = null;\n fail = null;\n run(++runTick);\n }\n break;\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n if (status === SUSPENDED) {\n run(runTick);\n }\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function () {\n return status === SUSPENDED;\n },\n run: function () {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n run(runTick);\n });\n } else {\n run(runTick);\n }\n }\n }\n };\n }", "function Fiber(util, supervisor, aff) {\n // Monotonically increasing tick, increased on each asynchronous turn.\n var runTick = 0; // The current branch of the state machine.\n\n var status = SUSPENDED; // The current point of interest for the state machine branch.\n\n var step = aff; // Successful step\n\n var fail = null; // Failure step\n\n var interrupt = null; // Asynchronous interrupt\n // Stack of continuations for the current fiber.\n\n var bhead = null;\n var btail = null; // Stack of attempts and finalizers for error recovery. Every `Cons` is also\n // tagged with current `interrupt` state. We use this to track which items\n // should be ignored or evaluated as a result of a kill.\n\n var attempts = null; // A special state is needed for Bracket, because it cannot be killed. When\n // we enter a bracket acquisition or finalizer, we increment the counter,\n // and then decrement once complete.\n\n var bracketCount = 0; // Each join gets a new id so they can be revoked.\n\n var joinId = 0;\n var joins = null;\n var rethrow = true; // Each invocation of `run` requires a tick. When an asynchronous effect is\n // resolved, we must check that the local tick coincides with the fiber\n // tick before resuming. This prevents multiple async continuations from\n // accidentally resuming the same fiber. A common example may be invoking\n // the provided callback in `makeAff` more than once, but it may also be an\n // async effect resuming after the fiber was already cancelled.\n\n function _run(localRunTick) {\n var tmp, result, attempt;\n\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n\n try {\n step = bhead(step);\n\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n } catch (e) {\n status = RETURN;\n fail = util.left(e);\n step = null;\n }\n\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n\n status = STEP_RESULT;\n step = result;\n\n _run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n\n case BRACKET:\n bracketCount++;\n\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n\n if (supervisor) {\n supervisor.register(tmp);\n }\n\n if (step._1) {\n tmp.run();\n }\n\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n\n break;\n\n case RETURN:\n bhead = null;\n btail = null; // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n\n break;\n // We cannot resume from an unmasked interrupt or exception.\n\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n\n break;\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n\n case BRACKET:\n bracketCount--;\n\n if (fail === null) {\n result = util.fromRight(step); // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp); // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n\n break;\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE; // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n\n joins = null; // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0); // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n\n return;\n\n case SUSPENDED:\n status = CONTINUE;\n break;\n\n case PENDING:\n return;\n }\n }\n }\n\n function onComplete(join) {\n return function () {\n if (status === COMPLETED) {\n rethrow = rethrow && join.rethrow;\n join.handler(step)();\n return function () {};\n }\n\n var jid = joinId++;\n joins = joins || {};\n joins[jid] = join;\n return function () {\n if (joins !== null) {\n delete joins[jid];\n }\n };\n };\n }\n\n function kill(error, cb) {\n return function () {\n if (status === COMPLETED) {\n cb(util.right(void 0))();\n return function () {};\n }\n\n var canceler = onComplete({\n rethrow: false,\n handler: function handler()\n /* unused */\n {\n return cb(util.right(void 0));\n }\n })();\n\n switch (status) {\n case SUSPENDED:\n interrupt = util.left(error);\n status = COMPLETED;\n step = interrupt;\n\n _run(runTick);\n\n break;\n\n case PENDING:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n\n if (bracketCount === 0) {\n if (status === PENDING) {\n attempts = new Aff(CONS, new Aff(FINALIZER, step(error)), attempts, interrupt);\n }\n\n status = RETURN;\n step = null;\n fail = null;\n\n _run(++runTick);\n }\n\n break;\n\n default:\n if (interrupt === null) {\n interrupt = util.left(error);\n }\n\n if (bracketCount === 0) {\n status = RETURN;\n step = null;\n fail = null;\n }\n\n }\n\n return canceler;\n };\n }\n\n function join(cb) {\n return function () {\n var canceler = onComplete({\n rethrow: false,\n handler: cb\n })();\n\n if (status === SUSPENDED) {\n _run(runTick);\n }\n\n return canceler;\n };\n }\n\n return {\n kill: kill,\n join: join,\n onComplete: onComplete,\n isSuspended: function isSuspended() {\n return status === SUSPENDED;\n },\n run: function run() {\n if (status === SUSPENDED) {\n if (!Scheduler.isDraining()) {\n Scheduler.enqueue(function () {\n _run(runTick);\n });\n } else {\n _run(runTick);\n }\n }\n }\n };\n }", "_run(cb) {\n cb();\n }", "_run(cb) {\n cb();\n }", "run(self, cb) {\n const context = this.fiberContext(self);\n context.runAsync(cb || empty);\n }", "function _run(localRunTick) {\n var tmp, result, attempt;\n\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n\n try {\n step = bhead(step);\n\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n } catch (e) {\n status = RETURN;\n fail = util.left(e);\n step = null;\n }\n\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n\n status = STEP_RESULT;\n step = result;\n\n _run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n\n case BRACKET:\n bracketCount++;\n\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n\n if (supervisor) {\n supervisor.register(tmp);\n }\n\n if (step._1) {\n tmp.run();\n }\n\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n\n break;\n\n case RETURN:\n bhead = null;\n btail = null; // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n\n break;\n // We cannot resume from an unmasked interrupt or exception.\n\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n\n break;\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n\n case BRACKET:\n bracketCount--;\n\n if (fail === null) {\n result = util.fromRight(step); // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp); // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n\n break;\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE; // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n\n joins = null; // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0); // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n\n return;\n\n case SUSPENDED:\n status = CONTINUE;\n break;\n\n case PENDING:\n return;\n }\n }\n }", "function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item.\n if (interrupt && interrupt !== tmp) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }", "function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item.\n if (interrupt && interrupt !== tmp) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }", "function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item.\n if (interrupt && interrupt !== tmp) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }", "function run(localRunTick) {\n var tmp, result, attempt;\n while (true) {\n tmp = null;\n result = null;\n attempt = null;\n\n switch (status) {\n case STEP_BIND:\n status = CONTINUE;\n step = bhead(step);\n if (btail === null) {\n bhead = null;\n } else {\n bhead = btail._1;\n btail = btail._2;\n }\n break;\n\n case STEP_RESULT:\n if (util.isLeft(step)) {\n status = RETURN;\n fail = step;\n step = null;\n } else if (bhead === null) {\n status = RETURN;\n } else {\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n case CONTINUE:\n switch (step.tag) {\n case BIND:\n if (bhead) {\n btail = new Aff(CONS, bhead, btail);\n }\n bhead = step._2;\n status = CONTINUE;\n step = step._1;\n break;\n\n case PURE:\n if (bhead === null) {\n status = RETURN;\n step = util.right(step._1);\n } else {\n status = STEP_BIND;\n step = step._1;\n }\n break;\n\n case SYNC:\n status = STEP_RESULT;\n step = runSync(util.left, util.right, step._1);\n break;\n\n case ASYNC:\n status = PENDING;\n step = runAsync(util.left, step._1, function (result) {\n return function () {\n if (runTick !== localRunTick) {\n return;\n }\n runTick++;\n Scheduler.enqueue(function () {\n // It's possible to interrupt the fiber between enqueuing and\n // resuming, so we need to check that the runTick is still\n // valid.\n if (runTick !== localRunTick + 1) {\n return;\n }\n status = STEP_RESULT;\n step = result;\n run(runTick);\n });\n };\n });\n return;\n\n case THROW:\n status = RETURN;\n fail = util.left(step._1);\n step = null;\n break;\n\n // Enqueue the Catch so that we can call the error handler later on\n // in case of an exception.\n case CATCH:\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n // Enqueue the Bracket so that we can call the appropriate handlers\n // after resource acquisition.\n case BRACKET:\n bracketCount++;\n if (bhead === null) {\n attempts = new Aff(CONS, step, attempts, interrupt);\n } else {\n attempts = new Aff(CONS, step, new Aff(CONS, new Aff(RESUME, bhead, btail), attempts, interrupt), interrupt);\n }\n bhead = null;\n btail = null;\n status = CONTINUE;\n step = step._1;\n break;\n\n case FORK:\n status = STEP_RESULT;\n tmp = Fiber(util, supervisor, step._2);\n if (supervisor) {\n supervisor.register(tmp);\n }\n if (step._1) {\n tmp.run();\n }\n step = util.right(tmp);\n break;\n\n case SEQ:\n status = CONTINUE;\n step = sequential(util, supervisor, step._1);\n break;\n }\n break;\n\n case RETURN:\n bhead = null;\n btail = null;\n // If the current stack has returned, and we have no other stacks to\n // resume or finalizers to run, the fiber has halted and we can\n // invoke all join callbacks. Otherwise we need to resume.\n if (attempts === null) {\n status = COMPLETED;\n step = interrupt || fail || step;\n } else {\n // The interrupt status for the enqueued item.\n tmp = attempts._3;\n attempt = attempts._1;\n attempts = attempts._2;\n\n switch (attempt.tag) {\n // We cannot recover from an unmasked interrupt. Otherwise we should\n // continue stepping, or run the exception handler if an exception\n // was raised.\n case CATCH:\n // We should compare the interrupt status as well because we\n // only want it to apply if there has been an interrupt since\n // enqueuing the catch.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n status = RETURN;\n } else if (fail) {\n status = CONTINUE;\n step = attempt._2(util.fromLeft(fail));\n fail = null;\n }\n break;\n\n // We cannot resume from an unmasked interrupt or exception.\n case RESUME:\n // As with Catch, we only want to ignore in the case of an\n // interrupt since enqueing the item.\n if (interrupt && interrupt !== tmp && bracketCount === 0 || fail) {\n status = RETURN;\n } else {\n bhead = attempt._1;\n btail = attempt._2;\n status = STEP_BIND;\n step = util.fromRight(step);\n }\n break;\n\n // If we have a bracket, we should enqueue the handlers,\n // and continue with the success branch only if the fiber has\n // not been interrupted. If the bracket acquisition failed, we\n // should not run either.\n case BRACKET:\n bracketCount--;\n if (fail === null) {\n result = util.fromRight(step);\n // We need to enqueue the Release with the same interrupt\n // status as the Bracket that is initiating it.\n attempts = new Aff(CONS, new Aff(RELEASE, attempt._2, result), attempts, tmp);\n // We should only coninue as long as the interrupt status has not changed or\n // we are currently within a non-interruptable finalizer.\n if (interrupt === tmp || bracketCount > 0) {\n status = CONTINUE;\n step = attempt._3(result);\n }\n }\n break;\n\n // Enqueue the appropriate handler. We increase the bracket count\n // because it should not be cancelled.\n case RELEASE:\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n // It has only been killed if the interrupt status has changed\n // since we enqueued the item, and the bracket count is 0. If the\n // bracket count is non-zero then we are in a masked state so it's\n // impossible to be killed.\n if (interrupt && interrupt !== tmp && bracketCount === 0) {\n step = attempt._1.killed(util.fromLeft(interrupt))(attempt._2);\n } else if (fail) {\n step = attempt._1.failed(util.fromLeft(fail))(attempt._2);\n } else {\n step = attempt._1.completed(util.fromRight(step))(attempt._2);\n }\n fail = null;\n bracketCount++;\n break;\n\n case FINALIZER:\n bracketCount++;\n attempts = new Aff(CONS, new Aff(FINALIZED, step, fail), attempts, interrupt);\n status = CONTINUE;\n step = attempt._1;\n break;\n\n case FINALIZED:\n bracketCount--;\n status = RETURN;\n step = attempt._1;\n fail = attempt._2;\n break;\n }\n }\n break;\n\n case COMPLETED:\n for (var k in joins) {\n if (joins.hasOwnProperty(k)) {\n rethrow = rethrow && joins[k].rethrow;\n runEff(joins[k].handler(step));\n }\n }\n joins = null;\n // If we have an interrupt and a fail, then the thread threw while\n // running finalizers. This should always rethrow in a fresh stack.\n if (interrupt && fail) {\n setTimeout(function () {\n throw util.fromLeft(fail);\n }, 0);\n // If we have an unhandled exception, and no other fiber has joined\n // then we need to throw the exception in a fresh stack.\n } else if (util.isLeft(step) && rethrow) {\n setTimeout(function () {\n // Guard on reathrow because a completely synchronous fiber can\n // still have an observer which was added after-the-fact.\n if (rethrow) {\n throw util.fromLeft(step);\n }\n }, 0);\n }\n return;\n case SUSPENDED:\n status = CONTINUE;\n break;\n case PENDING: return;\n }\n }\n }", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_rc_util_es_raf__[\"a\" /* default */])(internalCallback);\n }\n }\n\n ids[myId] = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0_rc_util_es_raf__[\"a\" /* default */])(internalCallback);\n return myId;\n}", "async run(callback) {\n while (this._locked) {\n await this._notify;\n }\n this._locked = true;\n this._notify = new Future_1.Future();\n try {\n return await callback();\n }\n finally {\n this._locked = false;\n this._notify.resolve();\n }\n }", "runAfterInteractions(callback: Function) {\n invariant(\n typeof callback === 'function',\n 'Must specify a function to schedule.'\n );\n scheduleUpdate();\n _queue.push(callback);\n }", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = raf_id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf_default()(internalCallback);\n }\n }\n\n ids[myId] = raf_default()(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = requestAnimationFrame(internalCallback);\n }\n }\n\n ids[myId] = requestAnimationFrame(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = requestAnimationFrame(internalCallback);\n }\n }\n\n ids[myId] = requestAnimationFrame(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n }\n }\n\n ids[myId] = (0, _raf[\"default\"])(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = (0,rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__.default)(internalCallback);\n }\n }\n\n ids[myId] = (0,rc_util_es_raf__WEBPACK_IMPORTED_MODULE_0__.default)(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf__WEBPACK_IMPORTED_MODULE_0___default()(internalCallback);\n }\n }\n\n ids[myId] = raf__WEBPACK_IMPORTED_MODULE_0___default()(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf__WEBPACK_IMPORTED_MODULE_0___default()(internalCallback);\n }\n }\n\n ids[myId] = raf__WEBPACK_IMPORTED_MODULE_0___default()(internalCallback);\n return myId;\n}", "function wrapperRaf(callback) {\n var delayFrames =\n arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = wrapperRaf$1(internalCallback);\n }\n }\n\n ids[myId] = wrapperRaf$1(internalCallback);\n return myId;\n}", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _utils__WEBPACK_IMPORTED_MODULE_0__[\"noop\"]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _utils__WEBPACK_IMPORTED_MODULE_0__[\"noop\"]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _utils__WEBPACK_IMPORTED_MODULE_0__[\"noop\"]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _utils__WEBPACK_IMPORTED_MODULE_0__[\"noop\"]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__[\"r\" /* noop */]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__[\"r\" /* noop */]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function manualThunk(callback) {\n\t\tprocess.nextTick(function() {\n\t\t\tcallback(null, true)\n\t\t})\n\t}", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__[\"u\" /* noop */]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__[\"u\" /* noop */]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __WEBPACK_IMPORTED_MODULE_0__utils__[\"u\" /* noop */]; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function wrapperRaf(callback) {\n var delayFrames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = wrapperRaf$2(internalCallback);\n }\n }\n\n ids[myId] = wrapperRaf$2(internalCallback);\n return myId;\n}", "syncApply(context, func, args) {\n //noinspection JSUnresolvedVariable\n let fiber = Fiber.current;\n if (!fiber) {\n throw new Error(this.Errors.ERR_NO_FIBER);\n }\n\n // Create a closure to resume on callback\n let resumeCallback = function (err, data) {\n if (fiber.callbackAlreadyCalled) {\n throw new Error(\"Callback for function \" + func.name + \" called twice. Wait.for already resumed the execution.\");\n }\n\n fiber.callbackAlreadyCalled = true;\n fiber.err = err;\n fiber.data = data;\n\n if (fiber.yielded) {\n fiber.run();\n }\n };\n\n // Add resumeCallback to arguments\n args.push(resumeCallback);\n\n fiber.callbackAlreadyCalled = false;\n fiber.yielded = false;\n\n // Call async function/method...\n func.apply(context, args);\n\n // ...except callback was called before async fn return\n if (!fiber.callbackAlreadyCalled) {\n fiber.yielded = true;\n\n // Pause fiber, until callback => wait for results\n //noinspection JSUnresolvedFunction\n Fiber.yield();\n }\n\n if (fiber.err) {\n // Re-throw fiber errors\n throw fiber.err;\n }\n\n // Return data on success\n return fiber.data;\n }", "function run() {\n console.log(\"tick\");\n delayedCall(1, run)\n }", "function currCb(res, isErr) {\n\t if (effectSettled) {\n\t return;\n\t }\n\n\t effectSettled = true;\n\t cb.cancel = _utils.noop; // defensive measure\n\t if (sagaMonitor) {\n\t isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n\t }\n\n\t cb(res, isErr);\n\t }", "function raf(ctx, fn) {\n var callback = function () { fn(ctx); };\n return requestAnimationFrame\n ? requestAnimationFrame(callback)\n : setTimeout(callback, 16.66);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _utils.noop; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _utils.noop; // defensive measure\n if (sagaMonitor) {\n isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n }\n cb(res, isErr);\n }", "function currCb(err, res) {\n if (effectSettled) return;\n\n effectSettled = true;\n cb.cancel = _utils.noop; // defensive measure\n err ? monitor(monitorActions.effectRejected(effectId, err)) : monitor(monitorActions.effectResolved(effectId, res));\n\n cb(err, res);\n }", "run (f, callback) {\n f().then(() => {\n callback(null)\n }, (error) => {\n callback(new Error(error))\n }).catch((error) => {\n throw error\n })\n }", "run(callback) {\n callback = callback_wrappers_1.tryCallback(callback);\n if (this.run_cb) {\n return callback(new Error(this.log_prefix + \"Pending run callback already exists.\"));\n }\n this.run_cb = callback;\n // child guards itself against running twice\n // or running uninitialized, returns an exception in response\n this.send(intf.ParentMsgCode.run, {});\n }", "runCancel(self, cb) {\n const context = this.fiberContext(self);\n context.runAsync(cb || empty);\n return context.interruptAs(context.id);\n }", "function wrapperRaf(callback) {\n var delayFrames =\n arguments.length > 1 && arguments[1] !== undefined\n ? arguments[1]\n : 1;\n var myId = id++;\n var restFrames = delayFrames;\n\n function internalCallback() {\n restFrames -= 1;\n\n if (restFrames <= 0) {\n callback();\n delete ids[myId];\n } else {\n ids[myId] = raf__WEBPACK_IMPORTED_MODULE_0___default()(\n internalCallback,\n );\n }\n }\n\n ids[myId] = raf__WEBPACK_IMPORTED_MODULE_0___default()(\n internalCallback,\n );\n return myId;\n }", "function callback(cb){\n\n cb(1);\n}", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __chunk_1.noop; // defensive measure\n\n if (env.sagaMonitor) {\n if (isErr) {\n env.sagaMonitor.effectRejected(effectId, res);\n } else {\n env.sagaMonitor.effectResolved(effectId, res);\n }\n }\n\n if (isErr) {\n setCrashedEffect(effect);\n }\n\n cb(res, isErr);\n } // tracks down the current cancel", "function currCb(res, isErr) {\n\t if (effectSettled) {\n\t return;\n\t }\n\n\t effectSettled = true;\n\t cb.cancel = utils.noop; // defensive measure\n\n\t if (sagaMonitor) {\n\t isErr ? sagaMonitor.effectRejected(effectId, res) : sagaMonitor.effectResolved(effectId, res);\n\t }\n\n\t if (isErr) {\n\t crashedEffect = effect;\n\t }\n\n\t cb(res, isErr);\n\t } // tracks down the current cancel", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = __WEBPACK_IMPORTED_MODULE_4__chunk_e3ea3b33_js__[\"t\" /* x */]; // defensive measure\n\n if (env.sagaMonitor) {\n if (isErr) {\n env.sagaMonitor.effectRejected(effectId, res);\n } else {\n env.sagaMonitor.effectResolved(effectId, res);\n }\n }\n\n if (isErr) {\n setCrashedEffect(effect);\n }\n\n cb(res, isErr);\n } // tracks down the current cancel", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _io_6de156f3_js__WEBPACK_IMPORTED_MODULE_4__[\"t\"]; // defensive measure\n\n if (env.sagaMonitor) {\n if (isErr) {\n env.sagaMonitor.effectRejected(effectId, res);\n } else {\n env.sagaMonitor.effectResolved(effectId, res);\n }\n }\n\n if (isErr) {\n setCrashedEffect(effect);\n }\n\n cb(res, isErr);\n } // tracks down the current cancel", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = _io_6de156f3_js__WEBPACK_IMPORTED_MODULE_4__[\"t\"]; // defensive measure\n\n if (env.sagaMonitor) {\n if (isErr) {\n env.sagaMonitor.effectRejected(effectId, res);\n } else {\n env.sagaMonitor.effectResolved(effectId, res);\n }\n }\n\n if (isErr) {\n setCrashedEffect(effect);\n }\n\n cb(res, isErr);\n } // tracks down the current cancel", "function runCallbacks() {\n callbacks.forEach((callback) => {\n callback();\n });\n\n running = false;\n }", "function currCb(res, isErr) {\n if (effectSettled) {\n return;\n }\n\n effectSettled = true;\n cb.cancel = noop; // defensive measure\n\n if (env.sagaMonitor) {\n if (isErr) {\n env.sagaMonitor.effectRejected(effectId, res);\n } else {\n env.sagaMonitor.effectResolved(effectId, res);\n }\n }\n\n if (isErr) {\n setCrashedEffect(effect);\n }\n\n cb(res, isErr);\n } // tracks down the current cancel", "function doRun(){// run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if(calledRun)return;calledRun=true;Module['calledRun']=true;if(ABORT)return;initRuntime();preMain();readyPromiseResolve(Module);if(Module['onRuntimeInitialized'])Module['onRuntimeInitialized']();postRun();}", "function callback() {\n\t\t\tvar t = that,\n\t\t\t p = params,\n\t\t\t run = false,\n\t\t\t resched = (counter !== 1); // equiv to > 1\n\t\t\tif (flags.debounce) {\n\t\t\t\t// Debounce executes at end of last interval, last interval is\n\t\t\t\t// when there were no additional calls during the interval.\n\t\t\t\t// (Except in atStart mode, since the call was already made)\n\t\t\t\trun = !resched && !flags.atStart;\n\t\t\t} else {\n\t\t\t\t// In at end mode, we run every time and reschedule if there were\n\t\t\t\t// additional calls.\n\t\t\t\t// In atStart mode, we run if there were additional calls during\n\t\t\t\t// the interval, unless noTrail is active then we just block calls for\n\t\t\t\t// one interval and terminate to allow the base function to make\n\t\t\t\t// the call the next time it's called.\n\t\t\t\trun = !flags.atStart || (resched && !flags.noTrail);\n\t\t\t\tresched = resched && !flags.noTrail;\n\t\t\t}\n\t\t\tif (resched) {\n\t\t\t\tcounter = 1;\n\t\t\t\twindow.setTimeout(callback, delay);\n\t\t\t} else {\n\t\t\t\tcounter = 0;\n\t\t\t\tthat = params = null;\n\t\t\t}\n\t\t\tif (run) {\n\t\t\t\tf.apply(t, p);\n\t\t\t}\n\t\t}", "function runCallbacks() {\n\n\t\tcallbacks.forEach(function (callback) {\n\t\t\tcallback();\n\t\t});\n\n\t\trunning = false;\n\t}", "function recomputeCallback() {\n var len = TO_CALL.length;\n CALL_TIMEOUT = null;\n while (len--) {\n (TO_CALL.shift() || NOOP).call();\n }\n\n TO_CALL.added = {};\n}", "run () {\n if (!this.active) return this.fn()\n const lastShouldTrack = shouldTrack\n try {\n pushTarget(this)\n shouldTrack = true\n return this.fn()\n } finally {\n popTarget()\n shouldTrack = lastShouldTrack\n this.deferStop ? this.stop() : this.cleanupDeps()\n }\n }", "function runCallbacks() {\n callbacks.forEach(function (callback) {\n callback();\n });\n\n running = false;\n }", "function runCallbacks() {\n callbacks.forEach(function(callback) {\n callback();\n });\n\n running = false;\n }", "function runCallbacks() {\n callbacks.forEach(function(callback) {\n callback();\n });\n running = false;\n }", "runCallbacks(callbacks, args) {\r\n for (let i = 0; i < callbacks.length; i++) {\r\n if (typeof callbacks[i] !== 'function') continue;\r\n callbacks[i].apply(null, args);\r\n }\r\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function done() {\n if (!invoked) {\n invoked = true\n\n callback.apply(null, arguments)\n }\n }", "function runNow() {\n cancelTimer = null;\n start = null;\n runScheduledForNextTick = false;\n fn.apply(ctx, args);\n }", "function runNow() {\n cancelTimer = null;\n start = null;\n runScheduledForNextTick = false;\n fn.apply(ctx, args);\n }", "function example_1_normal(cb) {\n // TODO\n}", "function callRafCallbacks() {\n var rafCallbacksCopy = new Array(rafCallbacks.length);\n for (var i = 0; i < rafCallbacks.length; i++) {\n rafCallbacksCopy[i] = rafCallbacks[i];\n }\n rafCallbacks = [];\n for (var i = 0; i < rafCallbacksCopy.length; i++) {\n rafCallbacksCopy[i]();\n }\n }", "function done() {\n if (!invoked) {\n invoked = true;\n\n callback.apply(null, arguments);\n }\n }", "function thenRun() {\n\tconst args = Array.prototype.slice.call(arguments);\n\treturn () => run.apply(null, args);\n}", "function doRun() {\nif (Module['calledRun']) return; // run may have just been called while the async setStatus time below was happening\nModule['calledRun'] = true;\nif (ABORT) return;\nensureInitRuntime();\npreMain();\nif (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\npostRun();\n}", "runCallbacks(){\n if(this.state == 'FULLFILLED') {\n this.thenCbs.forEach(thenCb => {\n thenCb(this.value);// notifies all our thenable callbacks of our fulfilled value\n })\n this.thenCbs = [];\n }\n }", "function currCb(res,isErr){if(effectSettled){return;}effectSettled=true;cb.cancel=_chunk_e922c950_js__WEBPACK_IMPORTED_MODULE_4__[\"x\"];// defensive measure\nif(env.sagaMonitor){if(isErr){env.sagaMonitor.effectRejected(effectId,res);}else{env.sagaMonitor.effectResolved(effectId,res);}}if(isErr){setCrashedEffect(effect);}cb(res,isErr);}// tracks down the current cancel", "function doRun() {\n // run may have just been called through dependencies being fulfilled just in this very frame,\n // or while the async setStatus time below was happening\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n\n if (ABORT) return;\n\n initRuntime();\n\n preMain();\n\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n\n postRun();\n }", "up(cb, arg) {\n this.waitCount++\n return () => {\n cb(arg)\n this.waitCount--\n }\n }", "function sched(cb, ticks) {\n function fn() {\n if (--ticks)\n setImmediate(fn);\n else\n cb();\n }\n setImmediate(fn);\n}", "function longRun(callBack) {\n setTimeout(() => {\n var x = 0; \n while(x < 10000000000){\n x++;\n }\n callBack(\"All Done First Example !\");\n }, 0); \n}" ]
[ "0.6128974", "0.58031833", "0.58031833", "0.58031833", "0.58031833", "0.57707703", "0.57707703", "0.57490844", "0.57490844", "0.5741124", "0.5722254", "0.5722254", "0.5708513", "0.54968584", "0.5473654", "0.5473654", "0.54087937", "0.54087937", "0.5328791", "0.53110456", "0.52726835", "0.5261979", "0.5247714", "0.5247714", "0.5240513", "0.5240513", "0.5240513", "0.5240513", "0.5240513", "0.5240513", "0.5240513", "0.5240513", "0.5240513", "0.522493", "0.52147764", "0.52147764", "0.5199016", "0.51784635", "0.51784635", "0.51784635", "0.51784635", "0.5177451", "0.5177451", "0.5170696", "0.5156133", "0.5156133", "0.5156133", "0.5155749", "0.5138131", "0.5129137", "0.5126421", "0.5112945", "0.5101434", "0.5101434", "0.50733495", "0.50660104", "0.5049594", "0.50476235", "0.5043257", "0.50267154", "0.5012152", "0.49938157", "0.49936506", "0.4989777", "0.4989777", "0.49500212", "0.49425444", "0.4926213", "0.49203423", "0.4899574", "0.48894617", "0.4881895", "0.48762348", "0.48422438", "0.48401785", "0.4834722", "0.48287544", "0.48287544", "0.48287544", "0.48287544", "0.48287544", "0.48287544", "0.48287544", "0.48287544", "0.4805491", "0.4805491", "0.47877643", "0.4787597", "0.4787188", "0.47797927", "0.4775317", "0.4733725", "0.47111094", "0.46988308", "0.4685362", "0.46812284", "0.46750325" ]
0.53848475
20
Walks a tree, invoking all the cancelers. Returns the table of pending cancellation fibers.
function kill(error, par, cb) { var step = par; var head = null; var tail = null; var count = 0; var kills = {}; var tmp, kid; loop: while (true) { tmp = null; switch (step.tag) { case FORKED: if (step._3 === EMPTY) { tmp = fibers[step._1]; kills[count++] = tmp.kill(error, function (result) { return function () { count--; if (count === 0) { cb(result)(); } }; }); } // Terminal case. if (head === null) { break loop; } // Go down the right side of the tree. step = head._2; if (tail === null) { head = null; } else { head = tail._1; tail = tail._2; } break; case MAP: step = step._2; break; case APPLY: case ALT: if (head) { tail = new Aff(CONS, head, tail); } head = step; step = step._1; break; } } if (count === 0) { cb(util.right(void 0))(); } else { // Run the cancelation effects. We alias `count` because it's mutable. kid = 0; tmp = count; for (; kid < tmp; kid++) { kills[kid] = kills[kid](); } } return kills; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function fx_cancel_all(element) {\n var uid = $uid(element._);\n\n (running_fx[uid] || []).each('cancel');\n (scheduled_fx[uid] || []).splice(0);\n}", "function buildTree(table, lookups, tableIndex) {\n const results = [];\n const firstGlyphs = coverage_1.listGlyphsByIndex(table.coverage);\n for (const { glyphId } of firstGlyphs) {\n const firstInputClass = classDef_1.default(table.inputClassDef, glyphId);\n for (const [glyphId, inputClass] of firstInputClass.entries()) {\n // istanbul ignore next - invalid font\n if (inputClass === null) {\n continue;\n }\n const classSet = table.chainClassSet[inputClass];\n // If the class set is null there's nothing to do with this table.\n if (!classSet) {\n continue;\n }\n for (const [subIndex, subTable] of classSet.entries()) {\n const result = {\n individual: {},\n range: []\n };\n let currentEntries = helper_1.getInputTree(result, subTable.lookupRecords, lookups, 0, glyphId).map(({ entry, substitution }) => ({ entry, substitutions: [substitution] }));\n for (const [index, classNum] of subTable.input.entries()) {\n currentEntries = helper_1.processInputPosition(classDef_1.listClassGlyphs(table.inputClassDef, classNum), index + 1, currentEntries, subTable.lookupRecords, lookups);\n }\n for (const classNum of subTable.lookahead) {\n currentEntries = helper_1.processLookaheadPosition(classDef_1.listClassGlyphs(table.lookaheadClassDef, classNum), currentEntries);\n }\n for (const classNum of subTable.backtrack) {\n currentEntries = helper_1.processBacktrackPosition(classDef_1.listClassGlyphs(table.backtrackClassDef, classNum), currentEntries);\n }\n // When we get to the end, all of the entries we've accumulated\n // should have a lookup defined\n for (const { entry, substitutions } of currentEntries) {\n entry.lookup = {\n substitutions,\n index: tableIndex,\n subIndex,\n length: subTable.input.length + 1,\n contextRange: [\n -1 * subTable.backtrack.length,\n 1 + subTable.input.length + subTable.lookahead.length\n ]\n };\n }\n results.push(result);\n }\n }\n }\n return merge_1.default(results);\n}", "function killAllActions() {\n outstandingPendingActions = [];\n return outstandingPendingActions;\n }", "function CutAllInvites(treeID, CB) {\n // Whichever removal method, cut all mod and guest links\n Find(colls.CTRL_TREES, { _id: treeID }, CutAllInvitesParamPass(treeID, CB));\n }", "function findCousins(root, targetValue){\n //find all cousins of tragetValue in root binary tree\n\n // basically have a counter that counts the amount of parents a node has\n // if the node has the same amount of parents, \n // but the imediate parent is different, add it to the cousins list\n}", "getAllCallables() {\n //get callables from parent scopes\n let parentScope = this.getParentScope();\n if (parentScope) {\n return [...this.getOwnCallables(), ...parentScope.getAllCallables()];\n }\n else {\n return [...this.getOwnCallables()];\n }\n }", "function allPathsOfABinaryTree(root) {\n if (!root) {\n return [];\n }\n const result = [];\n dfs(root, [], result);\n return result;\n}", "computeTweetTree(data, cb) {\r\n cb(data);\r\n }", "walkTokens(tokens, callback) {\n let values = [];\n for (const token of tokens) {\n values = values.concat(callback.call(this, token));\n switch (token.type) {\n case \"table\": {\n for (const cell of token.header) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n for (const row of token.rows) {\n for (const cell of row) {\n values = values.concat(this.walkTokens(cell.tokens, callback));\n }\n }\n break;\n }\n case \"list\": {\n values = values.concat(this.walkTokens(token.items, callback));\n break;\n }\n default: {\n if (this.defaults.extensions && this.defaults.extensions.childTokens && this.defaults.extensions.childTokens[token.type]) {\n this.defaults.extensions.childTokens[token.type].forEach((childTokens) => {\n values = values.concat(this.walkTokens(token[childTokens], callback));\n });\n } else if (token.tokens) {\n values = values.concat(this.walkTokens(token.tokens, callback));\n }\n }\n }\n }\n return values;\n }", "function kill(error, par, cb) {\n var step = par;\n var head = null;\n var tail = null;\n var count = 0;\n var kills = {};\n var tmp, kid;\n\n loop: while (true) {\n tmp = null;\n\n switch (step.tag) {\n case FORKED:\n if (step._3 === EMPTY) {\n tmp = fibers[step._1];\n kills[count++] = tmp.kill(error, function (result) {\n return function () {\n count--;\n\n if (count === 0) {\n cb(result)();\n }\n };\n });\n } // Terminal case.\n\n\n if (head === null) {\n break loop;\n } // Go down the right side of the tree.\n\n\n step = head._2;\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n\n break;\n\n case MAP:\n step = step._2;\n break;\n\n case APPLY:\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = step;\n step = step._1;\n break;\n }\n }\n\n if (count === 0) {\n cb(util.right(void 0))();\n } else {\n // Run the cancelation effects. We alias `count` because it's mutable.\n kid = 0;\n tmp = count;\n\n for (; kid < tmp; kid++) {\n kills[kid] = kills[kid]();\n }\n }\n\n return kills;\n } // When a fiber resolves, we need to bubble back up the tree with the", "function treeProcessor(options) {\n const {\n nodeComplete,\n nodeStart,\n queueRunnerFactory,\n runnableIds,\n tree\n } = options;\n\n function isEnabled(node, parentEnabled) {\n return parentEnabled || runnableIds.indexOf(node.id) !== -1;\n }\n\n function getNodeHandler(node, parentEnabled) {\n const enabled = isEnabled(node, parentEnabled);\n return node.children\n ? getNodeWithChildrenHandler(node, enabled)\n : getNodeWithoutChildrenHandler(node, enabled);\n }\n\n function getNodeWithoutChildrenHandler(node, enabled) {\n return function fn(done = () => {}) {\n node.execute(done, enabled);\n };\n }\n\n function getNodeWithChildrenHandler(node, enabled) {\n return async function fn(done = () => {}) {\n nodeStart(node);\n await queueRunnerFactory({\n onException: error => node.onException(error),\n queueableFns: wrapChildren(node, enabled),\n userContext: node.sharedUserContext()\n });\n nodeComplete(node);\n done();\n };\n }\n\n function hasNoEnabledTest(node) {\n if (node.children) {\n return node.children.every(hasNoEnabledTest);\n }\n\n return node.disabled || node.markedPending;\n }\n\n function wrapChildren(node, enabled) {\n if (!node.children) {\n throw new Error('`node.children` is not defined.');\n }\n\n const children = node.children.map(child => ({\n fn: getNodeHandler(child, enabled)\n }));\n\n if (hasNoEnabledTest(node)) {\n return children;\n }\n\n return node.beforeAllFns.concat(children).concat(node.afterAllFns);\n }\n\n const treeHandler = getNodeHandler(tree, false);\n return treeHandler();\n}", "getTables() {\n return this.root.getChain().map(node => node.table).filter(table => table);\n }", "function tree(filter) {\n return __WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __awaiter */](this, void 0, void 0, function () {\n var _a;\n return __WEBPACK_IMPORTED_MODULE_0_tslib__[\"b\" /* __generator */](this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = convertToTree;\n return [4 /*yield*/, list(filter)];\n case 1: return [2 /*return*/, _a.apply(void 0, [_b.sent()])];\n }\n });\n });\n}", "function scan_tree(tree, max_code) {\n\t\tvar n, // iterates over all tree elements\n\t\t\tprevlen = -1, // last emitted length\n\t\t\tcurlen, // length of current code\n\t\t\tnextlen = tree[0].dl, // length of next code\n\t\t\tcount = 0, // repeat count of the current code\n\t\t\tmax_count = 7, // max repeat count\n\t\t\tmin_count = 4; // min repeat count\n\n\t\tif (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t}\n\t\ttree[max_code + 1].dl = 0xffff; // guard\n\n\t\tfor (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[n + 1].dl;\n\t\t\tif (++count < max_count && curlen === nextlen) {\n\t\t\t\tcontinue;\n\t\t\t} else if (count < min_count) {\n\t\t\t\tbl_tree[curlen].fc += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t\tif (curlen !== prevlen) {\n\t\t\t\t\tbl_tree[curlen].fc++;\n\t\t\t\t}\n\t\t\t\tbl_tree[REP_3_6].fc++;\n\t\t\t} else if (count <= 10) {\n\t\t\t\tbl_tree[REPZ_3_10].fc++;\n\t\t\t} else {\n\t\t\t\tbl_tree[REPZ_11_138].fc++;\n\t\t\t}\n\t\t\tcount = 0; prevlen = curlen;\n\t\t\tif (nextlen === 0) {\n\t\t\t\tmax_count = 138;\n\t\t\t\tmin_count = 3;\n\t\t\t} else if (curlen === nextlen) {\n\t\t\t\tmax_count = 6;\n\t\t\t\tmin_count = 3;\n\t\t\t} else {\n\t\t\t\tmax_count = 7;\n\t\t\t\tmin_count = 4;\n\t\t\t}\n\t\t}\n\t}", "function chainOfCommand(root){\n let CoC = [];\n let currentLevel = [root];\n while (currentLevel.length !== 0) {\n let nextLevel = [];\n currentLevel.forEach(node => {\n CoC.push(node.name);\n if(node.soldiersBelow){\n node.soldiersBelow.forEach(soldierNode=>{\n nextLevel.push(soldierNode);\n });\n }\n \n });\n currentLevel=nextLevel;\n }\n console.log(CoC);\n}", "async * getOperations() {\n for await (const num of this.getSequentBlockNum()) {\n const operations = await this.getBlockOperations(num);\n for (const op of operations) yield op;\n }\n }", "function buildTree(table, lookups, tableIndex) {\n const result = {\n individual: {},\n range: []\n };\n const firstGlyphs = coverage_1.listGlyphsByIndex(table.coverage);\n for (const { glyphId, index } of firstGlyphs) {\n const chainRuleSet = table.chainRuleSets[index];\n // If the chain rule set is null there's nothing to do with this table.\n if (!chainRuleSet) {\n continue;\n }\n for (const [subIndex, subTable] of chainRuleSet.entries()) {\n let currentEntries = helper_1.getInputTree(result, subTable.lookupRecords, lookups, 0, glyphId).map(({ entry, substitution }) => ({ entry, substitutions: [substitution] }));\n // We walk forward, then backward\n for (const [index, glyph] of subTable.input.entries()) {\n currentEntries = helper_1.processInputPosition([glyph], index + 1, currentEntries, subTable.lookupRecords, lookups);\n }\n for (const glyph of subTable.lookahead) {\n currentEntries = helper_1.processLookaheadPosition([glyph], currentEntries);\n }\n for (const glyph of subTable.backtrack) {\n currentEntries = helper_1.processBacktrackPosition([glyph], currentEntries);\n }\n // When we get to the end, insert the lookup information\n for (const { entry, substitutions } of currentEntries) {\n entry.lookup = {\n substitutions,\n length: subTable.input.length + 1,\n index: tableIndex,\n subIndex,\n contextRange: [\n -1 * subTable.backtrack.length,\n 1 + subTable.input.length + subTable.lookahead.length\n ]\n };\n }\n }\n }\n return result;\n}", "function kill(error, par, cb) {\n var step = par;\n var head = null;\n var tail = null;\n var count = 0;\n var kills = {};\n var tmp, kid;\n\n loop: while (true) {\n tmp = null;\n\n switch (step.tag) {\n case FORKED:\n if (step._3 === EMPTY) {\n tmp = fibers[step._1];\n kills[count++] = tmp.kill(error, function (result) {\n return function () {\n count--;\n if (count === 0) {\n cb(result)();\n }\n };\n });\n }\n // Terminal case.\n if (head === null) {\n break loop;\n }\n // Go down the right side of the tree.\n step = head._2;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n break;\n case MAP:\n step = step._2;\n break;\n case APPLY:\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = step;\n step = step._1;\n break;\n }\n }\n\n if (count === 0) {\n cb(util.right(void 0))();\n } else {\n // Run the cancelation effects. We alias `count` because it's mutable.\n kid = 0;\n tmp = count;\n for (; kid < tmp; kid++) {\n kills[kid] = kills[kid]();\n }\n }\n\n return kills;\n }", "function kill(error, par, cb) {\n var step = par;\n var head = null;\n var tail = null;\n var count = 0;\n var kills = {};\n var tmp, kid;\n\n loop: while (true) {\n tmp = null;\n\n switch (step.tag) {\n case FORKED:\n if (step._3 === EMPTY) {\n tmp = fibers[step._1];\n kills[count++] = tmp.kill(error, function (result) {\n return function () {\n count--;\n if (count === 0) {\n cb(result)();\n }\n };\n });\n }\n // Terminal case.\n if (head === null) {\n break loop;\n }\n // Go down the right side of the tree.\n step = head._2;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n break;\n case MAP:\n step = step._2;\n break;\n case APPLY:\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = step;\n step = step._1;\n break;\n }\n }\n\n if (count === 0) {\n cb(util.right(void 0))();\n } else {\n // Run the cancelation effects. We alias `count` because it's mutable.\n kid = 0;\n tmp = count;\n for (; kid < tmp; kid++) {\n kills[kid] = kills[kid]();\n }\n }\n\n return kills;\n }", "function getChildren(parent, t){\n\t\tvar filtered = typeof t === \"function\";\n\t\tvar descendants = [];\n\t\tif(typeof parent.widgets === \"function\"){\n\t\t\tlet children = parent.widgets();\n\t\t\tif(filtered) children = children.filter(t);\n\t\t\tdescendants = descendants.concat(children);\n\t\t}\n\t\treturn descendants;\n\t}", "getSymbolTable() {\n let node = this;\n while (node) {\n if (node.symbolTable) {\n return node.symbolTable;\n }\n node = node.parent;\n }\n }", "function prewalk(treeNode, iterator, childGetter) {\n var counter = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : { i: 0 };\n var depth = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n\n var i = counter.i++;\n iterator(treeNode, i, depth);\n (childGetter(treeNode, i, depth) || []).forEach(function (ea) {\n return prewalk(ea, iterator, childGetter, counter, depth + 1);\n });\n}", "runCancel(self, cb) {\n const context = this.fiberContext(self);\n context.runAsync(cb || empty);\n return context.interruptAs(context.id);\n }", "function scan_tree(tree, // the tree to be scanned\n\t\tmax_code // and its largest code of non zero frequency\n\t\t) {\n\t\t var n; // iterates over all tree elements\n \n\t\t var prevlen = -1; // last emitted length\n \n\t\t var curlen; // length of current code\n \n\t\t var nextlen = tree[0 * 2 + 1]; // length of next code\n \n\t\t var count = 0; // repeat count of the current code\n \n\t\t var max_count = 7; // max repeat count\n \n\t\t var min_count = 4; // min repeat count\n \n\t\t if (nextlen === 0) {\n\t\t\tmax_count = 138;\n\t\t\tmin_count = 3;\n\t\t }\n \n\t\t tree[(max_code + 1) * 2 + 1] = 0xffff; // guard\n \n\t\t for (n = 0; n <= max_code; n++) {\n\t\t\tcurlen = nextlen;\n\t\t\tnextlen = tree[(n + 1) * 2 + 1];\n \n\t\t\tif (++count < max_count && curlen == nextlen) {\n\t\t\t continue;\n\t\t\t} else if (count < min_count) {\n\t\t\t bl_tree[curlen * 2] += count;\n\t\t\t} else if (curlen !== 0) {\n\t\t\t if (curlen != prevlen) bl_tree[curlen * 2]++;\n\t\t\t bl_tree[REP_3_6 * 2]++;\n\t\t\t} else if (count <= 10) {\n\t\t\t bl_tree[REPZ_3_10 * 2]++;\n\t\t\t} else {\n\t\t\t bl_tree[REPZ_11_138 * 2]++;\n\t\t\t}\n \n\t\t\tcount = 0;\n\t\t\tprevlen = curlen;\n \n\t\t\tif (nextlen === 0) {\n\t\t\t max_count = 138;\n\t\t\t min_count = 3;\n\t\t\t} else if (curlen == nextlen) {\n\t\t\t max_count = 6;\n\t\t\t min_count = 3;\n\t\t\t} else {\n\t\t\t max_count = 7;\n\t\t\t min_count = 4;\n\t\t\t}\n\t\t }\n\t\t} // Construct the Huffman tree for the bit lengths and return the index in", "function resetChildFibers(workInProgress, lanes) {\n var child = workInProgress.child;\n while (child !== null) {\n resetWorkInProgress(child, lanes);\n child = child.sibling;\n }\n }", "get path() {\n let events = this._heimdall._events;\n let root = new HeimdallNode('root', 1e9);\n let currentNode = root;\n let nodeMap = new HashMap();\n let node;\n let top;\n let path = [];\n\n events.forEach(([op, name], i) => {\n switch (op) {\n case OP_START:\n node = new HeimdallNode(name, i);\n nodeMap.set(i, node);\n currentNode.addNode(node);\n currentNode = node;\n break;\n\n case OP_STOP:\n node = nodeMap.get(name);\n\n if (name !== currentNode._id) {\n // potentially throw the correct error (already stopped)\n if (node) {\n node.stop();\n } else {\n throw new Error(\"Cannot Stop, Attempting to stop a non-existent node!\");\n }\n throw new Error(\"Cannot Stop, Attempting to stop a node with an active child!\");\n }\n\n currentNode.stop();\n currentNode = currentNode.resumeNode;\n break;\n\n case OP_RESUME:\n node = nodeMap.get(name);\n node.resume(currentNode);\n currentNode = node;\n break;\n\n default:\n throw new Error(`HeimdallTree encountered an unknown OpCode '${op}' during path construction.`);\n }\n });\n\n top = currentNode;\n\n while (top !== undefined && top !== root) {\n path.unshift(top.name);\n top = top.parent;\n }\n\n return path;\n }", "flushPendingDeletes () {\n for (let i = 0, len = this.pendingDeletes.length; i !== len; ++i) {\n var pd = this.pendingDeletes[i];\n while (pd.nodesets.length) {\n this.removeNodes(pd.nodesets.pop());\n }\n if (pd.data && pd.data[PENDING_DELETE_INDEX_SYM] !== undefined) { delete pd.data[PENDING_DELETE_INDEX_SYM]; }\n }\n this.pendingDeletes = [];\n }", "function traverse(uid){\n\t\n\t\t\t//Before anything, see if the counter for max returns is at 0\n\t\t\t//If so, we immediately bypass the tree traversal\n\t\t\tif(counter === 0){\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\t// get the action object and loop through each of its children\n\t\t\tvar action = tree.actions[uid];\n\t\t\tfor(var i = 0; i < action.children.length; i++){\n\t\t\t\tvar actionUID = action.children[i];\n\t\t\t\tvar actionObj = tree.actions[actionUID];\n\t\n\t\t\t\t//evaluate each precondition for the child object\n\t\t\t\tvar trig = false;\n\t\t\t\tfor(var j = 0; j < actionObj.preconditions.length; j++){\n\t\t\t\t\tvar pre = actionObj.preconditions[j];\n\t\n\t\t\t\t\t//check to see if we get a false value\n\t\t\t\t\tif(!evaluatePrecondition(pre)){\n\t\t\t\t\t\ttrig = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//If we do get a false value, move on in the loop\n\t\t\t\tif(trig) continue;\n\t\n\t\t\t\t//Now check if the class has been added to the list in the past\n\t\t\t\t//If so, disregard this whole branch in our traversal\n\t\t\t\tfor(var k = 0; k < classes.length; k++){\n\t\t\t\t\tif(classes[k] === actionObj.cls) continue;\n\t\t\t\t}\n\t\n\t\t\t\t//We can assume now that we've succesfully passed the preconditions\n\t\t\t\t//This means we can add the action to the uid list\n\t\t\t\tuidList.push(actionUID);\n\t\n\t\t\t\t//If it's a leaf, we push it onto the return list and decrement the counter for max returns\n\t\t\t\t//If not a leaf, we keep traversing\n\t\t\t\tif(actionObj.isLeaf()){\n\t\t\t\t\tuids.push(uidList);\n\t\t\t\t\tuidList = [];\n\t\t\t\t\tif(actionObj.cls !== \"\"){\n\t\t\t\t\t\tclasses.push(actionObj.cls);\n\t\t\t\t\t}\n\t\t\t\t\tcounter--;\n\t\t\t\t} else {\n\t\t\t\t\ttraverse(actionUID);\n\t\t\t\t}\n\t\n\t\t\t\t\n\t\t\t}\n\t\t}", "function getTraceBackEdges(tbnodes) {\n tbnodes.reverse();\n const path = [];\n for (let i = 0; i < tbnodes.length - 1; i += 1) { // Don't iterate through the last node\n path.push(getEdgeConnecting(tbnodes[i], tbnodes[i + 1]));\n }\n return path;\n}", "async *walk() {\n for await (let relPath of this.walkRecursively('')) {\n yield relPath;\n }\n }", "_getAllActions (file) {\n let visited = {}\n let queue = [file]\n let actions = []\n while (queue.length > 0) {\n const next = queue.shift()\n const nextActions = this._actionsByInput[next]\n for (let id in nextActions) {\n if (!nextActions.hasOwnProperty(id)) continue\n if (visited[id]) continue\n const action = nextActions[id]\n visited[id] = true\n actions.push(action)\n queue = queue.concat(action.outputs)\n }\n }\n return actions\n }", "function scrapeTabManagedSubtree(walker) {\n var tabManagedElement = walker.currentNode,\n childFocus = tabManagedElement._tabContainer.childFocus,\n elementsFound = [];\n\n if (!childFocus) {\n return [];\n }\n\n walker.currentNode = childFocus;\n function scrapeSubtree() {\n if (walker.currentNode._tabContainer) {\n elementsFound = elementsFound.concat(scrapeTabManagedSubtree(walker));\n } else {\n // A child focus can have tabIndex = -1, so check the tabIndex before marking it as valid\n if (getTabIndex(walker.currentNode) >= 0) {\n elementsFound.push(walker.currentNode);\n }\n if (walker.firstChild()) {\n do {\n scrapeSubtree();\n } while (walker.nextSibling());\n walker.parentNode();\n }\n }\n }\n scrapeSubtree();\n walker.currentNode = tabManagedElement;\n\n return elementsFound;\n }", "function scrapeTabManagedSubtree(walker) {\n var tabManagedElement = walker.currentNode,\n childFocus = tabManagedElement._tabContainer.childFocus,\n elementsFound = [];\n\n if (!childFocus) {\n return [];\n }\n\n walker.currentNode = childFocus;\n function scrapeSubtree() {\n if (walker.currentNode._tabContainer) {\n elementsFound = elementsFound.concat(scrapeTabManagedSubtree(walker));\n } else {\n // A child focus can have tabIndex = -1, so check the tabIndex before marking it as valid\n if (getTabIndex(walker.currentNode) >= 0) {\n elementsFound.push(walker.currentNode);\n }\n if (walker.firstChild()) {\n do {\n scrapeSubtree();\n } while (walker.nextSibling());\n walker.parentNode();\n }\n }\n }\n scrapeSubtree();\n walker.currentNode = tabManagedElement;\n\n return elementsFound;\n }", "run(operation: TracerOperation) {\n if (this.current) {\n if (this.current instanceof Tracer) {\n this.current.cancel();\n } else {\n this.current.forEach((tracer) => {\n tracer.cancel();\n });\n }\n }\n\n ++this.runTag;\n this.current = operation;\n\n let operationPromise: Promise<any>;/* eslint-disable-line init-declarations */\n if (operation instanceof Tracer) {\n operation.teRunTag = this.runTag;\n operationPromise = operation.run();\n } else {\n operationPromise = Promise.all(operation.map((tracer) => {\n tracer.teRunTag = this.runTag;\n return tracer.run();\n }));\n }\n\n operationPromise.then(this.client);\n }", "function CancelAllTimeouts(win) {\n if (win && win._tm) {\n try {\n for (var i in win._tm) {\n win.clearTimeout(i);\n }\n win._tm = [];\n } catch (e) {\n DumpException(e);\n }\n }\n}", "function traverseTree(tree, onChar, onBranch) {\n\t\tfunction rec(tree, path) {\n\t\t\ttree.forEach(function(branch, i) {\n\t\t\t\tlet newPath = path + i.toString();\n\t\t\t\tif (typeof branch === \"string\") {\n\t\t\t\t\tif (onChar)\n\t\t\t\t\t\tonChar(tree, branch, i, newPath);\n\t\t\t\t} else {\n\t\t\t\t\tif (onBranch)\n\t\t\t\t\t\tonBranch(tree, branch, i, newPath);\n\t\t\t\t\trec(branch, newPath);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\trec(tree, \"\");\n\t}", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function buildTree(table, tableIndex) {\n const result = {\n individual: {},\n range: []\n };\n const glyphs = coverage_1.listGlyphsByIndex(table.coverage);\n for (const { glyphId, index } of glyphs) {\n const initialEntry = {};\n if (Array.isArray(glyphId)) {\n result.range.push({\n entry: initialEntry,\n range: glyphId\n });\n }\n else {\n result.individual[glyphId] = initialEntry;\n }\n let currentEntries = [{\n entry: initialEntry,\n substitutions: [table.substitutes[index]]\n }];\n // We walk forward, then backward\n for (const coverage of table.lookaheadCoverage) {\n currentEntries = helper_1.processLookaheadPosition(coverage_1.listGlyphsByIndex(coverage).map(glyph => glyph.glyphId), currentEntries);\n }\n for (const coverage of table.backtrackCoverage) {\n currentEntries = helper_1.processBacktrackPosition(coverage_1.listGlyphsByIndex(coverage).map(glyph => glyph.glyphId), currentEntries);\n }\n // When we get to the end, insert the lookup information\n for (const { entry, substitutions } of currentEntries) {\n entry.lookup = {\n substitutions,\n index: tableIndex,\n subIndex: 0,\n length: 1,\n contextRange: [\n -1 * table.backtrackCoverage.length,\n 1 + table.lookaheadCoverage.length\n ]\n };\n }\n }\n return result;\n}", "compileAll() {\n const app = this;\n const todo = [];\n const workspace = this.workspace;\n document.querySelectorAll('#toolbar .user div.gate').forEach(el => {\n const type = workspace.gates[el.dataset.type];\n if (!type.matrix) {\n todo.push(type);\n }\n });\n const loop = i => {\n if (i < todo.length) {\n const n = Math.pow(2, todo[i].circuit.nqubits);\n const I = new numeric.T(\n numeric.identity(n),\n numeric.rep([n, n], 0)\n );\n app.applyCircuit(todo[i].circuit, I, U => {\n todo[i].matrix = U;\n setTimeout(() => loop(i + 1), 1);\n });\n }\n };\n loop(0);\n }", "function Trees() {\n}", "function Trees() {\n}", "function all(parent) {\n var self = this;\n var children = parent.children;\n var length = children.length;\n var results = [];\n var index = -1;\n\n while (++index < length) {\n results[index] = self.visit(children[index], parent);\n }\n\n return results;\n}", "function getTrees() {\n let trees = [];\n for (let i = 1; i <= 5; i++) {\n let trunkElm = $(`#trunk-${i}`);\n let leavesElm = $(`#leaves-${i}`);\n let startPathTrunk = trunkElm.getAttribute(\"d\");\n let startPathLeaves = leavesElm.getAttribute(\"d\");\n let endPathTrunk = _getEndPath(startPathTrunk);\n let endPathLeaves = _getEndPath(startPathLeaves);\n let obj = {\n leaves: { elm: leavesElm, paths: [startPathLeaves, ...endPathLeaves] },\n trunk: { elm: trunkElm, paths: [startPathTrunk, ...endPathTrunk] },\n tilt: i <= 3 ? \"right\" : \"left\"\n };\n trees.push(obj);\n }\n return trees;\n}", "function walk(node, fn) {\n const queue = [node]\n\n while (queue.length) {\n const next = queue.shift()\n if (fn(next) !== false) {\n Array.from(next.children, (c) => queue.push(c))\n }\n }\n}", "function getChains() {\n var x, y,\n chains = [];\n\n for (x = 0; x < cols; ++x) {\n chains[x] = [];\n for (y = 0; y < rows; ++y) {\n chains[x][y] = checkChain(x, y);\n }\n }\n\n return chains;\n }", "function getSuccs (n) {\n /* Add successor nodes to queue. */\n n.succs.values().forEach(s => {\n if (s instanceof window.provvisDecl.Node &&\n window.nset.indexOf(s.parent.parent) === -1) {\n window.nset.push(s.parent.parent);\n window.nqueue.push(s.parent.parent);\n } else if (window.nset.indexOf(s) === -1) {\n window.nset.push(s);\n window.nqueue.push(s);\n }\n });\n }", "clearAllTimers() {\n for (let status of ROUND_TIMED_STATUSES) {\n this.clearFlag(status);\n }\n }", "function getTraceBackNodes(node) {\n let currentNode = node;\n let finished = false;\n const path = [];\n while (!finished) { // Add parents of nodes until we reach the start\n path.push(currentNode);\n if (startpages.indexOf(currentNode) !== -1) { // Check if we've reached the end\n finished = true;\n }\n currentNode = nodes.get(currentNode).parent; // Keep exploring with the node above.\n }\n return path;\n}", "function count_comp_fors(c, n) {\n var n_fors = 0;\n var is_async;\n count_comp_for: while (true) {\n // @meredydd needs new grammar\n // REQ(n, SYM.comp_for);\n // if (NCH(n) === 2) {\n // REQ(CHILD(n, 0), TOK.T_ASYNC);\n // n = CHILD(n, 1);\n // } else if (NCH(n) === 1) {\n // n = CHILD(n, 0);\n // } else {\n // Sk.asserts.fail(\"logic error in count_comp_fors\");\n // }\n // if (NCH(n) == (5)) {\n // n = CHILD(n, 4);\n // } else {\n // return n_fors;\n // }\n is_async = 0;\n n_fors++;\n REQ(n, SYM.comp_for);\n if (TYPE(CHILD(n, 0)) == TOK.T_ASYNC) {\n is_async = 1;\n }\n if (NCH(n) == (5 + is_async)) {\n n = CHILD(n, 4 + is_async);\n } else {\n return n_fors;\n }\n count_comp_iter: while (true) {\n REQ(n, SYM.comp_iter);\n n = CHILD(n, 0);\n if (TYPE(n) === SYM.comp_for) {\n continue count_comp_for;\n } else if (TYPE(n) === SYM.comp_if) {\n if (NCH(n) === 3) {\n n = CHILD(n, 2);\n continue count_comp_iter;\n } else {\n return n_fors;\n }\n }\n break;\n }\n break;\n }\n}", "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(symbols.TASK_CANCEL, false);\n }\n }", "breadthFirstForEach(cb) {\n const queue = [];\n queue.push(this);\n while (queue.length !== 0) {\n const currentNode = queue.shift();\n cb(currentNode.value);\n if (currentNode.left) queue.push(currentNode.left);\n if (currentNode.right) queue.push(currentNode.right); \n } \n }", "stopAllTasks() {\n for (let iTask = 0; iTask < this._scheduledTasks.length; ++iTask) {\n this._scheduledTasks[iTask].cancel();\n }\n\n this._scheduledTasks = [];\n }", "function tree_forEach(tree, f) {\n var scan = function(n) {\n if (!n) return\n\n f(n)\n\n if (n.forEach) n.forEach(scan)\n if (n.children) n.children.forEach(scan)\n if (n.funDecls) n.funDecls.forEach(scan)\n if (n.catchClauses) n.catchClauses.forEach(scan)\n if (n.cases) n.cases.forEach(scan)\n \n if (n.initializer) scan(n.initializer)\n if (n.body) scan(n.body)\n if (n.expression) scan(n.expression)\n if (n.condition) scan(n.condition)\n if (n.thenPart) scan(n.thenPart)\n if (n.elsePart) scan(n.elsePart)\n if (n.value) scan(n.value)\n if (n.block) scan(n.block)\n if (n.tryBlock) scan(n.tryBlock)\n if (n.exception) scan(n.exception)\n if (n.discriminant) scan(n.discriminant)\n if (n.caseLabel) scan(n.caseLabel)\n if (n.statements) scan(n.statements)\n if (n.setup) scan(n.setup)\n if (n.update) scan(n.update)\n if (n.varDecl) scan(n.varDecl)\n if (n.object) scan(n.object)\n if (n.iterator) scan(n.iterator)\n \n }\n scan(tree)\n}", "function gen_codes(tree, max_code, bl_count) // ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1);\n /* next code value for each bit length */\n\n var code = 0;\n /* running code value */\n\n var bits;\n /* bit index */\n\n var n;\n /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]\n /*.Len*/\n ;\n\n if (len === 0) {\n continue;\n }\n /* Now reverse the bits */\n\n\n tree[n * 2]\n /*.Code*/\n = bi_reverse(next_code[len]++, len); //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function buildTree(table, lookups, tableIndex) {\n const result = {\n individual: {},\n range: []\n };\n const firstGlyphs = coverage_1.listGlyphsByIndex(table.inputCoverage[0]);\n for (const { glyphId } of firstGlyphs) {\n let currentEntries = helper_1.getInputTree(result, table.lookupRecords, lookups, 0, glyphId).map(({ entry, substitution }) => ({ entry, substitutions: [substitution] }));\n for (const [index, coverage] of table.inputCoverage.slice(1).entries()) {\n currentEntries = helper_1.processInputPosition(coverage_1.listGlyphsByIndex(coverage).map(glyph => glyph.glyphId), index + 1, currentEntries, table.lookupRecords, lookups);\n }\n for (const coverage of table.lookaheadCoverage) {\n currentEntries = helper_1.processLookaheadPosition(coverage_1.listGlyphsByIndex(coverage).map(glyph => glyph.glyphId), currentEntries);\n }\n for (const coverage of table.backtrackCoverage) {\n currentEntries = helper_1.processBacktrackPosition(coverage_1.listGlyphsByIndex(coverage).map(glyph => glyph.glyphId), currentEntries);\n }\n // When we get to the end, all of the entries we've accumulated\n // should have a lookup defined\n for (const { entry, substitutions } of currentEntries) {\n entry.lookup = {\n substitutions,\n index: tableIndex,\n subIndex: 0,\n length: table.inputCoverage.length,\n contextRange: [\n -1 * table.backtrackCoverage.length,\n table.inputCoverage.length + table.lookaheadCoverage.length\n ]\n };\n }\n }\n return result;\n}", "getTree() {\n\n return [\n 'apply',\n this.address.getTree(),\n this.args.map(arg => arg.getTree()),\n this.block\n ];\n }", "function SetNextStates() {\n\n // Loop over all tree columns, excluding the borders\n for (var x = 1; x < TREE_COUNT_X - 1; x++) {\n\n // Loop over all tree rows, excluding the borders\n for (var y = 1; y < TREE_COUNT_Y - 1; y++) {\n\n // Create a variable to store the current tree\n var tree = document.getElementById(x + \"-\" + y);\n\n // If the tree is currently burning\n if (tree.style.backgroundColor === \"red\") {\n\n // Set it to be burnt in the next time step\n tree.setAttribute(\"data-nextBackground\", \"black\");\n\n } // end if\n\n // Otherwise, if the tree is not currently burning\n else {\n\n // Keep the tree in its current state for the next time step\n tree.setAttribute(\"data-nextBackground\", tree.style.backgroundColor);\n\n } // end else\n\n // If the tree will be non-burning in the next time step\n if (tree.getAttribute(\"data-nextBackground\") === \"green\") {\n\n // Try to spread the fire to the tree from each of its 4 neighbors\n TrySpread(tree);\n\n } // end if\n\n } // end for (var y)\n\n } // end for (var x)\n\n} // end function SetNextStates()", "function cancel() {\n\t /**\n\t We need to check both Running and Cancelled status\n\t Tasks can be Cancelled but still Running\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\n\t Ending with a Never result will propagate the Cancellation to all joiners\n\t **/\n\n\t end(TASK_CANCEL);\n\t }\n\t }", "function getChains () {\n var x, y,\n chains = [];\n for (x = 0; x < cols; x++) {\n chains[x] = [];\n for (y = 0; y < rows; y++) {\n chains[x][y] = checkChain(x, y);\n }\n }\n return chains;\n }", "function processChildThreatActors(actors) {\n var actorNodes = [];\n $(actors).each(function (index, actor) {\n\t var idRef = getObjIdRefStr($(xpFindSingle(STIXPattern.ta, actor)));\n\t if (idRef != \"\") {\n\t \tactorNodes.push(createTopDownIdRef(STIXType.ta, idRef));\n\t }\n\t});\n return actorNodes;\n}", "function getStack() {\n var result = [];\n for(var caller = arguments.callee.caller; caller; caller = caller.caller) {\n if (result.indexOf(caller) != -1) {\n result.push({name: \"recursive call can't be traced\"});\n break;\n }\n result.push(caller);\n };\n return result;\n}", "breadthFirstForEach(cb) {\n const queue = [];\n queue.push(this); // Insert first item into queue array\n const result = [];\n\n for (let i = 0; i < queue.length; i++) {\n cb(queue[i].value);\n result.push(queue[i].value)\n if (queue[i].left) {\n queue.push(queue[i].left);\n }\n if (queue[i].right) {\n queue.push(queue[i].right);\n }\n }\n return result;\n }", "*descendants(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n for (var [node, path] of Node.nodes(root, options)) {\n if (path.length !== 0) {\n // NOTE: we have to coerce here because checking the path's length does\n // guarantee that `node` is not a `Editor`, but TypeScript doesn't know.\n yield [node, path];\n }\n }\n }", "*descendants(root) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n for (var [node, path] of Node.nodes(root, options)) {\n if (path.length !== 0) {\n // NOTE: we have to coerce here because checking the path's length does\n // guarantee that `node` is not a `Editor`, but TypeScript doesn't know.\n yield [node, path];\n }\n }\n }", "getTree() {\n\n var result = ['cond',\n this.predicate.getTree(),\n this.consequent.getTree(),\n ];\n\n if (this.alternate) {\n result.push(this.alternate.getTree());\n }\n\n return result;\n }", "function resetChildFibers(workInProgress, renderExpirationTime) {\n var child = workInProgress.child;\n while (child !== null) {\n resetWorkInProgress(child, renderExpirationTime);\n child = child.sibling;\n }\n}", "function resetChildFibers(workInProgress, renderExpirationTime) {\n var child = workInProgress.child;\n while (child !== null) {\n resetWorkInProgress(child, renderExpirationTime);\n child = child.sibling;\n }\n}", "function getStack() {\n var result = [];\n for(var caller = arguments.callee.caller; caller; caller = caller.caller) {\n if (result.indexOf(caller) != -1) {\n result.push({name: \"recursive call can't be traced\"});\n break;\n }\n result.push(caller);\n };\n return result; \n}", "function getCallTree(thread, interval, callNodeInfo, implementationFilter, invertCallstack) {\n return timeCode('getCallTree', () => {\n const {\n callNodeTimes,\n callNodeChildCount,\n rootTotalTime,\n rootCount,\n } = computeCallTreeCountsAndTimings(\n thread,\n callNodeInfo,\n interval,\n invertCallstack\n );\n\n const jsOnly = implementationFilter === 'js';\n const isIntegerInterval = Math.floor(interval) === interval;\n\n return new CallTree(\n thread,\n callNodeInfo.callNodeTable,\n callNodeTimes,\n callNodeChildCount,\n rootTotalTime,\n rootCount,\n jsOnly,\n isIntegerInterval\n );\n });\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n const next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n let code = 0; /* running code value */\n let bits; /* bit index */\n let n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = code + bl_count[bits - 1] << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n const len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) {\n continue; \n }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "bfsTraversal(root) {\r\n const path = []\r\n if(root.children.length === 0)\r\n path.push(root.val)\r\n else {\r\n let bfsQueue = new Queue();\r\n bfsQueue.enqueue(root)\r\n while(bfsQueue.size!==0) {\r\n const currentNode = bfsQueue.dequeue()\r\n for (let child of currentNode.children) {\r\n bfsQueue.enqueue(child)\r\n }\r\n path.push(currentNode.val)\r\n }\r\n }\r\n return path\r\n }", "function parseCirTree(buffer) {\n return new _jbinary2['default'](buffer, _formatsBbi2['default'].TYPE_SET).read('CirTree');\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}", "function gen_codes(tree, max_code, bl_count)\n// ct_data *tree; /* the tree to decorate */\n// int max_code; /* largest code with non zero frequency */\n// ushf *bl_count; /* number of codes at each bit length */\n{\n var next_code = new Array(MAX_BITS + 1); /* next code value for each bit length */\n var code = 0; /* running code value */\n var bits; /* bit index */\n var n; /* code index */\n\n /* The distribution counts are first used to generate the code values\n * without bit reversal.\n */\n for (bits = 1; bits <= MAX_BITS; bits++) {\n next_code[bits] = code = (code + bl_count[bits - 1]) << 1;\n }\n /* Check that the bit counts in bl_count are consistent. The last code\n * must be all ones.\n */\n //Assert (code + bl_count[MAX_BITS]-1 == (1<<MAX_BITS)-1,\n // \"inconsistent bit counts\");\n //Tracev((stderr,\"\\ngen_codes: max_code %d \", max_code));\n\n for (n = 0; n <= max_code; n++) {\n var len = tree[n * 2 + 1]/*.Len*/;\n if (len === 0) { continue; }\n /* Now reverse the bits */\n tree[n * 2]/*.Code*/ = bi_reverse(next_code[len]++, len);\n\n //Tracecv(tree != static_ltree, (stderr,\"\\nn %3d %c l %2d c %4x (%x) \",\n // n, (isgraph(n) ? n : ' '), len, tree[n].Code, next_code[len]-1));\n }\n}" ]
[ "0.48802206", "0.4814092", "0.4814092", "0.4814092", "0.4814092", "0.4814092", "0.4814092", "0.47828734", "0.47828734", "0.44948825", "0.4485283", "0.44197616", "0.43601492", "0.4337563", "0.430427", "0.42914742", "0.42650235", "0.42486465", "0.42313492", "0.42152625", "0.42126733", "0.42009756", "0.41978237", "0.41822478", "0.417078", "0.41423267", "0.41379017", "0.41379017", "0.4132784", "0.4131242", "0.41308227", "0.41293177", "0.41280624", "0.4106566", "0.40914062", "0.40905985", "0.40897855", "0.4087326", "0.40730947", "0.40680197", "0.40577382", "0.40577382", "0.40554595", "0.40498966", "0.4029085", "0.40266716", "0.40266716", "0.40266716", "0.40266716", "0.40266716", "0.40266716", "0.4017223", "0.40041533", "0.40011588", "0.40011588", "0.39919075", "0.39915538", "0.39891952", "0.39650542", "0.39621907", "0.39598927", "0.39562687", "0.39498854", "0.3947969", "0.39475864", "0.39454883", "0.3941054", "0.39397505", "0.3936996", "0.393413", "0.39341292", "0.39337105", "0.39320603", "0.39318916", "0.392799", "0.39273024", "0.3926038", "0.3926038", "0.3921376", "0.39197344", "0.39197344", "0.39180866", "0.39163184", "0.39105952", "0.3904144", "0.39034712", "0.39008507", "0.39008507", "0.39008507", "0.39008507", "0.39008507", "0.39008507", "0.39008507", "0.39008507", "0.39008507" ]
0.40950757
38
When a fiber resolves, we need to bubble back up the tree with the result, computing the applicative nodes.
function join(result, head, tail) { var fail, step, lhs, rhs, tmp, kid; if (util.isLeft(result)) { fail = result; step = null; } else { step = result; fail = null; } loop: while (true) { lhs = null; rhs = null; tmp = null; kid = null; // We should never continue if the entire tree has been interrupted. if (interrupt !== null) { return; } // We've made it all the way to the root of the tree, which means // the tree has fully evaluated. if (head === null) { cb(fail || step)(); return; } // The tree has already been computed, so we shouldn't try to do it // again. This should never happen. // TODO: Remove this? if (head._3 !== EMPTY) { return; } switch (head.tag) { case MAP: if (fail === null) { head._3 = util.right(head._1(util.fromRight(step))); step = head._3; } else { head._3 = fail; } break; case APPLY: lhs = head._1._3; rhs = head._2._3; // If we have a failure we should kill the other side because we // can't possible yield a result anymore. if (fail) { head._3 = fail; tmp = true; kid = killId++; kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) { return function () { delete kills[kid]; if (tmp) { tmp = false; } else if (tail === null) { join(fail, null, null); } else { join(fail, tail._1, tail._2); } }; }); if (tmp) { tmp = false; return; } } else if (lhs === EMPTY || rhs === EMPTY) { // We can only proceed if both sides have resolved. return; } else { step = util.right(util.fromRight(lhs)(util.fromRight(rhs))); head._3 = step; } break; case ALT: lhs = head._1._3; rhs = head._2._3; // We can only proceed if both have resolved or we have a success if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) { return; } // If both sides resolve with an error, we should continue with the // first error if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) { fail = step === lhs ? rhs : lhs; step = null; head._3 = fail; } else { head._3 = step; tmp = true; kid = killId++; // Once a side has resolved, we need to cancel the side that is still // pending before we can continue. kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) { return function () { delete kills[kid]; if (tmp) { tmp = false; } else if (tail === null) { join(step, null, null); } else { join(step, tail._1, tail._2); } }; }); if (tmp) { tmp = false; return; } } break; } if (tail === null) { head = null; } else { head = tail._1; tail = tail._2; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n\n if (supervisor) {\n supervisor.register(tmp);\n }\n\n }\n\n break;\n\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n } // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n\n\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n\n }\n } // Keep a reference to the tree root so it can be cancelled.\n\n\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n } // Cancels the entire tree. If there are already subtrees being canceled,", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nif((typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null){newChild=newChild.props.children;}// Handle object types\nvar isObject=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_CALL_TYPE:return placeSingleChild(reconcileSingleCall(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_RETURN_TYPE:return placeSingleChild(reconcileSingleReturn(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionalComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nif((typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null){newChild=newChild.props.children;}// Handle object types\nvar isObject=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_CALL_TYPE:return placeSingleChild(reconcileSingleCall(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_RETURN_TYPE:return placeSingleChild(reconcileSingleReturn(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionalComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,lanes){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=typeof newChild==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=typeof newChild==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,lanes));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,lanes));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,lanes));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,lanes);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,lanes);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType(returnFiber);}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase Block:case FunctionComponent:case ForwardRef:case SimpleMemoComponent:{{{throw Error((getComponentName(returnFiber.type)||'Component')+\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");}}}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,lanes){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=_typeof(newChild)==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=_typeof(newChild)==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,lanes));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,lanes));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,lanes));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,lanes);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,lanes);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType(returnFiber);}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase Block:case FunctionComponent:case ForwardRef:case SimpleMemoComponent:{{{throw Error((getComponentName(returnFiber.type)||'Component')+\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");}}}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n\t// If the top level item is an array, we treat it as a set of children,\n\t// not as a fragment. Nested arrays on the other hand will be treated as\n\t// fragment nodes. Recursion happens at the normal flow.\n\t// Handle top level unkeyed fragments as if they were arrays.\n\t// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n\t// We treat the ambiguous cases above the same.\n\tif((typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null){newChild=newChild.props.children;}// Handle object types\n\tvar isObject=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_CALL_TYPE:return placeSingleChild(reconcileSingleCall(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_RETURN_TYPE:return placeSingleChild(reconcileSingleReturn(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'){// If the new child is undefined, and the return fiber is a composite\n\t// component, throw an error. If Fiber return types are disabled,\n\t// we already threw above.\n\tswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\n\tbreak;}}}// Intentionally fall through to the next case, which handles both\n\t// functions and classes\n\t// eslint-disable-next-lined no-fallthrough\n\tcase FunctionalComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\n\treturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=(typeof newChild==='undefined'?'undefined':_typeof(newChild))==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionalComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=typeof newChild==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=typeof newChild==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=typeof newChild==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=typeof newChild==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionComponent:{var Component=returnFiber.type;{{throw Error((Component.displayName||Component.name||'Component')+\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");}}}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=typeof newChild==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=typeof newChild==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionComponent:{var Component=returnFiber.type;{{throw Error((Component.displayName||Component.name||'Component')+\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");}}}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=typeof newChild==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=typeof newChild==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionalComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=_typeof(newChild)==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=_typeof(newChild)==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionComponent:{var Component=returnFiber.type;invariant(false,'%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.',Component.displayName||Component.name||'Component');}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function reconcileChildFibers(returnFiber,currentFirstChild,newChild,expirationTime){// This function is not recursive.\n// If the top level item is an array, we treat it as a set of children,\n// not as a fragment. Nested arrays on the other hand will be treated as\n// fragment nodes. Recursion happens at the normal flow.\n// Handle top level unkeyed fragments as if they were arrays.\n// This leads to an ambiguity between <>{[...]}</> and <>...</>.\n// We treat the ambiguous cases above the same.\nvar isUnkeyedTopLevelFragment=_typeof(newChild)==='object'&&newChild!==null&&newChild.type===REACT_FRAGMENT_TYPE&&newChild.key===null;if(isUnkeyedTopLevelFragment){newChild=newChild.props.children;}// Handle object types\nvar isObject=_typeof(newChild)==='object'&&newChild!==null;if(isObject){switch(newChild.$$typeof){case REACT_ELEMENT_TYPE:return placeSingleChild(reconcileSingleElement(returnFiber,currentFirstChild,newChild,expirationTime));case REACT_PORTAL_TYPE:return placeSingleChild(reconcileSinglePortal(returnFiber,currentFirstChild,newChild,expirationTime));}}if(typeof newChild==='string'||typeof newChild==='number'){return placeSingleChild(reconcileSingleTextNode(returnFiber,currentFirstChild,''+newChild,expirationTime));}if(isArray$1(newChild)){return reconcileChildrenArray(returnFiber,currentFirstChild,newChild,expirationTime);}if(getIteratorFn(newChild)){return reconcileChildrenIterator(returnFiber,currentFirstChild,newChild,expirationTime);}if(isObject){throwOnInvalidObjectType(returnFiber,newChild);}{if(typeof newChild==='function'){warnOnFunctionType();}}if(typeof newChild==='undefined'&&!isUnkeyedTopLevelFragment){// If the new child is undefined, and the return fiber is a composite\n// component, throw an error. If Fiber return types are disabled,\n// we already threw above.\nswitch(returnFiber.tag){case ClassComponent:{{var instance=returnFiber.stateNode;if(instance.render._isMockFunction){// We allow auto-mocks to proceed as if they're returning null.\nbreak;}}}// Intentionally fall through to the next case, which handles both\n// functions and classes\n// eslint-disable-next-lined no-fallthrough\ncase FunctionComponent:{var Component=returnFiber.type;{{throw Error((Component.displayName||Component.name||'Component')+\"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");}}}}}// Remaining cases are all treated as empty.\nreturn deleteRemainingChildren(returnFiber,currentFirstChild);}", "function performUnitOfWork(fiber) {\n const isFunctionComponent =\n fiber.type instanceof Function\n if (isFunctionComponent) {\n updateFunctionComponent(fiber)\n } else {\n updateHostComponent(fiber)\n }\n\n // we return the first child \n // and then if no child siblings\n if (fiber.child) {\n return fiber.child;\n }\n let nextFiber = fiber;\n while (nextFiber) {\n if (nextFiber.sibling) {\n return nextFiber.sibling;\n }\n nextFiber = nextFiber.parent;\n }\n}", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n\t // This function is not recursive.\n\t // If the top level item is an array, we treat it as a set of children,\n\t // not as a fragment. Nested arrays on the other hand will be treated as\n\t // fragment nodes. Recursion happens at the normal flow.\n\t\n\t // Handle top level unkeyed fragments as if they were arrays.\n\t // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n\t // We treat the ambiguous cases above the same.\n\t if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n\t newChild = newChild.props.children;\n\t }\n\t\n\t // Handle object types\n\t var isObject = typeof newChild === 'object' && newChild !== null;\n\t\n\t if (isObject) {\n\t switch (newChild.$$typeof) {\n\t case REACT_ELEMENT_TYPE:\n\t return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\t\n\t case REACT_CALL_TYPE:\n\t return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n\t case REACT_RETURN_TYPE:\n\t return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n\t case REACT_PORTAL_TYPE:\n\t return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n\t }\n\t }\n\t\n\t if (typeof newChild === 'string' || typeof newChild === 'number') {\n\t return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n\t }\n\t\n\t if (isArray$1(newChild)) {\n\t return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n\t }\n\t\n\t if (getIteratorFn(newChild)) {\n\t return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n\t }\n\t\n\t if (isObject) {\n\t throwOnInvalidObjectType(returnFiber, newChild);\n\t }\n\t\n\t {\n\t if (typeof newChild === 'function') {\n\t warnOnFunctionType();\n\t }\n\t }\n\t if (typeof newChild === 'undefined') {\n\t // If the new child is undefined, and the return fiber is a composite\n\t // component, throw an error. If Fiber return types are disabled,\n\t // we already threw above.\n\t switch (returnFiber.tag) {\n\t case ClassComponent:\n\t {\n\t {\n\t var instance = returnFiber.stateNode;\n\t if (instance.render._isMockFunction) {\n\t // We allow auto-mocks to proceed as if they're returning null.\n\t break;\n\t }\n\t }\n\t }\n\t // Intentionally fall through to the next case, which handles both\n\t // functions and classes\n\t // eslint-disable-next-lined no-fallthrough\n\t case FunctionalComponent:\n\t {\n\t var Component = returnFiber.type;\n\t invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n\t }\n\t }\n\t }\n\t\n\t // Remaining cases are all treated as empty.\n\t return deleteRemainingChildren(returnFiber, currentFirstChild);\n\t }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle object types\n var isObject = \"object\" == typeof newChild && null !== newChild;\n if (isObject) switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_CALL_TYPE:\n return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_RETURN_TYPE:\n return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n if (\"string\" == typeof newChild || \"number\" == typeof newChild) return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, \"\" + newChild, expirationTime));\n if (isArray$1(newChild)) return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n if (getIteratorFn(newChild)) return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n if (isObject && throwOnInvalidObjectType(returnFiber, newChild), void 0 === newChild) // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent$7:\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent$2:\n var Component = returnFiber.type;\n invariant(!1, \"%s(...): Nothing was returned from render. This usually means a \" + \"return statement is missing. Or, to render nothing, \" + \"return null.\", Component.displayName || Component.name || \"Component\");\n }\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error((Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error((Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error((Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error((Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\");\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n (function () {\n {\n {\n throw ReactError(Error((Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\"));\n }\n }\n })();\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n (function () {\n {\n {\n throw ReactError(Error((Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\"));\n }\n }\n })();\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n (function () {\n {\n {\n throw ReactError(Error((Component.displayName || Component.name || 'Component') + '(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.'));\n }\n }\n })();\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n (function () {\n {\n {\n throw ReactError(Error((Component.displayName || Component.name || 'Component') + '(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.'));\n }\n }\n })();\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n var isUnkeyedTopLevelFragment = typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null;\n\n if (isUnkeyedTopLevelFragment) {\n newChild = newChild.props.children;\n } // Handle object types\n\n\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n\n if (typeof newChild === 'undefined' && !isUnkeyedTopLevelFragment) {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n\n case FunctionComponent:\n {\n var Component = returnFiber.type;\n\n {\n {\n throw Error( (Component.displayName || Component.name || 'Component') + \"(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.\" );\n }\n }\n }\n }\n } // Remaining cases are all treated as empty.\n\n\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_CALL_TYPE:\n return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_RETURN_TYPE:\n return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_CALL_TYPE:\n return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_RETURN_TYPE:\n return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_CALL_TYPE:\n return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_RETURN_TYPE:\n return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }", "function reconcileChildFibers(returnFiber, currentFirstChild, newChild, expirationTime) {\n // This function is not recursive.\n // If the top level item is an array, we treat it as a set of children,\n // not as a fragment. Nested arrays on the other hand will be treated as\n // fragment nodes. Recursion happens at the normal flow.\n\n // Handle top level unkeyed fragments as if they were arrays.\n // This leads to an ambiguity between <>{[...]}</> and <>...</>.\n // We treat the ambiguous cases above the same.\n if (typeof newChild === 'object' && newChild !== null && newChild.type === REACT_FRAGMENT_TYPE && newChild.key === null) {\n newChild = newChild.props.children;\n }\n\n // Handle object types\n var isObject = typeof newChild === 'object' && newChild !== null;\n\n if (isObject) {\n switch (newChild.$$typeof) {\n case REACT_ELEMENT_TYPE:\n return placeSingleChild(reconcileSingleElement(returnFiber, currentFirstChild, newChild, expirationTime));\n\n case REACT_CALL_TYPE:\n return placeSingleChild(reconcileSingleCall(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_RETURN_TYPE:\n return placeSingleChild(reconcileSingleReturn(returnFiber, currentFirstChild, newChild, expirationTime));\n case REACT_PORTAL_TYPE:\n return placeSingleChild(reconcileSinglePortal(returnFiber, currentFirstChild, newChild, expirationTime));\n }\n }\n\n if (typeof newChild === 'string' || typeof newChild === 'number') {\n return placeSingleChild(reconcileSingleTextNode(returnFiber, currentFirstChild, '' + newChild, expirationTime));\n }\n\n if (isArray$1(newChild)) {\n return reconcileChildrenArray(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (getIteratorFn(newChild)) {\n return reconcileChildrenIterator(returnFiber, currentFirstChild, newChild, expirationTime);\n }\n\n if (isObject) {\n throwOnInvalidObjectType(returnFiber, newChild);\n }\n\n {\n if (typeof newChild === 'function') {\n warnOnFunctionType();\n }\n }\n if (typeof newChild === 'undefined') {\n // If the new child is undefined, and the return fiber is a composite\n // component, throw an error. If Fiber return types are disabled,\n // we already threw above.\n switch (returnFiber.tag) {\n case ClassComponent:\n {\n {\n var instance = returnFiber.stateNode;\n if (instance.render._isMockFunction) {\n // We allow auto-mocks to proceed as if they're returning null.\n break;\n }\n }\n }\n // Intentionally fall through to the next case, which handles both\n // functions and classes\n // eslint-disable-next-lined no-fallthrough\n case FunctionalComponent:\n {\n var Component = returnFiber.type;\n invariant(false, '%s(...): Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null.', Component.displayName || Component.name || 'Component');\n }\n }\n }\n\n // Remaining cases are all treated as empty.\n return deleteRemainingChildren(returnFiber, currentFirstChild);\n }" ]
[ "0.635805", "0.635805", "0.6323152", "0.6305275", "0.6305275", "0.6305275", "0.6305275", "0.6305275", "0.6305275", "0.61049896", "0.61049896", "0.61034787", "0.61016244", "0.6070817", "0.60692793", "0.6054034", "0.6044368", "0.60350144", "0.60350144", "0.60350144", "0.60342264", "0.6032506", "0.59821874", "0.5752749", "0.57359457", "0.56422466", "0.56422466", "0.56422466", "0.56422466", "0.56422466", "0.56422466", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5628396", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5624182", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.5622144", "0.56214976", "0.56214976", "0.56214976", "0.56214976" ]
0.0
-1
Walks the applicative tree, substituting nonapplicative nodes with `FORKED` nodes. In this tree, all applicative nodes use the `_3` slot as a mutable slot for memoization. In an unresolved state, the `_3` slot is `EMPTY`. In the cases of `ALT` and `APPLY`, we always walk the left side first, because both operations are leftassociative. As we `RETURN` from those branches, we then walk the right side.
function run() { var status = CONTINUE; var step = par; var head = null; var tail = null; var tmp, fid; loop: while (true) { tmp = null; fid = null; switch (status) { case CONTINUE: switch (step.tag) { case MAP: if (head) { tail = new Aff(CONS, head, tail); } head = new Aff(MAP, step._1, EMPTY, EMPTY); step = step._2; break; case APPLY: if (head) { tail = new Aff(CONS, head, tail); } head = new Aff(APPLY, EMPTY, step._2, EMPTY); step = step._1; break; case ALT: if (head) { tail = new Aff(CONS, head, tail); } head = new Aff(ALT, EMPTY, step._2, EMPTY); step = step._1; break; default: // When we hit a leaf value, we suspend the stack in the `FORKED`. // When the fiber resolves, it can bubble back up the tree. fid = fiberId++; status = RETURN; tmp = step; step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY); tmp = Fiber(util, supervisor, tmp); tmp.onComplete({ rethrow: false, handler: resolve(step) })(); fibers[fid] = tmp; if (supervisor) { supervisor.register(tmp); } } break; case RETURN: // Terminal case, we are back at the root. if (head === null) { break loop; } // If we are done with the right side, we need to continue down the // left. Otherwise we should continue up the stack. if (head._1 === EMPTY) { head._1 = step; status = CONTINUE; step = head._2; head._2 = EMPTY; } else { head._2 = step; step = head; if (tail === null) { head = null; } else { head = tail._1; tail = tail._2; } } } } // Keep a reference to the tree root so it can be cancelled. root = step; for (fid = 0; fid < fiberId; fid++) { fibers[fid].run(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reduceLeftmostOutermost(exp) {\n if (exp[0] === \"var\") {\n return [false, exp];\n } else if (exp[0] === \"lam\") {\n var [reduceHappened, reducedBody] = reduceLeftmostOutermost(exp[2]);\n return [reduceHappened, [exp[0], exp[1], reducedBody]];\n } else {\n // app\n if (exp[1][0] === \"lam\") {\n // yes !\n return [true, sub(exp[1][2], exp[1][1], exp[2])];\n } else {\n var [reduceHappened, reducedBody] = reduceLeftmostOutermost(exp[1]);\n if (reduceHappened) {\n return [reduceHappened, [\"app\", reducedBody, exp[2]]];\n } else {\n var [reduceHappened2, reducedBody2] = reduceLeftmostOutermost(exp[2]);\n return [reduceHappened2, [\"app\", exp[1], reducedBody2]];\n }\n }\n }\n}", "function findApp(node) {\n // Exit early if we've crossed roots from |result|.\n if (result.root !== node.root) {\n return null;\n }\n\n // This node is actually in a different backing C++ tree though at\n // this internal js layer, we merge the trees so that it is rooted to\n // the desktop tree (same as |result|).\n if (node.appId) {\n return node;\n }\n\n for (const child of node.children) {\n const found = findApp(child);\n if (found) {\n return found;\n }\n }\n\n return null;\n }", "function A(f, args) {\n while(true) {\n f = E(f);\n if(f instanceof F) {\n f = E(B(f));\n }\n if(f instanceof PAP) {\n // f is a partial application\n if(args.length == f.arity) {\n // Saturated application\n return f.f.apply(null, f.args.concat(args));\n } else if(args.length < f.arity) {\n // Application is still unsaturated\n return new PAP(f.f, f.args.concat(args));\n } else {\n // Application is oversaturated; \n var f2 = f.f.apply(null, f.args.concat(args.slice(0, f.arity)));\n args = args.slice(f.arity);\n f = B(f2);\n }\n } else if(f instanceof Function) {\n if(args.length == f.length) {\n return f.apply(null, args);\n } else if(args.length < f.length) {\n return new PAP(f, args);\n } else {\n var f2 = f.apply(null, args.slice(0, f.length));\n args = args.slice(f.length);\n f = B(f2);\n }\n } else {\n return f;\n }\n }\n}", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null; // We should never continue if the entire tree has been interrupted.\n\n if (interrupt !== null) {\n return;\n } // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n\n\n if (head === null) {\n cb(fail || step)();\n return;\n } // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n\n\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n\n break;\n\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3; // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function ()\n /* unused */\n {\n return function () {\n delete kills[kid];\n\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n\n break;\n\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3; // We can only proceed if both have resolved or we have a success\n\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n } // If both sides resolve with an error, we should continue with the\n // first error\n\n\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++; // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function ()\n /* unused */\n {\n return function () {\n delete kills[kid];\n\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function join(result, head, tail) {\n var fail, step, lhs, rhs, tmp, kid;\n\n if (util.isLeft(result)) {\n fail = result;\n step = null;\n } else {\n step = result;\n fail = null;\n }\n\n loop: while (true) {\n lhs = null;\n rhs = null;\n tmp = null;\n kid = null;\n\n // We should never continue if the entire tree has been interrupted.\n if (interrupt !== null) {\n return;\n }\n\n // We've made it all the way to the root of the tree, which means\n // the tree has fully evaluated.\n if (head === null) {\n cb(fail || step)();\n return;\n }\n\n // The tree has already been computed, so we shouldn't try to do it\n // again. This should never happen.\n // TODO: Remove this?\n if (head._3 !== EMPTY) {\n return;\n }\n\n switch (head.tag) {\n case MAP:\n if (fail === null) {\n head._3 = util.right(head._1(util.fromRight(step)));\n step = head._3;\n } else {\n head._3 = fail;\n }\n break;\n case APPLY:\n lhs = head._1._3;\n rhs = head._2._3;\n // If we have a failure we should kill the other side because we\n // can't possible yield a result anymore.\n if (fail) {\n head._3 = fail;\n tmp = true;\n kid = killId++;\n\n kills[kid] = kill(early, fail === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(fail, null, null);\n } else {\n join(fail, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n } else if (lhs === EMPTY || rhs === EMPTY) {\n // We can only proceed if both sides have resolved.\n return;\n } else {\n step = util.right(util.fromRight(lhs)(util.fromRight(rhs)));\n head._3 = step;\n }\n break;\n case ALT:\n lhs = head._1._3;\n rhs = head._2._3;\n // We can only proceed if both have resolved or we have a success\n if (lhs === EMPTY && util.isLeft(rhs) || rhs === EMPTY && util.isLeft(lhs)) {\n return;\n }\n // If both sides resolve with an error, we should continue with the\n // first error\n if (lhs !== EMPTY && util.isLeft(lhs) && rhs !== EMPTY && util.isLeft(rhs)) {\n fail = step === lhs ? rhs : lhs;\n step = null;\n head._3 = fail;\n } else {\n head._3 = step;\n tmp = true;\n kid = killId++;\n // Once a side has resolved, we need to cancel the side that is still\n // pending before we can continue.\n kills[kid] = kill(early, step === lhs ? head._2 : head._1, function (/* unused */) {\n return function () {\n delete kills[kid];\n if (tmp) {\n tmp = false;\n } else if (tail === null) {\n join(step, null, null);\n } else {\n join(step, tail._1, tail._2);\n }\n };\n });\n\n if (tmp) {\n tmp = false;\n return;\n }\n }\n break;\n }\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }", "function Applicative$8(M) {\n var S = [M[0]];\n var map = function (f, param) {\n return /* tuple */[\n param[0],\n _1(f, param[1])\n ];\n };\n var apply = function (param, param$1) {\n return /* tuple */[\n _2(S[/* append */0], param[0], param$1[0]),\n _1(param[1], param$1[1])\n ];\n };\n var pure = function (a) {\n return /* tuple */[\n M[/* empty */1],\n a\n ];\n };\n return /* module */[\n /* map */map,\n /* apply */apply,\n /* pure */pure\n ];\n }", "function parseBinaryExpression$962() {\n var expr$1342, token$1343, prec$1344, previousAllowIn$1345, stack$1346, right$1347, operator$1348, left$1349, i$1350;\n previousAllowIn$1345 = state$893.allowIn;\n state$893.allowIn = true;\n expr$1342 = parseUnaryExpression$960();\n token$1343 = lookahead$891;\n prec$1344 = binaryPrecedence$961(token$1343, previousAllowIn$1345);\n if (prec$1344 === 0) {\n return expr$1342;\n }\n token$1343.prec = prec$1344;\n lex$925();\n stack$1346 = [\n expr$1342,\n token$1343,\n parseUnaryExpression$960()\n ];\n while ((prec$1344 = binaryPrecedence$961(lookahead$891, previousAllowIn$1345)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack$1346.length > 2 && prec$1344 <= stack$1346[stack$1346.length - 2].prec) {\n right$1347 = stack$1346.pop();\n operator$1348 = stack$1346.pop().value;\n left$1349 = stack$1346.pop();\n stack$1346.push(delegate$888.createBinaryExpression(operator$1348, left$1349, right$1347));\n }\n // Shift.\n token$1343 = lex$925();\n token$1343.prec = prec$1344;\n stack$1346.push(token$1343);\n stack$1346.push(parseUnaryExpression$960());\n }\n state$893.allowIn = previousAllowIn$1345;\n // Final reduce to clean-up the stack.\n i$1350 = stack$1346.length - 1;\n expr$1342 = stack$1346[i$1350];\n while (i$1350 > 1) {\n expr$1342 = delegate$888.createBinaryExpression(stack$1346[i$1350 - 1].value, stack$1346[i$1350 - 2], expr$1342);\n i$1350 -= 2;\n }\n return expr$1342;\n }", "function preOrder_iterative(tree, index) {\n \n var stack = [];\n \n while (stack.length > 0 || !isUndefined(tree[index])) {\n if (!isUndefined(tree[index])) {\n console.log(tree[index]);\n \n var rightNode = right(index);\n \n if (!isUndefined(tree[rightNode])) {\n stack.push(rightNode);\n }\n \n index = left(index);\n } else {\n index = stack.pop();\n }\n }\n}", "function parseBinaryExpression()\n\t\t{\n\t\t\tvar marker, markers, expr, token, prec, stack, right, operator, left, i;\n\t\t\tmarker = lookahead;\n\t\t\tleft = parseUnaryExpression();\n\t\t\tif (left === PlaceHolders.ArrowParameterPlaceHolder)\n\t\t\t{\n\t\t\t\treturn left;\n\t\t\t}\n\t\t\ttoken = lookahead;\n\t\t\tprec = binaryPrecedence(token, state.allowIn);\n\t\t\tif (prec === 0)\n\t\t\t{\n\t\t\t\treturn left;\n\t\t\t}\n\t\t\ttoken.prec = prec;\n\t\t\tlex();\n\t\t\tmarkers = [ marker, lookahead ];\n\t\t\tright = parseUnaryExpression();\n\t\t\tstack = [ left, token, right ];\n\t\t\twhile ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0)\n\t\t\t{\n\t\t\t\t// Reduce: make a binary expression from the three topmost entries.\n\t\t\t\twhile ((stack.length > 2) && (prec <= stack[stack.length - 2].prec))\n\t\t\t\t{\n\t\t\t\t\tright = stack.pop();\n\t\t\t\t\toperator = stack.pop().value;\n\t\t\t\t\tleft = stack.pop();\n\t\t\t\t\tmarkers.pop();\n\t\t\t\t\texpr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n\t\t\t\t\tstack.push(expr);\n\t\t\t\t}\n\t\t\t\t// Shift.\n\t\t\t\ttoken = lex();\n\t\t\t\ttoken.prec = prec;\n\t\t\t\tstack.push(token);\n\t\t\t\tmarkers.push(lookahead);\n\t\t\t\texpr = parseUnaryExpression();\n\t\t\t\tstack.push(expr);\n\t\t\t}\n\t\t\t// Final reduce to clean-up the stack.\n\t\t\ti = stack.length - 1;\n\t\t\texpr = stack[i];\n\t\t\tmarkers.pop();\n\t\t\twhile (i > 1)\n\t\t\t{\n\t\t\t\texpr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n\t\t\t\ti -= 2;\n\t\t\t}\n\t\t\treturn expr;\n\t\t}", "apply(fn) {\n // overload custom middleware to allow context free transitions\n let root = this.root.assign({ data: { middleware: defaultMiddleware } });\n // focus on current tree and apply the function to it\n let nextRoot = over(this.lens, fn, root);\n // put the original middleware into the next root tree so the middleware will\n return map(tree => {\n if (tree.is(nextRoot)) {\n return nextRoot.assign({ data: { middleware: this.root.data.middleware } });\n } else {\n return tree;\n }\n }, nextRoot);\n }", "function _gobbleBinaryExpression(context) {\n var node, biop, prec, stack, biop_info, left, right, i, cur_biop;\n\n // First, try to get the leftmost thing\n // Then, check to see if there's a binary operator operating on that leftmost thing\n left = _gobbleToken(context);\n biop = _gobbleBinaryOp(context);\n\n // If there wasn't a binary operator, just return the leftmost node\n if (!biop) {\n return left;\n }\n\n // Otherwise, we need to start a stack to properly place the binary operations in their\n // precedence structure\n biop_info = { value: biop, prec: _binaryPrecedence(biop) };\n\n right = _gobbleToken(context);\n if (!right) {\n _throwError('Expected expression after ' + biop, context.index);\n }\n stack = [left, biop_info, right];\n\n // Properly deal with precedence using [recursive descent](http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm)\n // eslint-disable-next-line no-cond-assign\n while ((biop = _gobbleBinaryOp(context))) {\n prec = _binaryPrecedence(biop);\n\n if (prec === 0) {\n break;\n }\n biop_info = { value: biop, prec: prec };\n\n cur_biop = biop;\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n biop = stack.pop().value;\n left = stack.pop();\n node = _createBinaryExpression(biop, left, right, context);\n stack.push(node);\n }\n\n node = _gobbleToken(context);\n if (!node) {\n _throwError('Expected expression after ' + cur_biop, context.index);\n }\n stack.push(biop_info, node);\n }\n\n i = stack.length - 1;\n node = stack[i];\n while (i > 1) {\n node = _createBinaryExpression(stack[i - 1].value, stack[i - 2], node, context);\n i -= 2;\n }\n return node;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n if (left === PlaceHolders.ArrowParameterPlaceHolder) {\n return left;\n }\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function ParentChainFavRecursion(idx, newFavObj, setModifier) {\n var parentIdx = branches[idx].parent;\n if(parentIdx > -1) {\n var type = branches[idx].type,\n otherSide = (type == Consts.argTypes.CORROB) ? Consts.argTypes.REFUTE : Consts.argTypes.CORROB,\n argSibs = branches[parentIdx].children[type];\n\n var val = 0,\n pct = 0,\n count = 0,\n entries = 0,\n avg = 0;\n\n // Get mod & vis str rating averages for type of given arg.\n for(var i = 0; i < argSibs.length; i++) {\n var arg = branches[argSibs[i]];\n var ratingAtSib = isCtrl ? arg.rating[ratedAs] : arg.rating;\n\n //* This is stopping fav calculations from continuing upward toward the root.\n if(ratingAtSib.entries > 0) {\n count++;\n entries += ratingAtSib.entries;\n val = ratingAtSib.cumuValue / ratingAtSib.entries;\n pct = (val / 5) * 100;\n\n // Pass full favourability object (before type distinction) into function, and use when appropriate.\n var favObj = (argSibs[i] == idx) ? newFavObj : isCtrl ? arg.favour[ratedAs] : arg.favour;\n if(favObj[Consts.argTypes.CORROB].entries > 0 || favObj[Consts.argTypes.REFUTE].entries > 0) {\n // Include all child entries having made any influence\n entries = entries + favObj[Consts.argTypes.CORROB].entries + favObj[Consts.argTypes.REFUTE].entries;\n \n // If the corrob avg >= refute avg by any amount, maintain 100% positive rating avg.\n // Otherwise, refute > corrob avg by any amount, reduce the rating avg by the proportional difference\n var argSupportFactor = 1;\n if(favObj[Consts.argTypes.REFUTE].avg > favObj[Consts.argTypes.CORROB].avg) {\n var avgTotal = favObj[Consts.argTypes.CORROB].avg + favObj[Consts.argTypes.REFUTE].avg,\n rightAvgPct = favObj[Consts.argTypes.REFUTE].avg / avgTotal;\n // With right being > left, the above calc is guarenteed to be > .5, and we want to know how much greater,\n // as a percentage of the remaining 0.5, so we double the remainder, then take that amount off 1 (100% potential support).\n argSupportFactor = 1 - ((rightAvgPct - 0.5) * 2);\n\n // argSupportFactor = (100 - (favObj[Consts.argTypes.REFUTE].avg - favObj[Consts.argTypes.CORROB].avg)) * .01;\n }\n \n pct *= argSupportFactor;\n }\n avg += pct;\n }\n }\n if(count > 0)\n avg /= count;\n\n var nextAvgObj = [{}, {}];\n nextAvgObj[type].entries = entries;\n nextAvgObj[type].avg = avg;\n var favAtType = isCtrl ? branches[parentIdx].favour[ratedAs] : branches[parentIdx].favour;\n nextAvgObj[otherSide].entries = favAtType[otherSide].entries;\n nextAvgObj[otherSide].avg = favAtType[otherSide].avg;\n \n // Set newly calculated direct data\n var typeString = isCtrl ? ratedAs + '.' : '';\n setModifier.$set['branches.' + parentIdx + '.favour.' + typeString + type + '.entries'] = entries;\n setModifier.$set['branches.' + parentIdx + '.favour.' + typeString + type + '.avg'] = avg;\n\n console.log('Parent index to change: ' + parentIdx);\n console.log('entries: ' + entries);\n console.log('avg: ' + avg);\n console.log('Next avg object being sent in:');\n console.log(nextAvgObj);\n\n ParentChainFavRecursion(parentIdx, nextAvgObj, setModifier);\n }\n else {\n Update(isCtrl ? colls.CTRL_TREES : colls.OPEN_TREES, { _id: treeID }, setModifier, {}, function(nModified) {});\n }\n }", "liftUp(node, parentIndex, side) {\n let parentElement = node.popAt(Math.floor(this.base / 2));\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node, Math.floor(this.base / 2))\n );\n let newNode = this.split(node);\n\n if (!node.hasParent()) {\n node.parent = new BNode();\n let nodeParentIsLeafOldValue = node.parent.isLeaf;\n node.parent.isLeaf = false;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.isLeaf = nodeParentIsLeafOldValue;\n });\n }\n\n if (this.root === node) {\n let rootOldValue = this.root;\n this.root = node.parent;\n this.addAtLastIndexOfCallStack(() => {\n this.root = rootOldValue\n });\n }\n\n let newNodeParentOldValue = newNode.parent;\n newNode.parent = node.parent;\n this.addAtLastIndexOfCallStack(() => {\n newNode.parent = newNodeParentOldValue;\n });\n\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = node;\n this.addAtLastIndexOfCallStack(() => {\n parentElement.leftChild = parentElementLeftChildOldValue\n });\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = newNode;\n this.addAtLastIndexOfCallStack(() => {\n parentElement.rightChild = parentElementRightChildOldValue;\n });\n\n if (node.parent.empty() || (parentIndex === node.parent.size() - 1 && side === true)) {\n node.parent.addLast(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, node.parent)\n );\n } else {\n if (node.parent.hasLeftChildAt(parentIndex)) {\n let nodeParentAtLeftChildOldValue = node.parent.at(parentIndex).leftChild;\n node.parent.at(parentIndex).leftChild = parentElement.rightChild;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.at(parentIndex).leftChild = nodeParentAtLeftChildOldValue;\n });\n }\n\n if (node.parent.hasRightChildAt(parentIndex - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentIndex - 1).rightChild;\n node.parent.at(parentIndex - 1).rightChild = parentElement.leftChild;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.at(parentIndex - 1).rightChild = nodeParentAtRightChildOldValue;\n });\n }\n\n node.parent.addAt(parentIndex, parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddAt.bind(this, node.parent, parentIndex)\n );\n }\n\n let nodeParentIsLeafOldValue = node.parent.isLeaf;\n node.parent.isLeaf = false;\n this.addAtLastIndexOfCallStack(() => {\n node.parent.isLeaf = nodeParentIsLeafOldValue;\n })\n }", "ap (aFn) { \n //return this.fmap(aFn.value)\n return aFn.chain(fn => Right.of(fn(this.value)))\n }", "function liftA2(func) {\n return function runApplicativeFunc(a, b) {\n return b.ap(a.map(func));\n };\n}", "function firstWalk(v) {\n\t var children = v.children,\n\t siblings = v.parent.children,\n\t w = v.i ? siblings[v.i - 1] : null;\n\n\t if (children.length) {\n\t layout_treeShift(v);\n\t var midpoint = (children[0].z + children[children.length - 1].z) / 2;\n\n\t if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t v.m = v.z - midpoint;\n\t } else {\n\t v.z = midpoint;\n\t }\n\t } else if (w) {\n\t v.z = w.z + separation(v._, w._);\n\t }\n\n\t v.parent.A = apportion(v, w, v.parent.A || siblings[0]);\n\t } // SECOND WALK", "preOrder() { //DLR\n let results = [];\n\n let _walk = node => {\n results.push(node.value); //executing code\n if(node.left) _walk(node.left); //go left - if node,left is null, we are at a leaf - traversing\n if(node.right) _walk(node.right); // go right - if node.right=null then we are at a leaf - traversing\n };\n console.log(_walk(this.root));\n _walk(this.root); // for whiteboard use ll.root instead of this.root, unless using a class constructor\n return results;\n }", "function recusion() {\n // some serious code\n recusion();\n}", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = inheritCoverGrammar(parseUnaryExpression);\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n isAssignmentTarget = isBindingElement = false;\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = isolateCoverGrammar(parseUnaryExpression);\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = isolateCoverGrammar(parseUnaryExpression);\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n var bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "performReduction() {\n var reduced_expr = this.reduce();\n if (reduced_expr !== undefined && reduced_expr != this) { // Only swap if reduction returns something > null.\n\n console.warn('performReduction with ', this, reduced_expr);\n\n if (!this.stage) return;\n\n this.stage.saveState();\n Logger.log('state-save', this.stage.toString());\n\n // Log the reduction.\n let reduced_expr_str;\n if (reduced_expr === null)\n reduced_expr_str = '()';\n else if (Array.isArray(reduced_expr))\n reduced_expr_str = reduced_expr.reduce((prev,curr) => (prev + curr.toString() + ' '), '').trim();\n else reduced_expr_str = reduced_expr.toString();\n Logger.log('reduction', { 'before':this.toString(), 'after':reduced_expr_str });\n\n var parent = this.parent ? this.parent : this.stage;\n if (reduced_expr) reduced_expr.ignoreEvents = this.ignoreEvents; // the new expression should inherit whatever this expression was capable of as input\n parent.swap(this, reduced_expr);\n\n // Check if parent expression is now reducable.\n if (reduced_expr && reduced_expr.parent) {\n var try_reduce = reduced_expr.parent.reduceCompletely();\n if (try_reduce != reduced_expr.parent && try_reduce !== null) {\n Animate.blink(reduced_expr.parent, 400, [0,1,0], 1);\n }\n }\n\n if (reduced_expr)\n reduced_expr.update();\n\n return reduced_expr;\n }\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = inheritCoverGrammar(parseUnaryExpression);\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n isAssignmentTarget = isBindingElement = false;\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = isolateCoverGrammar(parseUnaryExpression);\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = isolateCoverGrammar(parseUnaryExpression);\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = inheritCoverGrammar(parseUnaryExpression);\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n isAssignmentTarget = isBindingElement = false;\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = isolateCoverGrammar(parseUnaryExpression);\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = isolateCoverGrammar(parseUnaryExpression);\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = inheritCoverGrammar(parseUnaryExpression);\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n isAssignmentTarget = isBindingElement = false;\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = isolateCoverGrammar(parseUnaryExpression);\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = isolateCoverGrammar(parseUnaryExpression);\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = inheritCoverGrammar(parseUnaryExpression);\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n isAssignmentTarget = isBindingElement = false;\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = isolateCoverGrammar(parseUnaryExpression);\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = isolateCoverGrammar(parseUnaryExpression);\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = inheritCoverGrammar(parseUnaryExpression);\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n isAssignmentTarget = isBindingElement = false;\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = isolateCoverGrammar(parseUnaryExpression);\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = isolateCoverGrammar(parseUnaryExpression);\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n var bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ? updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) : getPureFunctionReturnValue(lView, bindingIndex + 3);\n }", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "function pureFunction3Internal(lView, bindingRoot, slotOffset, pureFn, exp1, exp2, exp3, thisArg) {\n const bindingIndex = bindingRoot + slotOffset;\n return bindingUpdated3(lView, bindingIndex, exp1, exp2, exp3) ?\n updateBinding(lView, bindingIndex + 3, thisArg ? pureFn.call(thisArg, exp1, exp2, exp3) : pureFn(exp1, exp2, exp3)) :\n getPureFunctionReturnValue(lView, bindingIndex + 3);\n}", "function leaf(state, ply) {\n if (ply === 0) {\n evaluations = evaluations + 1;\n return { value: evaluationFunction(state) };\n }\n var actions = getActionsFunction(state);\n if (actions.length === 0) {\n evaluations = evaluations + 1;\n return { value: evaluationFunction(state) };\n }\n return { actions: actions };\n }", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n \n previousAllowIn = state.allowIn;\n state.allowIn = true;\n \n marker = markerCreate();\n left = parseUnaryExpression();\n \n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n \n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n \n stack = [left, token, right];\n \n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n \n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n \n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n \n state.allowIn = previousAllowIn;\n \n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n \n return expr;\n }", "function Function$prototype$ap(f) {\n var apply = this;\n return function(x) { return f (x) (apply (x)); };\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n if (supervisor) {\n supervisor.register(tmp);\n }\n }\n break;\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n }\n // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n }\n }\n\n // Keep a reference to the tree root so it can be cancelled.\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n }", "function fnTraversal(root, node, preorder, postorder) {\n\t\tnode.childnodes.forEach((child, i) => { //iterate over next deep level\n\t\t\tpreorder(root, node, child, i) && fnTraversal(root, child, preorder, postorder); //preorder = cut/poda\n\t\t\tpostorder(root, node, child, i);\n\t\t});\n\t\treturn self;\n\t}", "function A(f, args) {\n while(true) {\n f = E(f);\n if(f instanceof Function) {\n if(args.length === f.length) {\n return f.apply(null, args);\n } else if(args.length < f.length) {\n return new PAP(f, args);\n } else {\n var f2 = f.apply(null, args.slice(0, f.length));\n args = args.slice(f.length);\n f = B(f2);\n }\n } else if(f instanceof PAP) {\n if(args.length === f.arity) {\n return f.f.apply(null, f.args.concat(args));\n } else if(args.length < f.arity) {\n return new PAP(f.f, f.args.concat(args));\n } else {\n var f2 = f.f.apply(null, f.args.concat(args.slice(0, f.arity)));\n args = args.slice(f.arity);\n f = B(f2);\n }\n } else {\n return f;\n }\n }\n}", "function inOrder_iterative(tree, index) {\n \n var stack = [];\n \n while (stack.length > 0 || !isUndefined(tree[index])) {\n if (!isUndefined(tree[index])) {\n stack.push(index);\n index = left(index);\n } else {\n index = stack.pop();\n console.log(tree[index]);\n index = right(index);\n }\n }\n}", "function testTree3() {\n var e = schema.getEmployee();\n var j = schema.getJob();\n\n var treeBefore =\n 'order_by(Employee.id)\\n' +\n '-select(value_pred(Employee.salary))\\n' +\n '--cross_product\\n' +\n '---table_access(Employee)\\n' +\n '---table_access(Job)\\n';\n\n var treeAfter =\n 'order_by(Employee.id)\\n' +\n '-cross_product\\n' +\n '--select(value_pred(Employee.salary))\\n' +\n '---table_access(Employee)\\n' +\n '--table_access(Job)\\n';\n\n var orderByNode = new lf.proc.OrderByNode(\n [{column: e.id, order: lf.Order.ASC}]);\n var selectNode = new lf.proc.SelectNode(e.salary.gt(10));\n orderByNode.addChild(selectNode);\n var crossProductNode = new lf.proc.CrossProductNode();\n selectNode.addChild(crossProductNode);\n crossProductNode.addChild(new lf.proc.TableAccessNode(e));\n crossProductNode.addChild(new lf.proc.TableAccessNode(j));\n var rootNodeBefore = orderByNode;\n assertEquals(treeBefore, lf.tree.toString(rootNodeBefore));\n\n var pass = new lf.proc.PushDownSelectionsPass();\n var rootNodeAfter = pass.rewrite(rootNodeBefore);\n assertEquals(treeAfter, lf.tree.toString(rootNodeAfter));\n}", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n\n marker = markerCreate();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n state.allowIn = previousAllowIn;\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n\n marker = markerCreate();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n state.allowIn = previousAllowIn;\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n\n marker = markerCreate();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n state.allowIn = previousAllowIn;\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n\n marker = markerCreate();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n state.allowIn = previousAllowIn;\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n\n marker = markerCreate();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n state.allowIn = previousAllowIn;\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, previousAllowIn, stack, right, operator, left, i,\n marker, markers;\n\n previousAllowIn = state.allowIn;\n state.allowIn = true;\n\n marker = markerCreate();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, previousAllowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, markerCreate()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, previousAllowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n markerApply(marker, expr);\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(markerCreate());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n state.allowIn = previousAllowIn;\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n markerApply(marker, expr);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n\t var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n\t marker = lookahead;\n\t left = parseUnaryExpression();\n\n\t token = lookahead;\n\t prec = binaryPrecedence(token, state.allowIn);\n\t if (prec === 0) {\n\t return left;\n\t }\n\t token.prec = prec;\n\t lex();\n\n\t markers = [marker, lookahead];\n\t right = parseUnaryExpression();\n\n\t stack = [left, token, right];\n\n\t while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n\t // Reduce: make a binary expression from the three topmost entries.\n\t while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n\t right = stack.pop();\n\t operator = stack.pop().value;\n\t left = stack.pop();\n\t markers.pop();\n\t expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n\t stack.push(expr);\n\t }\n\n\t // Shift.\n\t token = lex();\n\t token.prec = prec;\n\t stack.push(token);\n\t markers.push(lookahead);\n\t expr = parseUnaryExpression();\n\t stack.push(expr);\n\t }\n\n\t // Final reduce to clean-up the stack.\n\t i = stack.length - 1;\n\t expr = stack[i];\n\t markers.pop();\n\t while (i > 1) {\n\t expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n\t i -= 2;\n\t }\n\n\t return expr;\n\t }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers[markers.length - 1];\n delegate.markEnd(expr, marker);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n delegate.markEnd(expr, marker);\n }\n\n return expr;\n }", "function explore(sumLeft, accum, numsLeft) {\n if ((sumLeft <= 0 && numsLeft != 0)\n || (numsLeft <= 0 && sumLeft != 0)\n || (maxTreeSum(accum[accum.length - 1], numsLeft) < sumLeft)) {\n // Overshot/undershot target\n return null;\n }\n if (sumLeft == 0 && numsLeft == 0) {\n return accum;\n }\n\n for (var i = 0; i < accum.length; i++) { // Non-greedy, slower\n // for (var i = accum.length - 1; i >= 0; i--) { // Greedy, start from end\n var next = accum[i] + accum[accum.length - 1];\n accum.push(next);\n\n var result = explore(sumLeft - next, accum, numsLeft - 1);\n if (result !== null) {\n return result;\n }\n accum.pop();\n }\n\n return null; // Solution not found in this branch\n}", "function run() {\n var status = CONTINUE;\n var step = par;\n var head = null;\n var tail = null;\n var tmp, fid;\n\n loop: while (true) {\n tmp = null;\n fid = null;\n\n switch (status) {\n case CONTINUE:\n switch (step.tag) {\n case MAP:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = new Aff(MAP, step._1, EMPTY, EMPTY);\n step = step._2;\n break;\n\n case APPLY:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = new Aff(APPLY, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n\n case ALT:\n if (head) {\n tail = new Aff(CONS, head, tail);\n }\n\n head = new Aff(ALT, EMPTY, step._2, EMPTY);\n step = step._1;\n break;\n\n default:\n // When we hit a leaf value, we suspend the stack in the `FORKED`.\n // When the fiber resolves, it can bubble back up the tree.\n fid = fiberId++;\n status = RETURN;\n tmp = step;\n step = new Aff(FORKED, fid, new Aff(CONS, head, tail), EMPTY);\n tmp = Fiber(util, supervisor, tmp);\n tmp.onComplete({\n rethrow: false,\n handler: resolve(step)\n })();\n fibers[fid] = tmp;\n\n if (supervisor) {\n supervisor.register(tmp);\n }\n\n }\n\n break;\n\n case RETURN:\n // Terminal case, we are back at the root.\n if (head === null) {\n break loop;\n } // If we are done with the right side, we need to continue down the\n // left. Otherwise we should continue up the stack.\n\n\n if (head._1 === EMPTY) {\n head._1 = step;\n status = CONTINUE;\n step = head._2;\n head._2 = EMPTY;\n } else {\n head._2 = step;\n step = head;\n\n if (tail === null) {\n head = null;\n } else {\n head = tail._1;\n tail = tail._2;\n }\n }\n\n }\n } // Keep a reference to the tree root so it can be cancelled.\n\n\n root = step;\n\n for (fid = 0; fid < fiberId; fid++) {\n fibers[fid].run();\n }\n } // Cancels the entire tree. If there are already subtrees being canceled,", "function parseBinaryExpression() {\n\t var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n\t marker = lookahead;\n\t left = inheritCoverGrammar(parseUnaryExpression);\n\n\t token = lookahead;\n\t prec = binaryPrecedence(token, state.allowIn);\n\t if (prec === 0) {\n\t return left;\n\t }\n\t isAssignmentTarget = isBindingElement = false;\n\t token.prec = prec;\n\t lex();\n\n\t markers = [marker, lookahead];\n\t right = isolateCoverGrammar(parseUnaryExpression);\n\n\t stack = [left, token, right];\n\n\t while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n\t // Reduce: make a binary expression from the three topmost entries.\n\t while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n\t right = stack.pop();\n\t operator = stack.pop().value;\n\t left = stack.pop();\n\t markers.pop();\n\t expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);\n\t stack.push(expr);\n\t }\n\n\t // Shift.\n\t token = lex();\n\t token.prec = prec;\n\t stack.push(token);\n\t markers.push(lookahead);\n\t expr = isolateCoverGrammar(parseUnaryExpression);\n\t stack.push(expr);\n\t }\n\n\t // Final reduce to clean-up the stack.\n\t i = stack.length - 1;\n\t expr = stack[i];\n\t markers.pop();\n\t while (i > 1) {\n\t expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n\t i -= 2;\n\t }\n\n\t return expr;\n\t }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop();\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = createLocationMarker();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, createLocationMarker()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n if (marker) {\n marker.end();\n marker.apply(expr);\n }\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(createLocationMarker());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n if (marker) {\n marker.end();\n marker.apply(expr);\n }\n }\n\n return expr;\n }", "function transformChainExpression(node) {\n if (node.type === \"CallExpression\") {\n node.type = \"OptionalCallExpression\";\n node.callee = transformChainExpression(node.callee);\n } else if (node.type === \"MemberExpression\") {\n node.type = \"OptionalMemberExpression\";\n node.object = transformChainExpression(node.object);\n }\n // typescript\n else if (node.type === \"TSNonNullExpression\") {\n node.expression = transformChainExpression(node.expression);\n }\n return node;\n}", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = createLocationMarker();\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, createLocationMarker()];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n if (marker) {\n marker.apply(expr);\n }\n stack.push(expr);\n markers.push(marker);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(createLocationMarker());\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n if (marker) {\n marker.apply(expr);\n }\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop()\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n}", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n\n marker = lookahead;\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n markers = [marker, lookahead];\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n markers.pop();\n expr = finishBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(lookahead);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n while (i > 1) {\n markers.pop()\n expr = finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n}", "function _overwrite(args, t) {\n var previous = _stack[_index].graph;\n if (_index > 0) {\n _index--;\n _stack.pop();\n }\n _stack = _stack.slice(0, _index + 1);\n var actionResult = _act(args, t);\n _stack.push(actionResult);\n _index++;\n return change(previous);\n }", "function foldRight(onNil, onCons) {\n return as => foldRight_(as, onNil, onCons);\n}", "function combinedReduction() {\n var reducers = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n reducers[_i - 0] = arguments[_i];\n }\n var dispatchPairs = _.reduce(reducers, function (m, r) { return m.concat(_findReducers(r)); }, []);\n return function (state, action) {\n //if (state === void 0) { state = {}; }\n for (var _i = 0, dispatchPairs_1 = dispatchPairs; _i < dispatchPairs_1.length; _i++) {\n var _a = dispatchPairs_1[_i], path = _a[0], reducer = _a[1];\n var currentState = path.length === 0 ? state : _.get(state, path);\n var newState = void 0;\n try {\n newState = reducer(currentState, action);\n }\n catch (error) {\n console.error(\"Error in reducer mounted at \" + path.join('.') + \":\", error);\n continue;\n }\n if (currentState === newState)\n continue;\n state = deepUpdate(state, path, { $set: newState });\n }\n return state;\n };\n}", "function Function$prototype$ap(f) {\n var apply = this;\n return function(x) { return f(x)(apply(x)); };\n }", "function parseBinaryExpression() {\n var expr, token, prec, stack, right, operator, left, i;\n\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, stack, right, operator, left, i;\n\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function parseBinaryExpression() {\n var expr, token, prec, stack, right, operator, left, i;\n\n left = parseUnaryExpression();\n\n token = lookahead;\n prec = binaryPrecedence(token);\n if (prec === 0) {\n return left;\n }\n token.prec = prec;\n lex();\n\n right = parseUnaryExpression();\n\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead)) > 0) {\n\n // Reduce: make a binary expression from the three topmost entries.\n while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n stack.push(expr);\n }\n\n // Shift.\n token = lex();\n token.prec = prec;\n stack.push(token);\n expr = parseUnaryExpression();\n stack.push(expr);\n }\n\n // Final reduce to clean-up the stack.\n i = stack.length - 1;\n expr = stack[i];\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n }\n\n return expr;\n }", "function fork(peg_parser, tree_obj){\n\t\tvar child_funcs = [];\n\t\tfor (var i = 0; i < tree_obj.combine.length; i++){\n\t\t\tchild_funcs.push(combine(peg_parser, tree_obj.combine[i]));\n\t\t}\n\t\treturn peg_parser.or.apply(peg_parser, child_funcs);\n\t}", "evalTree() {\n\t\treturn this.evalTreeHelper(this);\t//pass in self as the root for the first pass\n\t}", "function postOrder_iterative(tree, index) {\n \n var stack = [];\n var lastNodeVisited = null;\n \n var node = tree[index];\n \n while (stack.length > 0 || !isUndefined(node)) {\n if (!isUndefined(node)) {\n \n stack.push(index);\n index = left(index);\n node = tree[index];\n\n } else {\n var peekNode = peek(stack);\n var peekNodeRight = right(peekNode);\n \n if (!isUndefined(tree[peekNodeRight]) && lastNodeVisited != peekNodeRight) {\n index = peekNodeRight;\n node = tree[index];\n } else {\n console.log(tree[peekNode]);\n lastNodeVisited = stack.pop();\n delete node;\n }\n }\n }\n}", "function parseBinaryExpression() {\n var marker, markers, expr, token, prec, stack, right, operator, left, i;\n marker = createLocationMarker();\n left = parseUnaryExpression();\n token = lookahead;\n prec = binaryPrecedence(token, state.allowIn);\n\n if (prec === 0) {\n return left;\n }\n\n token.prec = prec;\n lex();\n markers = [marker, createLocationMarker()];\n right = parseUnaryExpression();\n stack = [left, token, right];\n\n while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {\n // Reduce: make a binary expression from the three topmost entries.\n while (stack.length > 2 && prec <= stack[stack.length - 2].prec) {\n right = stack.pop();\n operator = stack.pop().value;\n left = stack.pop();\n expr = delegate.createBinaryExpression(operator, left, right);\n markers.pop();\n marker = markers.pop();\n\n if (marker) {\n marker.apply(expr);\n }\n\n stack.push(expr);\n markers.push(marker);\n } // Shift.\n\n\n token = lex();\n token.prec = prec;\n stack.push(token);\n markers.push(createLocationMarker());\n expr = parseUnaryExpression();\n stack.push(expr);\n } // Final reduce to clean-up the stack.\n\n\n i = stack.length - 1;\n expr = stack[i];\n markers.pop();\n\n while (i > 1) {\n expr = delegate.createBinaryExpression(stack[i - 1].value, stack[i - 2], expr);\n i -= 2;\n marker = markers.pop();\n\n if (marker) {\n marker.apply(expr);\n }\n }\n\n return expr;\n } // 11.12 Conditional Operator", "function ApplyExtensions(A) {\n var BsApplyExtensions = Apply$2(A);\n var applyFirst = BsApplyExtensions[/* apply_first */1];\n var applySecond = BsApplyExtensions[/* apply_second */2];\n var map2 = BsApplyExtensions[/* lift2 */4];\n var map3 = BsApplyExtensions[/* lift3 */5];\n var map4 = BsApplyExtensions[/* lift4 */6];\n var map5 = BsApplyExtensions[/* lift5 */7];\n var tuple2 = BsApplyExtensions[/* apply_both */3];\n var tuple3 = function (fa, fb, fc) {\n return _4(map3, (function (a, b, c) {\n return /* tuple */[\n a,\n b,\n c\n ];\n }), fa, fb, fc);\n };\n var tuple4 = function (fa, fb, fc, fd) {\n return _5(map4, (function (a, b, c, d) {\n return /* tuple */[\n a,\n b,\n c,\n d\n ];\n }), fa, fb, fc, fd);\n };\n var tuple5 = function (fa, fb, fc, fd, fe) {\n return _6(map5, (function (a, b, c, d, e) {\n return /* tuple */[\n a,\n b,\n c,\n d,\n e\n ];\n }), fa, fb, fc, fd, fe);\n };\n return /* module */[\n /* BsApplyExtensions */BsApplyExtensions,\n /* applyFirst */applyFirst,\n /* applySecond */applySecond,\n /* map2 */map2,\n /* map3 */map3,\n /* map4 */map4,\n /* map5 */map5,\n /* tuple2 */tuple2,\n /* tuple3 */tuple3,\n /* tuple4 */tuple4,\n /* tuple5 */tuple5\n ];\n }", "LCA(root, n1, n2)\n {\n //your code here\n if(!root) return null\n // console.log(root.data,root.data)\n if(root.data==n1 || root.data==n2) return root\n let left=this.LCA(root.left,n1,n2)\n let right=this.LCA(root.right,n1,n2)\n \n if(left && right) return root\n if(!left && !right) return null\n \n return left?left:right;\n \n }", "either(program, state) {\n const array = program.arguments[0].elements;\n return _.some(array, (sub) => {\n return isFinal(sub, state);\n });\n }", "mergeToLeft(leftNode, rightNode) {\n if (!rightNode.empty()) {\n let leftNodeLastRightChildOldValue = leftNode.last().rightChild;\n leftNode.last().rightChild = rightNode.getLeftmostChild();\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild = leftNodeLastRightChildOldValue;\n }\n )\n if (leftNode.hasRightmostChild()) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue;\n }\n );\n }\n while (!rightNode.empty()) {\n let rightNodeElement = rightNode.popFirst();\n this.addAtLastIndexOfCallStack(\n this.undoPopFirst.bind(this, rightNodeElement, rightNode)\n );\n leftNode.addLast(rightNodeElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddLast.bind(this, leftNode)\n )\n if (leftNode.last().leftChild != null) {\n let leftNodeLastLeftChildParentOldValue = leftNode.last().leftChild.parent;\n leftNode.last().leftChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().leftChild.parent = leftNodeLastLeftChildParentOldValue;\n }\n )\n }\n if (leftNode.last().rightChild != null) {\n let leftNodeLastRightChildParentOldValue = leftNode.last().rightChild.parent;\n leftNode.last().rightChild.parent = leftNode;\n this.addAtLastIndexOfCallStack(\n () => {\n leftNode.last().rightChild.parent = leftNodeLastRightChildParentOldValue\n }\n );\n }\n }\n }\n\n let rightNodeParentOldValue = rightNode.parent;\n rightNode.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode.parent = rightNodeParentOldValue;\n }\n );\n\n let rightNodeOldValue = rightNode;\n rightNode = null;\n this.addAtLastIndexOfCallStack(\n () => {\n rightNode = rightNodeOldValue;\n }\n );\n }", "function GetAxiomTree() {\n var Waxiom = rules.axiom;\n var newf = rules.mainRule;\n var newb = 'bb';\n var newx = rules.Rule2;\n var level = params.iterations;\n while (level > 0) {\n var m = Waxiom.length;\n var T = '';\n for (var j=0; j < m; j++) {\n var a = Waxiom[j];\n if (a == 'F'){T += newf;}\n else\n if (a == 'b'){T += newb;}\n else\n if (a == 'X'){T += newx;}\n else\n T += a;\n }\n Waxiom = T;\n level--;\n }\n return Waxiom;\n}", "function chain(arr, done) {\n return arr.reduceRight(function (memo, f, index) {\n return function (err) {\n upgrade(f)(err, memo);\n };\n }, function (e) { done(e); });\n }", "function evaluateThunks(original){\n for(attr in original){\n if(original.hasOwnProperty(attr) && typeof original[attr] != 'undefined'){\n if(original[attr].constructor == Array || typeof original[attr] == 'object'){\n original[attr] = evaluateThunks(original[attr]);\n }else if(typeof original[attr] == 'function' && original[attr].length == 0){\n original[attr] = original[attr]();\n }\n }\n }\n return original;\n}", "function performConcurrentWorkOnRoot(root) {\n // Since we know we're in a React event, we can clear the current\n // event time. The next update will compute a new event time.\n currentEventTime = NoTimestamp;\n currentEventWipLanes = NoLanes;\n currentEventPendingLanes = NoLanes;\n if (!((executionContext & (RenderContext | CommitContext)) === NoContext)) {\n {\n throw Error(\"Should not already be working.\");\n }\n }\n // Flush any pending passive effects before deciding which lanes to work on,\n // in case they schedule additional work.\n var originalCallbackNode = root.callbackNode;\n var didFlushPassiveEffects = flushPassiveEffects();\n if (didFlushPassiveEffects) {\n // Something in the passive effect phase may have canceled the current task.\n // Check if the task node for this root was changed.\n if (root.callbackNode !== originalCallbackNode) {\n // The current task was canceled. Exit. We don't need to call\n // `ensureRootIsScheduled` because the check above implies either that\n // there's a new task, or that there's no remaining work on this root.\n return null;\n }\n }\n // Determine the next expiration time to work on, using the fields stored\n // on the root.\n var lanes = getNextLanes(root, root === workInProgressRoot ? workInProgressRootRenderLanes : NoLanes);\n if (lanes === NoLanes) {\n // Defensive coding. This is never expected to happen.\n return null;\n }\n var exitStatus = renderRootConcurrent(root, lanes);\n if (includesSomeLane(workInProgressRootIncludedLanes, workInProgressRootUpdatedLanes)) {\n // The render included lanes that were updated during the render phase.\n // For example, when unhiding a hidden tree, we include all the lanes\n // that were previously skipped when the tree was hidden. That set of\n // lanes is a superset of the lanes we started rendering with.\n // \n // So we'll throw out the current work and restart.\n prepareFreshStack(root, NoLanes);\n } else if (exitStatus !== RootIncomplete) {\n if (exitStatus === RootErrored) {\n executionContext |= RetryAfterError;\n // If an error occurred during hydration,\n // discard server response and fall back to client side render.\n if (root.hydrate) {\n root.hydrate = false;\n clearContainer(root.containerInfo);\n }\n // If something threw an error, try rendering one more time. We'll render\n // synchronously to block concurrent data mutations, and we'll includes\n // all pending updates are included. If it still fails after the second\n // attempt, we'll give up and commit the resulting tree.\n lanes = getLanesToRetrySynchronouslyOnError(root);\n if (lanes !== NoLanes) {\n exitStatus = renderRootSync(root, lanes);\n }\n }\n if (exitStatus === RootFatalErrored) {\n var fatalError = workInProgressRootFatalError;\n prepareFreshStack(root, NoLanes);\n markRootSuspended$1(root, lanes);\n ensureRootIsScheduled(root, now());\n throw fatalError;\n }\n // We now have a consistent tree. The next step is either to commit it,\n // or, if something suspended, wait to commit it after a timeout.\n var finishedWork = root.current.alternate;\n root.finishedWork = finishedWork;\n root.finishedLanes = lanes;\n finishConcurrentRender(root, exitStatus, lanes);\n }\n ensureRootIsScheduled(root, now());\n if (root.callbackNode === originalCallbackNode) {\n // The task node scheduled for this root is the same one that's\n // currently executed. Need to return a continuation.\n return performConcurrentWorkOnRoot.bind(null, root);\n }\n return null;\n }", "function traverseExpressionsInLHS(node, cb) {\n switch (node.kind) {\n case ts.SyntaxKind.ParenthesizedExpression:\n traverseExpressionsInLHS(node.expression, cb);\n break;\n case ts.SyntaxKind.ArrayLiteralExpression:\n for (var _i = 0, _a = node.elements; _i < _a.length; _i++) {\n var e = _a[_i];\n traverseExpressionsInLHS(e, cb);\n }\n break;\n case ts.SyntaxKind.ObjectLiteralExpression:\n for (var _b = 0, _c = node.properties; _b < _c.length; _b++) {\n var o = _c[_b];\n traverseExpressionsInLHS(o, cb);\n }\n break;\n case ts.SyntaxKind.BinaryExpression: {\n var _d = node, left = _d.left, operatorToken = _d.operatorToken, right = _d.right;\n if (operatorToken.kind === ts.SyntaxKind.EqualsToken) {\n traverseExpressionsInLHS(left, cb);\n cb(right);\n }\n }\n }\n}", "propagateDownFromLeft(node, parentPos, leftSibling) {\n let parentElement = node.parent.popAt(parentPos);\n this.addAtLastIndexOfCallStack(\n this.undoPopAt.bind(this, parentElement, node.parent, parentPos)\n );\n if (node.parent.hasRightChildAt(parentPos - 1)) {\n let nodeParentAtRightChildOldValue = node.parent.at(parentPos - 1).rightChild;\n node.parent.at(parentPos - 1).rightChild = node;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent.at(parentPos - 1).rightChild = nodeParentAtRightChildOldValue;\n }\n );\n }\n let parentElementLeftChildOldValue = parentElement.leftChild;\n parentElement.leftChild = null;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.leftChild = parentElementLeftChildOldValue;\n }\n )\n\n let parentElementRightChildOldValue = parentElement.rightChild;\n parentElement.rightChild = node.hasLeftmostChild() ? node.getLeftmostChild() : this.recentNode;\n this.addAtLastIndexOfCallStack(\n () => {\n parentElement.rightChild = parentElementRightChildOldValue;\n }\n )\n\n node.addFirst(parentElement);\n this.addAtLastIndexOfCallStack(\n this.undoAddFirst.bind(this, node)\n );\n\n let nodeIsLeafOldValue = node.isLeaf;\n node.isLeaf = node.isLeaf && leftSibling.isLeaf;\n this.addAtLastIndexOfCallStack(\n () => {\n node.isLeaf = nodeIsLeafOldValue;\n }\n );\n\n this.mergeToRight(leftSibling, node);\n if (node.parent === this.root && this.root.size() === 0) {\n let rootOldValue = this.root;\n this.root = node;\n this.addAtLastIndexOfCallStack(\n () => {\n this.root = rootOldValue;\n }\n );\n\n let nodeParentOldValue = node.parent;\n node.parent = null;\n this.addAtLastIndexOfCallStack(\n () => {\n node.parent = nodeParentOldValue;\n }\n )\n }\n }", "function unflattenr(node) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i]);\n }\n\n if (l > 2 && isAssociative(node)) {\n var curnode = node.args.pop();\n\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n\n node.args = curnode.args;\n }\n }", "function unflattenr(node) {\n if (!node.args || node.args.length === 0) {\n return;\n }\n\n var makeNode = createMakeNodeFunction(node);\n var l = node.args.length;\n\n for (var i = 0; i < l; i++) {\n unflattenr(node.args[i]);\n }\n\n if (l > 2 && isAssociative(node)) {\n var curnode = node.args.pop();\n\n while (node.args.length > 0) {\n curnode = makeNode([node.args.pop(), curnode]);\n }\n\n node.args = curnode.args;\n }\n }" ]
[ "0.5131394", "0.5002274", "0.47398615", "0.47051564", "0.46100226", "0.46100226", "0.46100226", "0.46100226", "0.46100226", "0.46100226", "0.46007454", "0.46007454", "0.4547759", "0.4469237", "0.44272396", "0.43940535", "0.4392496", "0.43687135", "0.43284127", "0.4323733", "0.43196926", "0.43183178", "0.431383", "0.42953414", "0.42779025", "0.42735767", "0.42692548", "0.42653787", "0.42653787", "0.4263013", "0.4262818", "0.4261044", "0.4261044", "0.4261044", "0.4261044", "0.4261044", "0.4260355", "0.42495883", "0.42495883", "0.42495883", "0.42495883", "0.42495883", "0.42495883", "0.4243932", "0.4243026", "0.42306545", "0.4227264", "0.4227264", "0.42260975", "0.4223242", "0.42226562", "0.42018417", "0.42010653", "0.42010653", "0.42010653", "0.42010653", "0.42010653", "0.42010653", "0.41969588", "0.41958857", "0.41958857", "0.41958857", "0.41958857", "0.4192525", "0.41676787", "0.41568795", "0.41547537", "0.4144624", "0.4140631", "0.41317356", "0.41215035", "0.41215035", "0.41192913", "0.4117821", "0.4114795", "0.41033217", "0.4102896", "0.4102896", "0.4102896", "0.4102815", "0.4094394", "0.4082034", "0.4080657", "0.40715957", "0.40708992", "0.4069451", "0.40634704", "0.4053289", "0.40511698", "0.40489128", "0.404423", "0.4043975", "0.40397638", "0.40386003", "0.40386003" ]
0.407574
88
Cancels the entire tree. If there are already subtrees being canceled, we need to first cancel those joins. We will then add fresh joins for all pending branches including those that were in the process of being canceled.
function cancel(error, cb) { interrupt = util.left(error); var innerKills; for (var kid in kills) { if (kills.hasOwnProperty(kid)) { innerKills = kills[kid]; for (kid in innerKills) { if (innerKills.hasOwnProperty(kid)) { innerKills[kid](); } } } } kills = null; var newKills = kill(error, root, cb); return function (killError) { return new Aff(ASYNC, function (killCb) { return function () { for (var kid in newKills) { if (newKills.hasOwnProperty(kid)) { newKills[kid](); } } return nonCanceler; }; }); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function repoAbortTransactions(repo, path) {\n var affectedPath = treeGetPath(repoGetAncestorTransactionNode(repo, path));\n var transactionNode = treeSubTree(repo.transactionQueueTree_, path);\n treeForEachAncestor(transactionNode, function (node) {\n repoAbortTransactionsOnNode(repo, node);\n });\n repoAbortTransactionsOnNode(repo, transactionNode);\n treeForEachDescendant(transactionNode, function (node) {\n repoAbortTransactionsOnNode(repo, node);\n });\n return affectedPath;\n}", "clearTree() {\n // ******* TODO: PART VII *******\n\n // You only need two lines of code for this! No loops! \n }", "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(symbols.TASK_CANCEL, false);\n }\n }", "function cancel() {\n\t /**\n\t We need to check both Running and Cancelled status\n\t Tasks can be Cancelled but still Running\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\n\t Ending with a Never result will propagate the Cancellation to all joiners\n\t **/\n\n\t end(TASK_CANCEL);\n\t }\n\t }", "pruneBranches() {\n let node = this._top();\n let branches = node.branches;\n node.branches = [];\n for (let n = 0, l = branches.length; n < l; ++n) {\n this._mergeSets(node, branches[n]);\n }\n }", "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = redux_saga_core_esm_CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(TASK_CANCEL, false);\n }\n }", "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED$1;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(__WEBPACK_IMPORTED_MODULE_0__redux_saga_symbols__[\"f\" /* TASK_CANCEL */], false);\n }\n }", "function cancel() {\n\t /**\n\t We need to check both Running and Cancelled status\n\t Tasks can be Cancelled but still Running\n\t **/\n\t if (iterator._isRunning && !iterator._isCancelled) {\n\t iterator._isCancelled = true;\n\t taskQueue.cancelAll();\n\t /**\n\t Ending with a Never result will propagate the Cancellation to all joiners\n\t **/\n\t end(TASK_CANCEL);\n\t }\n\t }", "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"], false);\n }\n }", "function cancel() {\n if (status === RUNNING) {\n // Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n // effects in the iterator's finally block will still be executed\n status = CANCELLED;\n queue.cancelAll(); // Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\n\n end(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"], false);\n }\n }", "cancelEdit() {\n if (this._editedLevel > 0) {\n this._editedLevel--;\n }\n\n // Cancel in sub-models\n if (this._editedLevel === 0) {\n _each(this._childCollections, childCollection => {\n childCollection.cancelEdit();\n });\n\n // Revert changes\n // TODO\n\n // Reset state\n this._editedEvents = [];\n }\n }", "function clearTree() {\n\n // ******* TODO: PART VII *******\n \n\n}", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true;\n taskQueue.cancelAll();\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n end(TASK_CANCEL);\n }\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n\n return nonCanceler;\n };\n });\n };\n }", "function terminateChange() {\r\n window.setTimeout(\"cancelRecursiveChange_OnGoingChange=false;\", 100);\r\n}", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function cancel(error, cb) {\n interrupt = util.left(error);\n var innerKills;\n for (var kid in kills) {\n if (kills.hasOwnProperty(kid)) {\n innerKills = kills[kid];\n for (kid in innerKills) {\n if (innerKills.hasOwnProperty(kid)) {\n innerKills[kid]();\n }\n }\n }\n }\n\n kills = null;\n var newKills = kill(error, root, cb);\n\n return function (killError) {\n return new Aff(ASYNC, function (killCb) {\n return function () {\n for (var kid in newKills) {\n if (newKills.hasOwnProperty(kid)) {\n newKills[kid]();\n }\n }\n return nonCanceler;\n };\n });\n };\n }", "function destorySubtrees(state) {\n destorySubtreesRecursively(state.rootNode);\n}", "function cancel(){if(status===RUNNING){// Setting status to CANCELLED does not necessarily mean that the task/iterators are stopped\n// effects in the iterator's finally block will still be executed\nstatus=CANCELLED;queue.cancelAll();// Ending with a TASK_CANCEL will propagate the Cancellation to all joiners\nend(_redux_saga_symbols__WEBPACK_IMPORTED_MODULE_0__[\"TASK_CANCEL\"],false);}}", "function cancelLeaves(cancel_app, id) {\n return new Promise(function(resolve, reject) {\n try {\n getUsername(id)\n .then(user => {\n db().collection(\n appconfig.database.collections.leaveCollection,\n function(err, collection) {\n if (err) {\n reject(ERROR_TYPES.CANCEL_LEAVES.COLLECTION);\n }\n let removeobj;\n if (cancel_app.type == \"A\") {\n removeobj =\n appconfig.database.documents.leaves.approveParentNode +\n cancel_app.id;\n } else if (cancel_app.type == \"P\") {\n removeobj =\n appconfig.database.documents.leaves.applyParentNode +\n cancel_app.id;\n }\n collection.updateOne(\n { user: user },\n { $unset: { [removeobj]: \"\" } }\n );\n resolve(1);\n }\n );\n })\n .catch(err => {\n reject(err);\n });\n } catch (err) {\n reject(err);\n }\n });\n}", "function cancel() {\n /**\n We need to check both Running and Cancelled status\n Tasks can be Cancelled but still Running\n **/\n //\n if (iterator._isRunning && !iterator._isCancelled) {\n iterator._isCancelled = true\n taskQueue.cancelAll() // cancel all tasks,特别是 mainTask\n /**\n Ending with a Never result will propagate the Cancellation to all joiners\n **/\n // 主动 cancel task (saga | iterator)\n // end task with cancel signal\n end(TASK_CANCEL)\n }\n }", "function repoAbortTransactionsOnNode(repo, node) {\n var queue = treeGetValue(node);\n if (queue) {\n // Queue up the callbacks and fire them after cleaning up all of our\n // transaction state, since the callback could trigger more transactions\n // or sets.\n var callbacks = [];\n // Go through queue. Any already-sent transactions must be marked for\n // abort, while the unsent ones can be immediately aborted and removed.\n var events = [];\n var lastSent = -1;\n for (var i = 0; i < queue.length; i++) {\n if (queue[i].status === 3 /* SENT_NEEDS_ABORT */) ;\n else if (queue[i].status === 1 /* SENT */) {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(lastSent === i - 1, 'All SENT items should be at beginning of queue.');\n lastSent = i;\n // Mark transaction for abort when it comes back.\n queue[i].status = 3 /* SENT_NEEDS_ABORT */;\n queue[i].abortReason = 'set';\n }\n else {\n Object(_firebase_util__WEBPACK_IMPORTED_MODULE_2__[\"assert\"])(queue[i].status === 0 /* RUN */, 'Unexpected transaction status in abort');\n // We can abort it immediately.\n queue[i].unwatcher();\n events = events.concat(syncTreeAckUserWrite(repo.serverSyncTree_, queue[i].currentWriteId, true));\n if (queue[i].onComplete) {\n callbacks.push(queue[i].onComplete.bind(null, new Error('set'), false, null));\n }\n }\n }\n if (lastSent === -1) {\n // We're not waiting for any sent transactions. We can clear the queue.\n treeSetValue(node, undefined);\n }\n else {\n // Remove the transactions we aborted.\n queue.length = lastSent + 1;\n }\n // Now fire the callbacks.\n eventQueueRaiseEventsForChangedPath(repo.eventQueue_, treeGetPath(node), events);\n for (var i = 0; i < callbacks.length; i++) {\n exceptionGuard(callbacks[i]);\n }\n }\n}", "clearTree() {\n // ******* TODO: PART VII *******\n\n // You only need two lines of code for this! No loops! \n d3.selectAll('.selected').classed('selected', false);\n d3.selectAll('.selectedLabel').classed('selectedLabel', false);\n \n }", "function cancelAll() {\r\n while (animator.jobs.length) {\r\n cancelJob(animator.jobs[0]);\r\n }\r\n }", "updateTrees(ctx) {\n for(let i = this.trees.length - 1; i >= 0; i--) {\n this.trees[i].update(ctx, i, this.playerSpeed);\n\n if(this.trees[i].treeBorderPassed(ctx)) {\n this.trees.splice(i, 1);\n } \n }\n\n if(this.trees.length < this.numberOfTreeRows) {\n this.newTree();\n }\n }", "function restoreCC() {\n\tcy.nodes().forEach(function(item, index, array) {\n\t\tlet cC = item.data().collapsedChildren;\n\t\tif ( cC ) {\n\t\t\titem.data().collapsedChildren = cy.add(cC);\n\t\t\tremovedNodes.restore();\n\t\t\trestoreOE();\n\t\t\tcC.forEach(function(item, index, array) {\n\t\t\t\tremovedNode = cy.$id(item.data.id);\n \t\tremovedNodes = removedNodes.union(removedNode);\n\t\t\t\tremovedNodes.remove();\n \t\t});\n\n \t\t};\n \t});\n\t//Reset removedNodes\n removedNodes = cy.collection();\n}", "function cancelMerge()\n{\n mergeToCounter = 0;\n mergeInOperation = 0;\n hideMergeTo();\n hideMergeFrom();\n document.getElementById(\"CancelMergeWindow\").style.display = \"none\";\n\n}", "function TNodes_doRemoveBranch( nd, action ) {\n action = action || 'nothing';\n var sourcenode = {}\n , mynodesobj = {}\n , targetnode = {};\n \n mynodesobj = nd.Owner;// the TNodes-structure of \n targetnode = nd.Parent.Parent;\n /////////////////////////////////////////////////////////////\n // SOURCE: GET THE BRANCH-\"CONTENT\" FROM THE OPPOSITE NODE //\n /////////////////////////////////////////////////////////////\n switch ( nd.Spin ) {\n case 1: sourcenode = nd.Parent.DownNode;\n break;\n case -1: sourcenode = nd.Parent.UpNode;\n break;\n default: sourcenode = nd;\n }//END SWITCH\n \n if ( sourcenode.HasChild ) {\n \n \n \n // first swap the child's up and down to the target in the database\n\n // using json-obj as clipboard \n var jsonsource=mynodesobj.doCopyBranchToJson();\n //remove the split with delete, because the relink has dropped the children\n mynodesobj.doRemove(nd.Parent,'delete'); // owner is TNodes, parent is TSplit\n mynodesobj.doPasteBranchFromJson(jsonsource, targetnode,'relink');\n mynodesobj.doRemove(nd.Parent,'delete'); \n } else if ( sourcenode.ContainerList.Count > 0 ) {\n ///////////////////////////////\n // LOOP TROUGH CONTAINERLIST //\n ///////////////////////////////\n for ( var i in sourcenode.ContainerList.Item ) {\n var container = sourcenode.ContainerList.Item[ i ];\n if ( container !== null ) {\n var storedLabel = container.Label//Store label to override the 'copy of' wich is added after copy\n if ( container.Nature == 'Container' || container.Nature == 'Sticker' ) {\n var copy = targetnode.doContainerMove( container, undefined, true );\n targetnode.ContainerList.Item[ copy ].Label = storedLabel;// Make the copy and overwrite the labal of the copy\n }//END IF \n }//END IF\n }//END LOOP\n mynodesobj.doRemove( nd.Parent, 'delete' ); // owner is TNodes, parent is TSplit\n } else {\n mynodesobj.doRemove( nd.Parent, 'delete' ); // owner is TNodes, parent is TSplit \n }//END ELSE\n }", "selectCancel(e){\n var { selectField, selectArrayIdx } = this.state;\n this.modifyNewContext(selectField, null, 'existing linked object', null, selectArrayIdx);\n this.setState({ 'selectType': null, 'selectField': null, 'selectArrayIdx': null });\n }", "function clearTree() {\n // ******* TODO: PART VII *******\n d3.selectAll(\".selected\").classed(\"selected\",false);\n d3.selectAll(\".selectedLabel\").classed(\"selectedLabel\",false);\n}", "cancel() {\n\t\tif (!this.state.executing) {\n\t\t\tthis.opts.cancel && this.opts.cancel();\n\t\t}\n\t}", "cancel() {\n\t\tif (!this.state.executing) {\n\t\t\tthis.opts.cancel && this.opts.cancel();\n\t\t}\n\t}", "flushPendingDeletes () {\n for (let i = 0, len = this.pendingDeletes.length; i !== len; ++i) {\n var pd = this.pendingDeletes[i];\n while (pd.nodesets.length) {\n this.removeNodes(pd.nodesets.pop());\n }\n if (pd.data && pd.data[PENDING_DELETE_INDEX_SYM] !== undefined) { delete pd.data[PENDING_DELETE_INDEX_SYM]; }\n }\n this.pendingDeletes = [];\n }", "clearTree() {\n d3.select(\"g#tree\").selectAll(\"text\").classed(\"selectedLabel\", false);\n d3.select(\"g#tree\").selectAll(\"path\").classed(\"selected\", false);\n // You only need two lines of code for this! No loops! \n }", "cancel() {\n\t\tweakmap.get(this).isCanceled = true;\n\t}", "delete() {\n if (this.leftChild !== null && this.rightChild !== null) {\n var inOrderNext = this.inOrderNext()\n var originalParent = this.parent\n var originalLeftChild = this.leftChild\n var originalRightChild = this.rightChild\n Object.assign(this, inOrderNext)\n this.parent = originalParent\n this.leftChild = originalLeftChild\n this.rightChild = originalRightChild\n inOrderNext.delete()\n } else if (this.parent !== null && this.leftChild === null && this.rightChild === null) {\n if (this.parent.leftChild === this)\n this.parent.leftChild = null\n else \n this.parent.rightChild = null\n this.parent = null\n } else if (this.parent !== null) {\n var orphan = this.rightChild !== null ? this.rightChild : this.leftChild\n if (this.parent.leftChild === this)\n this.parent.setLeftChild(orphan)\n else\n this.parent.setRightChild(orphan)\n this.parent = null\n } else {\n console.log('in this case, delete operation requires the change of the root pointer')\n }\n }", "recountTree() {\n const flatNodes = this.getFlatNodes();\n const rootNodeValues = Object.keys(flatNodes).filter((value) => {\n return !this.getFlatNodeByValue(value).parent.id;\n });\n\n rootNodeValues.forEach((value) => {\n const flatNode = this.getFlatNodeByValue(value).self;\n const allNodesToRecount = this.getAllNodesToRecount(flatNode);\n\n allNodesToRecount.forEach(item => this.recountParentsCheck(getNodeValue(item)));\n });\n }", "clearOldTints(gridsConChildren){\n\n if(this.currentThreadId === this.props.commentThreadDoc._id){ return; }\n\n gridsConChildren.forEach(row => {\n\n Array.from(row.children).forEach(commentDiv => {\n\n let id = 'c_' + commentDiv.id.slice(5); //remove 'tint_' prefix\n if(commentDiv.className === 'commentBox--tint' && row.querySelector('#'+id) === null){\n commentDiv.remove();\n }\n })\n });\n }", "abortTest () {\n\t\tif (this.runningQueue) {\n\t\t\tthis.runningQueue.cancel()\n\t\t}\n\t}", "function cancelChanges() {\n\t\tsetEditMode(false);\n\t\tsetRows(previousRows);\n\t\tsetSelected([]);\n\t}", "function clearTree() {\n\n // ******* TODO: PART VII *******\n /* tableElements.map(function (d) {\n\tvar elm = d.key;\n return d.classed(\"selected\", false);\n });*/\n\n\n}", "handleRemoval(tree){\n // Get the one child node, if there is one.\n const child = this.left || this.right;\n // Handle the case where this node is the root\n if(!this.parent){\n tree.root = child;\n if(child){\n child.parent = null;\n child.color = Black;\n }\n // Delete a red node (which by implication has no children)\n }else if(this.color === Red){\n this.makeOrphan();\n // Delete a black node with a red child\n }else if(child && child.color === Red){\n this.intervals = child.intervals;\n this.low = child.low;\n this.high = child.high;\n this.minimumLow = child.minimumLow;\n this.maximumLow = child.maximumLow;\n this.minimumHigh = child.minimumHigh;\n this.maximumHigh = child.maximumHigh;\n this.left = child.left;\n this.right = child.right;\n // Delete a black node with a black child\n // Note: This case should not actually be reachable?\n }else if(child){\n this.swapWithChild(child);\n child.removalFix(tree);\n this.makeOrphan();\n // Delete a black node with no children\n }else{\n this.removalFix(tree);\n this.makeOrphan();\n }\n // Update interval information\n if(this.parent){\n this.parent.removeUpdateLimits();\n // Note: A reference implementation used this behavior instead.\n // This change did not cause issues during extensive testing.\n // Still, if bugs occur, it may be because of this change.\n // this.parent.immediateUpdateLimits();\n // if(this.parent.parent) this.parent.parent.removeUpdateLimits();\n }\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "function resetNextUnitOfWork() {\n // Clear out roots with no more work on them, or if they have uncaught errors\n while (nextScheduledRoot !== null && nextScheduledRoot.current.pendingWorkPriority === NoWork$2) {\n // Unschedule this root.\n nextScheduledRoot.isScheduled = false;\n // Read the next pointer now.\n // We need to clear it in case this root gets scheduled again later.\n var next = nextScheduledRoot.nextScheduledRoot;\n nextScheduledRoot.nextScheduledRoot = null;\n // Exit if we cleared all the roots and there's no work to do.\n if (nextScheduledRoot === lastScheduledRoot) {\n nextScheduledRoot = null;\n lastScheduledRoot = null;\n nextPriorityLevel = NoWork$2;\n return null;\n }\n // Continue with the next root.\n // If there's no work on it, it will get unscheduled too.\n nextScheduledRoot = next;\n }\n\n var root = nextScheduledRoot;\n var highestPriorityRoot = null;\n var highestPriorityLevel = NoWork$2;\n while (root !== null) {\n if (root.current.pendingWorkPriority !== NoWork$2 && (highestPriorityLevel === NoWork$2 || highestPriorityLevel > root.current.pendingWorkPriority)) {\n highestPriorityLevel = root.current.pendingWorkPriority;\n highestPriorityRoot = root;\n }\n // We didn't find anything to do in this root, so let's try the next one.\n root = root.nextScheduledRoot;\n }\n if (highestPriorityRoot !== null) {\n nextPriorityLevel = highestPriorityLevel;\n // Before we start any new work, let's make sure that we have a fresh\n // stack to work from.\n // TODO: This call is buried a bit too deep. It would be nice to have\n // a single point which happens right before any new work and\n // unfortunately this is it.\n resetContextStack();\n\n nextUnitOfWork = createWorkInProgress$1(highestPriorityRoot.current, highestPriorityLevel);\n if (highestPriorityRoot !== nextRenderedTree) {\n // We've switched trees. Reset the nested update counter.\n nestedUpdateCount = 0;\n nextRenderedTree = highestPriorityRoot;\n }\n return;\n }\n\n nextPriorityLevel = NoWork$2;\n nextUnitOfWork = null;\n nextRenderedTree = null;\n return;\n }", "_cancel(...args) {\n\t\tif (this.onCancel && this._promise) {\n\t\t\tconst commands = this.onCancel(this._resolve, this._reject, ...args) || [];\n\t\t\tconst self = this;\n\t\t\tthis._promise.then(function () {\n\t\t\t\tself.closeCurrentRoute({commands: commands});\n\t\t\t}).catch(function (error) {\n\t\t\t\tself.closeCurrentRoute();\n\t\t\t});\n\t\t} else if (this.onCancel) {\n\t\t\tconst commands = this.onCancel(...args) || [];\n\t\t\tthis.closeCurrentRoute({commands: commands});\n\t\t} else {\n\t\t\tthis.closeCurrentRoute();\n\t\t}\n\t}", "function removeParentRefs(data) {\n\n\tif(data.parent)\n\t\tdata.parent = null;\n\n\tfor(var i in data.children) {\n\t removeParentRefs(data.children[i]);\n\t}\n}", "_removeNode(curr,data,parent){\n // case 1: node to be deleted is a leaf - simply remove parents connection to it\n // case 2: node to be deleted has one child\n if(curr.data === data && (curr.left == null || curr.right == null)){\n // get the child of curr that parent will now point to\n console.log(\"in case 1 & 2\");\n let child;\n if(curr.left !== null){\n child = curr.left;\n }else{\n child = curr.right;\n }\n // if root needs to be deleted then update root\n if(this.root === curr){ //\n this.root = child;\n }else{ // make the parent of curr point to its child\n if(parent.left === curr) {\n parent.left = child;\n }else{\n parent.right = child;\n }\n }\n this.nodeCount--;\n // case 3: node to be deleted has two children\n }else if(curr.data === data){ //if two children\n console.log(\"in case 3\");\n // get the minimum value from the right subtree\n let min = this.findMinNode(curr.right);\n let minValue = min.data;\n curr.data = minValue; // replace value of node to be removed with minimum value of right subtree\n // remove duplicate value from right subtree - will be caught by case 1 or 2\n this._removeNode(curr.right,minValue,curr);\n }else{ //traverse tree looking for node to delete\n if(data <= curr.data){ // go left\n this._removeNode(curr.left,data,curr);\n }else{ // go right\n this._removeNode(curr.right,data,curr);\n }\n }\n }", "function tryAppendingOrphansToTree() {\n for (var ic = 0; ic < orphanedChildren.length; ic++) {\n var cleanParentPath = orphanedChildren[ic].cleanParentPath;\n var parentNode = getParentNodeFromPath(cleanParentPath);\n if (parentNode) {\n appendXmlToNode(parentNode, orphanedChildren[ic].dataXml);\n orphanedChildren.splice(ic, 1);\n\n // We just appended new nodes, so run this again. But, wait\n // a tick so the new nodes have time to expand\n setTimeout(function() {\n tryAppendingOrphansToTree();\n });\n return;\n }\n }\n\n // If we didn't find any parent nodes and all the folders have been\n // loaded, then it must mean the parent was collapsed\n if (numFoldersLoaded === _self.expandedNodes.length)\n return onFinish();\n }", "function CutAllInvites(treeID, CB) {\n // Whichever removal method, cut all mod and guest links\n Find(colls.CTRL_TREES, { _id: treeID }, CutAllInvitesParamPass(treeID, CB));\n }", "function doTreesMerge(newLvl, existingLvl, newParentId, existingParentId, tP) { //console.log(\"doTreesMerge called. newLvl = %s, existingLvl = %s, newParent = %s, existingParent = %s\", newLvl, existingLvl, taxaNameMap[newParentId], taxaNameMap[existingParentId])\n if (newLvl > existingLvl) { // more specific taxon\n if (treesMergeAtHigherLevel(tP.taxaObjs[taxaNameMap[newParentId]], existingParentId, tP)) {\n tP.recrd.parent = newParentId; \t\t\t\t\t\t// console.log(\"trees merge\");\n }\n } else { confirmDirectRelationship(tP.taxaObjs[taxaNameMap[newParentId]], newParentId); }\n /**\n * If the taxon has a less specific direct parent in this record than in one previously processed, \n * check to ensure the existing parent is a child of the parent taxon in this record.\n */\n function confirmDirectRelationship(existingTaxonObj, newParentId) { \n if (!isChild(existingTaxonObj)) { // No case yet. TODO: add to Complex Errors\n console.log(\"trees don't merge. newParent =%s, existing =%s, rcrd = %O, existingParent = %O\", taxaNameMap[newParentId], taxaNameMap[existingParentId], tP.recrd, tP.taxaObjs[taxaNameMap[existingParentId]].name); \n }\n\n function isChild(existingParnt) { // console.log(\"existingParnt - %s, existingParntLvl - %s, tP.taxaObjs = %O\", existingParnt.name, existingParnt.level, tP.taxaObjs)\n if ( existingParnt.level === newLvl ) { //console.log(\"levels equal. existingId = %s, newParentId = %s\", existingParnt.tempId, newParentId)\n if ( existingParnt.tempId === newParentId ) { return true; \n } else { return false; }\n }\n if ( existingParnt.parent === newParentId ) { return true;\n } else { return isChild(existingParnt.parent); }\n }\n }\n }", "remove(tree){\n let replaceWith;\n if(this.left && this.right){\n const next = this.right.getLeftmostChild();\n this.low = next.low;\n this.high = next.high;\n this.intervals = next.intervals;\n this.removeUpdateLimits();\n next.handleRemoval(tree); \n }else{\n this.handleRemoval(tree);\n }\n }", "brushfire(undo) {\n for (var i = 0; i < this.cols; i++) {\n for (var j = 0; j < this.rows; j++) {\n var cell = this.grid[i][j];\n cell.dist = this.cols * this.rows * 10; // max distance\n cell.vec = null\n cell.parent = 0\n cell.addNeighbors(this, this.grid);\n }\n }\n this.root.dist = 0;\n this.root.occupied = false;\n var queue = [this.root];\n\n //loops cells as long as queue is not empty\n while (queue.length) {\n var current = queue.shift()\n for (let j = 0; j < current.neighbors.length; j++) {\n let neighbor = current.neighbors[j]\n var dist = current.dist + 10;\n if (current.loc.x != neighbor.loc.x && current.loc.y != neighbor.loc.y)\n dist = current.dist + 14;\n //diagonals are included above\n if (neighbor.dist > dist) {\n neighbor.parent = current;\n neighbor.dist = dist;\n queue.push(neighbor);\n }\n }\n }\n if (!this.validMap()) {\n if (undo) {\n undo()\n this.brushfire()\n } else {\n //delete enemies\n for (let i = 0; i, this.enemies.length; i++) {\n let enemy = Game.enemies[i];\n if (!enemy.currentCell.parent)\n enemy.kill = true;\n }\n console.log(\"brushfire created an invalid map and no undo was inputed\")\n\n }\n }\n }", "cheat() {\n for (let i = 1; i < this.tx.length; i++) {\n if (this.isInvolvedIn(this.tx.slice(-i)[0])) {\n this.tx.splice(-i, 1);\n }\n }\n }", "popToNearestCommonAncestor(parentPrev, next);\n } else {\n // We must still be deeper.\n popPreviousToCommonLevel(parentPrev, next);\n }", "cancel() {\n moveToState(this, Cancelled());\n return this;\n }", "function cancelDrawing () {\n // This method clears a tempPath and cancels drawing. This method is called by Keyboard when esc is pressed.\n if ('tracker' in svl && svl.tracker && status.drawing) {\n svl.tracker.push(\"LabelingCanvas_CancelLabeling\");\n }\n\n tempPath = [];\n status.drawing = false;\n self.clear().render2();\n return this;\n }", "function pruneEmptyBranches(d) {\n for (var c = d.children.length; c > 0;) {\n var kid = d.children[--c];\n if (!kid.value) {\n if (kid.children) {\n pruneEmptyBranches(kid);\n } else {\n d.children.splice(c, 1);\n }\n }\n }\n }", "cancelBatch() {\n this.batching = null;\n this.meta.batchChanges = null;\n }", "cancelBatch() {\n this.batching = null;\n this.meta.batchChanges = null;\n }", "maybeCancel() {\n if (Pending.hasInstance(this._state)) {\n this.cancel();\n }\n return this;\n }", "cancel() {\n cancel();\n }", "discard() {\n super.discard();\n\n this.discardStates();\n\n this._promises.weight.cancel();\n delete this._promises;\n }", "function reset(tree) {\r\n tree.collapseAll();\r\n tree.enableAll();\r\n }", "function cancelAllJobs() {\n for (var job in scheduler.scheduledJobs) {\n if (scheduler.scheduledJobs.hasOwnProperty(job)) {\n scheduler.scheduledJobs[job].cancel();\n }\n }\n updateJobs = [];\n areJobsScheduled = false;\n}", "cancel() {\n this.end();\n queryManager.cancelQuery(this);\n return this;\n }", "function cancel() {\n gotoReturnState();\n }", "resetTree() {\n this.root.nodes.forEach((node) => { var _a; return (_a = node.currentAnimation) === null || _a === void 0 ? void 0 : _a.stop(); });\n this.root.nodes.forEach(clearMeasurements);\n this.root.sharedNodes.clear();\n }", "function commitRoot(){\n\n deletes.forEach(commitWork);\n\n commitWork(wipRoot.child);\n\n currentRoot = wipRoot;\n\n wipRoot = null;\n}", "applyReductionRule() {\n // console.log('applyReductionRule() ' + this.id);\n if (this.branches.hasEqualBranches()) {\n this.ensureNotDeleted('applyReductionRule');\n const keepBranch = this.branches.getBranch('0');\n // move own parents to keepBranch\n const ownParents = this.parents.getAll();\n ownParents.forEach(parent => {\n // console.log('ownParent: ' + parent.id);\n const branchKey = parent.branches.getKeyOfNode(this);\n parent.branches.setBranch(branchKey, keepBranch);\n // remove parents from own list\n // this will auto-remove the connection to the other '1'-branch\n this.parents.remove(parent);\n // if parent has now two equal branches,\n // we have to apply the reduction again\n // to ensure we end in a valid state\n if (parent.branches.areBranchesStrictEqual() && parent.isInternalNode()) {\n parent.applyReductionRule();\n }\n });\n return true;\n }\n return false;\n }", "function willCleanupTree(env, morph, destroySelf) {}", "function cancelButtonClick() {\n if (!continueProcessing) {\n $('#splitUUID').val('');\n $('#splitDescription').val(\"\");\n setTimefieldTimeBegin(0);\n setTimefieldTimeEnd(0);\n $('#splitIndex').html('#');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n editor.selectedSplit = null;\n }\n}", "popToNearestCommonAncestor(prev, parentNext);\n } else {\n // We must still be deeper.\n popNextToCommonLevel(prev, parentNext);\n }", "function repoPruneCompletedTransactionsBelowNode(repo, node) {\n var queue = treeGetValue(node);\n if (queue) {\n var to = 0;\n for (var from = 0; from < queue.length; from++) {\n if (queue[from].status !== 2 /* COMPLETED */) {\n queue[to] = queue[from];\n to++;\n }\n }\n queue.length = to;\n treeSetValue(node, queue.length > 0 ? queue : undefined);\n }\n treeForEachChild(node, function (childNode) {\n repoPruneCompletedTransactionsBelowNode(repo, childNode);\n });\n}", "function delete_project(){ \n \n if(tree_root != null){\n deletedpro = tree_root;\n treeNode = tree_nodes;\n if(project_id == -1){\n //When a new project is created but has not been saved yet\n discard_project();\n displayToastMessage('Project cleared from workspace');\n undoManager.add({\n undo: function () {\n save_project1();\n }\n // redo: function () {\n // console.log(\"inside redo function\");\n // delete_project();\n // }\n });\n return;\n }else{\n undoManager.add({\n undo: function () {\n save_project1(deletedpro);\n }\n // redo: function () {\n // console.log(\"inside redo function\");\n // delete_project();\n // }\n });\n $.ajax({\n 'url': '/delete_project',\n 'type': 'POST',\n 'contentType': 'application/json',\n 'data': JSON.stringify({\n 'pname': project_name,\n 'pid': project_id\n }),\n 'success': function(response){\n displayToastMessage(response);\n //Reset the canvas and global variables\n discard_project();\n \n },\n 'error': function(request, status, error){\n displayToastMessage('Project could not be deleted.');\n },\n 'timeout': 2000\n });\n } \n }else{\n if(project_id != -1){\n $.ajax({\n 'url': '/delete_project',\n 'type': 'POST',\n 'contentType': 'application/json',\n 'data': JSON.stringify({\n 'pname': project_name,\n 'pid': project_id\n }),\n 'success': function(response){\n displayToastMessage(response);\n //Reset the canvas and global variables\n discard_project();\n },\n 'error': function(request, status, error){\n displayToastMessage('Project could not be deleted.');\n },\n 'timeout': 2000\n });\n }else{\n displayToastMessage('Nothing to delete');\n }\n }\n}", "function cleanUncommittedReactions() {\n reactionCleanupHandle = undefined; // Loop through all the candidate leaked reactions; those older\n // than CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS get tidied.\n\n var now = Date.now();\n uncommittedReactionRefs.forEach(function (ref) {\n var tracking = ref.current;\n\n if (tracking) {\n if (now >= tracking.cleanAt) {\n // It's time to tidy up this leaked reaction.\n tracking.reaction.dispose();\n ref.current = null;\n uncommittedReactionRefs.delete(ref);\n }\n }\n });\n\n if (uncommittedReactionRefs.size > 0) {\n // We've just finished a round of cleanups but there are still\n // some leak candidates outstanding.\n ensureCleanupTimerRunning();\n }\n}", "function cleanUncommittedReactions() {\n reactionCleanupHandle = undefined; // Loop through all the candidate leaked reactions; those older\n // than CLEANUP_LEAKED_REACTIONS_AFTER_MILLIS get tidied.\n\n var now = Date.now();\n uncommittedReactionRefs.forEach(function (ref) {\n var tracking = ref.current;\n\n if (tracking) {\n if (now >= tracking.cleanAt) {\n // It's time to tidy up this leaked reaction.\n tracking.reaction.dispose();\n ref.current = null;\n uncommittedReactionRefs.delete(ref);\n }\n }\n });\n\n if (uncommittedReactionRefs.size > 0) {\n // We've just finished a round of cleanups but there are still\n // some leak candidates outstanding.\n ensureCleanupTimerRunning();\n }\n}", "function cancel(e) {\n e.parentNode.parentNode.removeChild(e.parentNode)\n}", "clipTo (tree, alsoRemovecoplanarFront) {\n let node = this\n const stack = []\n do {\n if (node.polygontreenodes.length > 0) {\n tree.rootnode.clipPolygons(node.polygontreenodes, alsoRemovecoplanarFront)\n }\n if (node.front) stack.push(node.front)\n if (node.back) stack.push(node.back)\n node = stack.pop()\n } while (node !== undefined)\n }", "function modify_child_Parent_relationship() {\n\t\n\tvar parent_index = 0, child_index = 1;\n\t\n\t\n\n\tparent = modify_Parent_Child_relationship_queue[parent_index].node,\n\tchild = modify_Parent_Child_relationship_queue[child_index].node;\n\t\n\t//If I get here no matter what I have to clear the queue\n\tmodify_Parent_Child_relationship_queue.length = 0;\n\t\n\tif ( parent === child ) {\n\t\t//If parent is child i'll delete the earliest clicked element\n\t\t//modify_Parent_Child_relationship_queue.splice(0);\n\t\tLog('Warning: Node ' + parent.id + ' cannot be a parent or child of itself');\n\t\t//modify_Parent_Child_relationship_queue.length = 0;\n\t\treturn;\n\t\t\n\t}\n\t\n\t\n\t//If you clicked on the two nodes and they are already\n\t//parent child but in the reverse order that you clicked\n\t//them break them up\n\tif ( child.animationChildren[parent.id] == parent ) {\n\t\t\n\t\tbreakConnection(child, parent);\t\n\t\t/*Log(\"Breaking Parent - Child ( \"+ parent.id + \" ---> \"\n\t\t + child.id + \" ) relationship\");\t*/\n\t\treturn; \n\t}\n\t\n\t//If they already parent child then break the relationship\n\tif (child.animationParent == parent ) {\n\t\tbreakConnection(parent, child);\t\n\t\t/*Log(\"Breaking Parent - Child ( \"+ parent.id + \" ---> \"\n\t\t + child.id + \" ) relationship\");*/\n\t\t \n\t\treturn; \n\t}\n\t\t\n\t//If child already has parent... See yaaaa\n\tif( (child.animationParent && child.animationParent != parent && max_number_of_parents<=1)){\n\t\tLog('Warning: No node including Node ' + child.id +\n\t\t ' can have more than one parent');\n\t\treturn;\t\n\t}\n\t\n\tif( Object.keys(parent.animationChildren).length \n\t\t>= max_number_of_children && parent.animationChildren[child.id]!=child ){\n\t\tLog('Warning: No node including Node ' + parent.id +\n\t\t ' can have more than '+ max_number_of_children + ' child(ren)');\n\t\t\treturn;\n\t\t\n\t\t}\n\t\t\n\t\n\tif ( parent.getLineConnectedToNode[child.id] ||\n\t child.getLineConnectedToNode[parent.id]) {\n\t\t\n\t\tbreakConnection( parent, child, true);\n\t\t//Lets disconnect them if theyre not parent-child\n\t\t\n\t\t \n\t\tLog(\"Breaking Connection from Node \"+ parent.id + \" to Node \"\n\t\t\t+ child.id );\n\t\t \n\t\t return;\n\t}\t\n\t\t\n\tcreateParent_Child_Relationship(parent, child); \n\t \n\t\n}", "cancel() {\n if (this.timeoutId) {\n clearTimeout(this.timeoutId);\n }\n if (this.intervalId) {\n clearInterval(this.intervalId);\n }\n this.timeoutId = undefined;\n this.intervalId = undefined;\n this.sequence = 0;\n this.isActive = false;\n this.times = [];\n if (this.rejectCallback) {\n this.rejectCallback(new Error('cancel'));\n }\n this.rejectCallback = undefined;\n }", "function selectAndCollapseParent() {\n const cursor = requireCursor();\n const tasks = getTasks();\n for (let i = 0; i < tasks.length; i++) {\n let task = tasks[i];\n if (task === cursor) {\n for (let j = i; j >= 0; j--) {\n task = tasks[j];\n if (getUniqueClass(task, 'down')) {\n setCursor(task, 'scroll');\n toggleCollapse(task);\n break;\n }\n // If we hit the top level, then stop looking for a parent.\n if (getIndentClass(task) === 'indent_1') {\n break;\n }\n }\n break;\n }\n }\n }" ]
[ "0.5689018", "0.54323924", "0.54191774", "0.524527", "0.5235297", "0.52264637", "0.5205375", "0.5180614", "0.5159359", "0.5159359", "0.5123126", "0.5114417", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5081385", "0.5034972", "0.5024011", "0.5021755", "0.5021755", "0.49786514", "0.4900382", "0.489858", "0.48841146", "0.48775348", "0.4862476", "0.4849258", "0.48438966", "0.48276207", "0.47945255", "0.47674286", "0.47135517", "0.4707686", "0.47048727", "0.47048727", "0.47015104", "0.46740362", "0.46520823", "0.4638774", "0.46310493", "0.46131772", "0.45911634", "0.4590111", "0.45786116", "0.45771897", "0.4573847", "0.4573847", "0.4573847", "0.4573847", "0.4573847", "0.4573847", "0.45705703", "0.45509133", "0.45443273", "0.454045", "0.45242938", "0.4504529", "0.44946614", "0.44901344", "0.44880906", "0.44773757", "0.44689664", "0.4466939", "0.44637972", "0.44509134", "0.44509134", "0.44384852", "0.44297135", "0.4421224", "0.44170544", "0.4408485", "0.44016695", "0.43921232", "0.4389289", "0.43888903", "0.43839592", "0.43761158", "0.43727282", "0.43716618", "0.4363544", "0.43623057", "0.43549353", "0.43549353", "0.43189842", "0.4318572", "0.4311198", "0.43107355", "0.4310268" ]
0.5037751
28
This class defines a complete listener for a parse tree produced by XMLParser.
function XMLParserListener() { antlr4.tree.ParseTreeListener.call(this); return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sectealListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function RListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function statListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function SHRDataElementParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function ErlangListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function cpdListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function ReoListener() {\n antlr4.tree.ParseTreeListener.call(this);\n return this\n}", "function ArticleListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n // Here should go the calls for different functions to parse the various blocks\n var error = this.parseXMLFile(rootElement);\n\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n this.loadedOk = true;\n\n // As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n this.scene.onGraphLoaded();\n }", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n // Here should go the calls for different functions to parse the various blocks\n var error = this.parseXMLFile(rootElement);\n\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n this.loadedOk = true;\n\n // As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n this.scene.onGraphLoaded();\n }", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n // Here should go the calls for different functions to parse the various blocks\n var error = this.parseXMLFile(rootElement);\n\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n this.loadedOk = true;\n\n // As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n this.scene.onGraphLoaded();\n }", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n // Here should go the calls for different functions to parse the various blocks\n var error = this.parseXMLFile(rootElement);\n\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n this.loadedOk = true;\n\n // As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n this.scene.onGraphLoaded();\n }", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n // Here should go the calls for different functions to parse the various blocks\n var error = this.parseXMLFile(rootElement);\n\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n this.loadedOk = true;\n\n // As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n this.scene.onGraphLoaded();\n }", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n // Here should go the calls for different functions to parse the various blocks\n var error = this.parseXMLFile(rootElement);\n\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n this.loadedOk = true;\n\n // As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n this.scene.onGraphLoaded();\n }", "onXMLReady() {\n\t\tthis.log(\"XML Loading finished.\");\n\t\tvar rootElement = this.reader.xmlDoc.documentElement;\n\n\t\t// Here should go the calls for different functions to parse the various blocks\n\t\tvar error = this.parseXMLFile(rootElement);\n\n\t\tif (error != null) {\n\t\t\tthis.onXMLError(error);\n\t\t\treturn;\n\t\t}\n\n\t\tthis.loadedOk = true;\n\n\t\t// As the graph loaded ok, signal the scene so that any additional initialization depending on the graph can take place\n\t\tthis.scene.onGraphLoaded();\n\t}", "function ExprListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function ArgdownListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "onXMLReady() {\n this.log(\"XML Loading finished.\");\n var rootElement = this.reader.xmlDoc.documentElement;\n\n var error = this.parseXMLFile(rootElement);\n if (error != null) {\n this.onXMLError(error);\n return;\n }\n\n // Signal the scene so that any additional initialization depending on the data can take place\n this.scene.onDataLoaded();\n }", "onXMLReady() {\n console.log(\"XML Loading finished.\");\n\n const rootElement = this.reader.xmlDoc.documentElement;\n\n console.groupCollapsed(\"XMLYas Parsing\");\n this.parseXMLFile(rootElement);\n console.groupEnd();\n\n this.scene.onGraphLoaded();\n }", "onXMLReady()\r\n {\r\n this.log(\"XML Loading finished.\");\r\n var rootElement = this.reader.xmlDoc.documentElement;\r\n \r\n var error = this.parseXMLFile(rootElement); // Here should go the calls for different functions to parse the various blocks\r\n if (error != null) { this.onXMLError(error); return; }\r\n this.loadedOk = true;\r\n \r\n /**\r\n * As the graph loaded ok, signal the scene so that any\r\n * additional initialization depending on the graph can take place */\r\n this.scene.onGraphLoaded();\r\n }", "function EQLListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function jsonListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function helloListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function repostListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function QLListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function Java9Listener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function FlightListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function grammarlangListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function FPythonListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "onend() {\n if (this.done)\n return;\n this.done = true;\n this.parser = null;\n this.handleCallback(null);\n }", "function NotepadParserListener() {\n antlr4.tree.ParseTreeListener.call(this);\n return this;\n }", "function SRListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function Listener() {}", "function Listener() {}", "function BVHListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function GraphGListener() {\r\n\tantlr4.tree.ParseTreeListener.call(this);\r\n\treturn this;\r\n}", "listener() {}", "function MappingListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function Listener() { }", "init() {\n //DW:P0:0;\n var self = this;\n var generalListener = function (line) {\n //decoupage\n var dataType = \"\";\n var name = \"\";\n var value = \"\";\n var re = /([A-Z]{2,3}):(.*):(.*);/i;\n var found = line.match(re);\n if (found != null && found.length == 4) {\n dataType = found[1];\n name = found[2];\n value = found[3];\n }\n //console.log_(found);\n var arrayLength = self.onReceivedListeners.length;\n var eventProcessed = false;\n for (var i = 0; i < arrayLength; i++) {\n var listener = self.onReceivedListeners[i];\n if (!eventProcessed && (listener.dataType === dataType || listener.dataType === \"*\")\n && (listener.name === name || listener.name === \"*\")) {\n listener.callback(this, value, line, dataType, name);\n eventProcessed = true;\n if (listener.removeAfter) {\n delete self.onReceivedListeners[i];\n }\n return;\n }\n }\n if (!eventProcessed) {\n self.onDefaultReceivedListener(line);\n }\n };\n //console.log_(this.onReadLine);\n //console.log(generalListener);\n this.onReadLine.addListener(generalListener);\n }", "function pseudoCodeParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function DataStructsListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function Parser()\n{\n this.pathArray = [];\n \n this.onopentag = function(path, node) { }\n this.onclosetag = function(path) { }\n this.ontext = function(path, text) { }\n \n this.parse = function(xmlSource) {\n this.pathArray = [];\n this.path = '';\n \n var parser = sax.parser(true);\n \n parser.onopentag = function(node) {\n this.pathArray.push(node.name);\n this.path = this.pathArray.join(\".\");\n \n this.onopentag(this.path, node);\n }.bind(this);\n \n parser.ontext = function(text) {\n this.ontext(this.path, text);\n }.bind(this);\n \n parser.onclosetag = function() {\n this.onclosetag(this.path);\n this.pathArray.pop();\n this.path = this.pathArray.join(\".\");\n }.bind(this);\n \n parser.write(xmlSource).close();\n }\n}", "_initTrackingXPathListener(listener) {\n listener.oldData = this._hashValueForListener(listener.trackingXPath);\n }", "addHikeListener() {\n // We need to loop through the children of our list and attach a listener to each, remember though that children is a nodeList...not an array. So in order to use something like a forEach we need to convert it to an array.\n }", "aListener(val) {}", "function PLSQLListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "function searchListenerTree(handlers, type, tree, i, typeLength) {\n if (!tree) {\n return null;\n }\n\n if (i === 0) {\n var kind = typeof type;\n if (kind === 'string') {\n var ns, n, l = 0, j = 0, delimiter = this.delimiter, dl = delimiter.length;\n if ((n = type.indexOf(delimiter)) !== -1) {\n ns = new Array(5);\n do {\n ns[l++] = type.slice(j, n);\n j = n + dl;\n } while ((n = type.indexOf(delimiter, j)) !== -1);\n\n ns[l++] = type.slice(j);\n type = ns;\n typeLength = l;\n } else {\n type = [type];\n typeLength = 1;\n }\n } else if (kind === 'object') {\n typeLength = type.length;\n } else {\n type = [type];\n typeLength = 1;\n }\n }\n\n var listeners= null, branch, xTree, xxTree, isolatedBranch, endReached, currentType = type[i],\n nextType = type[i + 1], branches, _listeners;\n\n if (i === typeLength) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n\n if(tree._listeners) {\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n listeners = [tree];\n } else {\n handlers && handlers.push.apply(handlers, tree._listeners);\n listeners = [tree];\n }\n }\n } else {\n\n if (currentType === '*') {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n branches = ownKeys(tree);\n n = branches.length;\n while (n-- > 0) {\n branch = branches[n];\n if (branch !== '_listeners') {\n _listeners = searchListenerTree(handlers, type, tree[branch], i + 1, typeLength);\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n }\n return listeners;\n } else if (currentType === '**') {\n endReached = (i + 1 === typeLength || (i + 2 === typeLength && nextType === '*'));\n if (endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = searchListenerTree(handlers, type, tree, typeLength, typeLength);\n }\n\n branches = ownKeys(tree);\n n = branches.length;\n while (n-- > 0) {\n branch = branches[n];\n if (branch !== '_listeners') {\n if (branch === '*' || branch === '**') {\n if (tree[branch]._listeners && !endReached) {\n _listeners = searchListenerTree(handlers, type, tree[branch], typeLength, typeLength);\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);\n } else if (branch === nextType) {\n _listeners = searchListenerTree(handlers, type, tree[branch], i + 2, typeLength);\n } else {\n // No match on this one, shift into the tree but not in the type array.\n _listeners = searchListenerTree(handlers, type, tree[branch], i, typeLength);\n }\n if (_listeners) {\n if (listeners) {\n listeners.push.apply(listeners, _listeners);\n } else {\n listeners = _listeners;\n }\n }\n }\n }\n return listeners;\n } else if (tree[currentType]) {\n listeners = searchListenerTree(handlers, type, tree[currentType], i + 1, typeLength);\n }\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i + 1, typeLength);\n }\n\n xxTree = tree['**'];\n if (xxTree) {\n if (i < typeLength) {\n if (xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n branches= ownKeys(xxTree);\n n= branches.length;\n while(n-->0){\n branch= branches[n];\n if (branch !== '_listeners') {\n if (branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i + 2, typeLength);\n } else if (branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i + 1, typeLength);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, {'**': isolatedBranch}, i + 1, typeLength);\n }\n }\n }\n } else if (xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength, typeLength);\n } else if (xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength, typeLength);\n }\n }\n\n return listeners;\n }", "function reqListener(){\n\t\tvar x = this;\n\t\tif(isFunc(this.cb_func)){\n\t\t\tthis.cb_func(this.responseXML);\n\t\t}\n\t}", "onDidChangeElementTree()/*: void*/ {\n if (this.elementTree) {\n for (let evt of this.DOM_EVENTS.split(\" \")) {\n this[_elementTree].addEventListener(evt, (e)=>this.emit(\"DOMEvent\", e), true);\n }\n //this[_hammer] = new Hammer(this[_elementTree], {domEvents: true});\n this[_hammer] = new Hammer.Manager(this[_elementTree], {\n recognizers: this.HAMMER_RECOGNIZERS,\n domEvents: true\n });\n this[_hammer].on(this.HAMMER_EVENTS, (e)=>this.emit(\"hammerEvent\", e));\n\n if (this.renderElement) {\n addTreeToElement.call(this);\n }\n }\n }", "function ParsedEvent(name,targetOrPhase,type,handler,sourceSpan){this.name=name;this.targetOrPhase=targetOrPhase;this.type=type;this.handler=handler;this.sourceSpan=sourceSpan;}", "on(name, cb) {\n let array = name.split(\".\"), adjustedLength = Math.max(array.length, 1), path = array.slice(0, adjustedLength - 1), last = array[adjustedLength - 1];\n let tree = this.evTree;\n for (let t of path) {\n tree = tree[t] || (tree[t] = { __ehs: [] });\n } // make tree via path\n if (!tree[last]) {\n tree[last] = { __ehs: [] };\n }\n tree[last].__ehs.push(cb); // store cb\n }", "function processDataFromXML() {\n\treturn function($event) {\n\t\tparseXML($event.target.result);\n\t\ttoolSetting();\n\t}\n}", "function FeedParser () {\n var self = this;\n self.saxStream = require('sax').createStream(false, {lowercasetags: true}); // https://github.com/isaacs/sax-js\n self.saxStream.on('error', function (e){ self.handleError(e, self) });\n self.saxStream.on('opentag', function (n){ self.handleOpenTag(n, self) });\n self.saxStream.on('closetag', function (el){ self.handleCloseTag(el, self) });\n self.saxStream.on('text', function (text){ self.handleText(text, self) });\n self.saxStream.on('cdata', function (text){ self.handleText(text, self) });\n self.saxStream.on('end', function (){ self.handleEnd(self) });\n events.EventEmitter.call(this);\n}", "function EmojiScriptParserListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "attachJsonParserListeners() {\n // Listen to json parser events\n this.jsonParser.onValue = (value) => {\n const depth = this.jsonParser.stack.length;\n const keys = (new Array(depth + 1).fill(0)).map((v, i) => {\n return i === depth ? this.jsonParser.key : this.jsonParser.stack[i].key;\n });\n if (!this.isParsingContextInner(depth)) { // Don't parse inner nodes inside @context\n const valueJobCb = () => this.newOnValueJob(keys, value, depth, true);\n if (!this.parsingContext.streamingProfile\n && !this.parsingContext.contextTree.getContext(keys.slice(0, -1))) {\n // If an out-of-order context is allowed,\n // we have to buffer everything.\n // We store jobs for @context's and @type's separately,\n // because at the end, we have to process them first.\n // We also handle @type because these *could* introduce a type-scoped context.\n if (keys[depth] === '@context') {\n let jobs = this.contextJobs[depth];\n if (!jobs) {\n jobs = this.contextJobs[depth] = [];\n }\n jobs.push(valueJobCb);\n }\n else if (keys[depth] === '@type'\n || typeof keys[depth] === 'number' && keys[depth - 1] === '@type') { // Also capture @type with array values\n // Remove @type from keys, because we want it to apply to parent later on\n this.typeJobs.push({ job: valueJobCb, keys: keys.slice(0, keys.length - 1) });\n }\n else {\n this.contextAwaitingJobs.push({ job: valueJobCb, keys });\n }\n }\n else {\n // Make sure that our value jobs are chained synchronously\n this.lastOnValueJob = this.lastOnValueJob.then(valueJobCb);\n }\n // Execute all buffered jobs on deeper levels\n if (!this.parsingContext.streamingProfile && depth === 0) {\n this.lastOnValueJob = this.lastOnValueJob\n .then(() => this.executeBufferedJobs());\n }\n }\n };\n this.jsonParser.onError = (error) => {\n this.emit('error', error);\n };\n }", "attachJsonParserListeners() {\n // Listen to json parser events\n this.jsonParser.onValue = (value) => {\n const depth = this.jsonParser.stack.length;\n const keys = (new Array(depth + 1).fill(0)).map((v, i) => {\n return i === depth ? this.jsonParser.key : this.jsonParser.stack[i].key;\n });\n if (!this.isParsingContextInner(depth)) { // Don't parse inner nodes inside @context\n const valueJobCb = () => this.newOnValueJob(keys, value, depth, true);\n if (!this.parsingContext.streamingProfile\n && !this.parsingContext.contextTree.getContext(keys.slice(0, -1))) {\n // If an out-of-order context is allowed,\n // we have to buffer everything.\n // We store jobs for @context's and @type's separately,\n // because at the end, we have to process them first.\n // We also handle @type because these *could* introduce a type-scoped context.\n if (keys[depth] === '@context') {\n let jobs = this.contextJobs[depth];\n if (!jobs) {\n jobs = this.contextJobs[depth] = [];\n }\n jobs.push(valueJobCb);\n }\n else if (keys[depth] === '@type'\n || typeof keys[depth] === 'number' && keys[depth - 1] === '@type') { // Also capture @type with array values\n // Remove @type from keys, because we want it to apply to parent later on\n this.typeJobs.push({ job: valueJobCb, keys: keys.slice(0, keys.length - 1) });\n }\n else {\n this.contextAwaitingJobs.push({ job: valueJobCb, keys });\n }\n }\n else {\n // Make sure that our value jobs are chained synchronously\n this.lastOnValueJob = this.lastOnValueJob.then(valueJobCb);\n }\n // Execute all buffered jobs on deeper levels\n if (!this.parsingContext.streamingProfile && depth === 0) {\n this.lastOnValueJob = this.lastOnValueJob\n .then(() => this.executeBufferedJobs());\n }\n }\n };\n this.jsonParser.onError = (error) => {\n this.emit('error', error);\n };\n }", "function PlayScriptListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "onChildrenLoadEnd() {\n if (this._childrenLoadEnd) {\n this._childrenLoadEnd.raise();\n }\n }", "onparserinit(){\n this.document = new XNode('document', { format: this.options.format })\n this._tagStack = [this.document]\n }", "function myParse (res, cb) {\n res.text = '';\n res.on('data', chunk => res.text += chunk);\n res.on('end', () => xml2js.parseString(res.text, cb));\n}", "addOnCompleteListener(callback) {\n this.on(this.fileTransferCompleteEvent, callback);\n }", "function __parseLoop__(impl, doc, p, isWindowDocument) {\n var iEvt, iNode, iAttr, strName;\n var iNodeParent = doc;\n\n var el_close_count = 0;\n\n var entitiesList = new Array();\n var textNodesList = new Array();\n\n // if namespaceAware, add default namespace\n if (impl.namespaceAware) {\n var iNS = doc.createNamespace(\"\"); // add the default-default namespace\n iNS.value = \"http://www.w3.org/2000/xmlns/\";\n doc._namespaces.setNamedItem(iNS);\n }\n\n // loop until SAX parser stops emitting events\n var q = 0;\n while(true) {\n // get next event\n iEvt = p.next();\n \n if (iEvt == XMLP._ELM_B) { // Begin-Element Event\n var pName = p.getName(); // get the Element name\n pName = trim(pName, true, true); // strip spaces from Element name\n if(pName.toLowerCase() == 'script')\n p.replaceEntities = false;\n\n if (!impl.namespaceAware) {\n iNode = doc.createElement(p.getName()); // create the Element\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttribute(strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNode(iAttr); // attach Attribute to Element\n }\n }\n else { // Namespace Aware\n // create element (with empty namespaceURI,\n // resolve after namespace 'attributes' have been parsed)\n iNode = doc.createElementNS(\"\", p.getName());\n\n // duplicate ParentNode's Namespace definitions\n iNode._namespaces = __cloneNamedNodes__(iNodeParent._namespaces, iNode);\n\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n\n // if attribute is a namespace declaration\n if (__isNamespaceDeclaration__(strName)) {\n // parse Namespace Declaration\n var namespaceDec = __parseNSName__(strName);\n\n if (strName != \"xmlns\") {\n iNS = doc.createNamespace(strName); // define namespace\n }\n else {\n iNS = doc.createNamespace(\"\"); // redefine default namespace\n }\n iNS.value = p.getAttributeValue(i); // set value = namespaceURI\n\n iNode._namespaces.setNamedItem(iNS); // attach namespace to namespace collection\n }\n else { // otherwise, it is a normal attribute\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttributeNS(\"\", strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNodeNS(iAttr); // attach Attribute to Element\n\n if (__isIdDeclaration__(strName)) {\n iNode.id = p.getAttributeValue(i); // cache ID for getElementById()\n }\n }\n }\n\n // resolve namespaceURIs for this Element\n if (iNode._namespaces.getNamedItem(iNode.prefix)) {\n iNode.namespaceURI = iNode._namespaces.getNamedItem(iNode.prefix).value;\n }\n\n // for this Element's attributes\n for (var i = 0; i < iNode.attributes.length; i++) {\n if (iNode.attributes.item(i).prefix != \"\") { // attributes do not have a default namespace\n if (iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix)) {\n iNode.attributes.item(i).namespaceURI = iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix).value;\n }\n }\n }\n }\n\n // if this is the Root Element\n if (iNodeParent.nodeType == DOMNode.DOCUMENT_NODE) {\n iNodeParent._documentElement = iNode; // register this Element as the Document.documentElement\n }\n\n iNodeParent.appendChild(iNode); // attach Element to parentNode\n iNodeParent = iNode; // descend one level of the DOM Tree\n }\n\n else if(iEvt == XMLP._ELM_E) { // End-Element Event \n __endHTMLElement__(iNodeParent, doc, p);\n iNodeParent = iNodeParent.parentNode; // ascend one level of the DOM Tree\n }\n\n else if(iEvt == XMLP._ELM_EMP) { // Empty Element Event\n pName = p.getName(); // get the Element name\n pName = trim(pName, true, true); // strip spaces from Element name\n\n if (!impl.namespaceAware) {\n iNode = doc.createElement(pName); // create the Element\n\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttribute(strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNode(iAttr); // attach Attribute to Element\n }\n }\n else { // Namespace Aware\n // create element (with empty namespaceURI,\n // resolve after namespace 'attributes' have been parsed)\n iNode = doc.createElementNS(\"\", p.getName());\n\n // duplicate ParentNode's Namespace definitions\n iNode._namespaces = __cloneNamedNodes__(iNodeParent._namespaces, iNode);\n\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n\n // if attribute is a namespace declaration\n if (__isNamespaceDeclaration__(strName)) {\n // parse Namespace Declaration\n var namespaceDec = __parseNSName__(strName);\n\n if (strName != \"xmlns\") {\n iNS = doc.createNamespace(strName); // define namespace\n }\n else {\n iNS = doc.createNamespace(\"\"); // redefine default namespace\n }\n iNS.value = p.getAttributeValue(i); // set value = namespaceURI\n\n iNode._namespaces.setNamedItem(iNS); // attach namespace to namespace collection\n }\n else { // otherwise, it is a normal attribute\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttributeNS(\"\", strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNodeNS(iAttr); // attach Attribute to Element\n\n if (__isIdDeclaration__(strName)) {\n iNode.id = p.getAttributeValue(i); // cache ID for getElementById()\n }\n }\n }\n\n // resolve namespaceURIs for this Element\n if (iNode._namespaces.getNamedItem(iNode.prefix)) {\n iNode.namespaceURI = iNode._namespaces.getNamedItem(iNode.prefix).value;\n }\n\n // for this Element's attributes\n for (var i = 0; i < iNode.attributes.length; i++) {\n if (iNode.attributes.item(i).prefix != \"\") { // attributes do not have a default namespace\n if (iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix)) {\n iNode.attributes.item(i).namespaceURI = iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix).value;\n }\n }\n }\n }\n\n // if this is the Root Element\n if (iNodeParent.nodeType == DOMNode.DOCUMENT_NODE) {\n iNodeParent._documentElement = iNode; // register this Element as the Document.documentElement\n }\n\n iNodeParent.appendChild(iNode); // attach Element to parentNode\n __endHTMLElement__(iNode, doc, p);\n }\n else if(iEvt == XMLP._TEXT || iEvt == XMLP._ENTITY) { // TextNode and entity Events\n // get Text content\n var pContent = p.getContent().substring(p.getContentBegin(), p.getContentEnd());\n\n if (!impl.preserveWhiteSpace ) {\n if (trim(pContent, true, true) == \"\") {\n pContent = \"\"; //this will cause us not to create the text node below\n }\n }\n\n if (pContent.length > 0) { // ignore empty TextNodes\n var textNode = doc.createTextNode(pContent);\n iNodeParent.appendChild(textNode); // attach TextNode to parentNode\n\n //the sax parser breaks up text nodes when it finds an entity. For\n //example hello&lt;there will fire a text, an entity and another text\n //this sucks for the dom parser because it looks to us in this logic\n //as three text nodes. I fix this by keeping track of the entity nodes\n //and when we're done parsing, calling normalize on their parent to\n //turn the multiple text nodes into one, which is what DOM users expect\n //the code to do this is at the bottom of this function\n if (iEvt == XMLP._ENTITY) {\n entitiesList[entitiesList.length] = textNode;\n }\n else {\n //I can't properly decide how to handle preserve whitespace\n //until the siblings of the text node are built due to\n //the entitiy handling described above. I don't know that this\n //will be all of the text node or not, so trimming is not appropriate\n //at this time. Keep a list of all the text nodes for now\n //and we'll process the preserve whitespace stuff at a later time.\n textNodesList[textNodesList.length] = textNode;\n }\n }\n }\n else if(iEvt == XMLP._PI) { // ProcessingInstruction Event\n // attach ProcessingInstruction to parentNode\n iNodeParent.appendChild(doc.createProcessingInstruction(p.getName(), p.getContent().substring(p.getContentBegin(), p.getContentEnd())));\n }\n else if(iEvt == XMLP._CDATA) { // CDATA Event\n // get CDATA data\n pContent = p.getContent().substring(p.getContentBegin(), p.getContentEnd());\n\n if (!impl.preserveWhiteSpace) {\n pContent = trim(pContent, true, true); // trim whitespace\n pContent.replace(/ +/g, ' '); // collapse multiple spaces to 1 space\n }\n\n if (pContent.length > 0) { // ignore empty CDATANodes\n iNodeParent.appendChild(doc.createCDATASection(pContent)); // attach CDATA to parentNode\n }\n }\n else if(iEvt == XMLP._COMMENT) { // Comment Event\n // get COMMENT data\n var pContent = p.getContent().substring(p.getContentBegin(), p.getContentEnd());\n\n if (!impl.preserveWhiteSpace) {\n pContent = trim(pContent, true, true); // trim whitespace\n pContent.replace(/ +/g, ' '); // collapse multiple spaces to 1 space\n }\n\n if (pContent.length > 0) { // ignore empty CommentNodes\n iNodeParent.appendChild(doc.createComment(pContent)); // attach Comment to parentNode\n }\n }\n else if(iEvt == XMLP._DTD) { // ignore DTD events\n }\n else if(iEvt == XMLP._ERROR) {\n $error(\"Fatal Error: \" + p.getContent() +\n \"\\nLine: \" + p.getLineNumber() +\n \"\\nColumn: \" + p.getColumnNumber() + \"\\n\");\n throw(new DOMException(DOMException.SYNTAX_ERR));\n }\n else if(iEvt == XMLP._NONE) { // no more events\n //steven woods notes that unclosed tags are rejected elsewhere and this check\n\t //breaks a table patching routine\n\t /*if (iNodeParent == doc) { // confirm that we have recursed back up to root\n break;\n }\n else {\n throw(new DOMException(DOMException.SYNTAX_ERR)); // one or more Tags were not closed properly\n }*/\n break;\n\n }\n }\n\n //normalize any entities in the DOM to a single textNode\n for (var i = 0; i < entitiesList.length; i++) {\n var entity = entitiesList[i];\n //its possible (if for example two entities were in the\n //same domnode, that the normalize on the first entitiy\n //will remove the parent for the second. Only do normalize\n //if I can find a parent node\n var parentNode = entity.parentNode;\n if (parentNode) {\n parentNode.normalize();\n\n //now do whitespace (if necessary)\n //it was not done for text nodes that have entities\n if(!impl.preserveWhiteSpace) {\n var children = parentNode.childNodes;\n for ( var j = 0; j < children.length; j++) {\n var child = children.item(j);\n if (child.nodeType == DOMNode.TEXT_NODE) {\n var childData = child.data;\n childData.replace(/\\s/g, ' ');\n child.data = childData;\n }\n }\n }\n }\n }\n\n //do the preserve whitespace processing on the rest of the text nodes\n //It's possible (due to the processing above) that the node will have been\n //removed from the tree. Only do whitespace checking if parentNode is not null.\n //This may duplicate the whitespace processing for some nodes that had entities in them\n //but there's no way around that\n if (!impl.preserveWhiteSpace) {\n for (var i = 0; i < textNodesList.length; i++) {\n var node = textNodesList[i];\n if (node.parentNode != null) {\n var nodeData = node.data;\n nodeData.replace(/\\s/g, ' ');\n node.data = nodeData;\n }\n }\n\n }\n}", "function __parseLoop__(impl, doc, p, isWindowDocument) {\n var iEvt, iNode, iAttr, strName;\n var iNodeParent = doc;\n\n var el_close_count = 0;\n\n var entitiesList = new Array();\n var textNodesList = new Array();\n\n // if namespaceAware, add default namespace\n if (impl.namespaceAware) {\n var iNS = doc.createNamespace(\"\"); // add the default-default namespace\n iNS.value = \"http://www.w3.org/2000/xmlns/\";\n doc._namespaces.setNamedItem(iNS);\n }\n\n // loop until SAX parser stops emitting events\n var q = 0;\n while(true) {\n // get next event\n iEvt = p.next();\n \n if (iEvt == XMLP._ELM_B) { // Begin-Element Event\n var pName = p.getName(); // get the Element name\n pName = trim(pName, true, true); // strip spaces from Element name\n if(pName.toLowerCase() == 'script')\n p.replaceEntities = false;\n\n if (!impl.namespaceAware) {\n iNode = doc.createElement(p.getName()); // create the Element\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttribute(strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNode(iAttr); // attach Attribute to Element\n }\n }\n else { // Namespace Aware\n // create element (with empty namespaceURI,\n // resolve after namespace 'attributes' have been parsed)\n iNode = doc.createElementNS(\"\", p.getName());\n\n // duplicate ParentNode's Namespace definitions\n iNode._namespaces = __cloneNamedNodes__(iNodeParent._namespaces, iNode);\n\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n\n // if attribute is a namespace declaration\n if (__isNamespaceDeclaration__(strName)) {\n // parse Namespace Declaration\n var namespaceDec = __parseNSName__(strName);\n\n if (strName != \"xmlns\") {\n iNS = doc.createNamespace(strName); // define namespace\n }\n else {\n iNS = doc.createNamespace(\"\"); // redefine default namespace\n }\n iNS.value = p.getAttributeValue(i); // set value = namespaceURI\n\n iNode._namespaces.setNamedItem(iNS); // attach namespace to namespace collection\n }\n else { // otherwise, it is a normal attribute\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttributeNS(\"\", strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNodeNS(iAttr); // attach Attribute to Element\n\n if (__isIdDeclaration__(strName)) {\n iNode.id = p.getAttributeValue(i); // cache ID for getElementById()\n }\n }\n }\n\n // resolve namespaceURIs for this Element\n if (iNode._namespaces.getNamedItem(iNode.prefix)) {\n iNode.namespaceURI = iNode._namespaces.getNamedItem(iNode.prefix).value;\n }\n\n // for this Element's attributes\n for (var i = 0; i < iNode.attributes.length; i++) {\n if (iNode.attributes.item(i).prefix != \"\") { // attributes do not have a default namespace\n if (iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix)) {\n iNode.attributes.item(i).namespaceURI = iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix).value;\n }\n }\n }\n }\n\n // if this is the Root Element\n if (iNodeParent.nodeType == DOMNode.DOCUMENT_NODE) {\n iNodeParent._documentElement = iNode; // register this Element as the Document.documentElement\n }\n\n iNodeParent.appendChild(iNode); // attach Element to parentNode\n iNodeParent = iNode; // descend one level of the DOM Tree\n }\n\n else if(iEvt == XMLP._ELM_E) { // End-Element Event \n __endHTMLElement__(iNodeParent, doc, p);\n iNodeParent = iNodeParent.parentNode; // ascend one level of the DOM Tree\n }\n\n else if(iEvt == XMLP._ELM_EMP) { // Empty Element Event\n pName = p.getName(); // get the Element name\n pName = trim(pName, true, true); // strip spaces from Element name\n\n if (!impl.namespaceAware) {\n iNode = doc.createElement(pName); // create the Element\n\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttribute(strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNode(iAttr); // attach Attribute to Element\n }\n }\n else { // Namespace Aware\n // create element (with empty namespaceURI,\n // resolve after namespace 'attributes' have been parsed)\n iNode = doc.createElementNS(\"\", p.getName());\n\n // duplicate ParentNode's Namespace definitions\n iNode._namespaces = __cloneNamedNodes__(iNodeParent._namespaces, iNode);\n\n // add attributes to Element\n for(var i = 0; i < p.getAttributeCount(); i++) {\n strName = p.getAttributeName(i); // get Attribute name\n\n // if attribute is a namespace declaration\n if (__isNamespaceDeclaration__(strName)) {\n // parse Namespace Declaration\n var namespaceDec = __parseNSName__(strName);\n\n if (strName != \"xmlns\") {\n iNS = doc.createNamespace(strName); // define namespace\n }\n else {\n iNS = doc.createNamespace(\"\"); // redefine default namespace\n }\n iNS.value = p.getAttributeValue(i); // set value = namespaceURI\n\n iNode._namespaces.setNamedItem(iNS); // attach namespace to namespace collection\n }\n else { // otherwise, it is a normal attribute\n iAttr = iNode.getAttributeNode(strName); // if Attribute exists, use it\n\n if(!iAttr) {\n iAttr = doc.createAttributeNS(\"\", strName); // otherwise create it\n }\n\n iAttr.value = p.getAttributeValue(i); // set Attribute value\n iNode.setAttributeNodeNS(iAttr); // attach Attribute to Element\n\n if (__isIdDeclaration__(strName)) {\n iNode.id = p.getAttributeValue(i); // cache ID for getElementById()\n }\n }\n }\n\n // resolve namespaceURIs for this Element\n if (iNode._namespaces.getNamedItem(iNode.prefix)) {\n iNode.namespaceURI = iNode._namespaces.getNamedItem(iNode.prefix).value;\n }\n\n // for this Element's attributes\n for (var i = 0; i < iNode.attributes.length; i++) {\n if (iNode.attributes.item(i).prefix != \"\") { // attributes do not have a default namespace\n if (iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix)) {\n iNode.attributes.item(i).namespaceURI = iNode._namespaces.getNamedItem(iNode.attributes.item(i).prefix).value;\n }\n }\n }\n }\n\n // if this is the Root Element\n if (iNodeParent.nodeType == DOMNode.DOCUMENT_NODE) {\n iNodeParent._documentElement = iNode; // register this Element as the Document.documentElement\n }\n\n iNodeParent.appendChild(iNode); // attach Element to parentNode\n __endHTMLElement__(iNode, doc, p);\n }\n else if(iEvt == XMLP._TEXT || iEvt == XMLP._ENTITY) { // TextNode and entity Events\n // get Text content\n var pContent = p.getContent().substring(p.getContentBegin(), p.getContentEnd());\n\n if (!impl.preserveWhiteSpace ) {\n if (trim(pContent, true, true) == \"\") {\n pContent = \"\"; //this will cause us not to create the text node below\n }\n }\n\n if (pContent.length > 0) { // ignore empty TextNodes\n var textNode = doc.createTextNode(pContent);\n iNodeParent.appendChild(textNode); // attach TextNode to parentNode\n\n //the sax parser breaks up text nodes when it finds an entity. For\n //example hello&lt;there will fire a text, an entity and another text\n //this sucks for the dom parser because it looks to us in this logic\n //as three text nodes. I fix this by keeping track of the entity nodes\n //and when we're done parsing, calling normalize on their parent to\n //turn the multiple text nodes into one, which is what DOM users expect\n //the code to do this is at the bottom of this function\n if (iEvt == XMLP._ENTITY) {\n entitiesList[entitiesList.length] = textNode;\n }\n else {\n //I can't properly decide how to handle preserve whitespace\n //until the siblings of the text node are built due to\n //the entitiy handling described above. I don't know that this\n //will be all of the text node or not, so trimming is not appropriate\n //at this time. Keep a list of all the text nodes for now\n //and we'll process the preserve whitespace stuff at a later time.\n textNodesList[textNodesList.length] = textNode;\n }\n }\n }\n else if(iEvt == XMLP._PI) { // ProcessingInstruction Event\n // attach ProcessingInstruction to parentNode\n iNodeParent.appendChild(doc.createProcessingInstruction(p.getName(), p.getContent().substring(p.getContentBegin(), p.getContentEnd())));\n }\n else if(iEvt == XMLP._CDATA) { // CDATA Event\n // get CDATA data\n pContent = p.getContent().substring(p.getContentBegin(), p.getContentEnd());\n\n if (!impl.preserveWhiteSpace) {\n pContent = trim(pContent, true, true); // trim whitespace\n pContent.replace(/ +/g, ' '); // collapse multiple spaces to 1 space\n }\n\n if (pContent.length > 0) { // ignore empty CDATANodes\n iNodeParent.appendChild(doc.createCDATASection(pContent)); // attach CDATA to parentNode\n }\n }\n else if(iEvt == XMLP._COMMENT) { // Comment Event\n // get COMMENT data\n var pContent = p.getContent().substring(p.getContentBegin(), p.getContentEnd());\n\n if (!impl.preserveWhiteSpace) {\n pContent = trim(pContent, true, true); // trim whitespace\n pContent.replace(/ +/g, ' '); // collapse multiple spaces to 1 space\n }\n\n if (pContent.length > 0) { // ignore empty CommentNodes\n iNodeParent.appendChild(doc.createComment(pContent)); // attach Comment to parentNode\n }\n }\n else if(iEvt == XMLP._DTD) { // ignore DTD events\n }\n else if(iEvt == XMLP._ERROR) {\n $error(\"Fatal Error: \" + p.getContent() +\n \"\\nLine: \" + p.getLineNumber() +\n \"\\nColumn: \" + p.getColumnNumber() + \"\\n\");\n throw(new DOMException(DOMException.SYNTAX_ERR));\n }\n else if(iEvt == XMLP._NONE) { // no more events\n //steven woods notes that unclosed tags are rejected elsewhere and this check\n\t //breaks a table patching routine\n\t /*if (iNodeParent == doc) { // confirm that we have recursed back up to root\n break;\n }\n else {\n throw(new DOMException(DOMException.SYNTAX_ERR)); // one or more Tags were not closed properly\n }*/\n break;\n\n }\n }\n\n //normalize any entities in the DOM to a single textNode\n for (var i = 0; i < entitiesList.length; i++) {\n var entity = entitiesList[i];\n //its possible (if for example two entities were in the\n //same domnode, that the normalize on the first entitiy\n //will remove the parent for the second. Only do normalize\n //if I can find a parent node\n var parentNode = entity.parentNode;\n if (parentNode) {\n parentNode.normalize();\n\n //now do whitespace (if necessary)\n //it was not done for text nodes that have entities\n if(!impl.preserveWhiteSpace) {\n var children = parentNode.childNodes;\n for ( var j = 0; j < children.length; j++) {\n var child = children.item(j);\n if (child.nodeType == DOMNode.TEXT_NODE) {\n var childData = child.data;\n childData.replace(/\\s/g, ' ');\n child.data = childData;\n }\n }\n }\n }\n }\n\n //do the preserve whitespace processing on the rest of the text nodes\n //It's possible (due to the processing above) that the node will have been\n //removed from the tree. Only do whitespace checking if parentNode is not null.\n //This may duplicate the whitespace processing for some nodes that had entities in them\n //but there's no way around that\n if (!impl.preserveWhiteSpace) {\n for (var i = 0; i < textNodesList.length; i++) {\n var node = textNodesList[i];\n if (node.parentNode != null) {\n var nodeData = node.data;\n nodeData.replace(/\\s/g, ' ');\n node.data = nodeData;\n }\n }\n\n }\n}", "function SQLListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "onopentagend(){\n//inspect(this._tokenizer)\n this._updatePosition(1)\n\n \tif(this._attribs){\n \t\tif(this._cbs.onopentag) this._cbs.onopentag(this._tagname, this._attribs)\n \t\tthis._attribs = null\n \t}\n\n \tif(!this._options.xmlMode && this._cbs.onclosetag && this._tagname in voidElements){\n \t\tthis._cbs.onclosetag(this._tagname)\n \t}\n\n \tthis._tagname = \"\"\n }", "onChildrenLoadStarted() {\n if (this._childrenLoadStarted) {\n this._childrenLoadStarted.raise();\n }\n }", "initialize() {\n this.listenTo(this.owner, {\n [converter_1.Converter.EVENT_BEGIN]: this.onBegin,\n [converter_1.Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,\n [converter_1.Converter.EVENT_CREATE_SIGNATURE]: this.onDeclaration,\n [converter_1.Converter.EVENT_RESOLVE_BEGIN]: this.onBeginResolve,\n [converter_1.Converter.EVENT_RESOLVE]: this.onResolve,\n [converter_1.Converter.EVENT_RESOLVE_END]: this.onEndResolve,\n });\n }", "parseEvents() {\n return {\n onStart: createEventCallback('onStart', this.pathNavigator).bind(this),\n onPause: createEventCallback('onPause', this.pathNavigator).bind(this),\n onMove: createEventCallback('onMove', this.pathNavigator).bind(this),\n onStop: createEventCallback('onStop', this.pathNavigator).bind(this),\n };\n }", "attachListeners() {\n this.#outInterface.on('line', this.lineListener);\n this.#errInterface.on('line', this.errorListener);\n this.#child.on('exit', this.exitListener);\n this.#child.on('close', () => {});\n }", "function ParsedEvent(name, targetOrPhase, type, handler, sourceSpan, handlerSpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n this.handlerSpan = handlerSpan;\n }", "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted) {\n return;\n }\n\n if (that._trackListener) {\n that._trackListener = new JQX.Utilities.InputEvents(that._track);\n that._trackListener.down(function (event) {\n that._SVGElementDownHandler(event);\n });\n }\n\n if (that._fillListener) {\n that._fillListener = new JQX.Utilities.InputEvents(that._fill);\n that._fillListener.down(function (event) {\n that._SVGElementDownHandler(event);\n });\n }\n\n if (that._lineListener) {\n that._lineListener = new JQX.Utilities.InputEvents(that._line);\n that._lineListener.down(function (event) {\n that._SVGElementDownHandler(event);\n });\n }\n }", "setupParsedEvents() {\n this.emitter.on('ws:update:parsed', ({ language, platform, data }) => {\n const packet = { platform, worldstate: data, language };\n this.parseEvents(packet, this.emitter);\n });\n }", "function DomHandler(callback,options,elementCB){/** The constructed DOM */this.dom=[];/** Indicated whether parsing has been completed. */this._done=false;/** Stack of open tags. */this._tagStack=[];/** A data node that is still being written to. */this._lastNode=null;/** Reference to the parser instance. Used for location information. */this._parser=null;// Make it possible to skip arguments, for backwards-compatibility\nif(typeof options===\"function\"){elementCB=options;options=defaultOpts;}if(_typeof(callback)===\"object\"){options=callback;callback=undefined;}this._callback=callback||null;this._options=options||defaultOpts;this._elementCB=elementCB||null;}", "function MsgAddedListener() {\n this._promise = new Promise(resolve => {\n this._resolve = resolve;\n });\n}", "function createListener() {\n let listener = fetchNode('.pagination');\n listener.addEventListener('click', event => {\n onClick(event.target.innerHTML);\n });\n}", "function BugHuntsListener() {\n\tantlr4.tree.ParseTreeListener.call(this);\n\treturn this;\n}", "parsingDidStart(requestContext) {\n console.log(`Parsing started !`)\n }", "function ParsedEvent(name, targetOrPhase, type, handler, sourceSpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n }", "function ParsedEvent(name, targetOrPhase, type, handler, sourceSpan) {\n this.name = name;\n this.targetOrPhase = targetOrPhase;\n this.type = type;\n this.handler = handler;\n this.sourceSpan = sourceSpan;\n }", "function parseData(xmldoc) {\r\n updateStatus('parsing Custom node');\r\n var root = xmldoc.getElementsByTagName('root').item(0);\r\n base_url = root.getAttribute('anidb');\r\n var t1 = new Date();\r\n parseCustom(root.getElementsByTagName('custom').item(0));\r\n var parseCustomNode = (new Date()) - t1;\r\n replaceGlobals(document.body);\r\n updateStatus('Processing anime...');\r\n t1 = new Date();\r\n parseAnimes(root.getElementsByTagName('animes'));\r\n var parseAnimeNode = (new Date()) - t1;\r\n updateStatus('Processing user information...');\r\n if (seeTimes) { alert('Processing...'+\r\n '\\n\\tanime: '+parseAnimeNode+'ms'+\r\n '\\n\\tcustom: '+parseCustomNode+' ms'+\r\n '\\nTotal: '+(parseAnimeNode+parseCustomNode)+' ms'); }\r\n updateStatus('');\r\n renderPage();\r\n}", "function searchListenerTree(handlers, type, tree, i) {\n\t if (!tree) {\n\t return [];\n\t }\n\t var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n\t typeLength = type.length, currentType = type[i], nextType = type[i+1];\n\t if (i === typeLength && tree._listeners) {\n\t //\n\t // If at the end of the event(s) list and the tree has listeners\n\t // invoke those listeners.\n\t //\n\t if (typeof tree._listeners === 'function') {\n\t handlers && handlers.push(tree._listeners);\n\t return [tree];\n\t } else {\n\t for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n\t handlers && handlers.push(tree._listeners[leaf]);\n\t }\n\t return [tree];\n\t }\n\t }\n\n\t if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n\t //\n\t // If the event emitted is '*' at this part\n\t // or there is a concrete match at this patch\n\t //\n\t if (currentType === '*') {\n\t for (branch in tree) {\n\t if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n\t }\n\t }\n\t return listeners;\n\t } else if(currentType === '**') {\n\t endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n\t if(endReached && tree._listeners) {\n\t // The next element has a _listeners, add it to the handlers.\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n\t }\n\n\t for (branch in tree) {\n\t if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n\t if(branch === '*' || branch === '**') {\n\t if(tree[branch]._listeners && !endReached) {\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n\t }\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n\t } else if(branch === nextType) {\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n\t } else {\n\t // No match on this one, shift into the tree but not in the type array.\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n\t }\n\t }\n\t }\n\t return listeners;\n\t }\n\n\t listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n\t }\n\n\t xTree = tree['*'];\n\t if (xTree) {\n\t //\n\t // If the listener tree will allow any match for this part,\n\t // then recursively explore all branches of the tree\n\t //\n\t searchListenerTree(handlers, type, xTree, i+1);\n\t }\n\n\t xxTree = tree['**'];\n\t if(xxTree) {\n\t if(i < typeLength) {\n\t if(xxTree._listeners) {\n\t // If we have a listener on a '**', it will catch all, so add its handler.\n\t searchListenerTree(handlers, type, xxTree, typeLength);\n\t }\n\n\t // Build arrays of matching next branches and others.\n\t for(branch in xxTree) {\n\t if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n\t if(branch === nextType) {\n\t // We know the next element will match, so jump twice.\n\t searchListenerTree(handlers, type, xxTree[branch], i+2);\n\t } else if(branch === currentType) {\n\t // Current node matches, move into the tree.\n\t searchListenerTree(handlers, type, xxTree[branch], i+1);\n\t } else {\n\t isolatedBranch = {};\n\t isolatedBranch[branch] = xxTree[branch];\n\t searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n\t }\n\t }\n\t }\n\t } else if(xxTree._listeners) {\n\t // We have reached the end and still on a '**'\n\t searchListenerTree(handlers, type, xxTree, typeLength);\n\t } else if(xxTree['*'] && xxTree['*']._listeners) {\n\t searchListenerTree(handlers, type, xxTree['*'], typeLength);\n\t }\n\t }\n\n\t return listeners;\n\t }", "function l(e) {\n var o = d3_v3.event; // Events can be reentrant (e.g., focus).\n d3_v3.event = e;\n try {\n listener.call(node, node.__data__, i);\n } finally {\n d3_v3.event = o;\n }\n }", "function _setupParser(){\n\t\t//Extend the parser with the local displayError function\n\t\tparser.displayError = displayError;\n\n\t\t$('html')\n\t\t\t.fileDragAndDrop(function(fileCollection){\n\t\t\t\t_resetUI();\n\n\t\t\t\t//Reset lists\n\t\t\t\tparser.errorList = [];\n\t\t\t\tparser.songList = [];\n\n\t\t\t\t//Loop through each file and parse it\n\t\t\t\t$.each(fileCollection, parser.parseFile);\n\n\t\t\t\t//Parsing complete, run the display/output functions\n\t\t\t\tparser.complete($output);\n\n\t\t\t\t//Update the total converted song count\n\t\t\t\t_updateSongCount(parser.songList.length);\n\t\t\t\t\n\t\t\t\t//Also display errors if there are any\n\t\t\t\tif(parser.errorList.length){\n\n\t\t\t\t\tvar errorTitle = parser.errorList.length == 1 ? \"One song ran into an error and could not be converted\": \"We ran into errors with \" + parser.errorList.length + \" of the songs, and they were not converted\";\n\n\t\t\t\t\t//Join all the error messages together\n\t\t\t\t\tdisplayError(parser.errorList.join(\"<br/>\"), errorTitle);\n\t\t\t\t}\n\n\t\t\t});\n\t}", "static _onListenDone () {\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n \n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n \n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }", "function searchListenerTree(handlers, type, tree, i) {\n if (!tree) {\n return [];\n }\n var listeners=[], leaf, len, branch, xTree, xxTree, isolatedBranch, endReached,\n typeLength = type.length, currentType = type[i], nextType = type[i+1];\n if (i === typeLength && tree._listeners) {\n //\n // If at the end of the event(s) list and the tree has listeners\n // invoke those listeners.\n //\n if (typeof tree._listeners === 'function') {\n handlers && handlers.push(tree._listeners);\n return [tree];\n } else {\n for (leaf = 0, len = tree._listeners.length; leaf < len; leaf++) {\n handlers && handlers.push(tree._listeners[leaf]);\n }\n return [tree];\n }\n }\n\n if ((currentType === '*' || currentType === '**') || tree[currentType]) {\n //\n // If the event emitted is '*' at this part\n // or there is a concrete match at this patch\n //\n if (currentType === '*') {\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+1));\n }\n }\n return listeners;\n } else if(currentType === '**') {\n endReached = (i+1 === typeLength || (i+2 === typeLength && nextType === '*'));\n if(endReached && tree._listeners) {\n // The next element has a _listeners, add it to the handlers.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree, typeLength));\n }\n\n for (branch in tree) {\n if (branch !== '_listeners' && tree.hasOwnProperty(branch)) {\n if(branch === '*' || branch === '**') {\n if(tree[branch]._listeners && !endReached) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], typeLength));\n }\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n } else if(branch === nextType) {\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i+2));\n } else {\n // No match on this one, shift into the tree but not in the type array.\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[branch], i));\n }\n }\n }\n return listeners;\n }\n\n listeners = listeners.concat(searchListenerTree(handlers, type, tree[currentType], i+1));\n }\n\n xTree = tree['*'];\n if (xTree) {\n //\n // If the listener tree will allow any match for this part,\n // then recursively explore all branches of the tree\n //\n searchListenerTree(handlers, type, xTree, i+1);\n }\n\n xxTree = tree['**'];\n if(xxTree) {\n if(i < typeLength) {\n if(xxTree._listeners) {\n // If we have a listener on a '**', it will catch all, so add its handler.\n searchListenerTree(handlers, type, xxTree, typeLength);\n }\n\n // Build arrays of matching next branches and others.\n for(branch in xxTree) {\n if(branch !== '_listeners' && xxTree.hasOwnProperty(branch)) {\n if(branch === nextType) {\n // We know the next element will match, so jump twice.\n searchListenerTree(handlers, type, xxTree[branch], i+2);\n } else if(branch === currentType) {\n // Current node matches, move into the tree.\n searchListenerTree(handlers, type, xxTree[branch], i+1);\n } else {\n isolatedBranch = {};\n isolatedBranch[branch] = xxTree[branch];\n searchListenerTree(handlers, type, { '**': isolatedBranch }, i+1);\n }\n }\n }\n } else if(xxTree._listeners) {\n // We have reached the end and still on a '**'\n searchListenerTree(handlers, type, xxTree, typeLength);\n } else if(xxTree['*'] && xxTree['*']._listeners) {\n searchListenerTree(handlers, type, xxTree['*'], typeLength);\n }\n }\n\n return listeners;\n }" ]
[ "0.63614464", "0.6252038", "0.6239024", "0.60875773", "0.6012387", "0.59997827", "0.5942085", "0.58709735", "0.5836972", "0.5836972", "0.5836972", "0.5836972", "0.5836972", "0.5836972", "0.5830943", "0.5778998", "0.575439", "0.5744269", "0.57429546", "0.5710543", "0.57002974", "0.5671173", "0.56538284", "0.56075513", "0.55642974", "0.55151707", "0.5454428", "0.5438863", "0.543689", "0.54200494", "0.5419001", "0.5403693", "0.5321563", "0.5321563", "0.5295923", "0.5292768", "0.52794", "0.5273593", "0.5258305", "0.52579916", "0.51985496", "0.51784426", "0.51702666", "0.5160095", "0.51284397", "0.5105244", "0.5077362", "0.50487167", "0.5044971", "0.5037866", "0.50350416", "0.49781415", "0.49508414", "0.49346086", "0.49317965", "0.49264726", "0.49264726", "0.49152952", "0.490618", "0.49047968", "0.48808426", "0.48804593", "0.48701626", "0.48701626", "0.4865995", "0.48590687", "0.48359132", "0.4817064", "0.48112202", "0.4808091", "0.47933903", "0.47908324", "0.4786402", "0.4779007", "0.47656673", "0.47542888", "0.47532168", "0.47504905", "0.47473526", "0.47473526", "0.47396144", "0.47195205", "0.46842164", "0.46722096", "0.46664798", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424", "0.46577424" ]
0.7505715
0
opt.check : check window top or window bottom? opt.class : class to toggle opt.onCross : function that is called on crossing target opt.offset : limit offset from el.offset().top
function UmScrollCheck(el, opt){ var win = $(window); var t = this; t.check = ( opt ) ? (opt.check || 'top' ) : 'top'; t.class = ( opt ) ? ( opt.class || 'shown' ) : 'shown'; t.onCross = ( opt ) ? ( opt.onCross || function(){} ) : function(){}; t.offset = ( opt ) ? ( opt.offset || 0 ) : 0; var target = el.offset().top + t.offset; var curPos, state; t.update = function(){ curPos = ( t.check === 'top' ) ? win.scrollTop() : win.scrollTop() + win.height(); if ( curPos < target && state !== 'before' ){ el.removeClass(t.class); state = 'before'; t.onCross(state); } else if ( curPos >= target && state !== 'after' ){ el.addClass(t.class); state = 'after'; t.onCross(state); } } t.update(); v = globalCounter++; win.on('scroll.umScrollCheck'+v, t.update); var updating = setInterval(function(){ target = el.offset().top + t.offset; t.update(); }, 2000); t.destroy = function(){ win.off('scroll.umScrollCheck'+v); el.removeClass(t.class); state = null; clearInterval(updating); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkOffset() {\n\n if ($(\"#head\").offset().top > 77) {\n \t$(\"#head\").removeClass(\"tall\");\n $(\"#head\").addClass(\"collapsed\");\n\n\n \n } \n else if($(\"#head\").offset().top < 20) {\n \t$(\"#head\").addClass(\"tall\");\n $(\"#head\").removeClass(\"collapsed\");\n \n }\n }", "function checkTop(x, y) {\n let up = parseInt(y) + 1;\n let $el = d.querySelector(`#block_${x}x${up}`);\n if ($el === null || $el.classList.contains('checked')) return false;\n var uBlock = d.querySelector(`#block_${x}x${up}`).style.backgroundColor;\n if (uBlock === clickColor ) {\n $el.classList.add('checked');\n arr.push({ xPos: x, yPos: up });\n checkTop(x, up);\n checkRight(x, up);\n checkLeft(x, up);\n }\n }", "function checkBoxes() {\n boxes.forEach((box) => {\n const triggerBottom = innerHeight * 0.8;\n const boxTop = box.getBoundingClientRect().top;\n console.log(boxTop);\n console.log(triggerBottom);\n if (boxTop < triggerBottom) {\n box.classList.add(\"show\");\n } else {\n box.classList.remove(\"show\");\n }\n });\n}", "function effect_check() {\n var window_height = $effect_window.height();//document.body.clientHeight;\n var window_top_position = $effect_window.scrollTop();\n var window_bottom_position = (window_top_position + window_height);\n var $animation_elements = $('.effect-scroll');\n $.each($animation_elements, function() {\n var $element = $(this);\n var element_height = $element.outerHeight();\n var element_top_position = $element.offset().top;\n var element_bottom_position = (element_top_position + element_height);\n\n //console.log('WT:: '+window_top_position); console.log('ET:> '+element_top_position);\n //console.log('EB:> '+element_bottom_position+' -ok'); console.log('WB:: '+window_bottom_position);\n //console.log('TT:: '+window_top_position); console.log('HH:: '+window_height);\n\n if ((element_bottom_position >= window_top_position) && (element_top_position <= window_bottom_position)) {\n $element.addClass('in-view');\n effect_start($element);\n } else {\n console.log('OUT')\n $element.removeClass('in-view');\n effect_inic($element);\n }\n });\n}", "function crossOff(e)\n{\n\tif(e.target.classList.contains('img-margin'))\n\t{\n\t\tlet list = e.target.parentElement;\n\t\tlist.classList.toggle('cross');\n\t}\n}", "checkDistance() {\n this.distance.forEach((item) => {\n if (window.pageYOffset > item.offset) {\n item.element.classList.add(\"ativo\");\n\n // Else to hide objects again if the scroll goes up.\n } else if (item.element.classList.contains(\"ativo\")) {\n item.element.classList.remove(\"ativo\");\n }\n });\n }", "function checkPosition () {\n if (!$el.is(':visible')) return;\n \n var height = $el.height(),\n // offset = options.offset\n scrollHeight = Math.max($(document).height(), $(document.body).height()),\n\n // position y of target compared to our scroll position\n\n scrollTop = $el.scrollTop(),\n position = $el.offset(),\n targetHeight = $el.height();\n\n console.log($el, height, scrollTop, position, targetHeight);\n\n $el.removeClass('affix-top affix-bottom affix');\n if (scrollTop <= offsetTop) {\n // top position\n $el.addClass('affix-top');\n } else if (position.top + height >= scrollHeight - offsetBottom) {\n // bottom position\n $el.addClass('affix-bottom');\n } else {\n // centered affixed position\n $el.addClass('affix');\n }\n\n }", "function check() {\n var cur = $(window).scrollTop();\n if (cur < 10) {\n $('#mainNav').addClass('topped');\n } else {\n $('#mainNav').removeClass('topped');\n }\n }", "function show() {\r\n showThis.forEach(function(e) {\r\n if (isElementInViewport(e)) {\r\n e.classList.add(\"showing\");\r\n } else {\r\n e.classList.remove(\"showing\");\r\n }\r\n });\r\n scroll(show); //request point and apply/remove classes\r\n}", "function inViewCheck()\n{\n\t$($(\".hideMe\").get().reverse()).each(function(i)\n\t{\n\t\tvar target = jQuery(this);\n\n\t\ta = target.offset().top + target.height();\n\t\tb = $(window).scrollTop() + $(window).height();\n\n\t\tif (a < b)\n\t\t{\n\t\t\tvar objectClass = target.attr('class').replace('hideMe' , 'animated');\n\t\t\ttarget.css('visibility','hidden').removeAttr('class');\n\t\t\tsetTimeout(function(){target.attr('class',objectClass).css('visibility','visable');},0.01);\n\t\t}\n\t});\n}", "function showToTop() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.scrollTop > 350 && !$offCanvasEl.is('.fullscreen.open') ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#to-top').stop().transition({\r\n\t\t\t\t\t\t\t'bottom': '17px'\r\n\t\t\t\t\t\t}, 350, 'easeInOutCubic');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.off('scroll', showToTop);\r\n\t\t\t\t\t\t$window.on('scroll', hideToTop);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function setWindowScrollFunction() {\n var offset = $( window ).height() / 2;\n if ( $( this ).scrollTop() > offset ) {\n\n // go to top button show\n $toTopBtn\n .css( 'opacity', '1' )\n .css( 'cursor', 'pointer' );\n\n $( '#contact-section' ).css( 'top', '76px' );\n\n } else {\n\n // go to top button hide\n $toTopBtn\n .css( 'opacity', '0' )\n .css( 'cursor', 'default' );\n\n $( '#contact-section' ).css( 'top', '244px' );\n }\n }", "function offCanvasCheck(el) {\n if (el.hasClass('off-canvas-nav-left')) {\n return 'off-canvas-nav-left';\n }\n }", "function cms_back_to_top(){\r\n\t\t/* Back To Top */\r\n if (scroll_top < window_height) {\r\n \t$('#back_to_top').addClass('off').removeClass('on');\r\n } else {\r\n \t$('#back_to_top').removeClass('off').addClass('on');\r\n }\r\n\t}", "function toggleScroll() {\r\n var maxOffset = Math.abs(parseInt($('.menu-holder').height() - $('.content').height())),\r\n currOffset = Math.abs(parseInt($(\".content\").css(\"margin-top\")));\r\n \r\n if (currOffset === 0) {\r\n $(\"#up .fas\").hide();\r\n $(\"#down .fas\").show();\r\n } \r\n else if (currOffset === maxOffset) {\r\n $(\"#up .fas\").show();\r\n $(\"#down .fas\").hide();\r\n    }\r\n else if (currOffset > 0 && currOffset < maxOffset) {\r\n $(\"#up .fas\").show();\r\n $(\"#down .fas\").show();\r\n }\r\n else {\r\n $(\"#up .fas\").hide();\r\n $(\"#down .fas\").hide();\r\n    }\r\n}", "function checkPosition() {\n const windowOffset = $(window).scrollTop(),\n aboutOffset = $('#about').offset().top - 240,\n portfolioOffset = $('#portfolio').offset().top - 240,\n contactOffset = $('#contact').offset().top - 240;\n if (windowOffset > contactOffset) {\n highlightButton('contact');\n } else if (windowOffset > portfolioOffset) {\n highlightButton('portfolio');\n } else if (windowOffset > aboutOffset) {\n highlightButton('about');\n }\n }", "function cms_back_to_top(){\r\n\t\t/* back to top */\r\n if (scroll_top < window_height) {\r\n \t$('#back_to_top').addClass('off').removeClass('on');\r\n } else {\r\n \t$('#back_to_top').removeClass('off').addClass('on');\r\n }\r\n\t}", "function check(x, y) {\n let $el = d.querySelector(`#block_${xPos}x${yPos}`).classList.add('checked');\n checkTop(xPos, yPos);\n checkBottom(xPos, yPos);\n checkRight(xPos, yPos);\n checkLeft(xPos, yPos); \n }", "function setTopConBoxTglOn(){\r\n\t\t$('.topConBox').each(function(){\r\n\t\t\tvar target=$(this);\r\n\t\t\ttarget.find('button.btnMore').on('click',function(e){\r\n\t\t\t\te.preventDefault();\r\n\t\t\t\ttarget.toggleClass('on');\r\n\t\t\t});\r\n\t\t});\r\n\t}", "function visible_scroll_up(){\n /*visible scroll up arrow */\n if ($(window).scrollTop() > 300) {\n $('.scroll-top-wrapper').addClass('show');\n } else {\n $('.scroll-top-wrapper').removeClass('show');\n }\n\n /*hidden opt*/\n\n var $same_content = $('.same_content').height() - 200;\n\n if ($(window).scrollTop() > $same_content) {\n $(\".pos_right_button\").addClass('pos_right_button_added');\n } else {\n $(\".pos_right_button\").removeClass('pos_right_button_added');\n }\n\n /*fixed navigation*/\n if ($(window).scrollTop() > 120) {\n $('#navbar').addClass('fixed-nav-top');\n $('.app-container').addClass('top_animate');\n } else {\n $('#navbar').removeClass('fixed-nav-top');\n $('.app-container').removeClass('top_animate');\n }\n}", "function menu_attache(){\r\n var scroll = $(window).scrollTop();\r\n //alert(scroll);\r\n var win_height = $( window ).height();\r\n var win= win_height+scroll;\r\n if($('.panneau')){\r\n if($('.panneau').offset()){\r\n var elem=$('.panneau').offset().top;\r\n if (win>elem) {\r\n var diff=elem-win;\r\n var limite=$('.slide').innerHeight() - $('.menu').innerHeight() - $('.g-head').innerHeight() - 162;\r\n if(diff<=-limite){\r\n //alert('alte1');\r\n return true;\r\n }else{\r\n //alert('alte2');\r\n return false;\r\n }\r\n }\r\n } else{\r\n return win;\r\n }\r\n }\r\n \r\n }", "function topEdge() {\n $( \"#target\" ).animate({paddingTop:\"-=310px\"});\n }", "function check() {\n if (inViewport()) {\n unbind();\n $elem.addClass('fadeVisible-visible');\n if (typeof opt.callback === 'function') {\n opt.callback.call($elem);\n }\n }\n }", "function addClasses(){\n var scroll = $(window).scrollTop();\n var parentPos = parent.offset().top;\n //console.log(parentPos,'parentPos',parent,element);\n if(!element.is('.noSticky')){\n //console.log((parentPos + parent.outerHeight() - element.outerHeight()-(num*2)), scroll,parentPos,parent.outerHeight(),element.outerHeight());\n if(scroll > (parentPos + parent.outerHeight() - element.outerHeight()-(num*2))){\n element.removeClass('doFixed').addClass('doFixedBottom');\n }\n else if(scroll > parentPos + num){\n element.removeClass('doFixedBottom').addClass('doFixed');\n }\n else if(scroll < parentPos - num){\n element.removeClass('doFixedBottom').removeClass('doFixed');\n }\n else{\n element.removeClass('isFixedBottom').removeClass('isFixed');\n }\n }\n }", "function toggleBtnGoTop() {\n if (this.document.body.scrollTop > 800 || this.document.documentElement.scrollTop > 800) {\n btnGoTop.classList.add('is-show');\n } else {\n btnGoTop.classList.remove('is-show');\n }\n}", "function checkScroll() {\n let scrY = window.scrollY;\n\n hideMenu();\n if (scrY > 10) {\n nav.className = \"scrolled\";\n } else {\n nav.className = \"\";\n }\n chekPosition(scrY);\n}", "function hideToTop() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (nectarDOMInfo.scrollTop < 350 || $offCanvasEl.is('.fullscreen.open') ) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $animationTiming = ($('#slide-out-widget-area.fullscreen.open').length > 0) ? 1150 : 350;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#to-top').stop().transition({\r\n\t\t\t\t\t\t\t'bottom': '-30px'\r\n\t\t\t\t\t\t}, $animationTiming, 'easeInOutQuint');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$window.off('scroll', hideToTop);\r\n\t\t\t\t\t\t$window.on('scroll', showToTop);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function checkBoxVisibility () {\n for (var i = 0; i < $('.complementaTuViajeWrp .ico-slider').length; i++) {\n if ($($('.complementaTuViajeWrp .ico-slider')[i]).closest('.container').find('.infoComplements').is(':visible')) {\n $($('.complementaTuViajeWrp .ico-slider')[i]).addClass('open')\n $($('.complementaTuViajeWrp .ico-slider')[i]).closest('.container').addClass('open-mobile')\n // open-mobile\n }else {\n $($('.complementaTuViajeWrp .ico-slider')[i]).removeClass('open')\n $($('.complementaTuViajeWrp .ico-slider')[i]).closest('.container').removeClass('open-mobile')\n }\n }\n }", "function checkConditions(data, settings) {\n\n $this = $(this),\n $wrapper = $this.parent();\n\n\t\t// if a sticky element in the flow changes size\n\t\t// recalculate the offset of absolutely positioned sticky elements\n\t\tif ( $wrapper.offset().top != data._offset ) {\n\t\t\tdata._offset = $wrapper.offset().top;\n\t\t}\n\n\t\t// if we scroll to the topCatch of our sticky elements\n\t\tif ( data._offset - data._topCatch - settings.fromTop <= $(document).scrollTop() ) {\n\t\t\tconsole.log(this);\n\n\t\t\tif (!data._isAnchored) {\n\t\t\t\t$this.addClass('s-fixed');\n\t\t\t\t$this.css( 'top', data._topCatch + settings.fromTop );\n\t\t\t}\n\n\t\t\t// if our sticky element takes up the full width of the window\n\t\t\tif ( settings.fullWidth === true ) {\n\t\t\t\t$this.css( \"width\", \"100%\" );\n\t\t\t}\n\n\n\t\t} else {\n\t\t\t$this.removeClass('s-fixed');\n\t\t}\n\n\t\t// if our sticky anchor settings is true\n\t\tif ( settings.anchored === true ) {\n\n\t\t\tdistanceToAnchor = $this.height() + settings.fromTop + data._topCatch + $(document).scrollTop();\n\t\t\twindowOffset = $(document).scrollTop() + $(window).height();\n\n\t\t\t// ...anchor us!\n\t\t\tif (!data._isAnchored && distanceToAnchor >= anchorOffset) {\n\t\t\t\tdata._isAnchored = true;\n\t\t\t\t$this.addClass('s-anchored').css('top', 'auto');\n\n\t\t\t\t// provide a callback for when we anchor\n\t\t\t\tif (typeof settings.anchorOn === 'function') settings.anchorOn.call(this);\n\t\t\t} \n\n\t\t\t// ...and we go above anchor\n\t\t\t// ...unanchor!\n\t\t\telse if (data._isAnchored && distanceToAnchor <= anchorOffset){\n\t\t\t\tdata._isAnchored = false;\n\t\t\t\t$this.removeClass('s-anchored');\n\t\t\t\t$this.css( 'top', data._topCatch + settings.fromTop );\n\n\t\t\t\t// provide a callback for when we unanchor\n\t\t\t\tif (typeof settings.anchorOff === 'function') settings.anchorOff.call(this);\n\t\t\t}\n\n\t\t\t// anchor is visible\n\t\t\tif (!data._anchorIsVisible && windowOffset >= anchorOffset) {\n\t\t\t\tdata._anchorIsVisible = true;\n\n\t\t\t\t// provide a callback for when anchor is visible\n\t\t\t\tif (typeof settings.anchorVisible === 'function') settings.anchorVisible.call(this);\n\t\t\t}\n\n\t\t\t// ...and when it becomes invisible \n\t\t\telse if (data._anchorIsVisible && windowOffset <= anchorOffset) {\n\t\t\t\tdata._anchorIsVisible = false;\n\n\t\t\t\t// provide a callback for when anchor is invisible\n\t\t\t\tif (typeof settings.anchorInvisible === 'function') settings.anchorInvisible.call(this);\n\t\t\t}\n\n\t\t}\n\t}", "mouseOverCheck(x,y){\n let d = dist(x,y,this.locX,this.locY);\n if(d<this.ballSize/2){return true;}\n else{return false;}\n }", "function checkActiveCross() {\n\t$('.crossPic').css('border-color','rgba(0, 153, 204, 0.7)');\n\t$('#crossPic' + pos).css('border-color', 'rgba(255, 170, 0, 0.9)');\n}", "function ww_check(){\n let dy = document.documentElement.scrollTop;\n let w = window.innerWidth;\n\n if (w < 990 && dy > 200){\n nav.classList.add('nav-color');\n nav.style.height = '';\n if(w < 568){\n logo_medium()\n }else{\n logo_large()\n }\n\n }else{\n nav.classList.remove('nav-color');\n logo_large()\n }\n navScrollPos();\n}", "function btnToTop() {\n var btnToTop = document.querySelector(\".btn-to-top\");\n\n if (window.pageYOffset > 180) {\n btnToTop.classList.add(\"btn-to-top--show\");\n } else {\n btnToTop.classList.remove(\"btn-to-top--show\");\n }\n}", "hasTop() {return this.Y<=0 ? false : true;}", "function isElementVisible(elementToBeChecked)\n{\n var TopView = $(window).scrollTop();\n var BotView = TopView + $(window).height();\n var TopElement = $(elementToBeChecked).offset().top;\n var BotElement = TopElement + $(elementToBeChecked).height()-150;\n return ((BotElement <= BotView) && (TopElement >= TopView));\n}", "function sectop(){\r\n const sectop= document.querySelectorAll('SECTION');\r\n\r\n for (const sectiontop of sectop) {\r\n window.addEventListener(\"scroll\",function(){\r\n if (sectiontop.getBoundingClientRect().top< window.innerHeight&& sectiontop.getBoundingClientRect().bottom>window.innerHeight){\r\n sectiontop.classList.add('active');\r\n }\r\n else{\r\n sectiontop.classList.remove(\"active\");\r\n }\r\n\r\n\r\n });\r\n\r\n /*\r\n let y= sectiontop.getBoundingClientRect().top;\r\n paragraph.classList.add('read');*/\r\n }\r\n\r\n}", "function IfInView(){\n\t\tvar \n\t\t\tel = document.querySelectorAll('.js-checkInView'),\n\t\t\tclassview = 'isInView';\n\n\t\tel.forEach(function(item){\n\t\t\tif(visibleY(item))\n\t\t\t\titem.classList.add(classview);\n\t\t});\n\t}", "function checkSlide() {\n images.forEach((img) => {\n // ((scY + inHe) - img.hei) / 2 // halfway of the image\n const slideInAt = window.scrollY + window.innerHeight - img.height / 2;\n const imgBottom = img.offsetTop + img.height;\n\n const halfShown = slideInAt > img.offsetTop;\n const notScrolledPast = window.scrollY < imgBottom;\n // log these vars & scroll the page to understand\n\n halfShown && notScrolledPast\n ? img.classList.add('active')\n : img.classList.remove('active');\n });\n}", "checkScrollPos() {\n let fromTop = window.scrollY;\n this.links.forEach(link => {\n let section = document.querySelector(`#${link.el.dataset.section}`);\n if (section.offsetTop <= fromTop && section.offsetTop + section.offsetHeight > fromTop) {\n link.setCurrent();\n } else {\n link.setCurrent(false);\n }\n })\n }", "function scroll_hand()\n{\n var e = window.event;\n var buttom = window.scrollY + window.innerHeight;\n //console.log(\"Window top = \" + window.scrollY + \"; Window buttom = \" + buttom);\n if((y1 > window.scrollY ) && ( y2 < (window.scrollY + window.innerHeight)))\n {\n if(flag === 0)\n {\n flag = 1;\n \n // Call function to react to being in the zone\n inZone();\n \n }\n else\n {\n //console.log(\"You are still in zone and flag = \" + flag);\n \n };\n }\n else\n {\n flag = 0;\n \n // Call function to react to leaving the zone.\n outZone();\n //console.log(\"You are out of zone and flag = \" + flag);\n };\n\n \n}", "function checkScroll() {\n console.log(\"Detected scroll, checking to see if classes should change\")\n if(win.scrollTop() > shiftY) {\n nav.addClass('grey');\n nav.addClass('darken-4');\n nav.removeClass('transparent');\n banner.removeClass('std-transparent');\n }\n else {\n nav.removeClass('grey');\n nav.removeClass('darken-4');\n nav.addClass('transparent');\n banner.addClass('std-transparent');\n }\n\n if(win.scrollTop() > shiftY/2) {\n jump.removeClass('transparent');\n jumpicon.removeClass('transparent');\n }\n else {\n jump.addClass('transparent');\n jumpicon.addClass('transparent');\n }\n\n}", "function classChange() {\n var scTopDist = $(window).scrollTop();\n if ( scTopDist == 0) {\n topSectionPhone.removeClass().addClass('default');\n }\n else if( (topSecProgress > 0.1) && (topSecProgress < 0.3) && (topSection.hasClass('active')) ) {\n topSectionPhone.removeClass().addClass('anim1');\n }\n else if( (topSecProgress > 0.3) && (topSecProgress < 0.55) && (topSection.hasClass('active')) ) {\n topSectionPhone.removeClass().addClass('anim2');\n }\n else if( (topSecProgress > 0.55) && (topSection.hasClass('active')) ) {\n topSectionPhone.removeClass().addClass('anim2-2');\n }\n else if(descTop.hasClass(\"active\")) {\n animLine.addClass('anim-line-active');\n animTel.removeClass('left-m').addClass('anim-tel-active');\n darkLineBoxPhone.removeClass().addClass('anim3');\n }\n if( (descTopProgress > 0.15) && (descTopProgress < 0.6) && (descTop.hasClass('active')) ) {\n animTel.addClass('left-m');\n //smartClock.removeClass('smart-clock-active');\n }\n if( (descTopProgress > 0.6) && (descTop.hasClass('active')) ) {\n animLine.removeClass('anim-line-active');\n animTel.removeClass('anim-tel-active').removeClass('left-m');\n // scrolledPhone.removeClass().addClass('anim4');\n darkLineBoxPhone.removeClass();\n //smartClock.removeClass().addClass('smart-clock-active');\n swiperContainer.removeClass('visible-swiper');\n sliderPhone.removeClass();\n smartClock.removeClass();\n }\n else if( !(descTop.hasClass('active')) ) {\n darkLineBoxPhone.removeClass();\n animLine.removeClass('anim-line-active');\n animTel.removeClass('anim-tel-active').removeClass('left-m');\n }\n if(sliderSection.hasClass(\"active\")) {\n smartClock.addClass('smart-clock-pos1');\n sliderPhone.addClass('anim5');\n }\n if( (sliderSectionProgress > 0.1) && (sliderSectionProgress < 0.55) && (sliderSection.hasClass('active')) ) {\n swiperContainer.addClass('visible-swiper');\n //smartClock.removeClass();\n }\n if( (sliderSectionProgress > 0.55) && (sliderSectionProgress < 0.75) && (sliderSection.hasClass('active')) ) {\n swiperContainer.removeClass('visible-swiper');\n sliderPhone.removeClass('anim6');\n smartClock.removeClass().addClass('smart-clock-pos1');\n }\n if( (sliderSectionProgress > 0.75) && (sliderSection.hasClass('active')) ) {\n sliderPhone.removeClass().addClass('anim6');\n smartClock.removeClass('smart-clock-pos1').addClass('smart-clock-pos2');\n gear360.removeClass();\n gear360Phone.removeClass();\n }\n if( (sliderSectionProgress > 0.75) && (sliderSection.hasClass('active')) ) {\n gear360Phone.addClass('anim7');\n gear360.removeClass().addClass('gear-360-pos1');\n }\n if(gear360Section.hasClass(\"active\")) {\n gear360.removeClass().addClass('gear-360-pos2');\n gear360Phone.removeClass().addClass('anim8');\n phoneView02.removeClass();\n }\n if( (gear360Progress > 0.4) && (gear360Progress < 0.6) && (gear360Section.hasClass('active')) ) {\n gear360Phone.removeClass().addClass('anim9');\n gear360.removeClass().addClass('gear-360-pos3');\n phoneView02.removeClass().addClass('visible');\n phoneView03.removeClass();\n }\n if( (gear360Progress > 0.6) && (gear360Section.hasClass('active')) ) {\n gear360Phone.removeClass().addClass('anim9');\n gear360.removeClass().addClass('gear-360-pos3');\n phoneView02.removeClass();\n phoneView03.addClass('visible');\n gearPhone.removeClass();\n }\n /*if( (gear360Progress > 0.35) && ((gear360Progress < 0.5)) && (gear360Section.hasClass('active')) ) {\n scrolledPhone.removeClass().addClass('anim10');\n gear360.removeClass().addClass('gear-360-pos4');\n }\n if( (gear360Progress > 0.5) && ((gear360Progress < 0.75)) && (gear360Section.hasClass('active')) ) {\n scrolledPhone.removeClass().addClass('anim11');\n gear360.removeClass().addClass('gear-360-pos5');\n }\n if( (gear360Progress > 0.75) && (gear360Section.hasClass('active')) ) {\n scrolledPhone.removeClass().addClass('anim12');\n gear360.removeClass().addClass('gear-360-pos5');\n }*/\n if(gearVr.hasClass(\"active\")) {\n gearPhone.removeClass().addClass('anim13');\n }\n if( (gearVrProgress > 0.15) && (gearVrProgress < 0.21) && (gearVr.hasClass(\"active\")) ) {\n gearPhone.removeClass().addClass('anim14');\n }\n if( (gearVrProgress > 0.21) && (gearVr.hasClass(\"active\")) ) {\n gearPhone.removeClass().addClass('anim15');\n headphones.removeClass();\n }\n if(musicSection.hasClass(\"active\")) {\n headphones.removeClass().addClass('headphones-pos1');\n musicPhone.removeClass();\n }\n if( (musicSectionProgress > 0.1) && (musicSectionProgress < 0.2) && (musicSection.hasClass(\"active\")) ) {\n musicPhone.removeClass().addClass('anim17');\n headphones.removeClass().addClass('headphones-pos2');\n }\n if( (musicSectionProgress > 0.2) && (musicSectionProgress < 0.35) && (musicSection.hasClass(\"active\")) ) {\n musicPhone.removeClass().addClass('anim18');\n headphones.removeClass().addClass('headphones-pos2');\n }\n if( (musicSectionProgress > 0.35) && (musicSection.hasClass(\"active\")) ) {\n scrolledPhone.removeClass().addClass('anim19');\n chargerFinal.removeClass('charger-final-active');\n }\n if(chargerSection.hasClass(\"active\")) {\n scrolledPhone.removeClass().addClass('anim20');\n chargerFinal.addClass('charger-final-active');\n }\n }", "function onScroll(event) {\n if ($('.mobileWrapp').width() < 639) {\n // console.log('asd')\n var scrollPos = $(document).scrollTop() + 65\n } else {\n // console.log('qwe')\n var scrollPos = $(document).scrollTop() + 68\n }\n $('ul.nav-script li a.ancor').each(function() {\n var currLink = $(this)\n var refElement = $(currLink.attr('href'))\n if (refElement.position().top <= scrollPos && refElement.position().top + refElement.height() > scrollPos) {\n $('ul.nav-script li a.ancor').removeClass('active')\n currLink.addClass('active')\n } else {\n currLink.removeClass('active')\n }\n })\n}", "function checkBottom(x, y) {\n let down = parseInt(y) - 1;\n let $el = d.querySelector(`#block_${x}x${down}`);\n if ($el === null || $el.classList.contains('checked')) return false;\n var dBlock = d.querySelector(`#block_${x}x${down}`).style.backgroundColor;\n if (dBlock === clickColor) {\n $el.classList.add('checked');\n arr.push({ xPos: x, yPos: down });\n checkBottom(x, down);\n checkRight(x, down);\n checkLeft(x, down);\n }\n }", "function onTopOf(obj) {\n\t\treturn (!(this.x + this.boundingBox.left >= obj.x + obj.boundingBox.right ||\n\t\t\tthis.x + this.boundingBox.right <= obj.x + obj.boundingBox.left) &&\n\t\tthis.y + this.boundingBox.bottom === obj.y + obj.boundingBox.top);\n\t}", "function check(e) {\n var pos = getPos(e), posAbs = { x: e.clientX, y: e.clientY }; // div is fixed, so use clientX/Y\n if (!visible &&\n pos.x >= region.x && pos.x < region.x + region.w &&\n pos.y >= region.y && pos.y < region.y + region.h) {\n me.show(posAbs); // show tool-tip at this pos\n }\n else\n setDivPos(posAbs); // otherwise, update position\n }", "function scl(){\n\tvar cp1 = 0;\n\tvar cp2 = 0;\n\t$(window).scroll(function(){\n\t\tvar k = $(\"header .menut\");\n\t\tcp1=$(\"html\").scrollTop();\n\t\tcp2=$(\"body\").scrollTop();\n\t\t\n\t\tif(cp1>500 || cp2>500){\n\t\t\t$(\".up\").removeClass(\"ddn\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\".up\").addClass(\"ddn\");\n\t\t}\n\t});\t\n\t\n\t\n\tvar cor_w_h = 0;\n\tvar cor_w_b = 0;\n\t\n\t$(window).scroll(function(){\n\t\tcor_w_h=$(\"html\").scrollTop();\n\t\tcor_w_b=$(\"body\").scrollTop();\n\t});\n\t\t\n\t// SCROLL Menut\n\tif($(\"[data-compare-scl]\").length){\n\t\tvar up = parseInt($(\".goods6__hdr\").offset().top -10);\n\t\t$(window).scroll(function(){\n\t\t\tvar k = $(\"header .menut\");\n\t\t\t\tif(cor_w_h > up || cor_w_b > up){\n\t\t\t\t\t$(\"[data-compare-scl]\").addClass('act');\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$(\"[data-compare-scl]\").removeClass('act');\n\t\t\t\t}\n\t\t});\t\t\n\t}\n\t\n}", "showViewOnTop(){\n this.scrollToTop(200)\n this.box.overview = !this.box.overview\n }", "function checkMoveOut(element){\r\n\t//Iterating site of map\r\n\tfor (i in circles_array){\r\n\t\tif(circles_array[i].centermarker.title==$(element).attr('cstitle'))\r\n\t\tif(element.checked){\r\n\t\tcircles_array[i].centermarker.set('moveOut',true);\r\n\t\t$('#customtooltip1').css('display','none');\r\n\t\t}\r\n\t\telse{\r\n\t\t$('#customtooltip1').css('display','none');\r\n\t\tcircles_array[i].centermarker.set('moveOut',false);\r\n\t\t}\t\r\n\t\t}\r\n\t\r\n\t\r\n}", "function headerScroll() {\n \"use strict\";\n var changeNavigationOn = 80;\n var sy = scrollY();\n // console.log($(window).innerWidth());\n if ($(window).innerWidth() > 991) {\n if (sy >= changeNavigationOn) {\n // console.log(\"ON\");\n $(\"#header\").removeClass('changeHeaderOn');\n } else {\n $(\"#header\").removeClass('changeHeaderOn');\n }\n if (sy >= 10) {\n $(\"#header\").addClass('changeHeaderOn');\n }\n }\n}", "function ma5menuCheckScroll() {\n $('html').removeClass('ma5menu--overflow');\n $('.ma5menu__container').removeClass('ma5menu__container--scroll');\n if ($('.ma5menu__panel.ma5menu__panel--active').detectElementScrollbar()) {\n $('.ma5menu__container').addClass('ma5menu__container--scroll');\n $('.ma5menu__panel.ma5menu__panel--active').bind('scroll', function () {\n if (($(this).scrollTop() + $(this).innerHeight() + 1) >= $(this)[0].scrollHeight) {\n $('.ma5menu__container').removeClass('ma5menu__container--scroll');\n } else {\n $('.ma5menu__container').addClass('ma5menu__container--scroll');\n }\n });\n } else {\n $('.ma5menu__panel.ma5menu__panel--active').unbind(\"scroll\");\n }\n}", "aboveView(element) {\n const br = this.getBoundingClientRect(element);\n return -1 * (br.top - this.viewport.top) > br.height;\n }", "function checkGoTopArraw() {\n if (document.body.scrollTop > 100 || document.documentElement.scrollTop > 100) {\n document.getElementById(\"myBtn\").style.display = \"block\";\n } else {\n document.getElementById(\"myBtn\").style.display = \"none\";\n }\n }", "function scrolltop() {\n const scrollUp = document.getElementById(\"scroll-up\")\n if (this.scrollY >= 1000) {\n scrollUp.classList.add(\"show-scroll\");\n }else{\n scrollUp.classList.remove(\"show-scroll\");\n }\n}", "offscreen(){return this.x < -this.w}", "function handleScroll() {\n var yPos = window.pageYOffset\n if (yPos>700) {\n setShowTopButton(true)\n } else {\n setShowTopButton(false)\n }\n }", "function inView() {\n $.fn.visible = function (partial) {\n \n var $t = $(this),\n $w = $(window),\n viewTop = $w.scrollTop(),\n viewBottom = viewTop + $w.height(),\n _top = $t.offset().top,\n _bottom = _top + $t.height(),\n compareTop = partial === true ? _bottom : _top,\n compareBottom = partial === true ? _top : _bottom;\n \n return ((compareBottom <= viewBottom) && (compareTop >= viewTop));\n \n };\n \n var win = $(window);\n \n var $animated = $(\".animated\");\n \n $animated.each(function (i, el) {\n var el = $(el);\n if (el.visible(true)) {\n el.addClass(\"already-visible\");\n }\n });\n \n win.scroll(function (event) {\n $animated.each(function (i, el) {\n var el = $(el);\n if (el.visible(true)) {\n el.addClass(\"come-in\");\n }\n });\n });\n }", "function _isInViewport() {\n _calculateOptionsDimensions();\n $outerWrapper.toggleClass(_this.classes.above, $outerWrapper.offset().top + $outerWrapper.outerHeight() + itemsHeight > $win.scrollTop() + $win.height());\n }", "get atTop() {\n return this.offset === 0;\n }", "function handleScrolling() {\n\tlet scrolled = root.scrollHeight - root.clientHeight;\n\tif((root.scrollTop / scrolled) > 0.95 ) {\n\t\tbtnToTop.style.display = 'block';\n\t} else {\n\t\tbtnToTop.style.display = 'none';\n\t};\n}", "function checkOffset() {\n if ($(\"#mainNav\").offset().top < 50) {\n $(\"#mainBanner\").slideDown(200);\n $( \"div#popInWindow\" ).slideUp(200);\n }\n else if(!$(window).scrollTop()) {\n $(\"#mainBanner\").show();\n $( \"div#popInWindow\" ).hide();\n }\n else {\n $(\"#mainBanner\").slideUp(200);\n $( \"div#popInWindow\" ).slideDown(600);\n }\n}", "function checkStickySubforumSidebar(){var e,t=$(\".jsMainContent\").offset().top,s=$(\".jsMainContent\").outerHeight(),a=$(\".jsSubforumFixedSidebar\").outerHeight();$(window).scrollTop()>t-50?(\n//$('.jsSubforumFixedSidebar').css(\"transform\", 'translateY(60px)');\n$(\".jsSubforumFixedSidebar\").css(\"top\",\"50px\"),$(window).scrollTop()>t+s-a-50&&(e=t+s-$(window).scrollTop()-a,$(\".jsSubforumFixedSidebar\").css(\"top\",e+\"px\"))):(e=$(\".jsMainContent\").offset().top-$(window).scrollTop(),$(\".jsSubforumFixedSidebar\").css(\"top\",e+\"px\"))}", "function animeScroll() { //criando função chamada animeScroll\n\t\tvar documentTop = $(document).scrollTop(); //pega a distancia do topo\n\t\t\n\t\t$target.each(function(){ //a cada elemento alvo\n\t\t\tvar itemTop = $(this).offset().top; //pega a distancia do elemento ate o topo\n\t\t\tif(documentTop > itemTop - offset){ // se a distancia do documento é maior que a distancia do item - a distancia do elemento ate o topo\n\t\t\t\t$(this).addClass(animationClass); // adiciona a classe animationCLass\n\t\t\t}else {\n\t\t\t\t$(this).removeClass(animationClass); // caso contrario, remove\n\t\t\t}\n\t\t});\n\t}", "function addButtonToTop(e) {\n if (window.pageYOffset > 15) {\n buttonToTop.classList.remove('no-show');\n } else {\n buttonToTop.classList.add('no-show');\n }\n}", "function scrollToTopInit() {\r\n\r\n\t\t\t\t\t// Show/hide based on scroll pos\r\n\t\t\t\t\tif ($('.nectar-social.fixed').length == 0) {\r\n\t\t\t\t\t\ttoTopBind();\r\n\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// Rounded style\r\n\t\t\t\t\tif ($('body[data-button-style*=\"rounded\"]').length > 0) {\r\n\t\t\t\t\t\tvar $clone = $('#to-top .fa-angle-up').clone();\r\n\t\t\t\t\t\t$clone.addClass('top-icon');\r\n\t\t\t\t\t\t$('#to-top').prepend($clone);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Scroll up click event\r\n\t\t\t\t\t$body.on('click', '#to-top, a[href=\"#top\"]', function () {\r\n\t\t\t\t\t\t$('body,html').stop().animate({\r\n\t\t\t\t\t\t\tscrollTop: 0\r\n\t\t\t\t\t\t}, 800, 'easeOutQuad', function () {\r\n\t\t\t\t\t\t\tif ($('.nectar-box-roll').length > 0) {\r\n\t\t\t\t\t\t\t\t$body.trigger('mousewheel', [1, 0, 0]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function onScroll() {\n\n //console.log(\"window.scrollY: \" + window.scrollY);\n\n if (window.scrollY >= 45) {\n //header.classList.add('slip');\n //breadcrumb.classList.add('slip');\n } else {\n //header.classList.remove('slip');\n //breadcrumb.classList.remove('slip');\n }\n\n if (window.scrollY >= origOffsetY) {\n pagehead.classList.add('stickit');\n\n inpagenav.classList.add('dropshadow'); // only on desktop\n } else {\n pagehead.classList.remove('stickit');\n\n inpagenav.classList.remove('dropshadow'); // only on desktop\n }\n\n}", "function back_to_top(){\n var scrollTop = $(window).scrollTop();\n var offset = 500;\n if (scrollTop < offset) {\n $('.evision-back-to-top').hide();\n } else {\n $('.evision-back-to-top').show();\n }\n }", "_scrollSpy() {\n let scrollPosition = document.querySelector(this.props.scrolledElementSelector).scrollTop;\n if (scrollPosition > this.props.scrollTriggerBorder) {\n if (!this.state.isVisible) {\n this.setState({isVisible: true});\n }\n } else {\n if (this.state.isVisible) {\n this.setState({isVisible: false});\n }\n }\n }", "function ifInSightStartFunc(\n className,\n visibleFunc,\n visibleFuncParam,\n unvisibleFunc,\n unvisibleFuncParam\n) {\n const targetElementsArray = document.getElementsByClassName(className)\n console.log(targetElementsArray)\n console.log(targetElementsArray[0])\n for (let i = 0; i < targetElementsArray.length; i++) {\n console.log(i)\n console.log(targetElementsArray[i])\n let targetElement = targetElementsArray[i]\n console.log(targetElement)\n let heightWindow = window.innerHeight\n let elementTop = targetElement.getBoundingClientRect().top\n let difference = heightWindow - elementTop\n console.log(difference)\n\n if (difference < 150) {\n unvisibleFunc(unvisibleFuncParam)\n console.log('not visible')\n } else {\n visibleFunc(visibleFuncParam)\n console.log('visible')\n }\n }\n}", "function toggleTop() {\n setTopActive(!topActive);\n }", "function checkPosition() {\n for (let i = 0; i < elements.length; i++) {\n // getBoundingClientRect returns the size of the element and its position relative to the viewport\n // so basically, look how far the element is from the top of the viewport, if it gets close in view \n // add the fade in animation\n let positionFromTop = elements[i].getBoundingClientRect().top;\n if (positionFromTop - windowHeight <= 0) {\n elements[i].className = elements[i].className.replace(\n 'hidden',\n 'fade-in-element'\n );\n }\n }\n }", "function scrollFun(e) {\n\n\tvar elem = e.data.elem,\n\t\tscrollTop = e.currentTarget.scrollTop;\n\n\n\tif ( browserCon === 'conFull' ) {\n\n\t\tif ( !elemImage.hasClass('inScroll') ) {\n\t\t\telemImage.addClass('inScroll');\n\t\t}\n\n\t\tif ( !elemColor.hasClass('inScroll') ) {\n\t\t\telemColor.addClass('inScroll');\n\t\t}\n\n\t} else if( browserCon === 'conHalf' ) {\n\n\t\tif ( !elemColor.hasClass('inScroll') ) {\n\t\t\telemColor.addClass('inScroll');\n\t\t}\n\n\t}\n\n\n\n\tif ( scrollTop <= (winHeight - 50) ) {\n\n\t\t// remove the body scroll class\n\t\t$('body').removeClass('bottom-section');\n\n\t\tif ( !$.browser.mobile ) {\n\t\t\tvar opaciryVal = (1-(scrollTop/winHeight*1.3)),\n\t\t\tcOpaciryVal = (1-(scrollTop/winHeight)),\n\t\t\tbackgroundPos = (scrollTop/8),\n\t\t\ttransformPos = (scrollTop/1.3);\n\n\t\t\tif ( browserCon === 'conFull' ) {\n\n\t\t\t\telemContent.css({\n\t\t\t\t\t'opacity': opaciryVal\n\t\t\t\t});\n\n\t\t\t\telemImage.css({\n\t\t\t\t\t'transform': 'translateY(-'+backgroundPos+'px)'\n\t\t\t\t});\n\n\n\t\t\t\telemContentWrapper.css({\n\t\t\t\t\t'transform': 'translateY('+transformPos+'px)'\n\t\t\t\t});\n\n\t\t\t\telemColor.css({\n\t\t\t\t\t'opacity': cOpaciryVal\n\t\t\t\t});\n\n\t\t\t} else if( browserCon === 'conHalf' ) {\n\n\t\t\t\telemColor.css({\n\t\t\t\t\t'opacity': cOpaciryVal\n\t\t\t\t});\n\n\t\t\t}\n\n\t\t}\n\n\t\tif ( winWidth < 992 ) {\n\t\t\tvar transformPos2 = (scrollTop*1.2);\n\n\t\t\telemMenu.css({\n\t\t\t\t'margin-top': ('-'+transformPos2+'px')\n\t\t\t});\n\t\t}\n\n\t} else {\n\n\t\t// add the body scroll class\n\t\t$('body').addClass('bottom-section');\n\n\t}\n\n}", "function makeActive() {\n sections.forEach(section => {\n let box = section.getBoundingClientRect();\n // section.addEventListener('click', function() {\n // console.log(box)\n // })\n if (box.top <= 150 && box.bottom >= 150) {\n document.querySelector(`.${section.id}`).classList.add('active')\n section.classList.add('your-active-class')\n } else {\n document.querySelector(`.${section.id}`).classList.remove('active')\n section.classList.remove('your-active-class')\n }\n })\n}", "function lynked_findPos(obj) {\n\tvar curtop = 0;\n\tlynked_windowHeight = Math.round(window.innerHeight);\n\tlynked_windowCenter = lynked_windowHeight / 2;\n\tif (obj.offsetParent) {\n\t\tdo {\n\t\t\tcurtop += obj.offsetTop;\n\t\t} while (obj = obj.offsetParent);\n\tcurtop = Math.round(curtop) - lynked_windowCenter;\n\tlynked_selectedCont.push(curtop);\n//\t//console.log(\"curleft,curtop----\"+curtop)\n\t}\n}", "function scrolEventListener(){ \n if(document.scrollingElement.scrollTop === 0){\n btn.classList.remove('show'); \n } \n allSections.forEach( (sec)=>{\n const rct = sec.getBoundingClientRect();\n \n if(rct.top >= -100 && rct.top <= 200){ \n allSections.forEach( (rem)=> {\n rem.style.background = \"\"; \n });\n sec.style.background = \"#337ab7\";\n \n allLinks.forEach((l)=>{\n if(l.id !=='button'){\n l.style.background=\"#337ab7\";\n }\n });\n allLinks.forEach((alink)=>{\n if(sec.getAttribute('data-nav')==alink.textContent){\n alink.style.background = \"blue\";\n }\n }); \n\n // show btn Back to top while scrolling \n btn.classList.add('show');\n }\n }); \n }", "function checkScrollPosition() {\n clearTimeout(scrollPosCheck);\n scrollPosCheck = setTimeout(function () {\n if ($(window).scrollTop() >= scrollIndicatorThreshold) {\n if (animating) {\n animating = 0;\n $('.scroll-indicator-shadow').css({ \"display\": \"none\" });\n }\n setTimeout(() => {\n $('.scroll-indicator').addClass(\"scroll-indicator-up\");\n }, 1);\n\n } else {\n $('.scroll-indicator').removeClass(\"scroll-indicator-up\");\n }\n }, 100);\n }", "function lazyLoad(){\n var element = document.getElementsByClassName('lazy-load');\n // alert('element');\n\n for (var i = 0; i < element.length; i++){\n var elementPosition = element[i].getBoundingClientRect();\n // alert(elementPosition.top);\n if(elementPosition.top < window.innerHeight / 1.5\n && elementPosition.top + element[i].clientHeight >= window.innerHeight / 2\n ){\n element[i].classList.add('active');\n }\n\n }\n}", "function mediaCheck(el) {\r\n\r\n var $mediaCheck = window.matchMedia('(min-width: 1280px)');\r\n\r\n if (!el.length) {\r\n return false;\r\n }\r\n\r\n if ($mediaCheck.matches) {\r\n\r\n var $stickyTop = el.offset().top;\r\n var $stickyHeight = el.outerHeight();\r\n $(window).on('scroll', function () {\r\n var $windowTop = $(window).scrollTop();\r\n var $limit = $(document).height() - $stickyHeight;\r\n\r\n // debugging\r\n //console.log('$limit: ' + $limit);\r\n //console.log('$stickyTop: ' + $stickyTop);\r\n //console.log('$windowTop: ' + $windowTop);\r\n //console.log(' ');\r\n\r\n if ($stickyTop < $windowTop) {\r\n el.addClass('pos_fixed').removeClass('pos_relative');\r\n } else if ($stickyTop < 10) {\r\n el.addClass('pos_relative').removeClass('pos_fixed');\r\n }\r\n\r\n if ( ($limit < $windowTop) && ($limit < $stickyTop) ) {\r\n var diff = $limit - $windowTop;\r\n el.css({\r\n top: diff\r\n });\r\n }\r\n });\r\n\r\n } else {\r\n if (el.length) {\r\n $(window).on('scroll', function () {\r\n el.addClass('pos_relative').removeClass('pos_fixed');\r\n });\r\n }\r\n }\r\n }", "function active(e){\n let selected = document.querySelector(\".wrapper i.active\");\n let changespan = document.querySelector(\".wrapper span\");\n\n if(selected != null){\n selected.classList.remove(\"active\");\n }\n const p = document.querySelector(\".wrapper\");\n const w = window.innerWidth;\n\n // console.log(window.innerWidth);\n // console.log(window.screen.width);\n // console.log(e.screenX);\n var position = \"\";\n if(e.toElement.classList.length > 2){\n\n e.target.classList.add(\"active\");\n position = e.toElement.classList[2];\n console.log(e.toElement.classList,e,e.value);\n }\n if(position == \"house\"){\n changespan.style.left = \"4%\";\n }else if (position == \"search\") {\n changespan.style.left = \"23%\";\n }else if (position == \"circle\") {\n changespan.style.left = \"42.5%\";\n }else if (position == \"heart\") {\n changespan.style.left = \"61.5%\";\n }else if (position ==\"person\") {\n changespan.style.left = \"81.5%\";\n }\n\n}", "function AddClassActiveToSection(e) {\n\n let TopResponsive, BottomResponsive;\n if (document.documentElement.clientWidth < 1000) {\n TopResponsive = 500, BottomResponsive = 500;\n } else {\n TopResponsive = 100, BottomResponsive = 100;\n }\n for (let section of Sections) {\n var rect = section.getBoundingClientRect();\n console.log(\"recttop\" + rect.top + TopResponsive);\n console.log(rect.bottom - BottomResponsive);\n if (rect.top + TopResponsive >= 0 &&\n rect.left >= 0 &&\n rect.bottom - BottomResponsive <= (window.innerHeight || document.documentElement.clientHeight) &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth)) {\n console.log(section);\n if (section.classList.contains(\"your-active-class\") == false)\n section.classList.add(\"your-active-class\");\n } else if (section.classList.contains(\"your-active-class\")) {\n section.classList.remove(\"your-active-class\");\n }\n }\n}", "function CheckClick () {\n\tif((Input.GetMouseButtonDown(1) || Input.GetKeyDown(playerData.keySettings[14])) && currentHealths[1] >= 1)\t{\n\t\t//if((Input.mousePosition.y < Camera.main.pixelHeight - playerData.topScrollPadding) && (Input.mousePosition.y > playerData.botScrollPadding))\n\t\tif(minimap.pixelRect.Contains(Input.mousePosition)) {\n\t\t\tPlayerTarget(minimap);\n\t\t}\n\t\telse {\n\t\t\tPlayerTarget(Camera.main);\n\t\t}\n\t}\n}", "hitTop() {\n if (this.y <= 1) {\n this.y = 1;\n return true;\n }\n return false;\n }", "function checkScroll() {\n var startY = $('.navbar').height() * 3; // Changes based on navbars size * 3\n\n if ($(window).scrollTop() > startY) {\n $('.navbar').addClass(\"scrolled\"); // The class to be added for css changes\n $('.glyphicon-th-large').addClass(\"scrolled\"); // The class to be added for css changes\n } else {\n $('.navbar').removeClass(\"scrolled\"); // Removing it again\n $('.glyphicon-th-large').removeClass(\"scrolled\"); // Removing it again\n }\n }", "function activateSideNav(option_element) {\n /* **************** **************** **************** **************** **************** \n * Fades in the HTML elements which are contained within a HTML element, '.copy',\n * of a given Section which had been invisible. \n * **************** *************** **************** **************** **************** */\n \n var section_value = new String();\n // This variable holds a number which represents the Section which is viewable and contains \n // the form this function processes.\n var scroll_to_value = new Number();\n \n section_value = $jQ(option_element).attr(\"id\");\n // Holds a value which matches the vertical location, in pixels.\n\n if (section_value === \"sctn_main\") {\n // If the Section to be navigated to is 'MAIN LANDING SECTION', \n // this condition is triggered.\n\n scroll_to_value = 0;\n // The vertical location to be navigated to is 0.\n } else {\n // Otherwise, if the Section to be navigated to is not 'MAIN LANDING SECTION', \n // this condition is triggered.\n\n var wndow_selector = new String();\n var wndow_elements = new Object();\n\n var wndow_height = new Number();\n\n wndow_selector = \".wndow\";\n wndow_elements = $jQ(wndow_selector);\n\n wndow_height = $jQ(wndow_elements).height();\n \n scroll_to_value = parseInt(section_value.charAt(section_value.length - 1)) * wndow_height;\n // The vertical location to be navigated to is equal to the product \n // of multiplying the number representing the Section Value multiplied by\n // the height of a HTML element using the selector, \".wndow\". \n }\n \n $jQ(window).scrollTop(scroll_to_value);\n // The browser window is navigated to the vertical location of the Section \n // being navigated to.\n}", "function checkScroll(e) {\n var activeOverlay = $(\".active\")[0];\n // check min or max scroll\n if (\n (activeOverlay.scrollTop === 0 && e.deltaY < 0) ||\n (activeOverlay.scrollHeight - activeOverlay.scrollTop ===\n activeOverlay.clientHeight &&\n e.deltaY > 0)\n ) {\n e.preventDefault();\n e.stopPropagation();\n }\n}", "function toggleActiveClass()\r\n{\r\n for(let section of sections)\r\n {\r\n let sectionBorder=section.getBoundingClientRect()\r\n if(sectionBorder.top >=-300 && sectionBorder.top <=100)\r\n {\r\n section.classList.add('your-active-class');\r\n }\r\n else\r\n {\r\n section.classList.remove('your-active-class');\r\n }\r\n }\r\n}", "function setActiveClass(event){\n const sections = document.querySelectorAll('section')\n\n function deleteClassAndStyle() {\n sections.forEach(section => {\n section.classList.remove('your-active-class');\n section.style.border = 'none';\n });\n } \n \n const positionSection1 = sections[0].getBoundingClientRect();\n const positionSection2 = sections[1].getBoundingClientRect();\n const positionSection3 = sections[2].getBoundingClientRect();\n const positionSection4 = sections[3].getBoundingClientRect();\n \n if (positionSection1.top < 0) {\n deleteClassAndStyle();\n sections[0].classList.add('your-active-class');\n sections[0].style.border =\"3px solid yellow\";\n } if (positionSection2.top < 0) {\n deleteClassAndStyle();\n sections[1].classList.add('your-active-class');\n sections[1].style.border =\"3px solid yellow\";\n } if (positionSection3.top < 0) {\n deleteClassAndStyle();\n sections[2].classList.add('your-active-class');\n sections[2].style.border =\"3px solid yellow\";\n } if (positionSection4.top < 0) {\n deleteClassAndStyle();\n sections[3].classList.add('your-active-class');\n sections[3].style.border =\"3px solid yellow\";\n } \n\n}", "function htmlScroll() {\n var div = $('.htmlBlock');\n //Get div position\n var divPos = div.position();\n //On scroll do this\n $(window).scroll(function() {\n //Top of the element position (in this case 0 as window is at the very top)\n var windowPos = $(window).scrollTop();\n //When the window is within 600px of the top of the element it will add class\n if(windowPos >= (divPos.top - 700)) \n {\n //Makes element visible\n div.addClass('afterScroll');\n \n }\n });\n}", "isCheckerOnBoard() {\n return this.state.checkerPosition[0] < this.state.size\n && this.state.checkerPosition[1] < this.state.size\n && this.state.checkerPosition[0] >= 0\n && this.state.checkerPosition[1] >= 0;\n }", "function activarPegajoso(){\n\n let bajada = document.documentElement.scrollTop;\n\n if(bajada !=0){\n\n header.classList.add(\"cambio\");\n\n\n\n }else{\n\n header.classList.remove(\"cambio\");\n\n }\n\n}", "function isScrollVisible($el, threshold = '50%'){\n\t\t\tconsole.log(threshold);\n\t\t}", "function ensureVisible()\r\n{\r\n var selectedTop = selected.position().top;\r\n var selectedBottom = selectedTop + selected.outerHeight();\r\n\r\n var $wnd = $(wnd);\r\n var wndTop = $wnd.scrollTop();\r\n var wndBottom = wndTop + $wnd.height();\r\n\r\n if(selectedBottom > wndBottom)\r\n {\r\n $wnd.scrollTop(wndTop + (selectedBottom-wndBottom));\r\n }\r\n else if(selectedTop < wndTop)\r\n {\r\n $wnd.scrollTop(selectedTop);\r\n }\r\n}", "function scroll_check(ev,tag){\n\n\tdrag_manager.scroll_value = tag.scrollTop;\n\n\tfolder_positions_find();\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 }", "function showDivTop() {\r\n if (window.scrollY >= 300) {\r\n divTop.classList.add('visible');\r\n } else {\r\n divTop.classList.remove('visible');\r\n }\r\n }", "function checkIfVisible(elem, offset) {\n var docViewBottom = $(window).scrollTop() + $(window).height();\n var elemTop = $(elem).offset().top;\n var offset = offset | 0;\n return( (elemTop + offset) <= docViewBottom );\n}", "function checkDirection() {\r\n if (scrolled < window.pageYOffset) {\r\n scrolled = window.pageYOffset;\r\n toBottom = true;\r\n toTop = false;\r\n } else if (scrolled > window.pageYOffset) {\r\n scrolled = window.pageYOffset;\r\n toBottom = false;\r\n toTop = true;\r\n }\r\n}", "function calcdockstick() {\n var annualDockTop = $(\".bfs-income-tax-calulator\").parent().offset();\n var topHeader = $(\".bfs-header-wrap\").outerHeight();\n\n if(annualDockTop != undefined && topHeader != undefined){\n \tif ($(window).scrollTop() >= annualDockTop.top) {\n $(\".summary-main-wrapper\").css({ \"top\": topHeader + \"px\" });\n $(\".summary-main-wrapper\").addClass(\"incomedockfixed\");\n }\n else {\n $(\".summary-main-wrapper\").removeClass(\"incomedockfixed\");\n }\n } \n}", "function check_if_in_view() {\n //get current window information\n var window_height = web_window.height();\n var window_top_position = web_window.scrollTop();\n var window_bottom_position = (window_top_position + window_height);\n \n //iterate through elements to see if its in view\n $.each(animation_elements, function() {\n //get the element sinformation\n var element = $(this);\n var element_height = $(element).outerHeight();\n var element_top_position = $(element).offset().top;\n var element_bottom_position = (element_top_position + element_height);\n \n //check to see if this current container is visible (its viewable if it exists between the viewable space of the viewport)\n if ((element_bottom_position >= (window_top_position + 50)) && (element_top_position <= (window_bottom_position - 50))) {\n element.addClass('in-view');\n } else {\n // element.removeClass('in-view');\n }\n });\n }", "function toggleContent(side){\n if(cubeMode === true) {\n setTimeout(()=>{\n document.querySelectorAll('.side .content').forEach((p)=>{\n p.classList.add('hidden');\n });\n document.querySelector(`${side} .content`).classList.remove('hidden');\n }, 1000)\n }else{\n console.log(document.querySelector(side).offsetTop);\n window.scrollTo(0, document.querySelector(side).offsetTop);\n }\n}" ]
[ "0.6633101", "0.6298274", "0.6096338", "0.6056699", "0.5963251", "0.58548504", "0.584619", "0.57902753", "0.57876086", "0.578115", "0.57399976", "0.5671648", "0.56478286", "0.5591243", "0.5589629", "0.5555272", "0.55435866", "0.5536853", "0.55211794", "0.5492056", "0.5452469", "0.54468787", "0.5443282", "0.5437611", "0.54255074", "0.54236466", "0.5409398", "0.5409352", "0.54021776", "0.53997904", "0.5399484", "0.5379438", "0.5378503", "0.5374744", "0.53533465", "0.5343158", "0.53412193", "0.5338882", "0.53379285", "0.5326431", "0.5324961", "0.5321449", "0.5314718", "0.5306806", "0.5304733", "0.52995473", "0.5291215", "0.5284738", "0.5283024", "0.52683425", "0.5261865", "0.52616715", "0.5254184", "0.5252719", "0.5250698", "0.52496743", "0.52491945", "0.5229688", "0.52264065", "0.5224683", "0.5224354", "0.52229935", "0.52077913", "0.5205595", "0.5205464", "0.520293", "0.5202584", "0.52013606", "0.5196839", "0.519631", "0.51924795", "0.5170376", "0.51674324", "0.51657146", "0.5165639", "0.5164972", "0.5161116", "0.51561356", "0.5149585", "0.5148493", "0.51484424", "0.5142944", "0.5142098", "0.5139886", "0.5138774", "0.5138096", "0.5138081", "0.51380247", "0.5133099", "0.51325446", "0.5131854", "0.5131018", "0.51286376", "0.51208264", "0.51205724", "0.5119119", "0.5118836", "0.51178783", "0.51158124", "0.51153004" ]
0.7553396
0
load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button ////////////////////////////////////////////////////////////load button
function load_element_button() { console.log("recup Element") const waitingWrapper = document.querySelector("#waiting-wrapper") const questionAndRepWrapper = document.querySelector("#questionAndRepButton-wrapper") const buttonP = document.querySelector("#buttonP") const buttonN = document.querySelector("#buttonN") const questionWrapper = document.querySelector("#question-wrapper") const repPWrapper = document.querySelector("#repP-wrapper") const repNWrapper = document.querySelector("#repN-wrapper") repNWrapper.style = `opacity : 0;` repPWrapper.style = `opacity : 0;` console.log("inside timeout"); waitingWrapper.style = "opacity : 0" setTimeout(function(){ waitingWrapper.style = "display : none" }, 300); questionAndRepWrapper.style = "display : flex;" buttonP.addEventListener("click", () => { console.log("click P") questionWrapper.style = `opacity : 0;` repPWrapper.style = `opacity : 1;` postMood(1, idResponseP) }) buttonN.addEventListener("click", () => { console.log("click N") questionWrapper.style = `opacity : 0;` repNWrapper.style = `opacity : 1;` postMood(2, idResponseN) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadButtons() {\n\tgetNumbers();\n getOperators();\n getExecuteOperationButton();\n\tgetClearButton();\n\tgetclearEverythingButton();\n\tgetRemoveLastButton();\n\tgetOpenParenthesesButton();\n\tgetCloseParenthesesButton();\n\tgetSquareButton();\n\tgetSquareRootButton();\n\tgetAnsButton();\n}", "function load_click() {\n\n if ($loadMoreButton.attr('disabled') === 'disabled') {\n return;\n } //don't load if currently loading\n\n if ($loadMoreButton.hasClass('support')) {\n client = 'support';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateNormal);\n } else if ($loadMoreButton.hasClass('blog')) {\n client = 'blog';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateNormal);\n } else if ($loadMoreButton.hasClass('more')) {\n client = 'more';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateNormal);\n } else {\n client = 'video';\n $container = $('.' + client + '-result-section .result-items', $context);\n resultTemplate = _.template(globalSearch.myConfig.templateVideo);\n }\n\n //increment to next page\n queryParam.start += queryParam.num;\n isLoadClick = true;\n loadResults();\n }", "__initLoadButton() {\n let instance = this;\n $( \"#load-points\").click(\n function () {\n $.ajax({\n url: '/_load_json_in_visor',\n type: \"POST\",\n data: JSON.stringify({'exercise': document.getElementById(\"ejercicio\").innerHTML, 'filename': document.getElementById(\"nombre\").innerHTML}),\n dataType: \"json\",\n contentType: \"application/json; charset=utf-8\",\n success: \n function (data) {\n \n //Warn when the file we are importing doesn't match the model.\n let url = document.URL;\n let documentFilename = url.substring(url.lastIndexOf('/') + 1);\n let jsonFilename = data[\"filename\"];\n if (jsonFilename !== documentFilename) {\n $( \"#not-same-model-warn\").dialog({\n title: \"Warning!\",\n });\n }\n\n //Load annotations.\n let annotations = data[\"annotations\"];\n for (let annotation of annotations) {\n let point = annotation.points[0];\n let tag = annotation.tag;\n instance.annotations.addPoint(point, tag);\n }\n //Load measurements.\n let measurements = data[\"measurements\"];\n for (let measurement of measurements) {\n let point1 = measurement.points[0];\n let point2 = measurement.points[1];\n let tag = measurement.tag;\n instance.measurements.addPoint(point1, tag);\n instance.measurements.addPoint(point2, tag);\n }\n }\n });\n }\n ).button({\n icon: \"ui-icon-arrowthickstop-1-n\",\n text: false\n });\n }", "function bootButtons() {\n\t$(\".back_button\").click(function() {\n\t\tloadPrevAsset();\n\t});\n\n\t$(\".forward_button\").click(function() {\n\t\tloadNextAsset();\n\t});\n}", "function loadButtonListener() {\n\t$('main').on('click', 'button', function(event) {\n\t\tevent.preventDefault()\n\n\t\tswitch (currentState) {\n\t\t\tcase STATES.START:\n\t\t\t\tloadNextQuestion()\n\t\t\t\tbreak\n\t\t\tcase STATES.QUESTION:\n\t\t\t\tcheckAnswerValid()\n\t\t\t\tbreak\n\t\t\tcase STATES.CORRECT:\n\t\t\tcase STATES.INCORRECT:\n\t\t\t\tcurrentQuestionIndex++\n\t\t\t\tcurrentQuestionIndex >= QUESTIONS.length\n\t\t\t\t\t? loadEnd()\n\t\t\t\t\t: loadNextQuestion()\n\t\t\t\tbreak\n\t\t\tcase STATES.END:\n\t\t\t\tloadStart()\n\t\t\t\tbreak\n\t\t}\n\t})\n}", "function load(){\n \tw = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth;\n \th = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;\n \n try{\n _('btn_Sentimiento').style.height = (h-160) +\"px\";\n _('btn_centro').style.marginTop = ((h-160)/2)-100 +\"px\";\n _('btn_centro').style.display = \"block\";\n \n topLoad = 150;\n for(i=1;i<=9;i++){\n _('load'+ i).style.marginTop = topLoad +\"px\";\n topLoad-12.5;\n }\n \n _('marcoSup').style.width = w +\"px\";\n _('marcoSup').style.height = h +\"px\";\n }\n catch(e){\n \n }\n \n \n try{\n _('flecha_der').style.marginTop = ((h-160)/2)-70 +\"px\";\n }\n catch(e){\n \n }\n }", "function setLoadPageBtns(classBtn = 'btn-load-page'){\n let btnsLoadPage = document.getElementsByClassName(classBtn);\n for (var i = 0; i < btnsLoadPage.length; i++) {\n btnsLoadPage[i].addEventListener(\"click\", function(){\n loadPage();\n });\n }\n }", "function load(){\r\n\r\n}", "function loadButton(toggle)\n {\n logDebug(\"loadButton: \", toggle) ;\n if (!toggle) toggle = false ;\n return partial(initButton,toggle) ;\n }", "function loaded () {\n textSize(30);\n noStroke();\n button = createButton('TORNADO START');\n button.mousePressed(togglePlaying);\n button.size(150, 45);\n button.position(330, 300);\n}", "function loadControls(id) {\n $(\"#main\").hide();\n showid = id;\n controls_loaded = true;\n $(\"#main\").load(\"/presentor/control/\" + id, function(){\n slideButtons();\n });\n $(\".menuitem.control\").show();\n}", "function load_buttons(){\n\t\t //Load Title\n\t\t var loader = new THREE.TextureLoader();\n\t\t loader.crossOrigin = true;\n\t\t \n\t\t // 0 - Undo Button\n\t\t var T = loader.load( 'Images/undoButton.png' );\n\t\t T.minFilter = THREE.LinearFilter;\n\t\t var T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\n\t\t var undoButton = new THREE.Sprite(T1);\t\t\t\n\t\t scene.add(undoButton);\n\t\t undoButton.posX = -9;\n\t\t undoButton.posY = 6.5;\n\t\t undoButton.posZ = 0;\n\t\t undoButton.position.set(undoButton.posX, undoButton.posY, undoButton.posZ);\n\t\t undoButton.scale.set(2.5 - 287/(window.innerWidth*.7), 7, 1);\n\t\t undoButton.name = \"undo\";\t\n\t\t undoButton.type = \"button\";\t\n\t\t buttons.push(undoButton);\n\t\t objects.push(undoButton);\n\t\t \n\t\t // 1 - Redo Button\n\t\t T = loader.load( 'Images/redoButton.png' );\n\t\t T.minFilter = THREE.LinearFilter;\n\t\t T1 = new THREE.SpriteMaterial( { map: T, color: 0x575757 } );\n\t\t var redoButton = new THREE.Sprite(T1);\t\t\t\t \n\t\t redoButton.posX = -6.5;\n\t\t redoButton.posY = 6.5;\n\t\t redoButton.posZ = 0;\n\t\t redoButton.position.set(redoButton.posX, redoButton.posY, redoButton.posZ);\n\t\t redoButton.scale.set(2.5 - 287/(window.innerWidth*.7), 7, 1);\n\t\t redoButton.name = \"redo\";\t\n\t\t redoButton.type = \"button\";\t\n\t\t scene.add(redoButton);\n\t\t buttons.push(redoButton);\n\t\t objects.push(redoButton);\n\t\t \n\t\t // 2 - Background Button\n\t\t T = loader.load( 'Images/backgroundButton.png' );\n\t\t T.minFilter = THREE.LinearFilter;\n\t\t T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\n\t\t var backgroundButton = new THREE.Sprite(T1);\t\t\t\t \n\t\t backgroundButton.posX = -4;\n\t\t backgroundButton.posY = 6.5;\n\t\t backgroundButton.posZ = 0;\n\t\t backgroundButton.position.set(backgroundButton.posX, backgroundButton.posY, backgroundButton.posZ);\n\t\t backgroundButton.scale.set(2.5 - 287/(window.innerWidth*.7), 7, 1);\n\t\t backgroundButton.name = \"background\";\t\n\t\t backgroundButton.type = \"button\";\t\n\t\t scene.add(backgroundButton);\n\t\t buttons.push(backgroundButton);\n\t\t objects.push(backgroundButton);\n\t\t \n\t\t // 3 - WebCam Button\n\t\t T = loader.load( 'Images/camButton.png' );\n\t\t T.minFilter = THREE.LinearFilter;\n\t\t T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\n\t\t var camButton = new THREE.Sprite(T1);\t\t\t\t \n\t\t camButton.posX = -1.5;\n\t\t camButton.posY = 6.5;\n\t\t camButton.posZ = 0;\n\t\t camButton.position.set(camButton.posX, camButton.posY, camButton.posZ);\n\t\t camButton.scale.set(2.5 - 287/(window.innerWidth*.7), 7, 1);\n\t\t camButton.name = \"cam\";\t\n\t\t camButton.type = \"button\";\t\n\t\t scene.add(camButton);\n\t\t buttons.push(camButton);\n\t\t objects.push(camButton);\n\t\t \n\t\t // 4 - Text Button\n\t\t T = loader.load( 'Images/textButton.png' );\n\t\t T.minFilter = THREE.LinearFilter;\n\t\t T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\n\t\t var textButton = new THREE.Sprite(T1);\t\t\t\t \n\t\t textButton.posX = 1;\n\t\t textButton.posY = 6.5;\n\t\t textButton.posZ = 0;\n\t\t textButton.position.set(textButton.posX, textButton.posY, textButton.posZ);\n\t\t textButton.scale.set(2.5 - 287/(window.innerWidth*.7), 7, 1);\n\t\t textButton.name = \"text\";\t\n\t\t textButton.type = \"button\";\t\n\t\t textButton.On = false;\t\n\t\t scene.add(textButton);\n\t\t buttons.push(textButton);\n\t\t objects.push(textButton);\n\n\t\t \n\t\t // Send Button\n\t\t T = loader.load( 'Images/sendButton.png' );\n\t\t T.minFilter = THREE.LinearFilter;\n\t\t T1 = new THREE.SpriteMaterial( { map: T, color: 0xffffff } );\n\t\t var sendButton = new THREE.Sprite(T1);\t\t\t\t \n\t\t sendButton.posX = 7;\n\t\t sendButton.posY = 6.5;\n\t\t sendButton.posZ = 0;\n\t\t sendButton.position.set(sendButton.posX, sendButton.posY, sendButton.posZ);\n\t\t sendButton.scale.set(2.5+ 1 - 287/(window.innerWidth*.7), 7, 1);\n\t\t sendButton.name = \"send\";\t\n\t\t sendButton.type = \"button\";\t\n\t\t scene.add(sendButton);\n\t\t buttons.push(sendButton);\n\t\t objects.push(sendButton);\n\t\t \n\t\t console.log(\"buttons loaded.\");\n\t }", "function eltdfInitButtonLoading() {\n $('.add_to_cart_button').click(function(){\n $(this).text(eltdfGlobalVars.vars.eltdAddingToCart);\n });\n }", "function showLoadMoreButtons() {\r\n textList.showButton();\r\n imageList.showButton();\r\n }", "async function load() {\n $(\"#openConfigs\").css(\"background\", \"rgb(0, 130, 255)\")\n await buttonTimer(500)\n\n $(\"#openConfigs\").css(\"background\", \"rgb(0, 174, 255)\")\n }", "function loadButton(e, sp) {\n $(e).attr(\"disabled\", true).html($(e).html() + sp);\n}", "function showLoadSeeUI(){\n\tif (lastclicked == \"load\"){\n\t\t$(\"#loadSeeConfig\").toggle(\"blind\");\n\t}else{\n\t\thideAll();\n\t\tlastclicked=\"load\";\n\t\tshowLoadSeeUI();\n\t}\n}", "function loadButtonClick() { \n // clear the datasource\n document.getElementById(\"listView\").winControl.itemDataSource = null;\n \n // set load button disabled \n loadBtn.disabled = true;\n\n // set progress be visible\n document.getElementById(\"loadprogressring\").style.visibility = \"visible\";\n \n // simulate listview to load large data. because the listview load data synchronously \n setTimeout(loaddata, 2000);\n }", "function setupLoad(btn) {\n // Check whether the loop is running or not\n if (btn.scrolling === false) {\n btn.innerHTML = 'Click to Stop Loading';\n btn.scrolling = true;\n // The list of tracks visible on screen, which changes for a playlist or likes\n let tracks;\n if (btn.pageType === \"Likes\") {\n tracks = document.querySelector('.lazyLoadingList__list');\n } else if (btn.pageType === \"Playlist\") {\n tracks = document.querySelector('.trackList__list');\n } else if (btn.pageType === \"Discover\") {\n tracks = document.querySelector('.systemPlaylistTrackList__list');\n }\n if (tracks.childElementCount > 2) {\n // Reset the queue to the beginning of the list of tracks\n let firstTrack = tracks.children[0];\n let secondTrack = tracks.children[1];\n\n let firstPlayButton = firstTrack.children[0].children[0].children[1].children[0];\n let secondPlayButton = secondTrack.children[0].children[0].children[1].children[0];\n // Reset by playing 2, playing 1, then pausing playback\n secondPlayButton.click();\n setTimeout(function(){ firstPlayButton.click(); }, 50);\n setTimeout(function(){\n let playButton = document.querySelector('.playControl');\n if (playButton.classList.contains('playing')) {\n playButton.click();\n }\n }, 150);\n\n // Add the first track to the queue so it gets shuffled\n tracks.getElementsByClassName(\"sc-button-more\")[0].click()\n document.getElementsByClassName(\"moreActions__button addToNextUp\")[0].click()\n\n // Open the queue to load it\n toggleQueue('open');\n\n // Setup the scrolling loop - Needs time before running so the queue loads\n btn.timeout = setTimeout(function(){\n btn.interval = setInterval(function() { scrollQueue(btn); }, 500);\n }, 3000);\n } else {\n // The list has two or less tracks - cannot shuffle play\n btn.innerHTML = 'Error: Too Few Tracks';\n }\n } else {\n clearInterval(btn.interval);\n clearTimeout(btn.timeout);\n btn.interval = 0;\n btn.scrolling = false;\n btn.innerHTML = 'Shuffle Play';\n }\n }", "function loaded() {\n play = createButton(\"PLAY TO TRIP\");\n\n //style the button\n play.position(width/2 - 75, height - 120);\n play.size(150)\n play.style('background-color', \"black\");\n play.style('font-size', '15px');\n play.style('font-weight', 'bold');\n play.style('letter-spacing','2px');\n play.style('color', \"#b0f11d\");\n play.style('padding', '15px');\n play.style('border-style', 'solid');\n play.style('border-width', '0.5px');\n play.style('border-color', \"#b0f11d\");\n\n //when the button is pressed, the function togglePlaying is called\n play.mousePressed(togglePlaying);\n console.log(\"loaded\");\n}", "function load(){\n\t\tsettingsLink = addSettingsLink();\n\t\tcreateCheckboxes();\n\t\tloadSettings();\n\t}", "function loadRemainingUI() {\n\t\tloadPalette();\n\t\tsetPlaybackButtons();\n\t\tloadDownloadButton();\n\t}", "function load(department)// button to back\n{\n document.getElementById(\"backButton\").style.visibility = \"visible\";\n console.log(\"clicked arg:\",department);\n loadData(department);\n}", "function calcInit () {\n loadButtons();\n}", "function whenClicked()\r\n{\r\n\r\n $('#trackbtn').button('loading');\r\n getUserLocation();\r\n\r\n}", "function LoadButton(obj,enableRecordType){\n CloseWindow();\n \n if(enableRecordType)\n {\n LoadFilterButton(obj);\n }\n else\n {\n LoadButtonWithoutFilter(obj)\n }\n}", "function loadTopicsButtons() {\n\t$('.buttons-div').text('');\n\ttopics.forEach(topic => {\n\tvar storedElement = $('<button>').attr('class', 'btn m-1 gif-buttons').attr('value', topic).text(topic);\n\t$('.buttons-div').append(storedElement);\n\t});\n}", "function load() {\r\n\t\tvisibility(\"none\", \"allbooks\");\r\n\t\tvisibility(\"\", \"singlebook\");\r\n\t\tbookTitle = this.className; // enables the user to go to page of the book that is clicked\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\"+bookTitle+\"/cover.jpg\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; \r\n\t\tsearchData(\"info&title=\" + bookTitle, oneBookInfo);\r\n\t\tsearchData(\"description&title=\" + bookTitle, oneBookDescription);\r\n\t\tsearchData(\"reviews&title=\" + bookTitle, oneBookReview);\t\r\n\t}", "function buttonLoad() {\n button.style.visibility = 'hidden'; \n cards.forEach(card => card.addEventListener('click', flipCard));\n container.addEventListener('click', gameOver);\n}", "function handleLoad() {\n magicalCanvas.canvas = document.querySelector(\"canvas\");\n magicalCanvas.crc2 = magicalCanvas.canvas.getContext(\"2d\");\n editBox = document.getElementById(\"edit\");\n let start = document.getElementById(\"start\");\n let load = document.getElementById(\"load\");\n start.addEventListener(\"click\", chooseBG);\n load.addEventListener(\"click\", loadFromDB);\n }", "function loadDataOptionsPressed() {\n\n switch (hdxAV.status) {\n\n case hdxStates.AV_RUNNING:\n // if there's an AV running, we need to pause it\n hdxAV.setStatus(hdxStates.AV_PAUSED);\n hdxAV.startPause.innerHTML = \"Start\";\n // break intentionally omitted\n\n case hdxStates.AV_PAUSED:\n case hdxStates.AV_COMPLETE:\n case hdxStates.GRAPH_LOADED:\n // show waypoints, show connections\n //initWaypointsAndConnections(true, true,\n // visualSettings.undiscovered);\n \n //cleanupAVControlPanel();\n //algorithmSelectionChanged();\n\thideAVStatusPanel();\n break;\n }\n\n // in all cases, we hide the top panel, show the load panel\n hideTopControlPanel();\n showLoadDataPanel();\n}", "function load() {\n\n\n convertToIndex();\n buildGraph();\n graph.consolePrintGraph();\n gameIntro();\n $(\"#newGame\").click(start);\n}", "function initButtons() {\n $('#wizard-next-button').click(nextPhase);\n $('#wizard-previous-button').click(previousPhase);\n $('.wizard-phase').hide();\n $('.wizard-phase-button').click(function () {\n setPhase($(this).attr('data-phase'));\n });\n $('#wizard-done-button').click(function () {\n doneCallbacks.every(function (callback) {\n return callback() !== false;\n });\n });\n }", "function displayButton() {\r\n var p = $('<p />').attr('id', 'imdbscout_button');\r\n p.append($('<button>Load links</button>').css({'background-color':'#F5C518', 'color':'blue', 'font-weight':'bold'}).click(function() {\r\n $('#imdbscout_button').remove();\r\n if (onSearchPage) {\r\n performSearch();\r\n } else {\r\n performPage();\r\n }\r\n }));\r\n if (onSearchPage) {\r\n $('#sidebar').prepend(p);\r\n } else if ($('[class^=SubNav__SubNavContainer]').length) {\r\n $('[class^=SubNav__SubNavContainer]').append(p);\r\n // reference\r\n } else if ($('.titlereference-header').length) {\r\n $('.titlereference-header').append(p);\r\n }\r\n}", "function updateBtnConf() {\n\tvar view = $('.carousel .active').attr('data-view') ;\n\tdocument.getElementById('ccBtnView').href = view ;\n\tvar info = $('.carousel .active').attr('data-info') ;\n\tdocument.getElementById('ccBtnInfo').href = info ;\n\t// enable Load if D8N available\n\tvar load = $('.carousel .active').attr('data-load-chart') ;\n\tif (load) {\n\t\t$('#ccBtnLoad').removeClass('disabled') ;\n\t} else {\n\t\t$('#ccBtnLoad').addClass('disabled') ;\n\t}\n}", "function onLoadHandler()\n{ \n button_save.disabled = true\n button_harden.disabled = true\n button_retrieve.disabled = true\n button_next.disabled = true\n}", "load() {\r\n\r\n }", "function enableButtons()\n {\n //show buttons for updating and creating new workflow\n $(\"#perc-update-wf-save-cancel-block\").show();\n $(\"#perc-new-wf-save-cancel-block\").show();\n }", "loadingState(event)\n {\n\n\n $(event.currentTarget).button('loading');\n\n\n }", "function showLoadMoreButton(){\n stopLoading();\n productsSinceLoadMoreButton = 0;\n\n // Preload next page before the user clicks on the button\n var deferredResponse = loadNextPage();\n\n $loadMoreButton.show();\n $loadMoreButton.one('click', function(){\n $loadMoreButton.hide();\n $spinner.css('display', 'block');\n\n deferredResponse\n .done(function(json) {\n appendResults(json);\n startLoading();\n })\n .always(function(){\n $spinner.css('display', 'none');\n });\n });\n }", "function loaded() {\n\taddElements();\n\tosScroll();\n\t// initiate tabs\n\t$('#tabs').tab();\n\t// set event listeners\n\tsetOneTimeEventListeners();\n\t//updateChecked();\n}", "function init(){\n appendButtons();\n clearVariables();\n}", "function loadButton(counts){\n\n //create div to put in all buttons\n let buttondiv = document.createElement(\"div\");\n buttondiv.setAttribute(\"id\",\"button\");\n\n //create first button\n let firstButton = document.createElement(\"button\");\n firstButton.innerHTML =\"First\";\n firstButton.setAttribute(\"class\",\"btn btn-primary\");\n buttondiv.append(firstButton);\n\n //addeventlistener to the button and pass the event and a function to be executed\n firstButton.addEventListener(\"click\",()=>reload(1)); \n \n //create previous button\n let prevButton = document.createElement(\"button\");\n prevButton.innerHTML =\"Previous\"\n prevButton.setAttribute(\"class\",\"btn btn-primary\");\n buttondiv.append(prevButton);\n\n //addeventlistener to the button and pass the event and a function to be executed\n prevButton.addEventListener(\"click\",()=>{\n \n //if altready @pg1 stay there else go a page back\n if (objData.page === 1)\n reload(1);\n else\n reload(objData.page - 1);\n });\n\n //use forloop to create numeric buttons\n for(let count = 1; count<= counts; count++){\n let button = document.createElement(\"button\");\n button.innerHTML=count;\n button.setAttribute(\"class\",\"btn btn-primary\");\n button.addEventListener('click',()=>reload(count));\n buttondiv.append(button);\n } \n\n //create next button\n let nextButton = document.createElement(\"button\")\n nextButton.innerHTML=\"Next\"\n nextButton.setAttribute(\"class\",\"btn btn-primary\");\n buttondiv.append(nextButton);\n\n //addeventlistener to the button and pass the event and a function to be executed\n nextButton.addEventListener(\"click\",()=>{\n\n //if altready last page stay there else go to next page\n if (objData.page === Math.ceil(objData.pageData.length/objData.rows))\n reload(objData.page);\n else\n reload(objData.page + 1);\n });\n\n //create last button\n let lastButton = document.createElement(\"button\")\n lastButton.innerHTML=\"Last\";\n lastButton.setAttribute(\"class\",\"btn btn-primary\");\n buttondiv.append(lastButton);\n\n //addeventlistener to the button and pass the event and a function to be executed\n lastButton.addEventListener(\"click\",()=>reload(objData.pageData.length/objData.rows)); \n\n main.append(buttondiv); \n}", "function loadShowUpdateFile(){\n\t$('a[data-tar=\"consultFile\"][data-loaded=\"0\"]').each(function(){\n\t\t$(this).on('click',function(e){\n\t\t\te.preventDefault();\n\t\t\tpre_fnloadFile($(this).attr(\"data-folio\"));\n\t\t\t$(this).attr(\"data-loaded\",\"1\");\n\t\t})\n\t});\n\t$('[data-btn=\"uploadFiles\"][data-loaded=\"0\"]').each(function(){\n\t\t$(this).on('click',function(e){\n\t\t\t$(\"#uploadFiles\").attr(\"data-grade\",$(this).attr(\"data-grade\"))\n\t\t\t\t\t\t\t .attr(\"data-period\",$(this).attr(\"data-period\"))\n\t\t\t\t\t\t\t .attr(\"data-document\",$(this).attr(\"data-document\"));\n\t\t});\n\t\t$(this).attr(\"data-loaded\",\"1\");\n\t});\n}", "function loadIcon() {\n $(\".button\")\n .addClass(\"button--loading\")\n .delay(1000)\n .queue(function (next) {\n $(this).removeClass(\"button--loading\");\n next();\n });\n}", "async function loadPokemonData() {\n\tbuttonsOn(false);\n\tpokemon1 = idList[currentL];\n\tresp = await axios.get(`/api/pokemon/${idList[currentL]}`);\n\tpoke1 = resp.data;\n\tpokemon2 = idList[currentR];\n\tresp = await axios.get(`/api/pokemon/${idList[currentR]}`);\n\tpoke2 = resp.data;\n\tloadHTML(poke1, 1);\n\tloadHTML(poke2, 2);\n\tgenerateMoveList(poke1, 1);\n\tgenerateMoveList(poke2, 2);\n\tbuttonsOn(true);\n\tsaveinStorage();\n}", "function initLoadMoreProjectsCardsBtn (){\n $('.js-more-procards').attr('disabled',false);\n $('.js-more-procards').on( 'click', function ( e ) {\n e.preventDefault();\n $('.js-more-procards').attr('disabled',true).html('<i class=\"spinner\"></i>');\n loadMoreProjectsCards();\n });\n}", "function loading() {\n}", "function loadHandler() {\n if (loaded === toload) {\n // console.log('All images loaded');\n\n // Get all images except the button and put in symbolsArray; as button is index 0, start from index 1 to skip it.\n for (var i = 1; i < loadedImagesArray.length; i++) {\n symbolsArray.push(loadedImagesArray[i]);\n // console.log(symbolsArray);\n }\n\n canvases.forEach(canvas => {\n canvasArray.push(canvas);\n drawingSurface = canvas.getContext('2d');\n drawingSurfacesArray.push(drawingSurface);\n });\n\n // Check array for content\n // console.log(canvasArray);\n // console.log(drawingSurfacesArray);\n\n // Create sprites from symbols\n for (let i = 0; i < symbolsArray.length; i++) {\n let sprite = Object.create(spriteObject);\n sprite.x = 0;\n sprite.y = 0;\n spritesArray.push(sprite);\n }\n\n // console.log(spritesArray);\n\n // Add spin button\n spinButton.setAttribute('src', 'images/button.png'); \n spinButton.addEventListener('click', update, false);\n } else {\n console.log('Loaded images does not equal expected images');\n }\n }", "function load_click() {\n if ($('random_front_picture') != null) {\n Event.observe('random_front_picture', 'click', function(e) {\n e.stop()\n to = $('random_front_picture').href \n new Ajax.Request(to)\n })\n }\n}", "function loadGame(){\r\n\t\t\t\t\tcountClick=0;\r\n\t\t\t \tdocument.getElementById(\"sr\").innerHTML = \"Game On !!\";\r\n\t\t\t \tdocument.getElementById(\"winner\").innerHTML = \"A Beautiful Mind\";\r\n\t\t \t\tvar buttonHtml = \"\";\r\n\t\t \t\tfor (i = 0; i <9; i++) { \r\n\t\t \t\t\tarr.length=0;// clear data of previous game\r\n\t\t\t\t\t\tif(i==2 || i==5)\r\n\t\t\t\t\t\t\tbuttonHtml=buttonHtml + \"<button class=\\\"button\\\" \"+\"id=\\\"\" +i+\"\\\" onclick=\\\"calcWinner(this.id)\\\" value=\\\"\\\"></button><br> \" ;\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\tbuttonHtml=buttonHtml + \"<button class=\\\"button\\\" \"+\"id=\\\"\" +i+\"\\\" onclick=\\\"calcWinner(this.id)\\\" value=\\\"\\\"></button> \" ;\r\n\t\t\t\t \t}//for;\r\n\t\t\t \tdocument.getElementById(\"b\").innerHTML = buttonHtml ;\r\n\t\t\t\t\tdocument.getElementById(\"b\").style.background = \"grey\";\r\n\r\n}// function loadGame", "function handleLoad(){\n for (let i = 0; i < 10; i++){\n numButtons.push(document.getElementById('butt' + i));\n }\n \n for (let i = 0; i < 10; i++){\n numButtons[i].addEventListener('click', handleNumberClick(i));\n }\n\n \n buttonPlus = document.getElementById('plus');\n buttonEqual = document.getElementById('equal');\n \n buttonPlus.addEventListener('click', plus);\n buttonEqual.addEventListener('click', equal);\n paragraph = document.getElementById('my_para');\n}", "function _load() {\r\n document.getElementById(\"loading-icon\").style.visibility = \"hidden\";\r\n document.getElementById(\"body\").style.visibility = \"visible\";\r\n }", "function loadButtons(arrayOfTopics) {\n $(\".buttonArea\").empty();\n\n arrayOfTopics.forEach(function(arrayItem) {\n $(\".buttonArea\").append(\n $(\"<button>\", {\n type: \"button\",\n class: \"btn btn-success btn-sm m-3 animalButton\",\n text: arrayItem.toUpperCase()\n }).on(\"click\", function() {\n // console.log(\"Clicked Animal Button : \" + $(this).text());\n getGifs($(this).text());\n })\n );\n });\n }", "function onload() {\r\n\tload();\r\n}", "onLoadButtonClick() {\n console.log(\"Loaderbox Clicked!\");\n this.jqueryMap.$load.click();\n return false;\n }", "function loadTopicButtons(){\n $('.buttons').empty();\n $.each(topics, function(i, val) {\n var topicButton = $('<button>').attr('class', 'btn').addClass('btn-primary').text(val);\n $('.buttons').append(topicButton);\n });\n }", "preload() {\n this.load.audio('confirm',['../../assets/fx/selection1.mp3', '../../assets/fx/selection1.ogg'])\n this.load.image('Background', '../../assets/images/background_menu.png')\n this.load.image('ButtonFactor', '../../assets/images/button_factor.png')\n this.load.image('ButtonMult', '../../assets/images/button_multiply.png')\n this.load.image('ButtonDiv', '../../assets/images/button_divide.png')\n }", "function loadMenuButtons(){\n texts = [];\n texts.push(new Text(WIDTH/2, HEIGHT/25, WIDTH/6, \"OCTE\", -WIDTH/10, false));\n //texts.push(new Text(WIDTH/2, HEIGHT*0.2, WIDTH/50, \"(overly complicated tennis experience)\", -WIDTH/10, false));\n buttons = [];\n buttons.push(new Button(WIDTH/2, HEIGHT/2 - HEIGHT/10 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"1player\", \"1 PLAYER\", 0, {}));\n buttons.push(new Button(WIDTH/2, HEIGHT/2 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"2player\", \"2 PLAYERS\", 0, {}));\n buttons.push(new Button(WIDTH/2, HEIGHT/2 + HEIGHT/10 + HEIGHT/150, WIDTH*0.2, HEIGHT/15, \"options\", \"OPTIONS\", 0, {}));\n}", "function contentLoader(ev) {\n let eventTarget = ev.target.textContent;\n console.log(eventTarget.textContent);\n\n /* \n Use conditional and event-object to check which button is clicked\n and based on that, create HTML with the data inside the backticks:\n `<h1>${headingContent}</h1>\n <img src=\"${imgUrl}\" alt=\"${imgAlt}\">\n <p>${bodyText}</p>`\n Assign this content to to your HTML-container that will \n be dynamically loaded (you already got the reference to \n this container before you started the function handleSelection) \n */\n\n if (eventTarget === \"1\") {\n currentContent.innerHTML = `<h1>${resources.Infrastructure.headingContent}</h1>\n <img src=\"${resources.Infrastructure.imgUrl}\">\n <p>${resources.Infrastructure.bodyText}</p>`;\n } else if (eventTarget === \"2\") {\n currentContent.innerHTML = `<h1>${resources.PAYG.headingContent}</h1>\n <img src=\"${resources.PAYG.imgUrl}\">\n <p>${resources.PAYG.bodyText}</p>`;\n } else {\n currentContent.innerHTML = `<h1>${resources.Grids.headingContent}</h1>\n <img src=\"${resources.Grids.imgUrl}\">\n <p>${resources.Grids.bodyText}</p>`;\n }\n\n /* \n Remove the id active-button from the element that\n contains it prior to the click-event. \n\n This will require the loop throught the NODE LIST of buttons. \n Inside the loop, use conditional and the element object method\n hasAttribute() to check if the current button in the loop containes the id.\n If it does, use element-object property removeAttribute()\n to remove the id. \n */\n\n for (let i = 0; i < btns.length; i++) {\n if (btns[i].hasAttribute(\"id\")) {\n btns[i].removeAttribute(\"id\");\n }\n }\n\n ev.target.id = \"active\";\n\n}", "function telepathyInit() {\n $('#autoload').load('../narratives/psion_nar.html #telepathy_1');\n $('.button_menu').load('../narratives/psion_nar.html #telepathy_menu_1');\n $('.button_menu').on(\"click\", \"#telepathy_bttn_1\", telepathyPt2);\n}", "function fetchButtons(){\n// div that we will use in order to add new buttons to that section\n\t\n\t//get the list of the urls\n\t// make a button for each url\n\tchrome.storage.local.get({userKeyIds: []}, function(result){\n\t\tresult.userKeyIds.forEach(function(result){\n\n\t\t\tlet button = createButton(result.keyPairId, result.buttonId);\n\t\t\t// checking the current background tab to see if it matches any of the url buttons\n\t\t\t// if so, highlight its border\n\t\t\tchrome.tabs.query({'active': true, 'currentWindow': true}, function(tabs){\n\t\t\t\tlet currentbackgroundurl = tabs[0].url.split('/');\n\n\t\t\t\tif((currentbackgroundurl[2].substring(0, 4) === \"www.\" && currentbackgroundurl[2].substring(4) === result.keyPairId) || currentbackgroundurl[2] === result.keyPairId){\n\t\t\t\t\tbutton.style.border = \"thick solid \t#ff0000\";\n\t\t\t\t}\n\t\t\t})\n\t\t\t\n\t\t\t//appending button to the popup\n\t\t\tappendButton(button);\n\t\t});\n\t});\n }", "function enableButtonsLoading() {\n var cancelButton = document.getElementById(\"cancelButton\");\n var submitButton = document.getElementById(\"loginButton\");\n cancelButton.disabled = false;\n submitButton.disabled = false; \n}", "function loadRadialButton(){\n\t$('#generarButtonRadial').click(function(event) {\n\t\tgenerateTreeParams(\"radial\",$('#sliderValLabel1').val());\n\t});\n}", "function loadVerbWikHTMLButtons() {\n verbFromWikHTMLButtons[verbIndex] = document.querySelector('#verbFromWik' + verbIndex + 'Button');\n for (let j = verbIndex; j < verbIndex + 1; j++) {\n verbFromWikHTMLButtons[j].addEventListener('click', () => verbFromWikHTML(j));\n } \n}", "function bindBtnLoadOnClick() {\n $('#btnLoad').click(function() {\n var confirm = window.confirm('Are You Sure Wanna Load This Delivery ?');\n if(!confirm) {\n return false;\n }\n submitForm('LOAD');\n });\n}", "function createButtons() {\n\n // Load control button template\n Ractive.load('templates/buttons.html').then(function (buttonControl) {\n\n buttonsControl = new buttonControl({\n el: 'buttonControl',\n data: {\n controlButton: updateButtons\n }\n });\n\n // Added listener to update progress bar value\n buttonsControl.on('upadateBar', function (event) {\n var selectedbar = selectControls.find(\"#selectProgress\").value;\n var valueUpdate = parseInt(this.get(event.keypath));\n updateProgressBar(selectedbar, valueUpdate,limit);\n });\n\n });\n}", "onButtonClick(options) {\n const loading = this.getButtonCallableProp(options, 'loading');\n if (!loading) {\n const result = this.getButtonCallableProp(options, 'onClick');\n if (options.autoLoading && Object(ng_zorro_antd_core_util__WEBPACK_IMPORTED_MODULE_6__[\"isPromise\"])(result)) {\n options.loading = true;\n result.then(() => (options.loading = false)).catch(() => (options.loading = false));\n }\n }\n }", "function initButtons() {\n var $exportButton = $(\"#export-link\");\n $exportButton.on('click', function(evt) {\n exportCookieCSV(SELECTED_SITES_CSV_URL+\"/\"+site+ \"/cookie_consent_log.csv\");\n });\n\n var $backButton = $('#perc-cookie-back-button');\n $backButton.off('click').on('click', returnToMainScreen);\n\n var $advancedAllSitesButton = $('#advanced-all-sites-btn');\n $advancedAllSitesButton.off('click').on('click', addAdvancedHeight);\n\n var $advancedSiteButton = $('#advanced-site-btn');\n $advancedSiteButton.off('click').on('click', addAdvancedHeight);\n\n var $deleteButton = $('#cookie-consent-delete-btn');\n $deleteButton.off('click').on('click', confirmDelete);\n }", "function onPageLoad() {\n $('button[data-button-cerca]').click(ricercaConciliazione.bind(undefined, false));\n $(\"#buttonNuovaConciliazione\").click(apriCollapseNuovaConciliazione);\n $('#inserimento_buttonSalva').click(gestisciConciliazione.bind(undefined, 'inserimento', 'gestioneConciliazionePerTitolo_inserisci.do'));\n $('#aggiornamento_buttonSalva').click(gestisciConciliazione.bind(undefined, 'aggiornamento', 'gestioneConciliazionePerTitolo_aggiornamento.do'));\n\n definisciRadioEntrataSpesa();\n definisciCaricamentoSelectViaAjax();\n definisciPulsantiAnnullamento();\n definisciRicercaGuidataConto();\n\n $(document).on('contoCaricato', gestioneContoCaricato);\n }", "function showLoadingView() {\n $loadScreen.show();\n $startGameButton.text(\"Loading...\");\n $gameCategoryRow.empty();\n $gameQuestionsBody.empty();\n $gameBoard.hide();\n\n\n}", "function load()\n{\n setupParts();\n\tbgn();\n}", "function initBtns(){\n okbtn = {\n x: (width - s_buttons.Ok.width)/2,\n y : height/1.8,\n width : s_buttons.Ok.width,\n height :s_buttons.Ok.height\n };\n \n startbtn = {\n x: (width - s_buttons.Score.width)/2,\n y : height/2.5,\n width : s_buttons.Score.width,\n height :s_buttons.Score.height\n };\n \n scorebtn = {\n x: (width - s_buttons.Score.width)/2,\n y : height/2,\n width : s_buttons.Score.width,\n height :s_buttons.Score.height\n };\n \n menubtn = {\n x:(width - 2*s_buttons.Menu.width),\n y : height/1.8,\n width : s_buttons.Menu.width,\n height :s_buttons.Menu.height\n };\n \n resetbtn = {\n x: (s_buttons.Reset.width),\n y : height/1.8,\n width : s_buttons.Reset.width,\n height :s_buttons.Reset.height\n };\n}", "function pageLoadFunctions() {\n\thideTableGeneratorButton();\n\thideAddRowButton();\n}", "function initializeButtons() {\n $(\"#show_choose_sheet_button\").click(showChooseSheetDialog);\n }", "function hideBtn(){\n\tsetTimeout(function(){\n\t\tload_btn.hide();\n\t},300);\n}", "function formLoad() {\n setFormElementsFromRdb();\n\n // Update derived radio button elements\n if ($(\"#id_enabled\").val() == '1') {\n $(\"#enabledButton_0\").attr(\"checked\", \"checked\");\n } else {\n $(\"#enabledButton_1\").attr(\"checked\", \"checked\");\n }\n\n displayInstalledFiles(cbqFiles);\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 }", "function loadClick(e, data)\n\t{\n\t\t$(data.popup).find('input[type=file]').unbind('change').bind('change', function(e){\n\n\t\t\tvar editor = data.editor;\n\n\t\t\tvar file = this.files[0];\n\n\t\t\tif (typeof file == 'object') {\n\t\t\t\tvar url = uploadUrl;\n\t\t\t\tvar alt = $(data.popup).find('input[name=alt]').val();\n\n\t\t\t\tuploadFile(file, url, function(response){\n\n\t\t\t\t\tvar html = '<img src=\"' + response + '\" alt=\"' + alt + '\"/>';\n\n\t\t\t\t\teditor.execCommand(data.command, html, null, data.button);\n\n\t\t\t\t\teditor.hidePopups();\n\t\t\t\t\teditor.focus();\n\t\t\t\t});\n\t\t\t}\n\n\n\t\t});\n\t}", "onButtonPressed(){\n\t\tnuevaPartida = true;\n\t\tgame.state.start('LoadLevel'); // Lanza el estado siguiente\n\t}", "function load_cb(data_id) {\n m_app.enable_controls();\n m_app.enable_camera_controls();\n\n document.addEventListener( 'mousemove', onDocumentMouseMove, false );\n shot.addEventListener( 'click', shotting, false );\n\n LTCTRF = m_scs.get_object_by_name(\"LTCTRF\");\n LTCTRB = m_scs.get_object_by_name(\"LTCTRB\");\n MotoMain = m_scs.get_object_by_name(\"MotoMain\");\n\n}", "getMusic(e) {\n e.preventDefault();\n var artist = e.target.artist.value;\n //changes the button to loading while songs load\n $('#get-music-button').text('LOADING....');\n itunesService.getMusicByArtist(artist).then(results => {\n drawSongs(results)\n //changes button back to GET MUSIC once songs are loaded\n $('#get-music-button').text('GET MUSIC');\n })\n }", "getMusic(e) {\n e.preventDefault();\n var artist = e.target.artist.value;\n //changes the button to loading while songs load\n $('#get-music-button').text('LOADING....');\n itunesService.getMusicByArtist(artist).then(results => {\n drawSongs(results)\n //changes button back to GET MUSIC once songs are loaded\n $('#get-music-button').text('GET MUSIC');\n })\n }", "function initUI() { \n var lesson = g_lessons[0];\n var lesson_code = lesson.lesson_code;\n $('#lesson_title').html(lesson.title);\n $('#lesson_code').html(lesson_code);\n $('#task_chooser').selectbox();\n updateTaskDescription(0); \n \n var utc_offset_minutes = (new Date()).getTimezoneOffset();\n\tvar html = '';\n html += '<button class=\"cssbtn\" id=\"edit_lesson_btn_'+lesson_code+'\" onclick=\"goToLessonForm(\\''+lesson_code+'\\');\">Edit activity<span class=\"edit\"></span></button><br/>';\n\thtml += '<button class=\"cssbtn\" id=\"stop_lesson_btn_'+lesson_code+'\" style=\"display:none\" onclick=\"stopLesson(\\''+lesson_code+'\\')\">Stop activity<span class=\"stop\"></span></button>';\n\thtml += '<button class=\"cssbtn\" id=\"start_lesson_btn_'+lesson_code+'\" style=\"display:none\" onclick=\"startLesson(\\''+lesson_code+'\\')\">Start activity<span class=\"start\"></span></button>';\n\thtml += '<br/>';\n\thtml += '<button class=\"cssbtn\" id=\"clone_lesson_btn_'+lesson_code+'\" onclick=\"cloneLesson(\\''+lesson_code+'\\', false)\">Clone activity</button><br/>';\n html += '<button class=\"cssbtn\" id=\"download_data_btn_'+lesson_code+'\" onclick=\"window.location=\\'/data_dump?lesson_code='+lesson_code+'&utc_offset_minutes=' + utc_offset_minutes + '\\'; return false;\">Download data<span class=\"dl\"></span></button><br/>' \n html += '<button class=\"cssbtn\" id=\"clear_lesson_btn_'+lesson_code+'\" onclick=\"clearLesson(\\''+lesson_code+'\\', false)\">Clear data<span class=\"clr\"></span></button><br/>';\n html += '<button class=\"cssbtn\" id=\"delete_lesson_btn_'+lesson_code+'\" onclick=\"deleteLesson(\\''+lesson_code+'\\')\">Delete activity<span class=\"del\"></span></button>';\n $('#side_button_bar2').html(html);\n}", "load() {\n\n }", "function data_wdLoad(e) { /* carrega HTML: data-wd-load=path{file}method{get|post}${form}overlap{} */\r\n\t\tif (!(\"wdLoad\" in e.dataset)) return;\r\n\r\n\t\t/* obter dados do atributo */\r\n\t\tlet data = wd_html_dataset_value(e, \"wdLoad\")[0];\r\n\t\tlet target = WD(e);\r\n\t\tlet method = data.method;\r\n\t\tlet file = data.path;\r\n\t\tlet pack = wd_$$$(data);\r\n\t\tlet exec = WD(pack);\r\n\t\tlet overlap = data.overlap === \"true\" ? true : false;\r\n\r\n\t\t/* abrir contagem */\r\n\t\twd_counter_control.load++;\r\n\t\t/* limpar atributo para evitar repetições desnecessárias e limpar conteúdo */\r\n\t\ttarget.data({wdLoad: null}).load(\"\");\r\n\t\t/* carregar arquivo e executar */\r\n\t\texec.send(file, function(x) {\r\n\t\t\tif (x.closed) {\r\n\t\t\t\t/* encerrar contagem */\r\n\t\t\t\twd_counter_control.load--;\r\n\t\t\t\t/* executar */\r\n\t\t\t\ttarget.load(x.text, overlap);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}, method);\r\n\t\treturn;\r\n\t}", "function processButton(param) {\n\n if (param.object == \"lyrMenu\") {\n switch (param.element) {\n case \"저장\":\n if(v_global.logic.pstat == \"대여\")\n processRetrieve({ chk: true });\n else\n processSave({});\n break;\n case \"닫기\":\n processClose();\n break;\n }\n }\n\n}", "function onMusicLoaded() {\n $btnPlay.removeClass('hidden');\n $loader.addClass('hidden');\n\n $btnPlay.on('click', function(e) {\n e.preventDefault();\n console.log('play');\n togglePlay();\n $btnPlay.addClass('hidden');\n });\n\n initPixiContainer();\n}", "function loadingBtn(element,iconClass=\"fa fa-spinner fa-spin mr-1\",btnText=\"Procesando\"){\n element.valor = $(element).html();\n $(element).html(`<i class='${iconClass}'></i> ${btnText}`);\n $(element).prop(\"disabled\",true);\n $(element).addClass('btn-procesando');\n}", "_loading() {\n }", "function waitLoad(){\n while (createButton === false){\n console.log(\"Waiting for load.\")\n }\n if (createButton != undefined){\n console.log(\"Yo, that shit button is loaded.\");\n window.onload(console.log(\"Page Fully Loaded\"));\n }\n}", "function clickDemarrer() {\n\tif (loading) {\n\t\treturn;\n\t}\n\tdocument.getElementById(\"btnDemarrer\").display = \"none\"; \n\tlancerChapitre(1);\n}", "function loading() {\n\tloader.hidden = false;\n\tmain.hidden = true;\n}", "function initializeButtons () {\n $('#show_choose_sheet_button').click(showChooseSheetDialog);\n }", "function initializeButtons () {\n $('#show_choose_sheet_button').click(showChooseSheetDialog);\n }", "initiate() {\n this.#buildStartGameButton();\n this.#buildhowToPlayButton();\n this.#buildAboutButton();\n this.#startHeaderAnimation();\n }", "function loadIdProvidersButtonsContent(){\n\tloadContent(SERVICES.getIdProvidersButtonsData, {}, TEMPLATES.idProvidersButtons, $content, loadIdProvidersButtonsContentCallback);\n}", "function onClick() {return thisObj.load(this.href);}", "function onClick() {return thisObj.load(this.href);}", "function loadCallControls() {\n $(\"#callControls\").load(\"call-controls.html\", loadVideoCallStatistics);\n}", "function processButton(param) {\n switch (param.element) {\n case \"조회\":\n processRetrieve({});\n break;\n case \"닫기\":\n processClose({});\n break;\n case \"실행\":\n processRetrieve({});\n break;\n }\n }" ]
[ "0.7654803", "0.70536375", "0.6884704", "0.6774222", "0.67694557", "0.67213917", "0.66893005", "0.66649187", "0.66617477", "0.66394806", "0.66117877", "0.6543771", "0.6483038", "0.6476322", "0.6473654", "0.6468095", "0.6465105", "0.64308304", "0.64095616", "0.639694", "0.63846916", "0.6368117", "0.6310442", "0.6299787", "0.6298577", "0.6283126", "0.6268793", "0.62463117", "0.6203425", "0.6195387", "0.6195184", "0.6172888", "0.6171345", "0.6148297", "0.6124331", "0.61217785", "0.611408", "0.6089777", "0.6084312", "0.60698396", "0.60673535", "0.6066206", "0.6059227", "0.6046769", "0.60363287", "0.60336643", "0.60259247", "0.6020666", "0.6013775", "0.60127205", "0.6009977", "0.60080206", "0.6007802", "0.6004268", "0.6001265", "0.59997267", "0.598879", "0.5987189", "0.5984815", "0.5975942", "0.59752405", "0.5959553", "0.5953359", "0.59440315", "0.59357846", "0.59341204", "0.5925067", "0.5918875", "0.591529", "0.59116375", "0.59089196", "0.5908662", "0.5900228", "0.5893263", "0.58924806", "0.58879095", "0.5879796", "0.58725053", "0.58719206", "0.58706164", "0.58681667", "0.58646935", "0.58646935", "0.58641845", "0.58634955", "0.5855402", "0.58514225", "0.5846603", "0.5846025", "0.58460027", "0.58444875", "0.5843226", "0.5842652", "0.5839098", "0.5839098", "0.58359766", "0.5831058", "0.58287805", "0.58287805", "0.5820409", "0.5808589" ]
0.0
-1
load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide ////////////////////////////////////////////////////////////load slide
function load_element_slide() { console.log("recup Element") const waitingWrapper = document.querySelector("#waiting-wrapper") const questionAndRepWrapper = document.querySelector("#questionAndRepSlide-wrapper") const pPreviewRep1 = document.querySelector("#previewRep1 p") const previewRep1 = document.querySelector("#previewRep1") const pPreviewRep2 = document.querySelector("#previewRep2 p") const previewRep2 = document.querySelector("#previewRep2") console.log("inside timeout"); waitingWrapper.style = "opacity : 0" setTimeout(function(){ waitingWrapper.style = "display : none" }, 300); questionAndRepWrapper.style = "display : flex;" let swipedir, startY, distY; questionAndRepWrapper.addEventListener(touchStart, (e) => { if (!mov && !wait) { swipedir = 'none' distY = 0 startY = e.changedTouches[0].pageY e.preventDefault() } }) questionAndRepWrapper.addEventListener(touchMove, (e) => { if (!mov && !wait) { distY = e.changedTouches[0].pageY - startY swipedir = (distY < 0) ? 'up' : 'down' appearRep(swipedir, distY) e.preventDefault() } }) questionAndRepWrapper.addEventListener(touchEnd, (e) => { if (!mov && !wait) { distY = e.changedTouches[0].pageY - startY swipedir = (distY < 0) ? 'up' : 'down' appearRep(0, 0); if (Math.abs(distY) >= 50) { swipe(swipedir) } } }) function swipe(dir) { mov = true previewRep2.style = `opacity : 0;` previewRep1.style = `opacity : 0;` window.addEventListener('beforeunload', stoprefresh) if (dir === "up") { questionAndRepWrapper.style = "display : flex;top:-200vh" postMood(2, idResponseN) } else { questionAndRepWrapper.style = "display : flex;top:0" postMood(1, idResponseP) } } function appearRep(dir, distY) { if (distY > 100) { distY = 100; } if (distY < -100) { distY = -100; } if (dir === "down") { previewRep1.style = `top:${-100 + distY}px` pPreviewRep1.style = `opacity : 1;` previewRep2.style = `bottom:-100px` pPreviewRep2.style = `opacity : 0;` } else if (dir === "up") { previewRep2.style = `bottom:${-100 - distY}px` pPreviewRep2.style = `opacity : 1;` previewRep1.style = `top:-100px` pPreviewRep1.style = `opacity : 0;` } else { previewRep1.style = `top:-100px` pPreviewRep1.style = `opacity : 0;` previewRep2.style = `bottom:-100px` pPreviewRep2.style = `opacity : 0;` } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadSlide(){\r\n\r\n\t\t\tif(_loading == 0)\r\n\t\t\t\tcheckWidthI = setInterval(checkWidth, 100);\r\n\r\n\t\t\tvar $slide = $slides.eq(_loading);\r\n\r\n\t\t\tif($slide.hasClass('zetaTextBox')){\r\n\r\n\t\t\t\tcontinueLoading($slide);\r\n\r\n\t\t\t}else if($slide.hasClass('zetaVideoBox')){\r\n\r\n\t\t\t\tvar iframe = $slide.data('type') == 'vimeo' ? '<iframe src=\"http://player.vimeo.com/video/'+ $slide.data('id') +'\" width=\"100%\" height=\"100%\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>' : '<iframe width=\"100%\" height=\"100%\" src=\"http://www.youtube.com/embed/'+ $slide.data('id') +'\" frameborder=\"0\" allowfullscreen></iframe>';\r\n\t\t\t\t$slide.append(iframe);\r\n\t\t\t\tcontinueLoading($slide);\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\tvar $img = $slide.find('img');\r\n\t\t\t\tif($img[0] != undefined){\r\n\t\t\t\t\tif($img[0].complete || $img[0].readyState == 4){\r\n\t\t\t\t\t\tcontinueLoading($slide);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t$img.load(function(){\r\n\t\t\t\t\t\t\tcontinueLoading($slide);\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n $msie = /msie/.test(navigator.userAgent.toLowerCase());\r\n\t\tif($msie){\r\n// \t\tif($.browser.msie){\r\n\t\t\t\t\t\t$img.attr('src', $img.data('src'));\r\n }\r\n\t\t\t\t}else{\r\n\t\t\t\t\tcontinueLoading($slide);\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t}", "function switchSlide () {\n grabNextSlide();\n loadSlide();\n }", "function _openSlide(el) {\n\t\t settings.start();\n\t\t\t$(\"#pageslide-slide-wrap\").animate({width: settings.width}, settings.duration);\n\t\t $(\"#pageslide-body-wrap\").animate({left: \"-\" + settings.width}, settings.duration, function() {\n\t\t settings.stop();\n\t\t });\n\t\t $.ajax({\n\t\t type: \"GET\",\n\t\t url: $(el).attr(\"href\"),\n\t\t success: function(data) {\n\t\t $(\"#pageslide-content\").html(data)\n\t\t .queue( function() {\n\t\t settings.loaded();\n\t\t $(this).dequeue();\n\t\t });\n\t\t }\n\t\t });\n\t\t}", "function loadSlides(href){\r\nconsole.log(href);\r\n\t\t\tif(emptyOffset<0) emptyOffset = $holder.offset().top;\r\n\t\t\tif(topOpen) emptyOffset = $slider.offset().top;\r\n\t\t\t$('html,body').animate({scrollTop:emptyOffset}, emptySpeed, 'easeInQuad')\r\n\t\t\tif(emptySpeed>800) emptySpeed = 600;\r\n\r\n\t\t\t$.ajax(href).done(function(data){\r\nconsole.log(data);\r\n\t\t\t\thtml = $(data).find('.content').children('div');\r\n\t\t\t\t$empty.append(html);\r\nconsole.log(html);\r\nconsole.log($empty);\r\n $msie = /msie/.test(navigator.userAgent.toLowerCase());\r\n\t\tif($msie){\r\n// \t\tif($.browser.msie){\r\n\t\t\t\t\t$empty.find('img').each(function(){\r\n\t\t\t\t\t\t$(this).data('src', $(this).attr('src'));\r\n\t\t\t\t\t\t$(this).attr('src', '');\r\n\t\t\t\t\t});\r\n }\r\n\t\t\t\t$slides = $empty.children('div');\r\n\r\n\t\t\t\t_loading = _index = 0;\r\n\t\t\t\tsliderW = sliderL = 1;\r\n\t\t\t\tloadSlideI = setTimeout(loadSlide, 700);\r\n\r\n\t\t\t});\r\n\t\t}", "function loadSlide() {\n\n image.onload = function() {\n\n bufferCtx.canvas.width = ctx.canvas.width;\n bufferCtx.canvas.height = ctx.canvas.height;\n bufferCtx.drawImage(image, 0, 0, slideshow.width, slideshow.height);\n drawCaption(bufferCtx);\n ctx.drawImage(bufferCanvas, 0, 0, slideshow.width, slideshow.height);\n }\n\n image.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n }", "loadImage() {\n this.imagesLoaded++;\n if (this.imagesLoaded >= this.slides.length) { this.playSlideshow() }\n }", "loadImage() {\n this.imagesLoaded++;\n if (this.imagesLoaded >= this.slides.length) {\n this.playSlideshow();\n }\n }", "function slideit() {\n x = document.getElementsByTagName(\"img\").item(0);\n v = x.getAttribute(\"src\");\n\n if(!document.images)\n return;\n\n v = slideImages[step].src;\n\n // gets the current image object from html file\n document.getElementById('slide').src = slideImages[step].src;\n\n whichimage = step;\n\n if (step<2) {\n step++;\n }\n else {\n step = 0;\n }\n\n // sets the slideit functions current image object in html file\n x.setAttribute(\"src\", v);\n\n // timing delay for 2.5 seconds before transition to new image\n setTimeout(\"slideit()\",2500);\n }", "function loadIframes(slideEl) {\n if (slideEl.querySelector('iframe') && !slideEl.querySelector('iframe').classList.contains('loaded')) {\n slideEl.querySelector('iframe').src = slideEl.querySelector('iframe').getAttribute('data-src')\n slideEl.querySelector('iframe').classList.add('loaded')\n }\n}", "function loadIframes(slideEl) {\n if (slideEl.querySelector('iframe') && !slideEl.querySelector('iframe').classList.contains('loaded')) {\n slideEl.querySelector('iframe').src = slideEl.querySelector('iframe').getAttribute('data-src')\n slideEl.querySelector('iframe').classList.add('loaded')\n }\n}", "function slidesChange(slideNum) {\n clearIntervals(); clearDomTween();\n app.stage.removeChildren(); left.innerHTML = \"\";\n\n const sceneLoad = slides[slideNum];\n for (let i = 1; i <= slideNum; i++) {\n const pos = `./assets/${i}/${i}.json`;\n if (!loader.resources[pos] && i != slideNum) loader.add(pos);\n else if (!loader.resources[pos] && i == slideNum) loader.add(pos).load(sceneLoad);\n else if (loader.resources[pos] && i == slideNum) sceneLoad();\n };\n}", "function slideView(shortName, slide_num) { // direction is next or prev\n contentDiv = $('#ajax_wrapper'); // slide_wrapper\n var theURL = \"/connections/slideshow/slide/\" + shortName + \"/\" + slide_num + \"/\";\n getURL(theURL, contentDiv);\n}", "function load_img(slide) {\n if ($(slide).find('img').length === 0) {\n //console.log('loading img into next figure');\n $(slide).prepend('<img alt=\"\" src=\"' + $(slide).attr('data-load-on-demand') + '\">');\n }\n }", "function loadNextSlide(value) {\r\n\t\t\tslidePointer = slidePointer + parseInt(value);\r\n\r\n\t\t\tif (slidePointer < minSlides) {\r\n\t\t\t\tslidePointer++;\r\n\t\t\t} else if (slidePointer > maxSlides) {\r\n\t\t\t\tslidePointer--;\r\n\t\t\t} else {\r\n\t\t\t\tslide = data.slides[slidePointer - 1].location;\r\n\t\t\t\t$(\".listContainer\").load(slide).appendTo($(\".listContainer\"))\r\n\t\t\t\t\t\t.hide().fadeIn(750);\r\n\t\t\t}\r\n\t\t}", "function loadSmallSlider() {\n\tpmmViewer.firstSlider.stopAuto();\n\tpmmViewer.firstSlider.reloadSlider({\n\t \tautoControls: false, \n auto: false, \n slideWidth: 0, \n minSlides: 1, \n maxSlides: 1, \n moveSlides: 0, \n slideMargin: 0 \n\t});\n}", "function loadWbSlider()\n {\n logDebug(\"loadSlider\") ;\n return partial(initWbSlider) ;\n }", "initSlideshow() {\n this.imagesLoaded = 0;\n this.currentIndex = 0;\n this.setNextSlide();\n this.slides.each((idx, slide) => {\n $('<img>').on('load', $.proxy(this.loadImage, this)).attr('src', $(slide).attr('src'));\n });\n }", "function loadNewSlides(swiperObj, dir) {\n \t/* Probably you should do some Ajax Request here But we will just use setTimeout */\n \tif (typeof prevSlideNumber === \"undefined\" || prevSlideNumber === null) { \n \t\tprevSlideNumber = 0;\n \t}\n\n \tif (typeof slideNumber === \"undefined\" || slideNumber === null) { \n \t\tslideNumber = 1;\n \t}\n\n \t$('.swiper-preloader:not(.end-loading)').addClass('visible');\n\n \tif(!$('.swiper-preloader').hasClass('end-loading') && slideNumber != prevSlideNumber){\n \t\tprevSlideNumber = slideNumber;\n \t\tsetTimeout(function() {\n \t\t\t$.ajax({\n \t\t\t\turl: 'ajax-porfolio-parts/ajax-portfolio-part-'+dir+'-'+slideNumber+'.html',\n \t\t\t\ttype: 'GET'\n \t\t\t})\n \t\t\t.done(function(html) {\n \t\t\t\tif(dir === 'vertical'){\n \t\t\t\t\tswiperObj.appendSlide(html, 'swiper-slide section-fw animated fadeInUp', 'article');\n \t\t\t\t}else if(dir === 'horizontal'){\n \t\t\t\t\tswiperObj.appendSlide(html, 'swiper-slide animated fadeInRight', 'article');\n \t\t\t\t\tvar newswiperpos = swiperObj.positions.start - $('.swiper-slide').width();\n \t\t\t\t\tswiperObj.setWrapperTranslate(newswiperpos,0,0);\n \t\t\t\t}\n\n\t\t\t// Hide loader\n\t\t\t$('.swiper-preloader').removeClass('visible');\n\t\t\tslideNumber++;\n\t\t})\n \t\t\t.fail(function() {\n \t\t\t\t$('.swiper-preloader').html('That\\'s all folks!');\n \t\t\t\t$('.swiper-preloader').addClass('end-loading');\n \t\t\t\tsetTimeout(function() {\n \t\t\t\t\t$('.swiper-preloader').removeClass('visible');\n\t\t\t}, 800); // <-- should be here instead\n \t\t\t})\n \t\t\t.always(function() {\n\t\t\t//console.log(\"complete\");\n\t\t});\n\t\t}, 500); // <-- should be here instead\n \t}\n }", "function slideSlide() {\n grabNextSlide();\n nextImage.src = slides[currentSlide].image;\n caption = slides[currentSlide].caption;\n sequence.innerHTML = (currentSlide + 1) + \" / \" + slides.length;\n\n bufferCtx.canvas.width = slideshow.width;\n bufferCtx.canvas.height = slideshow.height;\n\n x = -bufferCtx.canvas.width;\n draw();\n transition();\n\n }", "initSlideshow() {\n this.imagesLoaded = 0;\n this.currentIndex = 0;\n this.setNextSlide();\n this.slides.each((idx, slide) => {\n $(\"<img>\")\n .on(\"load\", $.proxy(this.loadImage, this))\n .attr(\"src\", $(slide).attr(\"src\"));\n });\n }", "function startPresentation()\r\n{\r\n\tvar delay = 200;\t\t\t\t\t\t\t\t//The delay, in MS, before buffering the next slide\r\n\tvar index = 0;\t\t\t\t\t\t\t\t\t//Tracks the position of the next slide in the slide deck\r\n\r\n\t//Show elements\r\n\t$(\"#transitionDiv\").show();\r\n\t$(\"#currentSlideHeading\").show();\r\n\t$(\"#nextSlideHeading\").show();\r\n\t\r\n\t//Disable the loadSlide button\r\n\t$(\"#loadSlide\").css(\"color\", \"white\");\r\n\t$(\"#loadSlide\").attr(\"disabled\", true);\r\n\t$(\"#loadSlide\").val(\"Loading...\");\r\n\t\r\n\t//Disable the slide deck\r\n\tvalidateSlideDeck(\"disable\");\r\n\t\r\n\t//Send the Transmission Type\r\n\tsendTransition(\"instant\");\r\n\t\r\n\t//Assign the currentSlideImage to the endPage and send/swap\r\n\tnextSlideName = startPage;\r\n\tnextSlideType = \"png\";\r\n\tcurrentSlideName = nextSlideName;\r\n\tcurrentSlideType = nextSlideType;\r\n\tdisplayImagePreview(\"current\", imageFilePath, currentSlideName);\r\n\t\r\n\t//Assign the first element of the slide deck to 'next' variables\r\n\t$('#order').children('input').each(function() \r\n\t{\r\n\t\tindex++;\r\n\t\tif (index == 1)\t\t\t//First element in the document\r\n\t\t{\r\n\t\t\tnextSlideName = this.id;\r\n\t\t\tnextSlideType = this.id.substr(this.id.lastIndexOf('.') + 1);\t\r\n\t\t\t$(this).addClass(\"btn-primary-hovered\");\r\n\t\t}\r\n\t});\r\n\t\r\n\t//Display the slide's filename next to the Next Slide heading\r\n\t$(\"#nextSlideHeading\").html(\"Next Slide: \" + nextSlideName.substr(nextSlideName.lastIndexOf('/') + 1));\r\n\t\r\n\t//Set the Next Slide to a loading screen\r\n\tdisplayImagePreview(\"next\", imageFilePath, loadingName);\r\n\t\r\n\t//Validate the next slide type and display it\r\n\tif (validateFiletype(videoFiletypes, nextSlideType))\r\n\t{\r\n\t\tcheckFileExists(mediaFilePath, nextSlideName, \"video\", delay, displayNextSlide)\r\n\t}\r\n\telse if (validateFiletype(imageFiletypes, nextSlideType))\r\n\t{\r\n\t\tcheckFileExists(mediaFilePath, nextSlideName, \"image\", delay, displayNextSlide)\r\n\t}\r\n\telse\r\n\t{\r\n\t\tdisplayErrorPage(\"invalidFileType\");\r\n\t}\r\n}", "function changeSlide() {\n\n mainSlide.setAttribute(\"src\", slideArray[slideIndex]['url']);\n slideIndex++;\n if (slideIndex >= slideArray.length) {\n slideIndex = 0;\n }\n }", "function SlideView($) {\n \"use strict\";\n this.renderSlide = function (url) {\n var self = this,\n request = new XMLHttpRequest();\n\n request.open('GET', url, true);\n request.onload = function() {\n if (request.status >= 200 && request.status < 400){\n self.jqQuiz.html(request.responseText);\n self.jqQuiz.removeClass('busy');\n } else {\n throw \"tutorweb::error::\" + request.status + \" whilst requesting \" + url;\n }\n };\n request.onerror = function(event) {\n throw \"tutorweb::error::Could not fetch \" + url;\n };\n request.send();\n };\n\n this.renderSlides = function (jqSlides) {\n var self = this;\n\n self.jqQuiz.find('.slide-collection').replaceWith(jqSlides);\n self.jqQuiz.removeClass('busy');\n self.jqQuiz.find('.slide-content figure').click(function (e) {\n $(this).toggleClass('show-code');\n });\n };\n\n this.selectSlide = function (slideId) {\n var self = this, jqPrevId, jqNextId,\n jqPrevButton = self.jqQuiz.find('#tw-slide-prev'),\n jqNextButton = self.jqQuiz.find('#tw-slide-next'),\n jqCollection = self.jqQuiz.find('.slide-collection').children();\n\n jqCollection.map(function (i, sl) {\n var jqNext, jqPrev, jqSl = $(sl);\n if ((slideId === \"\" && i === 0) || (slideId === jqSl.attr('id'))) {\n jqSl.addClass('selected');\n slideId = jqSl.attr('id');\n $(\"#tw-slide-title\").text(jqSl.find('h2').text());\n\n jqPrevId = jqSl.prev().attr('id');\n jqPrevButton.attr('href', '#' + (jqPrevId || slideId));\n jqPrevButton.toggleClass('disabled', typeof jqPrevId == 'undefined');\n\n jqNextId = jqSl.next().attr('id');\n jqNextButton.attr('href', '#' + (jqNextId || slideId));\n jqNextButton.toggleClass('disabled', typeof jqNextId == 'undefined');\n } else {\n jqSl.removeClass('selected');\n }\n });\n };\n}", "function loadFurtherCarouselSlides(){\n\t$(\".carousel .item\").each(function(n) {\n\t\tif(!$(this).hasClass(\"loadfast\")){\n\t\t\timgURL = $(this).attr(\"data-image\");\n\t\t\tif(cloudinaryAccount){\n\t\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\n\t\t\t\tpreload(cloudinaryURL);\n\t\t\t}\n\t\t}\n\t});\t\n}", "function setup_slideshow() {\n slide_count = img_array.length;\n current_slide_index = 0;\n set_current_slide(img_array[0].src);\n play();\n}", "function showSlides() {\n slideIndex++;\n showSlidesByClick(slideIndex);\n}", "function continueLoading($slide){\r\n\r\n\t\t\tsliderL = $slide.outerWidth()+o.slideMargin+gPadding;\r\n\t\t\t$slide.fadeIn();\r\n\r\n\t\t\tif(++_loading < $slides.length)\r\n\t\t\t\tloadSlideI = setTimeout(loadSlide, 300);\r\n\t\t\telse\r\n\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\tclearInterval(checkWidthI);\r\n\t\t\t\t}, 1000)\r\n\r\n\t\t\t$slide.find('img').bind('dragstart', function(event){\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\r\n\t\t\t/*$slide.find('a').bind('click', function(event) {\r\n\t\t\t\tevent.preventDefault();\r\n\t\t\t\treturn false;\r\n\t\t\t});*/\r\n\r\n\t\t}", "function startAutoslide() {\n if (!$run.autoslideId) {\n $run.autoslideId = window.setInterval(slideForward, $conf.autoslide);\n }\n }", "function slideit() {\n //------Função, sem variáveis, para executar slide show; \n //Atribui ao atributo src do elemento img o valor que estiver \n //aqui \"_imagens/pub_image\" + step + \".jpg\";\n document.getElementById('pub_image').src = \"_imagens/pub_image\" + step_slideit + \".jpg\";\n //Se o valor da variável step for menor que o número limite de imagens (6) \n //então soma mais um ao número;\n if (step_slideit < 6)\n step_slideit++;\n //Caso seja igual iguala o valor da variável step a 1, para começar de novo;\n else\n step_slideit = 1;\n //Temporizador para executar a função slideit(), auto se executa a \n //cada 2,5 segundos;\n setTimeout(\"slideit()\", 2500);\n}", "function loadControls(id) {\n $(\"#main\").hide();\n showid = id;\n controls_loaded = true;\n $(\"#main\").load(\"/presentor/control/\" + id, function(){\n slideButtons();\n });\n $(\".menuitem.control\").show();\n}", "function showAddSlide() {\n\t\t// Create our promise to fetch the template\n\t\tvar promise = $.ajax({\n\t\t\turl: mobile_kiosk.template_url + '/fq/admin/mobile-kiosk/show-add-slide',\n\t\t\tmethod: 'GET'\n\t\t});\n\t\tpromise.done(function(html) {\n\t\t\t// Add the html template to the page\n\t\t\t$('#add_slide_wrapper').html(html);\n\t\t\t\n\t\t\t// Initialize this UI\n\t\t\taddSlideInit();\n\t\t});\n\t}", "function loadPreviousSlide() {\n indexOfCurrentSlide -= 2;\n\n if (indexOfCurrentSlide <= 0) {\n indexOfCurrentSlide = maxNumberOfSlides;\n }\n\n resetTimer();\n }", "function onCurrentSlideImageLoadEnd(){\n\t\t\n\t\tif(t.isPlayMode() == true)\n\t\t\tt.continuePlaying();\n\t}", "function nextSlide() {\n \n}", "function initSlides() {\n console.log(\"Calling initSlides()\");\n //$scope.slides = pathologyService.getSlideList();\n pathologyService.getSlideList()\n .then(function(slides) {\n $scope.slides = slides;\n }).catch(function(error) {\n console.error(\"Error returned from slides promise: \" + error);\n });\n if ($scope.slides == \"not ready\") {\n console.log(\"Slide list not ready, will try again in 1 second.\")\n setTimeout(initSlides, 1000);\n }\n }", "function load(){\r\n\r\n}", "function reload(slideDeck, slideNum) {\r\n try{\r\n // Let the player know we are entering reload process\r\n isReload = true;\r\n\r\n // Set present slide number to the requested slide number\r\n presentSlideNumber = slideNum;\r\n\r\n slidedeck = slideDeck;//update the global slidedeck with updated one given by editor\r\n\r\n // Hide sections screen in case it was opened\r\n hideSectionsFrame();\r\n\r\n // Clear the slider marks since slide deck size could be changed\r\n clearSliderMarks();\r\n\r\n // Reload #scene and it's related assets\r\n EM.scenemanager.reload( slidedeck );\r\n\r\n // Disalbe auto play in player from editor in case of autoplay active\r\n if ( isAutoplay ){\r\n play();\r\n }\r\n\r\n } catch(e){\r\n console.log(e.message)\r\n $.post(\"/present/logError\", { source: \"player.js/relaod\", message: e.message });\r\n }\r\n\r\n }", "function nextSlide(){\n\tslideIndex++;\n\t\n\tif(userPath[userPath.length-3] == 3){\n\n\t\tif (slideIndex >= photos.length){\n\t\t\tslideIndex = 0;\n\t\t}\n\t\t\n\t\tvar file = photos[slideIndex];\n\t\tvar url = photos[slideIndex].url;\n\t\t\n\t} else if (userPath[userPath.length-3] == 6){\n\n\t\tif (slideIndex >= countryPhotos.length){\n\t\t\tslideIndex = 0;\n\t\t}\n\t\t\n\t\tvar file = countryPhotos[slideIndex];\n\t\tvar url = countryPhotos[slideIndex];\n\t}\n\t\n\tif(document.getElementById(\"fullscreenPhoto\")!== null){\n\t\tdocument.getElementById(\"fullscreenPhoto\").src = url;\n\t}else{\n\t\tconsole.log(\"stop that fukin taaaim\");\n\t\twindow.clearTimeout(timer);\n\t}\n}", "function showSlide() {\n slides[currentSlide].className = \"fds-slide\";\n currentSlide = (currentSlide + 1) % slides.length;\n slides[currentSlide].className = \"fds-slide is-visible\";\n updateNav();\n}", "function startslides() {\n\tif(imgSearch) {\n\t\timgSearch.startSlides();\n\t}\n}", "function swapSlide(container,opt) {\n\t\t\ttry{\n\t\t\t\tvar actli = container.find('>ul:first-child >li:eq('+opt.act+')');\n\t\t\t} catch(e) {\n\t\t\t\tvar actli=container.find('>ul:first-child >li:eq(1)');\n\t\t\t}\n\t\t\topt.lastslide=opt.act;\n\t\t\tvar nextli = container.find('>ul:first-child >li:eq('+opt.next+')');\n\n\t\t\tvar defimg= nextli.find('.defaultimg');\n\n\t\t\tif (defimg.data('lazyload') !=undefined && defimg.data('lazyload') !=\"undefined\" && defimg.data('lazydone') !=1 ) {\n\n\t\t\t\tdefimg.css({backgroundImage:'url(\"'+nextli.find('.defaultimg').data('lazyload')+'\")'});\n\t\t\t\tdefimg.data('src',nextli.find('.defaultimg').data('lazyload'));\n\t\t\t\tdefimg.data('lazydone',1);\n\t\t\t\tdefimg.data('orgw',0);\n\t\t\t\tnextli.data('loadeddone',1);\n\t\t\t\tcontainer.find('.tp-loader').css({'display':'block'}).transition({opacity:1,duration:300});\n\t\t\t\tvar limg = new Image();\n\t\t\t\tlimg.onload = function() {\n\t\t\t\t\t\tsetTimeout(function() { killBannerTimer(opt,container)},180);\n\n\t\t\t\t\t\t\tnextli.waitForImages(function() {\n\n\t\t\t\t\t\t\t\t\tdefimg.data('lazydone',1);\n\t\t\t\t\t\t\t\t\tnextli.data('owidth',limg.width);\n\t\t\t\t\t\t\t\t\tnextli.data('oheight',limg.height);\n\t\t\t\t\t\t\t\t\tnextli.find('.slotholder').data('owidth',limg.width);\n\t\t\t\t\t\t\t\t\tnextli.find('.slotholder').data('oheight',limg.height);\n\n\n\t\t\t\t\t\t\t\t\tsetTimeout(function() {restartBannerTimer(opt,container)},190);\n\n\t\t\t\t\t\t\t\t\tsetSize(defimg,opt);\n\t\t\t\t\t\t\t\t\tsetBulPos(container,opt);\n\n\t\t\t\t\t\t\t\t\tsetSize(defimg,opt);\n\t\t\t\t\t\t\t\t\tswapSlideProgress(container,opt);\n\t\t\t\t\t\t\t\t\tcontainer.find('.tp-loader').transition({opacity:0,duration:300});\n\n\t\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\t\tcontainer.find('.tp-loader').css({'display':'none'});\n\n\t\t\t\t\t\t\t\t\t},2200)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\tlimg.src=nextli.find('.defaultimg').data('lazyload');\n\n\t\t\t} else {\n\t\t\t\tif (nextli.data('loadeddone')==undefined) {\n\t\t\t\t\t\tvar limg = new Image();\n\t\t\t\t\t\tlimg.onload = function() {\n\t\t\t\t\t\t\t\t\tnextli.data('loadeddone',1);\n\t\t\t\t\t\t\t\t\tnextli.data('owidth',limg.width);\n\t\t\t\t\t\t\t\t\tnextli.data('oheight',limg.height);\n\t\t\t\t\t\t\t\t\tnextli.find('.slotholder').data('owidth',limg.width);\n\t\t\t\t\t\t\t\t\tnextli.find('.slotholder').data('oheight',limg.height);\n\n\n\n\t\t\t\t\t\t\t\t\tnextli.waitForImages(function() {\n\n\t\t\t\t\t\t\t\t\t\t\tsetSize(defimg,opt);\n\t\t\t\t\t\t\t\t\t\t\tsetBulPos(container,opt);\n\t\t\t\t\t\t\t\t\t\t\tsetSize(defimg,opt);\n\t\t\t\t\t\t\t\t\t\t\tswapSlideProgress(container,opt);\n\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tlimg.src=nextli.find('.defaultimg').data('src');\n\t\t\t\t} else {\n\t\t\t\t \tswapSlideProgress(container,opt);\n\t\t\t\t }\n\t\t\t}\n\t\t}", "function switch_slides () {\n // Animate to next slide by facing opacity of foreground from 100% to 0%\n foreground_element.animate({ opacity: 0 }, that.options.speed, function () {\n load_slide(foreground_element, that.options.slides[current_slide_id]);\n foreground_element.css('opacity', 1); // turn foreground on full opacity\n load_slide(background_element, that.options.slides[next_slide_id]); // load next slide into background\n });\n\n // Update slide_id's\n current_slide_id += 1; //next_slide_id - 1;\n if (current_slide_id >= slide_count) {\n current_slide_id = 0;\n }\n next_slide_id = current_slide_id + 1;\n if (next_slide_id >= slide_count) {\n next_slide_id = 0;\n }\n }", "function swapSlide(container,opt) {\n\t\t\ttry{\n\t\t\t\tvar actli = container.find('>ul:first-child >li:eq('+opt.act+')');\n\t\t\t} catch(e) {\n\t\t\t\tvar actli=container.find('>ul:first-child >li:eq(1)');\n\t\t\t}\n\t\t\topt.lastslide=opt.act;\n\t\t\tvar nextli = container.find('>ul:first-child >li:eq('+opt.next+')');\n\n\t\t\tvar defimg= nextli.find('.defaultimg');\n\n\t\t\tif (defimg.data('lazyload') !=undefined && defimg.data('lazyload') !=\"undefined\" && defimg.data('lazydone') !=1 ) {\n\n\t\t\t\tdefimg.css({backgroundImage:'url(\"'+nextli.find('.defaultimg').data('lazyload')+'\")'});\n\t\t\t\tdefimg.data('src',nextli.find('.defaultimg').data('lazyload'));\n\n\n\t\t\t\tdefimg.data('orgw',0);\n\t\t\t\tcontainer.find('.tp-loader').css({'display':'block'}).transition({opacity:1,duration:300});\n\t\t\t\tvar limg = new Image();\n\t\t\t\tlimg.onload = function() {\n\t\t\t\t\t\tsetTimeout(function() { killBannerTimer(opt,container)},180);\n\n\t\t\t\t\t\t\tnextli.waitForImages(function() {\n\n\t\t\t\t\t\t\t\t\tdefimg.data('lazydone',1);\n\t\t\t\t\t\t\t\t\tsetTimeout(function() {restartBannerTimer(opt,container)},190);\n\n\t\t\t\t\t\t\t\t\tsetSize(defimg,opt);\n\t\t\t\t\t\t\t\t\tsetBulPos(container,opt);\n\n\t\t\t\t\t\t\t\t\tsetSize(defimg,opt);\n\t\t\t\t\t\t\t\t\tswapSlideProgress(container,opt);\n\t\t\t\t\t\t\t\t\tcontainer.find('.tp-loader').transition({opacity:0,duration:300});\n\n\t\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\t\tcontainer.find('.tp-loader').css({'display':'none'});\n\n\t\t\t\t\t\t\t\t\t},2200)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\tlimg.src=nextli.find('.defaultimg').data('lazyload');\n\n\t\t\t} else {\n\t\t\t \tswapSlideProgress(container,opt);\n\t\t\t}\n\t\t}", "function showNewSlide(currentSlide){\n\t\t\t//localStorage.setItem('currentPage',JSON.stringify(currentSlide));\n\t\t\t\t//console.log('immediately to '+currentSlide);\n\t\t\t\tcurrentPage = currentSlide;\n\t\t\t$('.active').removeClass('active').addClass('hidder');\n\t\t\t\t//show page immediately\n\t\t\t$('#article'+(currentSlide))\n\t\t\t\t.attr('style','')\n\t\t\t\t.removeClass('hidder')\n\t\t\t\t.addClass('active'); \n\t\t\tif (pdContents.position().top>-200){\n\t\t\t\traisePull();\n\t\t\t}\n\t\t}", "function go(slide) {\n\t\t\tvar p = slideModel.get(slide);\n\t\t\tif(slide == current) {\n\t\t\t\treturn p;\n\t\t\t} else if(slide < 0) {\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfunction reject(num) {\n\t\t\t\tconsole.log(\"No such slide\", num);\n\t\t\t}\n\t\t\t\n\t\t\tif(!slides[slide]) {\n\t\t\t\t// container.className = slideContainerTransitioningState;\n\t\t\t\tp.then(\n\t\t\t\t\tfunction(result) {\n\t\t\t\t\t\taddSlide(slide, result.content);\n\t\t\t\t\t},\n\t\t\t\t\treject\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tp.then(\n\t\t\t\t\tfunction() {\n\t\t\t\t\t\ttransitionToSlide(slide);\n\t\t\t\t\t},\n\t\t\t\t\treject\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\treturn p;\n\t\t}", "function slide(){\n index = (index+1)%(bilder.length);\n imgTag.src = bilder[index];\n}", "function onload() {\r\n\tload();\r\n}", "function swapSlide(container,opt) {\n\t\t\ttry{\n\t\t\t\tvar actli = container.find('>ul:first-child >li:eq('+opt.act+')');\n\t\t\t} catch(e) {\n\t\t\t\tvar actli=container.find('>ul:first-child >li:eq(1)');\n\t\t\t}\n\t\t\topt.lastslide=opt.act;\n\t\t\tvar nextli = container.find('>ul:first-child >li:eq('+opt.next+')');\n\n\t\t\tvar defimg= nextli.find('.defaultimg');\n\n\n\t\t\topt.bannertimeronpause = true;\n\t\t\tcontainer.trigger('stoptimer');\n\t\t\topt.cd=0;\n\n\t\t\tif (defimg.data('lazyload') !=undefined && defimg.data('lazyload') !=\"undefined\" && defimg.data('lazydone') !=1 ) {\n\n\t\t\t\tif (!isIE(8))\n\t\t\t\t\tdefimg.css({backgroundImage:'url(\"'+nextli.find('.defaultimg').data('lazyload')+'\")'});\n\t\t\t\telse {\n\t\t\t\t\tdefimg.attr('src',nextli.find('.defaultimg').data('lazyload'));\n\t\t\t\t}\n\n\t\t\t\tdefimg.data('src',nextli.find('.defaultimg').data('lazyload'));\n\t\t\t\tdefimg.data('lazydone',1);\n\t\t\t\tdefimg.data('orgw',0);\n\t\t\t\tnextli.data('loadeddone',1);\n\n\t\t\t\tTweenLite.set(container.find('.tp-loader'),{display:\"block\",opacity:0});\n\t\t\t\tTweenLite.to(container.find('.tp-loader'),0.3,{autoAlpha:1});\n\n\t\t\t\twaitForLoads(nextli,function() {\n\t\t\t\t\t\t swapSlideCall(opt,defimg,container)\n\t\t\t\t},opt);\n\n\t\t\t} else {\n\n\t\t\t\tif (nextli.data('loadeddone')===undefined) {\n\t\t\t\t\tnextli.data('loadeddone',1);\n\t\t\t\t\twaitForLoads(nextli,function() {\n\t\t\t\t\t\t swapSlideCall(opt,defimg,container)\n\t\t\t\t\t\t},opt);\n\t\t\t\t} else\n\n\t\t\t\t swapSlideCall(opt,defimg,container)\n\t\t\t}\n\t\t}", "function swapSlide(container,opt) {\n\t\t\ttry{\n\t\t\t\tvar actli = container.find('>ul:first-child >li:eq('+opt.act+')');\n\t\t\t} catch(e) {\n\t\t\t\tvar actli=container.find('>ul:first-child >li:eq(1)');\n\t\t\t}\n\t\t\topt.lastslide=opt.act;\n\t\t\tvar nextli = container.find('>ul:first-child >li:eq('+opt.next+')');\n\n\t\t\tvar defimg= nextli.find('.defaultimg');\n\n\n\t\t\topt.bannertimeronpause = true;\n\t\t\tcontainer.trigger('stoptimer');\n\t\t\topt.cd=0;\n\n\t\t\tif (defimg.data('lazyload') !=undefined && defimg.data('lazyload') !=\"undefined\" && defimg.data('lazydone') !=1 ) {\n\n\t\t\t\tif (!isIE(8))\n\t\t\t\t\tdefimg.css({backgroundImage:'url(\"'+nextli.find('.defaultimg').data('lazyload')+'\")'});\n\t\t\t\telse {\n\t\t\t\t\tdefimg.attr('src',nextli.find('.defaultimg').data('lazyload'));\n\t\t\t\t}\n\n\t\t\t\tdefimg.data('src',nextli.find('.defaultimg').data('lazyload'));\n\t\t\t\tdefimg.data('lazydone',1);\n\t\t\t\tdefimg.data('orgw',0);\n\t\t\t\tnextli.data('loadeddone',1);\n\n\t\t\t\tTweenLite.set(container.find('.tp-loader'),{display:\"block\",opacity:0});\n\t\t\t\tTweenLite.to(container.find('.tp-loader'),0.3,{autoAlpha:1});\n\n\t\t\t\twaitForLoads(nextli,function() {\n\t\t\t\t\t\t swapSlideCall(opt,defimg,container)\n\t\t\t\t},opt);\n\n\t\t\t} else {\n\n\t\t\t\tif (nextli.data('loadeddone')===undefined) {\n\t\t\t\t\tnextli.data('loadeddone',1);\n\t\t\t\t\twaitForLoads(nextli,function() {\n\t\t\t\t\t\t swapSlideCall(opt,defimg,container)\n\t\t\t\t\t\t},opt);\n\t\t\t\t} else\n\n\t\t\t\t swapSlideCall(opt,defimg,container)\n\t\t\t}\n\t\t}", "function getDataSlider() {\n fetch(slideUrl)\n .then(response => response.json())\n .then(data => {\n slide = data;\n\n data.data.map((item, index) => {\n sliderSpace.innerHTML += generateSlidesHTML(index, item);\n });\n\n //execute here because it's necessary wait fetch\n slides = document.querySelectorAll('.slider .slider-image');\n getDataProducts();\n });\n}", "function previewSlide(clicked_id) \r\n{\r\n\tvar index = 0;\t\t\t\t\t\t\t\t\t\t//Tracks the position of the next slide in the slide deck\r\n\tvar nextFileValidity = \"valid\";\t\t//Tracks the whether or not a file is safe to load\r\n\tvar delay = 200;\t\t\t\t\t\t\t\t\t//The delay, in MS, before buffering the next slide\r\n\tvar filePosition = 0;\t\t\t\t\t\t\t//Tracks the position of the next slide in the slide deck\r\n\t\r\n\t//Set the current to the next fields\r\n\tnextSlideName = currentSlideName;\r\n\tnextSlideType = currentSlideType;\r\n\t\r\n\t//Disable Load Next Slide button\r\n\t$(\"#loadSlide\").css(\"color\", \"white\");\r\n\t$(\"#loadSlide\").attr(\"disabled\", true);\r\n\t$(\"#loadSlide\").val(\"Loading...\");\r\n\t\r\n\t//Disable the slide deck\r\n\tvalidateSlideDeck(\"disable\");\r\n\t\r\n\t//Loop through each element in the slide deck & assign variables\r\n\t$('#order').children('input').each(function() \r\n\t{\r\n\t\tindex++;\r\n if (clicked_id == this.id)\r\n\t\t{\r\n\t\t\tnextSlideName = this.id;\r\n\t\t\tnextSlideType = this.id.substr(this.id.lastIndexOf('.') + 1);\r\n\t\t\t$(this).addClass(\"btn-primary-hovered\");\r\n\t\t\tfilePosition = index;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$(this).removeClass(\"btn-primary-hovered\");\r\n\t\t}\r\n\t});\r\n\t\r\n\t//Display the filename next to the Next Slide heading\r\n\t$(\"#nextSlideHeading\").html(\"Next Slide: \" + nextSlideName.substr(nextSlideName.lastIndexOf('/') + 1));\r\n\t\r\n\t//Set the Next Slide to a loading screen\r\n\tdisplayImagePreview(\"next\", imageFilePath, loadingName);\r\n\t\r\n\t//Validate the next slide type and display it\r\n\tif (filePosition == $(\"#order *\").length)\t\t\t//The last slide in the slide deck\r\n\t{\r\n\t\t$(\"#nextSlideHeading\").html(\"Next Slide: Set Displays to Black\");\r\n\t\tif (validateFiletype(imageFiletypes, nextSlideType))\r\n\t\t{\r\n\t\t\tcheckFileExists(imageFilePath, nextSlideName, \"image\", delay, displayNextSlide)\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tnextFileValidity = \"invalidFileType\";\r\n\t\t\tdisplayNextSlide(nextSlideName, nextFileValidity, \"error\", imageFilePath, delay);\r\n\t\t}\r\n\t}\r\n\telse\t\t//Not the last slide\r\n\t{\r\n\t\tif (validateFiletype(videoFiletypes, nextSlideType))\r\n\t\t{\r\n\t\t\tcheckFileExists(mediaFilePath, nextSlideName, \"video\", delay, displayNextSlide)\r\n\t\t}\r\n\t\telse if (validateFiletype(imageFiletypes, nextSlideType))\r\n\t\t{\r\n\t\t\tcheckFileExists(mediaFilePath, nextSlideName, \"image\", delay, displayNextSlide)\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tdisplayErrorPage(\"invalidFileType\");\r\n\t\t}\r\n\t}\r\n}", "function carouselLoadPictures(xml) {\r\n\tsetTheParameters();\r\n\treadXml(xml);\r\n\txmldoc = null;\r\n\tif (booleanF2 == false) {\r\n\t\t//console.log(\"carousel\");\r\n\t\tYAHOO.widget.Carousel.prototype.STRINGS.NEXT_BUTTON_TEXT = \"<img src='right-enabled.gif'/> \";\r\n\t\tYAHOO.widget.Carousel.prototype.STRINGS.PREVIOUS_BUTTON_TEXT = \"<img src='left-enabled.gif'/> \";\r\n\t\tYAHOO.widget.Carousel.prototype.STRINGS.PAGER_PREFIX_TEXT = \"Go to page: \";\r\n\t\t//YAHOO.widget.Carousel.prototype.STRINGS.FIRST_PAGE= \"1\";\r\n\t\tg_jcarousel = new YAHOO.widget.Carousel(\"carousel\", {\r\n\t\t\tanimation : {\r\n\t\t\t\tspeed : 0.5,\r\n\t\t\t\teffect : null\r\n\t\t\t},\r\n\t\t\tnumVisible : one_stepCarousel,\r\n\t\t\tscrollInc : one_stepCarousel\r\n\t\t});\r\n\t\tg_jcarousel.addListener(\"afterScroll\", scrollEvtHandler);\r\n\t\tg_jcarousel.render();\r\n\t\tg_jcarousel.show();\r\n\t\tg_carouselTotalSize = g_carouselTotalSize + smallUrl.length;\r\n\t\t$(\".yui-carousel-nav\").css(\"background\", \"url('images/ui-bg_inset-hard_100_f5f8f9_1x30.png') repeat-x scroll 0 0 transparent\");\r\n\t\t$(\".yui-carousel-nav\").css(\"height\", \"30px\");\r\n\t\t//console.log(\"g_carouselTotalSize: \"+g_carouselTotalSize);\r\n\t\ttimeofUpload++;\r\n\t\tloadTheCarousel(0, g_jcarousel, smallUrl);\r\n\t\tbooleanF2 = true;\r\n\t}\r\n\tif (lastCarousel > g_carouselTotalSize - beforeLoad) {\r\n\t\tloadTheCarousel(g_carouselTotalSize, g_jcarousel, smallUrl);\r\n\t\tg_carouselTotalSize = g_carouselTotalSize + smallUrl.length;\r\n\t}\r\n\t// console.log(\"ready to execute is true\");\r\n\t// readyToExecute=true;\r\n}", "function displaySlide( arr, container ) {\n //console.log(container);\n var el = container.querySelectorAll(\".gallry .slides > figure\");\n\n // if elements created and variable successful\n if (el) {\n for ( var i = 0; i < arr.length; i++ ) {\n // clear out all active class assignments\n el[i].classList.remove(\"active\");\n // set default active state\n if ( arr[i].active ) {\n el[i].classList.add(\"active\");\n Velocity( el[i], { left: \"0%\" }, { display: \"block\" }, { duration: prefs.timing, easing: prefs.easing });\n }\n else if ( i < currentSlide( arr ).index() ) {\n Velocity( el[i], { left: \"-100%\" }, { display: \"none\" }, { duration: prefs.timing, easing: prefs.easing });\n }\n else {\n Velocity( el[i], { left: \"100%\" }, { display: \"none\" }, { duration: prefs.timing, easing: prefs.easing });\n }\n\n if (arr[i].backgroundPosition !== undefined) {\n el[i].style.backgroundSize = arr[i].size;\n el[i].style.backgroundPosition = arr[i].backgroundPosition;\n }\n else {\n el[i].style.backgroundSize = \"cover\";\n el[i].style.backgroundPosition = \"center\";\n }\n\n // this conditional currently requires 2x assets to be available. If no 2x assets are available,\n // no fallback images are provided.\n if (prefs.retina) {\n // do some device sniffing to determine if the screen is retina display or not\n if (window.devicePixelRatio > 1.5) {\n var str = arr[i].src;\n var first = str.slice(0, str.length - 4); // get first part of string\n var last = str.slice(str.length - 4, str.length); // get .jpg, .png, .svg, .gif files --- must be 4 character file extension\n el[i].style.backgroundImage = \"url('\" + first + \"_2x\" + last + \"')\"; // defining gallery slide image via arr.src prop\n }\n else {\n // if the device pixel ratio doesnt match up, use the 1x asset\n el[i].style.backgroundImage = \"url('\" + arr[i].src + \"')\"; // defining gallery slide image via arr.src prop\n }\n }\n // if prefs.retina is false, use the 1x image asset.\n else {\n el[i].style.backgroundImage = \"url('\" + arr[i].src + \"')\"; // defining gallery slide image via arr.src prop\n }\n\n el[i].classList.add( arr[i].name, \"slide\" ); // cycle through array.name values to assign as class to element\n el[i].style.backgroundRepeat = \"no-repeat\";\n el[i].style.height = \"100%\";\n el[i].style.margin = \"0\";\n }\n }\n else {\n console.log(\"Check el element is assigned to correct querySelectorAll value.\");\n }\n }", "slide () {\n if (window.location.pathname === '/') {\n let wrapper = document.getElementById('slider'),\n items = document.getElementById('slides');\n\n //get item length from mobile slider if screen size is small\n if (window.screen.width < 768) {\n items = document.getElementById('mobileslides')\n }\n\n //calculating positions & setting initials \n let posX1 = 0,\n posX2 = 0,\n posInitial,\n posFinal,\n threshold = 100,\n slides = items.getElementsByClassName('slide'),\n slidesLength = slides.length,\n slideSize = items.getElementsByClassName('slide')[0].offsetWidth,\n firstSlide = slides[0],\n lastSlide = slides[slidesLength - 1],\n cloneFirst = firstSlide.cloneNode(true),\n cloneLast = lastSlide.cloneNode(true),\n index = 0,\n allowShift = true;\n\n // Cloning first and last slide\n items.appendChild(cloneFirst);\n items.insertBefore(cloneLast, firstSlide);\n wrapper.classList.add('loaded');\n\n // Handle mouse event\n items.onmousedown = dragStart;\n\n // Handle touch events\n items.addEventListener('touchstart', dragStart);\n items.addEventListener('touchend', dragEnd);\n items.addEventListener('touchmove', dragAction);\n\n // Handle transition events\n items.addEventListener('transitionend', checkIndex);\n\n //HTML 5 drag & drop handlers\n function dragStart (e) {\n e = e || window.event;\n e.preventDefault();\n posInitial = items.offsetLeft;\n\n if (e.type === 'touchstart') {\n posX1 = e.touches[0].clientX;\n } else {\n posX1 = e.clientX;\n document.onmouseup = dragEnd;\n document.onmousemove = dragAction;\n }\n }\n\n function dragAction (e) {\n e = e || window.event;\n\n if (e.type === 'touchmove') {\n posX2 = posX1 - e.touches[0].clientX;\n posX1 = e.touches[0].clientX;\n } else {\n posX2 = posX1 - e.clientX;\n posX1 = e.clientX;\n }\n items.style.left = (items.offsetLeft - posX2) + \"px\";\n }\n\n function dragEnd (e) {\n posFinal = items.offsetLeft;\n if (posFinal - posInitial < -threshold) {\n shiftSlide(1, 'drag');\n } else if (posFinal - posInitial > threshold) {\n shiftSlide(-1, 'drag');\n } else {\n items.style.left = (posInitial) + \"px\";\n }\n\n document.onmouseup = null;\n document.onmousemove = null;\n }\n\n function shiftSlide (dir, action) {\n items.classList.add('shifting');\n\n if (allowShift) {\n if (!action) { posInitial = items.offsetLeft; }\n\n if (dir === 1) {\n items.style.left = (posInitial - slideSize) + \"px\";\n index++;\n } else if (dir === -1) {\n items.style.left = (posInitial + slideSize) + \"px\";\n index--;\n }\n };\n\n allowShift = false;\n }\n\n //find the index of slides based on length calculated\n function checkIndex () {\n items.classList.remove('shifting');\n\n if (index === -1) {\n items.style.left = -(slidesLength * slideSize) + \"px\";\n index = slidesLength - 1;\n }\n\n if (index === slidesLength) {\n items.style.left = -(1 * slideSize) + \"px\";\n index = 0;\n }\n\n allowShift = true;\n }\n }\n }", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n var element;\r\n\r\n panel.find('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]').each(function(){\r\n element = $(this);\r\n\r\n $.each(['src', 'srcset'], function(index, type){\r\n var attribute = element.attr('data-' + type);\r\n if(typeof attribute !== 'undefined' && attribute){\r\n setSrc(element, type);\r\n }\r\n });\r\n\r\n if(element.is('source')){\r\n var typeToPlay = element.closest('video').length ? 'video' : 'audio';\r\n element.closest(typeToPlay).get(0).load();\r\n }\r\n });\r\n }", "function showslide(s) {\n var slideid = s;\n $('.howtoslide').hide();\n $('#' + displaymode + '_howtoslide' + slideid).fadeIn('slow');\n $('body').scrollTop(0);\n}", "function lazyLoad(destiny){\n var destiny = getSlideOrSection(destiny);\n\n destiny.find('img[data-src], source[data-src], audio[data-src], iframe[data-src]').each(function(){\n $(this).attr('src', $(this).data('src'));\n $(this).removeAttr('data-src');\n\n if($(this).is('source')){\n $(this).closest('video').get(0).load();\n }\n });\n }", "openSlide() {\n this.reposSlide();\n this.dropAnimation();\n if(!this.transitions) {\n if (this.tansition_timer!=null) clearTimeout(this.tansition_timer);\n this.tansition_timer = setTimeout(this.checkIndex.bind(this), 250);\n }\n }", "function SetupAfterAllLoaded() {\n /**\n * CHECK IMAGE LOADED -> IF LOADED COMPLETE THEN EXECUTE 'SLIDE-END'\n */\n slData.nImage = slData.nImage + 1;\n if (slData.nImage == slData.imageLen\n && (!slData.isVideoback || (slData.isVideoback && slData.isVideobackLoaded))) {\n setTimeout(function () {\n VariableModule(that);\n (slData['id'] == 'home') ? M.Module('LAYER').LoadHomeEnd()\n : that.LOAD.SlideEnd($slCur);\n }, 10);\n }\n }", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n var element;\r\n \r\n panel.find('img[data-src], img[data-srcset], source[data-src], audio[data-src], iframe[data-src]').each(function(){\r\n element = $(this);\r\n\r\n $.each(['src', 'srcset'], function(index, type){\r\n var attribute = element.attr('data-' + type);\r\n if(typeof attribute !== 'undefined' && attribute){\r\n setSrc(element, type);\r\n }\r\n });\r\n\r\n if(element.is('source')){\r\n element.closest('video').get(0).load();\r\n }\r\n });\r\n }", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n var element;\r\n \r\n panel.find('img[data-src], img[data-srcset], source[data-src], audio[data-src], iframe[data-src]').each(function(){\r\n element = $(this);\r\n\r\n $.each(['src', 'srcset'], function(index, type){\r\n var attribute = element.attr('data-' + type);\r\n if(typeof attribute !== 'undefined' && attribute){\r\n setSrc(element, type);\r\n }\r\n });\r\n\r\n if(element.is('source')){\r\n element.closest('video').get(0).load();\r\n }\r\n });\r\n }", "function init() {\n \n\tTweenLite.set($slides, {\n\t\tleft: \"-100%\"\n });\n\tgotoSlide(0, 0);\n}", "function nextSlide() { showSlide(slideNumber + 1); }", "function goToSlide() {\n var found = false;\n // if already has slide param\n if ( urlParams[\"s\"] != null) {\n // for safety, make sure index exists \n var param = urlParams[\"s\"];\n for (var i=0; i<flow.length; i++) {\n if ( param == flow[i].descriptor ) {\n currentIndex = i; \n found = true;\n }\n }\n } else {\n // if there is no slide param\n currentIndex = 0;\n }\n if (!found) {\n currentIndex = 0;\n }\n window.history.pushState(urlParams, \"\", \"?s=\" + flow[currentIndex].descriptor);\n // cycleItems();\n showItem();\n}", "loadContent(element) {\n let id = $(element).data(\"post\");\n //$(element).parent().data(\"targetDiv\").slideToggle(\"slow\");\n $(element).parent().data(\"targetDiv\").load('data/blog.html ' + id);\n // $(element).parent().data(\"targetDiv\").slideToggle(\"slow\");\n \n }", "function resetSlides() {\n var slide1 = $('.slide1');\n if (slide1.length != 0) {\n var leftArrow = $('.arrow_left'), rightArrow = $('.arrow_right'),\n lastNumber = parseInt($('.projectlength').attr('text')),\n slides = $('.content-slides'), slideNumber, activeSlide,\n detailsBG = $('.details-bg');\n\n slides.removeClass('active');\n detailsBG.removeClass('active');\n slideNumber = getUrlParameter('slide');\n if (slideNumber == \"Null\") { slideNumber = 1; }\n else { slideNumber = Number(slideNumber); };\n\n if (slideNumber == 1) { leftArrow.addClass('hidden'); }\n else { leftArrow.removeClass('hidden'); };\n if (slideNumber == lastNumber) { rightArrow.addClass('hidden'); }\n else { rightArrow.removeClass('hidden'); };\n\n activeSlide = $('.slide' + slideNumber);\n activeSlide.addClass('active');\n detailsBG.eq(slideNumber-1).addClass('active');\n detailsBG.eq(slideNumber-1+lastNumber).addClass('active');\n\n setUrlParameter('slide', slideNumber);\n lazyLoad();\n };\n}", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n\r\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\r\n ['src', 'srcset'].forEach(function(type){\r\n var attribute = element.getAttribute('data-' + type);\r\n if(attribute != null && attribute){\r\n setSrc(element, type);\r\n element.addEventListener('load', function(){\r\n onMediaLoad(destiny);\r\n });\r\n }\r\n });\r\n\r\n if(matches(element, 'source')){\r\n var elementToPlay = closest(element, 'video, audio');\r\n if(elementToPlay){\r\n elementToPlay.load();\r\n elementToPlay.onloadeddata = function(){\r\n onMediaLoad(destiny);\r\n };\r\n }\r\n }\r\n });\r\n }", "function showSlide(id) {\n $(\".slide\").hide();\n $(\"#\"+id).show();\n}", "function showSlide(id) {\n $(\".slide\").hide();\n $(\"#\"+id).show();\n}", "function showSlide(id) {\n $(\".slide\").hide();\n $(\"#\"+id).show();\n}", "function lazyLoad(destiny) {\n if (!options.lazyLoading) {\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n var element;\n\n panel.find('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]').each(function() {\n element = $(this);\n\n $.each(['src', 'srcset'], function(index, type) {\n var attribute = element.attr('data-' + type);\n if (typeof attribute !== 'undefined' && attribute) {\n setSrc(element, type);\n }\n });\n\n if (element.is('source')) {\n var typeToPlay = element.closest('video').length ? 'video' : 'audio';\n element.closest(typeToPlay).get(0).load();\n }\n });\n }", "load() {\r\n\r\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n var element;\n \n panel.find('img[data-src], img[data-srcset], source[data-src], audio[data-src], iframe[data-src]').each(function(){\n element = $(this);\n\n $.each(['src', 'srcset'], function(index, type){\n var attribute = element.attr('data-' + type);\n if(typeof attribute !== 'undefined' && attribute){\n setSrc(element, type);\n }\n });\n\n if(element.is('source')){\n element.closest('video').get(0).load();\n }\n });\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n var element;\n \n panel.find('img[data-src], img[data-srcset], source[data-src], audio[data-src], iframe[data-src]').each(function(){\n element = $(this);\n\n $.each(['src', 'srcset'], function(index, type){\n var attribute = element.attr('data-' + type);\n if(typeof attribute !== 'undefined' && attribute){\n setSrc(element, type);\n }\n });\n\n if(element.is('source')){\n element.closest('video').get(0).load();\n }\n });\n }", "function paolettibibite_load(){\n jQuery(\"#loader\").slideUp(1000,'easeInOutExpo');\n /*.queue(function () {\n //Slide Birra\n jQuery(\"#birra\").delay(2600).slideDown(800,'easeInOutExpo');\n });*/\n}", "function showSlide(id) {\n // Hide all slides\n $(\".slide\").hide();\n // Show just the slide we want to show\n $(\"#\"+id).show();\n}", "function showSlide(id) {\n // Hide all slides\n\t$(\".slide\").hide();\n\t// Show just the slide we want to show\n\t$(\"#\"+id).show();\n}", "_renderSlide() {\n\t\t\t\tif (this.slideView) {\n\t\t\t\t\tthis.slideView.remove();\n\t\t\t\t}\n\n\t\t\t\tthis.slideView = new SlideView({model: this.collection.getCurrentModel()});\n\t\t\t\tthis.$el.find('ul.slides').append(this.slideView.el);\n\t\t\t}", "function load(id) {\n var doc = $(\"#\"+id);\n if (id == 'aja' || id == 'flo') {\n if (id == 'aja') { //document.body.scrollTop\n var widthaja = (document.documentElement.scrollWidth - 680 - 30) / 2;\n doc.css(\"left\",widthaja + 'px');\n doc.css(\"top\",(document.documentElement.scrollTop + 90) + 'px');\n doc.html('<div id=\"ajatitle\"><span>Loading...</span><img src=\"' + king_page + 'system/images/close.gif\" class=\"os\" onclick=\"display(\\'aja\\')\"/></div><div id=\"load\"><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>Loading...</div>');\n }\n else {\n var widthflo = (document.documentElement.scrollWidth - 360 - 30) / 2;\n doc.css(\"left\",widthflo + 'px');\n doc.css(\"top\",(document.documentElement.scrollTop + 190) + 'px');\n if (is != 0) {\n doc.html('<div id=\"flotitle\"><span>Loading...</span><img src=\"' + king_page + 'system/images/close.gif\" class=\"os\" onclick=\"display(\\'aja\\')\"/></div><div id=\"flomain\">Loading...</div>');\n }\n }\n } else {\n doc.html('<img class=\"\"os\"\" src=\"' + king_page + 'system/images/load.gif\"/>');\n }\n}", "function loadFirstCarouselSlides(){\n\t$(\".carousel .item\").each(function(n) {\n\t\tif($(this).hasClass(\"loadfast\")){\n\t\t\timgURL = $(this).attr(\"data-image\");\n\t\t\tif(cloudinaryAccount){\n\t\t\t\tcloudinaryURL = \"http://res.cloudinary.com/\"+cloudinaryAccount+\"/image/fetch/w_\"+pixelFullWidth+\",q_88,f_auto,fl_progressive,fl_force_strip/\"+imgURL;\n\t\t\t\tpreload(cloudinaryURL);\n\t\t\t}\n\t\t}\n\t});\n}", "function startEmbeddedContent(slide) {\n\n if (slide) {\n // HTML5 media elements\n toArray(slide.querySelectorAll('video, audio')).forEach(function (el) {\n if (el.hasAttribute('data-autoplay')) {\n el.play();\n }\n });\n\n // YouTube embeds\n toArray(slide.querySelectorAll('iframe[src*=\"youtube.com/embed/\"]')).forEach(function (el) {\n if (el.hasAttribute('data-autoplay')) {\n el.contentWindow.postMessage('{\"event\":\"command\",\"func\":\"playVideo\",\"args\":\"\"}', '*');\n }\n });\n }\n\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\n ['src', 'srcset'].forEach(function(type){\n var attribute = element.getAttribute('data-' + type);\n if(attribute != null && attribute){\n setSrc(element, type);\n element.addEventListener('load', function(){\n onMediaLoad(destiny);\n });\n }\n });\n\n if(matches(element, 'source')){\n var elementToPlay = closest(element, 'video, audio');\n if(elementToPlay){\n elementToPlay.load();\n elementToPlay.onloadeddata = function(){\n onMediaLoad(destiny);\n }\n }\n }\n });\n }", "function generateSlides() {\n const parentEle = document.querySelector('#container');\n currentQContent = [dataVizPage[state.q_id], ...sharedContent]\n\n currentQContent.forEach((slide, i) => {\n const slideElement = document.createElement('div');\n //element position absolute\n slideElement.style.zIndex = `-${i}`;\n slideElement.style.position = 'absolute';\n slideElement.classList.add('slide');\n slideElement.setAttribute('id', `slide${state.q_id}-${i}`)\n if (i == 0) {\n slideElement.classList.add('center');\n } else {\n slideElement.classList.add('right');\n }\n slideElement.innerHTML = `${currentQContent[i].slide_text}`;\n parentEle.appendChild(slideElement);\n });\n\n}", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\n ['src', 'srcset'].forEach(function(type){\n var attribute = element.getAttribute('data-' + type);\n if(attribute != null && attribute){\n setSrc(element, type);\n element.addEventListener('load', function(){\n onMediaLoad(destiny);\n });\n }\n });\n\n if(matches(element, 'source')){\n var elementToPlay = closest(element, 'video, audio');\n if(elementToPlay){\n elementToPlay.load();\n elementToPlay.onloadeddata = function(){\n onMediaLoad(destiny);\n };\n }\n }\n });\n }", "function lazyLoad(destiny){\n if (!options.lazyLoading){\n return;\n }\n\n var panel = getSlideOrSection(destiny);\n\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\n ['src', 'srcset'].forEach(function(type){\n var attribute = element.getAttribute('data-' + type);\n if(attribute != null && attribute){\n setSrc(element, type);\n element.addEventListener('load', function(){\n onMediaLoad(destiny);\n });\n }\n });\n\n if(matches(element, 'source')){\n var elementToPlay = closest(element, 'video, audio');\n if(elementToPlay){\n elementToPlay.load();\n elementToPlay.onloadeddata = function(){\n onMediaLoad(destiny);\n };\n }\n }\n });\n }", "function incImg() {\r\n\t\t\tloaded++;\r\n\t\t\tif(loaded == slides.length) {\r\n\t\t\t\tfor(var i = 0; i < slides.length; i++) {\r\n\t\t\t\t\tjbl.slides[i] = {\r\n\t\t\t\t\t\telement: slides[i],\r\n\t\t\t\t\t\twidth: img.width,\r\n\t\t\t\t\t\theight: img.height\r\n\t\t\t\t\t};\r\n\t\t\t\t\tvar sposx = -Math.round((img.width - $(slide).width()) / 2);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tpostaction();\r\n\t\t\t}\r\n\t\t}", "function rool(){\n\tsetInterval(function(){showSlides('card-body',1);\n\t\t\tshowSlides('card-body',2);},3000);\n\tsetInterval(function(){showSlides('card-body',3);\n\t\t\tshowSlides('card-body',4);},3000);\n\tsetInterval(function(){showSlides('card-body',5);\n\t\t\tshowSlides('card-body',6);},6000);\n}", "initSlides() {\n this.container = $(\"[data-slideshow]\");\n this.slides = this.container.find(\"img\");\n this.slides.each((idx, slide) => $(slide).attr(\"data-slide\", idx));\n }", "function currentSlide(n,p) {\r\n showSlides(slideIndex = n,p);\r\n \r\n}", "function slide(e){\n var indices, background, video;\n\n // Loop background vid\n indices = Reveal.getIndices(Reveal.getCurrentSlide());\n background = Reveal.getSlideBackground(indices.h, 0);\n video = background.querySelector('video');\n if (video) {\n video.loop = true;\n }\n\n // Also play slide vid\n var slideVid = e.currentSlide.querySelector('video');\n if (slideVid) {\n setTimeout(function(){\n slideVid.play();\n }, 500);\n }\n }", "function load() {\r\n\t\tvisibility(\"none\", \"allbooks\");\r\n\t\tvisibility(\"\", \"singlebook\");\r\n\t\tbookTitle = this.className; // enables the user to go to page of the book that is clicked\r\n\t\tdocument.getElementById(\"cover\").src = \"books/\"+bookTitle+\"/cover.jpg\";\r\n\t\tdocument.getElementById(\"allbooks\").innerHTML = \"\"; \r\n\t\tsearchData(\"info&title=\" + bookTitle, oneBookInfo);\r\n\t\tsearchData(\"description&title=\" + bookTitle, oneBookDescription);\r\n\t\tsearchData(\"reviews&title=\" + bookTitle, oneBookReview);\t\r\n\t}", "init() {\n this.timer = setInterval(this.nextSlide, 5000); // Change slide every 5 seconds\n }", "function loadSongsToDOM() {\n\n}", "function initSlide(id,range, zoom){\n\t// cord = document.getElementById('cord');\n\tctx = document.getElementById(id);\t\t\t\t\t\t\t// CONTENEDOR ASIGNADO PARA EL SLIDER.\n\t// agrego indices a las imagenes.\n\timagesSlide = ctx.querySelectorAll('.item-image');\n\timagesSlide.forEach((item,index)=>{\n\t\titem.dataset.id_img= index;\n\t})\n\ttotalImages = imagesSlide.length-1;\t\t\t\t\t\t\t\t\t// CANTIDAD DE IMAGENES DEL SLIDER\n\tlastImage \t= 0;\t\t\t\t\t\t\t\t\t\t\t// ULTIMO INDICE DE IMAGEN QUE SE MOSTRO.\n\tbod = document.getElementsByTagName('body')[0];\t\t\t\t// CUERPO - BODY HTML\n\tposx = 0;\n\tposy = 0;\n\timg = \"undefined\";\n\turl = window.location.href;\n\tbaseUrl = url.split('/').slice(0,length-1).join('/');\t\t// URL BASE DE LA PAGINA PARA OBTENER LAS RUTA.\n\timage = null;\n\tif(zoom){\n\t\timg = document.createElement('img');\n\t\td = document.createElement('div');\n\t\td.className = \"zoomin noview\";\n\t\tctx.appendChild(d);\n\t\tzoomSection = document.createElement('div');\n\t\tzoomSection.className = \"zoom-section noview\";\n\t\tbod.appendChild(zoomSection);\n\t\tzoomIn();\n\t}\n\tctx.onmousedown = function(e){\n\t\txInit = e.clientX;\n\t\tyInit = e.clientY;\n\t\td.classList.add('noview');\n\t\tctx.onmousemove = function(e){\n\t\t\td.classList.add('noview');\n\t\t\t// cord.innerText = \"coord: x=\"+e.clientX+\" y=\"+e.clientY;\n\t\t\tif(xInit < e.clientX){ // IMAGEN ANTERIOR\n\t\t\t\txSecundario = xInit+ range;\n\t\t\t\tif(xSecundario < e.clientX){\n\t\t\t\t\tconsole.log('move to RIGHT');\n\t\t\t\t\tpreviousImg = ctx.querySelector('.selected-slide');\n\t\t\t\t\t// console.log(previousImg);\n\t\t\t\t\tindex = parseInt(previousImg.dataset.id_img)-1;\n\t\t\t\t\tif(index<0){\n\t\t\t\t\t\tindex = totalImages;\n\t\t\t\t\t}\n\t\t\t\t\tchangeImg(index,previousImg);\n\t\t\t\t}\n\t\t\t}else{ // IMAGEN POSTERIOR\n\t\t\t\txSecundario = xInit -range;\n\t\t\t\tif(xSecundario > e.clientX){\n\t\t\t\t\tconsole.log('move to LEFT');\n\t\t\t\t\tpreviousImg = ctx.querySelector('.selected-slide');\n\t\t\t\t\tconsole.log(previousImg);\n\t\t\t\t\tindex = parseInt(previousImg.dataset.id_img)+1;\n\t\t\t\t\tconsole.log('indice',index);\n\t\t\t\t\tif(index>totalImages){\n\t\t\t\t\t\tindex = 0;\n\t\t\t\t\t}\n\t\t\t\t\tchangeImg(index,previousImg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tctx.onmouseup = function(e){\n\t\t\tcord.innerText = \"arrastre la imagen hacia los lados\";\n\t\t\tctx.onmousemove = function(){\n\t\t\t\tif(zoom){\n\t\t\t\t\treturn zoomIn();\n\t\t\t\t}\n\t\t\t};\n\t\t}\n\t}\n}", "function initThumbs() {\n showtheSlide();//hide all but the first entry after build\n $(\".thumbR\").on('click', function () {\n var t = $(this).attr('id').replace('thumb', '');\n currPage = t;//keep track of the page we just loaded\n showtheSlide();//hide all but they page we want\n });\n}", "function showSlides(){\r\n\t\tlet slides = document.getElementsByClassName(\"eachslide\");\r\n\t\t\tfor (let i=0; i < slides.length; i++){\r\n\t\t\t\tslides[i].style.display = \"none\";\r\n\t\t\t}\r\n\t\t\tslideIndx++;\r\n\t\t\tif (slideIndx > slides.length){\r\n\t\t\t\tslideIndx = 1;\r\n\t\t\t}\r\n\t\t\tslides[slideIndx-1].style.display = \"block\";\r\n\t\t\ttimerSlide = setTimeout(showSlides, 2500); //2.5 seconds\r\n\t}", "function loadAd(slideNum){ \n\n if(!setSlotListenerSet){\n googletag.cmd.push(function() {\n googletag.pubads().addEventListener('slotRenderEnded', function(event) {\n var targetingPos = String(event.slot.getTargeting(\"pos\"));\n\n if(targetingPos.indexOf(\"carousel_slide_0\") > -1){\n if(event.isEmpty && (event.slot.getTargeting(\"pos\") == \"carousel_slide_0\"+slideNum)){\n $(\"#slide\"+slideNum).addClass( \"blankNbaFlexContent\" );\n $(\"#slide\"+slideNum).removeClass( \"nbaFlexContent\" );\n blankAdCnt+=1;\n } \n else{ \n adsRenderedCnt+=1;\n if(adsRenderedCnt == 2){\n initCarousel(slideNum);\n }\n else if(adsRenderedCnt > 2){\n loadSlides(adsRenderedCnt, blankAdCnt,slideNum);\n }\n }\n if((adsRenderedCnt+blankAdCnt) < 6){\n var nextSlideNum = slideNum+1;\n if(nextSlideNum==6){\n nextSlideNum = 1;\n }\n slideNum = nextSlideNum;\n setTimeout(function(){renderAd(nextSlideNum)},3000); //3000\n }\n else{\n finalizeCarousel();\n } \n } //targetingPos.indexOf if condition\n }); //googletag.pubads().addEventListener\n }); // googletag.cmd.push function\n } // setSlotListenerSet if condition\n setSlotListenerSet = true;\n}", "function showSlide(id) {\n\t$(\".slide\").hide();\n\t$(\"#\"+id).show();\n}", "function lazyLoad(destiny){\r\n if (!options.lazyLoading){\r\n return;\r\n }\r\n\r\n var panel = getSlideOrSection(destiny);\r\n\r\n $('img[data-src], img[data-srcset], source[data-src], source[data-srcset], video[data-src], audio[data-src], iframe[data-src]', panel).forEach(function(element){\r\n ['src', 'srcset'].forEach(function(type){\r\n var attribute = element.getAttribute('data-' + type);\r\n if(attribute != null && attribute){\r\n setSrc(element, type);\r\n }\r\n });\r\n\r\n if(matches(element, 'source')){\r\n var typeToPlay = closest(element, 'video') != null ? 'video' : 'audio';\r\n closest(element, typeToPlay).load();\r\n }\r\n });\r\n }", "function showSlide(id) {\n // Hide all slides\n $(\".slide\").hide();\n // Show just the slide we want to show\n $(\"#\"+id).show();\n}", "function nextSlide()\r\n{\r\n slideIndex++;\r\n showSlide();\r\n}" ]
[ "0.7590229", "0.7177713", "0.69401866", "0.6809949", "0.67655057", "0.6640759", "0.66163397", "0.65466505", "0.65345395", "0.65345395", "0.64812076", "0.64728177", "0.6463014", "0.6385578", "0.6375247", "0.6343311", "0.6331319", "0.6299977", "0.62960774", "0.6276519", "0.62742925", "0.62740606", "0.6255485", "0.6240382", "0.6230118", "0.6210872", "0.6201945", "0.61915785", "0.61904997", "0.61818415", "0.6174163", "0.6164812", "0.6163172", "0.6156517", "0.6152073", "0.6145097", "0.6144721", "0.61361414", "0.60962355", "0.6093902", "0.60591245", "0.60337543", "0.6020975", "0.6018234", "0.6009173", "0.6008788", "0.6005671", "0.60000926", "0.60000926", "0.59696853", "0.59649885", "0.596402", "0.59639704", "0.59615237", "0.5950389", "0.5944237", "0.59395677", "0.593573", "0.59301025", "0.59222424", "0.59222424", "0.59221494", "0.59099185", "0.5906035", "0.59042597", "0.5898684", "0.5895993", "0.589505", "0.589505", "0.589505", "0.58945715", "0.58939016", "0.58911014", "0.58911014", "0.5890272", "0.58856094", "0.58808035", "0.5879835", "0.5872835", "0.5858004", "0.58511037", "0.5849688", "0.5848936", "0.58458436", "0.58458436", "0.5844498", "0.5843099", "0.58317745", "0.5831087", "0.5829789", "0.5827643", "0.5824629", "0.5823419", "0.58206254", "0.58177245", "0.58171666", "0.5816226", "0.5816069", "0.5811737", "0.5811567", "0.5807394" ]
0.0
-1
Define an async test based on a generator function
function asyncTest(generator) { return () => Task.spawn(generator).then(null, ok.bind(null, false)).then(finish); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function It(testName, generatorFn) {\n it(testName, function(done) {\n Promise.coroutine(generatorFn)(done);\n })\n}", "async function test() {}", "async runTest() {}", "function Test_Test() {\n return __awaiter(this, void 0, void 0, function () {\n var a, b;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_Test\");\n a = new VPN.VpnRpcTest({\n IntValue_u32: 12345\n });\n return [4 /*yield*/, api.Test(a)];\n case 1:\n b = _a.sent();\n console.log(b);\n console.log(\"End: Test_Test\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "async function useAsyncGenerator () {\n for await (let item of asyncGenerator(3)) {\n console.log(item)\n }\n}", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step(\"next\", value); }, function (err) { step(\"throw\", err); }); } } return step(\"next\"); }); }; }", "function Test_GetLink() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_create_link, out_rpc_create_link;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetLink\");\n in_rpc_create_link = new VPN.VpnRpcCreateLink({\n HubName_Ex_str: hub_name,\n AccountName_utf: \"linktest\"\n });\n return [4 /*yield*/, api.GetLink(in_rpc_create_link)];\n case 1:\n out_rpc_create_link = _a.sent();\n console.log(out_rpc_create_link);\n console.log(\"End: Test_GetLink\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { var callNext = step.bind(null, 'next'); var callThrow = step.bind(null, 'throw'); function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(callNext, callThrow); } } callNext(); }); }; }", "function run(genFn) {\n const it = genFn();\n\n function _next(err, val) {\n if (err) it.throw(err); //throw err to be caught in generator\n\n //get the generator object\n //a) the first time through val === undefined as yield returns what is returned from the thunk\n //b) next time through `val` will be the value passed as the second arg to the\n // node callback signature\n // - essentially this will \"dependency inject\" the async value from the `yield`\n const cont = it.next(val);\n\n if (cont.done) return;\n\n const cb = cont.value; //yielded function from Thunk that takes a callback as only arg\n\n //call the callback which exposes data inside the generator\n //the \"confusing\" part is that `_next` is the cb passed as the second arg to `fs.readFile`\n //so it will only be called again when `fs.readFile` calls it's cb\n //therefore, the generator is paused at the yield, until `_next` is called by `fs.readFile`\n //and therefore the generator object `.next` method is called advancing the\n //generator and resulting in generator obj `{value: ..., done: true}`\n cb(_next);\n }\n\n _next(); //start the generator\n}", "function Test_AddCrl() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_crl, out_rpc_crl;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_AddCrl\");\n in_rpc_crl = new VPN.VpnRpcCrl({\n HubName_str: hub_name,\n CommonName_utf: \"CN\",\n Organization_utf: \"Org\",\n Unit_utf: \"ICSCOE\",\n Country_utf: \"JP\",\n State_utf: \"Ibaraki\",\n Local_utf: \"Tsukuba\",\n Serial_bin: new Uint8Array([1, 2, 3, 4, 5,]),\n DigestMD5_bin: new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,]),\n DigestSHA1_bin: new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,])\n });\n return [4 /*yield*/, api.AddCrl(in_rpc_crl)];\n case 1:\n out_rpc_crl = _a.sent();\n console.log(out_rpc_crl);\n console.log(\"End: Test_AddCrl\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function run(_gen) {\n\n return new Promise((resolve, reject) => {\n //获取generator对象\n let gen = _gen()\n\n //开始执行到第一个yield关键字\n _next()\n\n function _next(last_res) {\n\n //执行next函数,并传递上一步的参数\n let tempRes = gen.next(last_res);\n\n //如果没有执行完毕\n if (!tempRes.done) {\n let obj = tempRes.value\n if (obj instanceof Promise) {\n obj.then(res => {\n _next(res)\n }, err => {\n reject(err)\n })\n } else if (obj instanceof Function) {\n //如果操作返回的是generator对象\n if (obj.constructor.toString().startsWith('function GeneratorFunction()')) {\n run(obj).then(res => _next(res), reject)\n } else {\n //执行下一个next方法\n _next(obj())\n }\n } else {\n _next(obj)\n }\n } else {\n resolve(tempRes.value)\n }\n }\n })\n\n}", "function Test_GetUser() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_set_user, out_rpc_set_user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetUser\");\n in_rpc_set_user = new VPN.VpnRpcSetUser({\n HubName_str: hub_name,\n Name_str: \"test1\"\n });\n return [4 /*yield*/, api.GetUser(in_rpc_set_user)];\n case 1:\n out_rpc_set_user = _a.sent();\n console.log(out_rpc_set_user);\n console.log(\"End: Test_GetUser\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }", "function yielding_promises() {\n function asyncPromise(value) {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(value);\n }, 500);\n });\n } \n\n function *yieldPromise() {\n var result = yield asyncPromise('foo');\n\n return result; // Note that you can return from generators\n }\n\n var co = require('co');\n\n co(function *() {\n var result = yield yieldPromise();\n\n console.log('This should be foo ->', result);\n });\n}", "function Test_AddL3Table() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_l3table, out_rpc_l3table;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_AddL3Table\");\n in_rpc_l3table = new VPN.VpnRpcL3Table({\n Name_str: \"L3SW1\",\n NetworkAddress_ip: \"10.0.0.0\",\n SubnetMask_ip: \"255.0.0.0\",\n GatewayAddress_ip: \"192.168.7.1\",\n Metric_u32: 10\n });\n return [4 /*yield*/, api.AddL3Table(in_rpc_l3table)];\n case 1:\n out_rpc_l3table = _a.sent();\n console.log(out_rpc_l3table);\n console.log(\"End: Test_AddL3Table\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function Test_RegenerateServerCert() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_test, out_rpc_test;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_RegenerateServerCert\");\n in_rpc_test = new VPN.VpnRpcTest({\n StrValue_str: \"abc.example.org\"\n });\n return [4 /*yield*/, api.RegenerateServerCert(in_rpc_test)];\n case 1:\n out_rpc_test = _a.sent();\n console.log(out_rpc_test);\n console.log(\"End: Test_RegenerateServerCert\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function Test_GetAdminMsg() {\n return __awaiter(this, void 0, void 0, function () {\n var out_rpc_msg;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetAdminMsg\");\n return [4 /*yield*/, api.GetAdminMsg()];\n case 1:\n out_rpc_msg = _a.sent();\n console.log(out_rpc_msg);\n console.log(\"End: Test_GetAdminMsg\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function createAsync(makeGenerator) {\n return function() {\n var generator = makeGenerator.apply(this, arguments);\n\n function handle(result) {\n if (result.done) {\n return Promise.resolve(result.value);\n }\n return Promise.resolve(result.value).then(function(res) {\n return handle(generator.next(res));\n }, function(err) {\n return handle(generator.throw(err));\n });\n }\n\n try {\n return handle(generator.next());\n } catch (ex) {\n return Promise.reject(ex);\n }\n }\n}", "function Test_AddEtherIpId() {\n return __awaiter(this, void 0, void 0, function () {\n var in_etherip_id, out_etherip_id;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_AddEtherIpId\");\n in_etherip_id = new VPN.VpnEtherIpId({\n Id_str: \"testid\",\n HubName_str: hub_name,\n UserName_str: \"nekosan\",\n Password_str: \"torisan\"\n });\n return [4 /*yield*/, api.AddEtherIpId(in_etherip_id)];\n case 1:\n out_etherip_id = _a.sent();\n console.log(out_etherip_id);\n console.log(\"End: Test_AddEtherIpId\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function Test_All() {\n return __awaiter(this, void 0, void 0, function () {\n var new_listener_port, farm_members, _i, _a, farm_member, enum_connection, _b, _c, connecton, hub_log_settings, enum_ca, _d, _e, ca, enum_link, _f, _g, link, enum_session, _h, _j, session, enum_mac, _k, _l, mac, enum_ip, _m, _o, ip, enum_crl, _p, _q, crl, got_crl, _r, _s, crl, enum_log_file, _t, _u, log, enum_etherip_id, _v, _w, etherip_id;\n return __generator(this, function (_x) {\n switch (_x.label) {\n case 0:\n hub_name = \"TEST\";\n return [4 /*yield*/, Test_Test()];\n case 1:\n _x.sent();\n return [4 /*yield*/, Test_GetServerInfo()];\n case 2:\n _x.sent();\n return [4 /*yield*/, Test_GetServerStatus()];\n case 3:\n _x.sent();\n return [4 /*yield*/, Test_CreateListener()];\n case 4:\n new_listener_port = _x.sent();\n return [4 /*yield*/, Test_EnableListener(new_listener_port, false)];\n case 5:\n _x.sent();\n return [4 /*yield*/, Test_EnumListener()];\n case 6:\n _x.sent();\n return [4 /*yield*/, Test_EnableListener(new_listener_port, true)];\n case 7:\n _x.sent();\n return [4 /*yield*/, Test_EnumListener()];\n case 8:\n _x.sent();\n return [4 /*yield*/, Test_DeleteListener(new_listener_port)];\n case 9:\n _x.sent();\n return [4 /*yield*/, Test_SetServerPassword()];\n case 10:\n _x.sent();\n return [4 /*yield*/, Test_GetFarmSetting()];\n case 11:\n _x.sent();\n if (!false) return [3 /*break*/, 19];\n return [4 /*yield*/, Test_SetFarmSetting()];\n case 12:\n _x.sent();\n return [4 /*yield*/, Test_EnumFarmMember()];\n case 13:\n farm_members = _x.sent();\n _i = 0, _a = farm_members.FarmMemberList;\n _x.label = 14;\n case 14:\n if (!(_i < _a.length)) return [3 /*break*/, 17];\n farm_member = _a[_i];\n return [4 /*yield*/, Test_GetFarmInfo(farm_member.Id_u32)];\n case 15:\n _x.sent();\n _x.label = 16;\n case 16:\n _i++;\n return [3 /*break*/, 14];\n case 17: return [4 /*yield*/, Test_GetFarmConnectionStatus()];\n case 18:\n _x.sent();\n return [3 /*break*/, 20];\n case 19:\n if (false) {\n console.log(\"abc\");\n }\n else {\n console.log(\"def\");\n }\n _x.label = 20;\n case 20: return [4 /*yield*/, Test_GetServerCert()];\n case 21:\n _x.sent();\n return [4 /*yield*/, Test_SetServerCert()];\n case 22:\n _x.sent();\n return [4 /*yield*/, Test_GetServerCipher()];\n case 23:\n _x.sent();\n return [4 /*yield*/, Test_SetServerCipher()];\n case 24:\n _x.sent();\n return [4 /*yield*/, Test_EnumConnection()];\n case 25:\n enum_connection = _x.sent();\n _b = 0, _c = enum_connection.ConnectionList;\n _x.label = 26;\n case 26:\n if (!(_b < _c.length)) return [3 /*break*/, 29];\n connecton = _c[_b];\n return [4 /*yield*/, Test_GetConnectionInfo(connecton.Name_str)];\n case 27:\n _x.sent();\n _x.label = 28;\n case 28:\n _b++;\n return [3 /*break*/, 26];\n case 29: return [4 /*yield*/, Test_CreateHub()];\n case 30:\n hub_name = _x.sent();\n return [4 /*yield*/, Test_SetHub()];\n case 31:\n _x.sent();\n return [4 /*yield*/, Test_GetHub()];\n case 32:\n _x.sent();\n return [4 /*yield*/, Test_EnumHub()];\n case 33:\n _x.sent();\n return [4 /*yield*/, Test_SetHubRadius()];\n case 34:\n _x.sent();\n return [4 /*yield*/, Test_GetHubRadius()];\n case 35:\n _x.sent();\n return [4 /*yield*/, Test_SetHubOnline()];\n case 36:\n _x.sent();\n return [4 /*yield*/, Test_GetHubStatus()];\n case 37:\n _x.sent();\n return [4 /*yield*/, Test_GetHubLog()];\n case 38:\n hub_log_settings = _x.sent();\n return [4 /*yield*/, Test_SetHubLog(hub_log_settings)];\n case 39:\n _x.sent();\n return [4 /*yield*/, Test_AddCa()];\n case 40:\n _x.sent();\n return [4 /*yield*/, Test_EnumCa()];\n case 41:\n enum_ca = _x.sent();\n _d = 0, _e = enum_ca.CAList;\n _x.label = 42;\n case 42:\n if (!(_d < _e.length)) return [3 /*break*/, 46];\n ca = _e[_d];\n return [4 /*yield*/, Test_GetCa(ca.Key_u32)];\n case 43:\n _x.sent();\n return [4 /*yield*/, Test_DeleteCa(ca.Key_u32)];\n case 44:\n _x.sent();\n _x.label = 45;\n case 45:\n _d++;\n return [3 /*break*/, 42];\n case 46: return [4 /*yield*/, Test_CreateLink()];\n case 47:\n _x.sent();\n return [4 /*yield*/, Test_GetLink()];\n case 48:\n _x.sent();\n return [4 /*yield*/, Test_SetLink()];\n case 49:\n _x.sent();\n return [4 /*yield*/, Test_SetLinkOffline()];\n case 50:\n _x.sent();\n return [4 /*yield*/, Test_SetLinkOnline()];\n case 51:\n _x.sent();\n return [4 /*yield*/, Test_EnumLink()];\n case 52:\n enum_link = _x.sent();\n _f = 0, _g = enum_link.LinkList;\n _x.label = 53;\n case 53:\n if (!(_f < _g.length)) return [3 /*break*/, 56];\n link = _g[_f];\n return [4 /*yield*/, Test_GetLinkStatus(link.AccountName_utf)];\n case 54:\n _x.sent();\n _x.label = 55;\n case 55:\n _f++;\n return [3 /*break*/, 53];\n case 56: return [4 /*yield*/, new Promise(function (r) { return setTimeout(r, 3000); })];\n case 57:\n _x.sent();\n return [4 /*yield*/, Test_RenameLink()];\n case 58:\n _x.sent();\n return [4 /*yield*/, Test_DeleteLink()];\n case 59:\n _x.sent();\n return [4 /*yield*/, Test_AddAccess()];\n case 60:\n _x.sent();\n return [4 /*yield*/, Test_EnumAccess()];\n case 61:\n _x.sent();\n return [4 /*yield*/, Test_DeleteAccess()];\n case 62:\n _x.sent();\n return [4 /*yield*/, Test_SetAccessList()];\n case 63:\n _x.sent();\n return [4 /*yield*/, Test_CreateGroup()];\n case 64:\n _x.sent();\n return [4 /*yield*/, Test_SetGroup()];\n case 65:\n _x.sent();\n return [4 /*yield*/, Test_GetGroup()];\n case 66:\n _x.sent();\n return [4 /*yield*/, Test_CreateUser()];\n case 67:\n _x.sent();\n return [4 /*yield*/, Test_SetUser()];\n case 68:\n _x.sent();\n return [4 /*yield*/, Test_GetUser()];\n case 69:\n _x.sent();\n return [4 /*yield*/, Test_EnumUser()];\n case 70:\n _x.sent();\n return [4 /*yield*/, Test_EnumGroup()];\n case 71:\n _x.sent();\n return [4 /*yield*/, Test_DeleteUser()];\n case 72:\n _x.sent();\n return [4 /*yield*/, Test_DeleteGroup()];\n case 73:\n _x.sent();\n return [4 /*yield*/, Test_EnumSession()];\n case 74:\n enum_session = _x.sent();\n _h = 0, _j = enum_session.SessionList;\n _x.label = 75;\n case 75:\n if (!(_h < _j.length)) return [3 /*break*/, 79];\n session = _j[_h];\n return [4 /*yield*/, Test_GetSessionStatus(session.Name_str)];\n case 76:\n _x.sent();\n return [4 /*yield*/, Test_DeleteSession(session.Name_str)];\n case 77:\n _x.sent();\n _x.label = 78;\n case 78:\n _h++;\n return [3 /*break*/, 75];\n case 79: return [4 /*yield*/, Test_EnumMacTable()];\n case 80:\n enum_mac = _x.sent();\n _k = 0, _l = enum_mac.MacTable;\n _x.label = 81;\n case 81:\n if (!(_k < _l.length)) return [3 /*break*/, 84];\n mac = _l[_k];\n return [4 /*yield*/, Test_DeleteMacTable(mac.Key_u32)];\n case 82:\n _x.sent();\n _x.label = 83;\n case 83:\n _k++;\n return [3 /*break*/, 81];\n case 84: return [4 /*yield*/, Test_EnumIpTable()];\n case 85:\n enum_ip = _x.sent();\n _m = 0, _o = enum_ip.IpTable;\n _x.label = 86;\n case 86:\n if (!(_m < _o.length)) return [3 /*break*/, 89];\n ip = _o[_m];\n return [4 /*yield*/, Test_DeleteIpTable(ip.Key_u32)];\n case 87:\n _x.sent();\n _x.label = 88;\n case 88:\n _m++;\n return [3 /*break*/, 86];\n case 89: return [4 /*yield*/, Test_SetKeep()];\n case 90:\n _x.sent();\n return [4 /*yield*/, Test_GetKeep()];\n case 91:\n _x.sent();\n return [4 /*yield*/, Test_EnableSecureNAT()];\n case 92:\n _x.sent();\n return [4 /*yield*/, Test_GetSecureNATOption()];\n case 93:\n _x.sent();\n return [4 /*yield*/, Test_SetSecureNATOption()];\n case 94:\n _x.sent();\n return [4 /*yield*/, Test_EnumNAT()];\n case 95:\n _x.sent();\n return [4 /*yield*/, Test_EnumDHCP()];\n case 96:\n _x.sent();\n return [4 /*yield*/, Test_GetSecureNATStatus()];\n case 97:\n _x.sent();\n return [4 /*yield*/, Test_DisableSecureNAT()];\n case 98:\n _x.sent();\n return [4 /*yield*/, Test_EnumEthernet()];\n case 99:\n _x.sent();\n return [4 /*yield*/, Test_EnumLocalBridge()];\n case 100:\n _x.sent();\n return [4 /*yield*/, Test_GetBridgeSupport()];\n case 101:\n _x.sent();\n return [4 /*yield*/, Test_GetCaps()];\n case 102:\n _x.sent();\n return [4 /*yield*/, Test_GetConfig()];\n case 103:\n _x.sent();\n return [4 /*yield*/, Test_GetDefaultHubAdminOptions()];\n case 104:\n _x.sent();\n return [4 /*yield*/, Test_GetHubAdminOptions()];\n case 105:\n _x.sent();\n return [4 /*yield*/, Test_SetHubAdminOptions()];\n case 106:\n _x.sent();\n return [4 /*yield*/, Test_GetHubExtOptions()];\n case 107:\n _x.sent();\n return [4 /*yield*/, Test_SetHubExtOptions()];\n case 108:\n _x.sent();\n return [4 /*yield*/, Test_AddL3Switch()];\n case 109:\n _x.sent();\n return [4 /*yield*/, Test_AddL3If()];\n case 110:\n _x.sent();\n return [4 /*yield*/, Test_EnumL3Switch()];\n case 111:\n _x.sent();\n return [4 /*yield*/, Test_EnumL3If()];\n case 112:\n _x.sent();\n return [4 /*yield*/, Test_AddL3Table()];\n case 113:\n _x.sent();\n return [4 /*yield*/, Test_EnumL3Table()];\n case 114:\n _x.sent();\n return [4 /*yield*/, Test_DelL3Table()];\n case 115:\n _x.sent();\n return [4 /*yield*/, Test_StartL3Switch()];\n case 116:\n _x.sent();\n return [4 /*yield*/, Test_StopL3Switch()];\n case 117:\n _x.sent();\n return [4 /*yield*/, Test_DelL3If()];\n case 118:\n _x.sent();\n return [4 /*yield*/, Test_DelL3Switch()];\n case 119:\n _x.sent();\n return [4 /*yield*/, Test_AddCrl()];\n case 120:\n _x.sent();\n return [4 /*yield*/, Test_EnumCrl()];\n case 121:\n enum_crl = _x.sent();\n _p = 0, _q = enum_crl.CRLList;\n _x.label = 122;\n case 122:\n if (!(_p < _q.length)) return [3 /*break*/, 126];\n crl = _q[_p];\n return [4 /*yield*/, Test_GetCrl(crl.Key_u32)];\n case 123:\n got_crl = _x.sent();\n got_crl.CommonName_utf = got_crl.CommonName_utf + \"_a\";\n return [4 /*yield*/, Test_SetCrl(got_crl)];\n case 124:\n _x.sent();\n _x.label = 125;\n case 125:\n _p++;\n return [3 /*break*/, 122];\n case 126: return [4 /*yield*/, Test_EnumCrl()];\n case 127:\n enum_crl = _x.sent();\n _r = 0, _s = enum_crl.CRLList;\n _x.label = 128;\n case 128:\n if (!(_r < _s.length)) return [3 /*break*/, 131];\n crl = _s[_r];\n return [4 /*yield*/, Test_DelCrl(crl.Key_u32)];\n case 129:\n _x.sent();\n _x.label = 130;\n case 130:\n _r++;\n return [3 /*break*/, 128];\n case 131: return [4 /*yield*/, Test_SetAcList()];\n case 132:\n _x.sent();\n return [4 /*yield*/, Test_GetAcList()];\n case 133:\n _x.sent();\n return [4 /*yield*/, Test_EnumLogFile()];\n case 134:\n enum_log_file = _x.sent();\n _t = 0, _u = enum_log_file.LogFiles;\n _x.label = 135;\n case 135:\n if (!(_t < _u.length)) return [3 /*break*/, 138];\n log = _u[_t];\n return [4 /*yield*/, Test_ReadLogFile(log.FilePath_str)];\n case 136:\n _x.sent();\n return [3 /*break*/, 138];\n case 137:\n _t++;\n return [3 /*break*/, 135];\n case 138: return [4 /*yield*/, Test_SetSysLog(true)];\n case 139:\n _x.sent();\n return [4 /*yield*/, Test_GetSysLog()];\n case 140:\n _x.sent();\n return [4 /*yield*/, Test_SetSysLog(false)];\n case 141:\n _x.sent();\n return [4 /*yield*/, Test_SetHubMsg()];\n case 142:\n _x.sent();\n return [4 /*yield*/, Test_GetHubMsg()];\n case 143:\n _x.sent();\n return [4 /*yield*/, Test_GetAdminMsg()];\n case 144:\n _x.sent();\n return [4 /*yield*/, Test_Flush()];\n case 145:\n _x.sent();\n return [4 /*yield*/, Test_SetIPsecServices()];\n case 146:\n _x.sent();\n return [4 /*yield*/, Test_GetIPsecServices()];\n case 147:\n _x.sent();\n return [4 /*yield*/, Test_AddEtherIpId()];\n case 148:\n _x.sent();\n return [4 /*yield*/, Test_EnumEtherIpId()];\n case 149:\n enum_etherip_id = _x.sent();\n _v = 0, _w = enum_etherip_id.Settings;\n _x.label = 150;\n case 150:\n if (!(_v < _w.length)) return [3 /*break*/, 154];\n etherip_id = _w[_v];\n return [4 /*yield*/, Test_GetEtherIpId(etherip_id.Id_str)];\n case 151:\n _x.sent();\n return [4 /*yield*/, Test_DeleteEtherIpId(etherip_id.Id_str)];\n case 152:\n _x.sent();\n _x.label = 153;\n case 153:\n _v++;\n return [3 /*break*/, 150];\n case 154: return [4 /*yield*/, Test_SetOpenVpnSstpConfig()];\n case 155:\n _x.sent();\n return [4 /*yield*/, Test_GetOpenVpnSstpConfig()];\n case 156:\n _x.sent();\n return [4 /*yield*/, Test_GetDDnsClientStatus()];\n case 157:\n _x.sent();\n return [4 /*yield*/, Test_SetDDnsInternetSettng()];\n case 158:\n _x.sent();\n return [4 /*yield*/, Test_GetDDnsInternetSettng()];\n case 159:\n _x.sent();\n return [4 /*yield*/, Test_ChangeDDnsClientHostname()];\n case 160:\n _x.sent();\n return [4 /*yield*/, Test_RegenerateServerCert()];\n case 161:\n _x.sent();\n return [4 /*yield*/, Test_MakeOpenVpnConfigFile()];\n case 162:\n _x.sent();\n return [4 /*yield*/, Test_SetSpecialListener()];\n case 163:\n _x.sent();\n return [4 /*yield*/, Test_GetSpecialListener()];\n case 164:\n _x.sent();\n return [4 /*yield*/, Test_GetAzureStatus()];\n case 165:\n _x.sent();\n return [4 /*yield*/, Test_SetAzureStatus()];\n case 166:\n _x.sent();\n return [4 /*yield*/, Test_SetVgsConfig()];\n case 167:\n _x.sent();\n return [4 /*yield*/, Test_GetVgsConfig()];\n case 168:\n _x.sent();\n return [4 /*yield*/, Test_DeleteHub()];\n case 169:\n _x.sent();\n return [2 /*return*/];\n }\n });\n });\n}", "function Test_GetHub() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_create_hub, out_rpc_create_hub;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetHub\");\n in_rpc_create_hub = new VPN.VpnRpcCreateHub({\n HubName_str: hub_name\n });\n return [4 /*yield*/, api.GetHub(in_rpc_create_hub)];\n case 1:\n out_rpc_create_hub = _a.sent();\n console.log(out_rpc_create_hub);\n console.log(\"End: Test_GetHub\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function Test_EnumUser() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_enum_user, out_rpc_enum_user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_EnumUser\");\n in_rpc_enum_user = new VPN.VpnRpcEnumUser({\n HubName_str: hub_name\n });\n return [4 /*yield*/, api.EnumUser(in_rpc_enum_user)];\n case 1:\n out_rpc_enum_user = _a.sent();\n console.log(out_rpc_enum_user);\n console.log(\"End: Test_EnumUser\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function run(gen) {\n var args = [].slice.call( arguments, 1), it;\n // initialize the generator in the current context\n it = gen.apply( this, args );\n // return a promise for the generator completing\n return Promise.resolve()\n .then( function handleNext(value){\n // run to the next yielded value\n var next = it.next( value );\n return (function handleResult(next){\n // generator has completed running?\n if (next.done) {\n return next.value;\n }\n // otherwise keep going\n else {\n return Promise.resolve( next.value )\n .then(\n // resume the async loop on\n // success, sending the resolved\n // value back into the generator\n handleNext,\n // if `value` is a rejected\n // promise, propagate error back\n // into the generator for its own\n // error handling\n function handleErr(err) {\n return Promise.resolve(\n it.throw( err )\n )\n .then( handleResult );\n }\n );\n }\n })(next);\n } );\n}", "function run(generatorFn){\n\n // invoke the generator and store the iterator\n let it = generatorFn();\n\n // Use an IIFE to kick off the iteration process\n // We manually call .next on the first go to start the process\n // and then yielded promises will drive each iteration\n (function advanceIterator(current){\n // if the iterator ran to completion then nothing for us to do\n if(current.done) return;\n\n // otherwise we assume we were yielded a promise\n // wire it up to handle the promise and advance the iterator\n current.value\n .then(response => advanceIterator(it.next(response)))\n .catch(it.throw);\n\n })(it.next())\n}", "function async(generator) {\n // Creates an iterator through which we'll control the generator\n const iterator = generator();\n\n // Defines the function that will handle each value generated by the genrator\n function handle(iteratorResult) {\n // Stops when the generator has no more results\n if (iteratorResult.done) {\n return;\n }\n\n const iteratorValue = iteratorResult.value;\n\n // If the generated value is a promise, register a suucess and a failure callback.\n // This is the asynchronous part.\n // If the promise succeeds, great, resume the generator and send in the promised value.\n // If there's an error, through an exception to the generator.\n if (iteratorValue instanceof Promise) {\n iteratorValue.then((res) => handle(iterator.next(res))).catch((err) => iterator.throw(err));\n }\n }\n\n // Restarts the generator execution.\n try {\n handle(iterator.next());\n } catch (err) {\n iterator.throw(err);\n }\n}", "function testasync(callback){\n\n\tfs.readFile('test4.txt', (err, data) => {\n\t if (err) throw err;\n\t callback(data);\n\t});\n\n}", "function runGenerator(gen) {\n const generator = gen();\n\n function iterate(iteration) {\n if (iteration.done) return iteration.value;\n const promise = iteration.value;\n return promise.then(res => iterate(generator.next(res)));\n }\n\n return iterate(generator.next());\n }", "function spawn(gen) {\n const it = gen(); //instantiate the generator and return the generator object\n\n function _co(method, arg) {\n let res;\n\n try {\n //retrieve the promise returned by the http request if `arg` is undefined\n //if `arg` is defined it will be the data from the http request promise\n //and will be \"injected\" into `yield` and caught in a variable\n res = it[method](arg);\n } catch(err) {\n //not sure about the error handling here??\n return Promise.reject(err);\n }\n\n if (res.done) {\n if (method === 'throw') {\n return arg;\n } else {\n return res.value;\n }\n } else {\n //at this point we may resolve a promise or a value??\n //a) if we are resolving a promise we will inject it's value by calling `.next`\n //b) if we are resolving a value it will be ignored by `.next` as `yield` will be\n // the returned Promise from the http request\n return Promise.resolve(res.value)\n .then((val) => {\n return _co('next', val);\n }, (err) => {\n //not sure about the error handling here??\n return _co('throw', err);\n });\n }\n }\n\n return _co('next'); //start the process by calling `.next` on the generator instance\n}", "function Test_GetLinkStatus(name) {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_link_status, out_rpc_link_status;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetLinkStatus\");\n in_rpc_link_status = new VPN.VpnRpcLinkStatus({\n HubName_Ex_str: hub_name,\n AccountName_utf: name\n });\n return [4 /*yield*/, api.GetLinkStatus(in_rpc_link_status)];\n case 1:\n out_rpc_link_status = _a.sent();\n console.log(out_rpc_link_status);\n console.log(\"End: Test_GetLinkStatus\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function async(makeGenerator){\n return function () {\n var generator = makeGenerator.apply(this, arguments);\n\n function handle(result){\n // result => { done: [Boolean], value: [Object] }\n if (result.done) return Promise.resolve(result.value);\n\n return Promise.resolve(result.value).then(function (res){\n return handle(generator.next(res));\n }, function (err){\n return handle(generator.throw(err));\n });\n }\n\n try {\n return handle(generator.next());\n } catch (ex) {\n return Promise.reject(ex);\n }\n }\n}", "function main() {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var sourceFile, generatedFileName, apiName, error_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 3]);\n return [4 /*yield*/, Ambrosia.initializeAsync(Ambrosia.LBInitMode.CodeGen)];\n case 1:\n _b.sent();\n sourceFile = Utils.getCommandLineArg(\"sourceFile\");\n generatedFileName = (_a = Utils.getCommandLineArg(\"generatedFileName\", \"TestOutput\")) !== null && _a !== void 0 ? _a : \"TestOutput\";\n apiName = Path.basename(generatedFileName).replace(Path.extname(generatedFileName), \"\");\n // If want to run as separate generation steps for consumer and publisher\n //Meta.emitTypeScriptFileFromSource(sourceFile, { fileKind: Meta.GeneratedFileKind.Consumer, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFileName: generatedFileName+\"_Consumer\" });\n //Meta.emitTypeScriptFileFromSource(sourceFile, { fileKind: Meta.GeneratedFileKind.Publisher, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFileName: generatedFileName+\"_Publisher\" });\n // Use this for single call to generate both consumer and publisher\n Meta.emitTypeScriptFileFromSource(sourceFile, { apiName: apiName, fileKind: Meta.GeneratedFileKind.All, mergeType: Meta.FileMergeType.None, emitGeneratedTime: false, generatedFilePrefix: generatedFileName, strictCompilerChecks: false });\n return [3 /*break*/, 3];\n case 2:\n error_1 = _b.sent();\n Utils.tryLog(error_1);\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/];\n }\n });\n });\n}", "function asyncAdapter(generator) {\n return function () {\n var g = generator.apply(this, arguments);\n\n function handle(result) {\n if (result.done) {\n return $p.resolve(result.value);\n }\n return $p.resolve(result.value)\n .then(function (res) {\n return handle(g.next(res));\n }, function (err) {\n return handle(g.throw(err));\n });\n }\n\n return handle(g.next());\n };\n }", "function asyncAdapter(generator) {\n return function () {\n var g = generator.apply(this, arguments);\n\n function handle(result) {\n if (result.done) {\n return $p.resolve(result.value);\n }\n return $p.resolve(result.value)\n .then(function (res) {\n return handle(g.next(res));\n }, function (err) {\n return handle(g.throw(err));\n });\n }\n\n return handle(g.next());\n }\n }", "function runTest(testFunction, test) {\n async.series([\n async.apply(loadConfig),\n async.apply(testFunction)\n ],\n\n function(err) {\n test.finish();\n });\n}", "function Test_GetFarmSetting() {\n return __awaiter(this, void 0, void 0, function () {\n var out_rpc_farm;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetFarmSetting\");\n return [4 /*yield*/, api.GetFarmSetting()];\n case 1:\n out_rpc_farm = _a.sent();\n console.log(out_rpc_farm);\n console.log(\"End: Test_GetFarmSetting\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function setup() {\n return __awaiter(this, void 0, void 0, function* () {\n console.log('\\nPreparing instance for tests...');\n try {\n // Verify API user can login\n const loginInfo = yield api_1.login(config_1.apiUser);\n if (loginInfo.status !== 'success') {\n throw new Error(`API user (${config_1.apiUser.username}) could not login`);\n }\n else {\n console.log(`API user (${config_1.apiUser.username}) logged in`);\n }\n // Verify or create user for bot\n let botInfo = yield userInfo(config_1.botUser.username);\n if (!botInfo || !botInfo.success) {\n console.log(`Bot user (${config_1.botUser.username}) not found`);\n botInfo = yield createUser(config_1.botUser);\n if (!botInfo.success) {\n throw new Error(`Bot user (${config_1.botUser.username}) could not be created`);\n }\n else {\n console.log(`Bot user (${config_1.botUser.username}) created`);\n }\n }\n else {\n console.log(`Bot user (${config_1.botUser.username}) exists`);\n }\n // Verify or create mock user for talking to bot\n let mockInfo = yield userInfo(config_1.mockUser.username);\n if (!mockInfo || !mockInfo.success) {\n console.log(`Mock user (${config_1.mockUser.username}) not found`);\n mockInfo = yield createUser(config_1.mockUser);\n if (!mockInfo.success) {\n throw new Error(`Mock user (${config_1.mockUser.username}) could not be created`);\n }\n else {\n console.log(`Mock user (${config_1.mockUser.username}) created`);\n }\n }\n else {\n console.log(`Mock user (${config_1.mockUser.username}) exists`);\n }\n // Verify or create channel for tests\n let testChannelInfo = yield channelInfo({ roomName: exports.testChannelName });\n if (!testChannelInfo || !testChannelInfo.success) {\n console.log(`Test channel (${exports.testChannelName}) not found`);\n testChannelInfo = yield createChannel(exports.testChannelName);\n if (!testChannelInfo.success) {\n throw new Error(`Test channel (${exports.testChannelName}) could not be created`);\n }\n else {\n console.log(`Test channel (${exports.testChannelName}) created`);\n }\n }\n else {\n console.log(`Test channel (${exports.testChannelName}) exists`);\n }\n // Verify or create private room for tests\n let testPrivateInfo = yield privateInfo({ roomName: exports.testPrivateName });\n if (!testPrivateInfo || !testPrivateInfo.success) {\n console.log(`Test private room (${exports.testPrivateName}) not found`);\n testPrivateInfo = yield createPrivate(exports.testPrivateName, [\n config_1.apiUser.username, config_1.botUser.username, config_1.mockUser.username\n ]);\n if (!testPrivateInfo.success) {\n throw new Error(`Test private room (${exports.testPrivateName}) could not be created`);\n }\n else {\n console.log(`Test private room (${exports.testPrivateName}) created`);\n }\n }\n else {\n console.log(`Test private room (${exports.testPrivateName}) exists`);\n }\n yield api_1.logout();\n }\n catch (e) {\n throw e;\n }\n });\n}", "function Test_GetSpecialListener() {\n return __awaiter(this, void 0, void 0, function () {\n var out_rpc_special_listener;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetSpecialListener\");\n return [4 /*yield*/, api.GetSpecialListener()];\n case 1:\n out_rpc_special_listener = _a.sent();\n console.log(out_rpc_special_listener);\n console.log(\"End: Test_GetSpecialListener\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "async *[Symbol.asyncIterator]() {}", "function Test_RenameLink() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_rename_link, out_rpc_rename_link;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_RenameLink\");\n in_rpc_rename_link = new VPN.VpnRpcRenameLink({\n HubName_str: hub_name,\n OldAccountName_utf: \"linktest\",\n NewAccountName_utf: \"linktest2\"\n });\n return [4 /*yield*/, api.RenameLink(in_rpc_rename_link)];\n case 1:\n out_rpc_rename_link = _a.sent();\n console.log(out_rpc_rename_link);\n console.log(\"End: Test_RenameLink\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function run(generator) {\n\tconst iterator = generator()\n\n\tfunction iterate(iteration) {\n\t\tif(iteration.done) return iteration.value\n\t\treturn iteration.value.then(x => iterate(iterator.next(x)))\n\t}\n\n\treturn iterate(iterator.next())\n}", "asyncGen(iterable) {\n\n var iter = _es6now.iter(iterable),\n state = \"paused\",\n queue = [];\n\n return {\n\n next(val) { return enqueue(\"next\", val) },\n throw(val) { return enqueue(\"throw\", val) },\n return(val) { return enqueue(\"return\", val) },\n [Symbol.asyncIterator]() { return this }\n };\n\n function enqueue(type, value) {\n\n var resolve, reject;\n var promise = new Promise((res, rej) => (resolve = res, reject = rej));\n\n queue.push({ type, value, resolve, reject });\n\n if (state === \"paused\")\n next();\n\n return promise;\n }\n\n function next() {\n\n if (queue.length > 0) {\n\n state = \"running\";\n var first = queue[0];\n resume(first.type, first.value);\n\n } else {\n\n state = \"paused\";\n }\n }\n\n function resume(type, value) {\n\n if (type === \"return\" && !(type in iter)) {\n\n // If the generator does not support the \"return\" method, then\n // emulate it (poorly) using throw\n type = \"throw\";\n value = { value, __return: true };\n }\n\n try {\n\n var result = iter[type](value),\n value = result.value;\n\n if (typeof value === \"object\" && \"_es6now_await\" in value) {\n\n if (result.done)\n throw new Error(\"Invalid async generator return\");\n\n Promise.resolve(value._es6now_await).then(\n x => resume(\"next\", x),\n x => resume(\"throw\", x));\n\n return;\n\n } else {\n\n queue.shift().resolve(result);\n }\n\n } catch (x) {\n\n if (x && x.__return === true)\n queue.shift().resolve({ value: x.value, done: true });\n else\n queue.shift().reject(x);\n }\n\n next();\n }\n }", "function generateTest() {\n // TODO\n}", "function asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}", "function asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}", "function asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}", "function asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}", "function asyncFromGen(genFn) {\r\n return function () {\r\n var gen = genFn.apply(this, arguments);\r\n var boundNext = bind(gen.next);\r\n var boundThrow = bind(gen.throw);\r\n return new Promise(function (resolve, reject) {\r\n function invoke(method, argument) {\r\n try {\r\n var result = method.call(gen, argument);\r\n }\r\n catch (error) {\r\n return reject(error);\r\n }\r\n var next = result.done ? resolve : invokeNext;\r\n if (isPromiseLike(result.value)) {\r\n result.value.then(next, result.done ? reject : invokeThrow);\r\n }\r\n else {\r\n next(result.value);\r\n }\r\n }\r\n var invokeNext = function (value) { return invoke(boundNext, value); };\r\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\r\n invokeNext();\r\n });\r\n };\r\n}", "function Test_GetHubStatus() {\n return __awaiter(this, void 0, void 0, function () {\n var in_rpc_hub_status, out_rpc_hub_status;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n console.log(\"Begin: Test_GetHubStatus\");\n in_rpc_hub_status = new VPN.VpnRpcHubStatus({\n HubName_str: hub_name\n });\n return [4 /*yield*/, api.GetHubStatus(in_rpc_hub_status)];\n case 1:\n out_rpc_hub_status = _a.sent();\n console.log(out_rpc_hub_status);\n console.log(\"End: Test_GetHubStatus\");\n console.log(\"-----\");\n console.log();\n return [2 /*return*/];\n }\n });\n });\n}", "function asyncFromGen(genFn) {\n return function () {\n var gen = genFn.apply(this, arguments);\n var boundNext = bind(gen.next);\n var boundThrow = bind(gen.throw);\n return new Promise(function (resolve, reject) {\n function invoke(method, argument) {\n try {\n var result = method.call(gen, argument);\n }\n catch (error) {\n return reject(error);\n }\n var next = result.done ? resolve : invokeNext;\n if (isPromiseLike(result.value)) {\n result.value.then(next, result.done ? reject : invokeThrow);\n }\n else {\n next(result.value);\n }\n }\n var invokeNext = function (value) { return invoke(boundNext, value); };\n var invokeThrow = function (error) { return invoke(boundThrow, error); };\n invokeNext();\n });\n };\n}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}", "function Generator() {}" ]
[ "0.74793214", "0.7470799", "0.7167396", "0.686909", "0.6646867", "0.6463009", "0.6463009", "0.6422385", "0.63445276", "0.63445276", "0.63445276", "0.6327872", "0.6322496", "0.62177676", "0.620974", "0.61521703", "0.6121818", "0.6117581", "0.61064905", "0.60528594", "0.60478336", "0.60312563", "0.6021247", "0.60188985", "0.6010669", "0.60049284", "0.60021996", "0.60012937", "0.59890443", "0.5986408", "0.5976213", "0.5960457", "0.5953517", "0.59506065", "0.5949681", "0.59410506", "0.5926868", "0.59190124", "0.59124523", "0.5912266", "0.5911244", "0.5909417", "0.5897137", "0.5895335", "0.58867574", "0.5879026", "0.5879026", "0.5879026", "0.5879026", "0.5879026", "0.5872865", "0.5863393", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965", "0.58593965" ]
0.8032856
1
Wait for the layoutviewupdated event
function waitForUpdate(inspector) { return inspector.once("layoutview-updated"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onLayoutModified() {\n void this._layoutDebouncer.invoke();\n }", "firstLayoutCompleted() {\n if (!this.hideBlurryPlaceholder_()) {\n this.togglePlaceholder(false);\n }\n }", "setNeedsLayout() {\n\t\tif(this._layoutTimerId == null) {\n\t\t \tthis._layoutTimerId = setTimeout( () => {\n\t\t \t\tthis.layout();\t\t\t\n\t\t \t\tthis._layoutTimerId = null;\n\t\t \t}, 0);\n\t\t}\n\t}", "function updateLayout(element, viewState, lastViewState) {\n /// <param name=\"element\" domElement=\"true\" />\n var listView = element.querySelector(\".resultslist\").winControl;\n if (lastViewState !== viewState) {\n if (lastViewState === appViewState.snapped || viewState === appViewState.snapped) {\n var handler = function (e) {\n listView.removeEventListener(\"contentanimating\", handler, false);\n e.preventDefault();\n }\n listView.addEventListener(\"contentanimating\", handler, false);\n var firstVisible = listView.indexOfFirstVisible;\n this._initializeLayout(listView, viewState);\n if (firstVisible >= 0 && listView.itemDataSource.list.length > 0) {\n listView.indexOfFirstVisible = firstVisible;\n }\n }\n }\n }", "function AppLayoutChangedHandler(e) {\n\t\tconsole.log('AppLayoutChangedHandler');\n\t\tif (showingHelp) {\n\t\t\tlocalUpdate();\n\t\t}\n\t}", "scheduleLayoutUpdate() {\n qx.ui.core.queue.Layout.add(this);\n }", "function triggerDOMRefresh() {\n\t if (view._isShown && view._isRendered && Marionette.isNodeAttached(view.el)) {\n\t Marionette.triggerMethodOn(view, 'dom:refresh', view);\n\t }\n\t }", "updateLayout() {\n if ( !this.isLocked ) {\n this.lock();\n\n this.layout();\n\n this.unlock();\n }\n }", "performLayoutUpdate () {\n this.component.layout ();\n this.stale = this.rows.length !== this.component.getRows ().length;\n\n if (this.stale) {\n next (this, 'performLayoutUpdate');\n }\n\n return this.stale;\n }", "function triggerDOMRefresh() {\n if (view._isShown && view._isRendered && Marionette.isNodeAttached(view.el)) {\n Marionette.triggerMethodOn(view, 'dom:refresh', view);\n }\n }", "function triggerDOMRefresh() {\n if (view._isShown && view._isRendered && Marionette.isNodeAttached(view.el)) {\n Marionette.triggerMethodOn(view, 'dom:refresh', view);\n }\n }", "updateLayoutAutomatically() {\n if ( this._enabled ) {\n this.updateLayout();\n }\n }", "function viewRenderComplete() {\n $container.trigger(topologyConstants.events.viewRenderComplete, {}); // Private Event\n }", "function Layout_PerformLayoutAsynch(objElement,intTimeOut)\r\n{\r\n // Replace empty timeout in default 50 mili-seconds.\r\n if(intTimeOut==null)\r\n {\r\n intTimeOut = 50;\r\n }\r\n \r\n // Perform layout with timeout.\t\r\n Aux_InvokeCallbackDelegateWithDelay(new Aux_CallbackDelegate(Layout_PerformLayout,objElement),intTimeOut);\r\n}", "function onAfterlayout(container/*:Container*/, layout/*:ContainerLayout*/)/*:void*/ {\n this.removeListener('afterlayout',AS3.bind( this,\"onAfterlayout$EBEj\"), this);\n this.layoutInitialized$EBEj = true;\n if (this.activeItemId$EBEj != null)\n this.setMyActiveItem$EBEj(this.activeItemId$EBEj);\n }", "relayout() {\n dispatchSimpleEvent(this, 'relayout', true);\n }", "get layoutModified() {\n return this._layoutModified;\n }", "function refreshLayout() {\n\tconsole.log(\"Refreshing layout...\");\n\t$thumbsPackery.packery();\n\t$unusedPackery.packery();\n}", "updateLayout() {\n this._updateColumnSizes();\n this._updateCollapseButtonPos();\n }", "update() {\n this._checkEvents();\n }", "_triggerUpdated() {\n\t if (!this.updating) {\n\t this.updating = true;\n\t const update = () => {\n\t this.updating = false;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-updated', this);\n\t };\n\t if (this._checkSync()) {\n\t update();\n\t }\n\t else {\n\t setTimeout(update);\n\t }\n\t }\n\t }", "componentDidUpdate() {\n LayoutAnimation.configureNext(CustomLayoutSpring());\n }", "function requestLayout() {\n clearContainer();\n items.forEach((item) => layout(item));\n }", "didSwitchLayout(clear) {\n this.render(clear);\n }", "function layoutChanged(page) {\n if (!$layout.length) return false;\n if (!lastPage || lastPage.fixlayout || lang(lastPage) !== lang(page)) return true;\n var currentlayout = $layout.attr('data-render-layout') || 'main-layout';\n var newlayout = generator.layoutTemplate(page);\n return (newlayout !== currentlayout);\n }", "function viewDidUpdate() {\n // stub\n }", "function updateLayoutMeasurement(visualElement) {\n if (visualElement.shouldResetTransform())\n return;\n var layoutState = visualElement.getLayoutState();\n visualElement.notifyBeforeLayoutMeasure(layoutState.layout);\n layoutState.isHydrated = true;\n layoutState.layout = visualElement.measureViewportBox();\n layoutState.layoutCorrected = (0,_utils_geometry_index_js__WEBPACK_IMPORTED_MODULE_2__.copyAxisBox)(layoutState.layout);\n visualElement.notifyLayoutMeasure(layoutState.layout, visualElement.prevViewportBox || layoutState.layout);\n framesync__WEBPACK_IMPORTED_MODULE_0__.default.update(function () { return visualElement.rebaseProjectionTarget(); });\n}", "function updateLayoutMeasurement(visualElement) {\n if (visualElement.shouldResetTransform())\n return;\n var layoutState = visualElement.getLayoutState();\n visualElement.notifyBeforeLayoutMeasure(layoutState.layout);\n layoutState.isHydrated = true;\n layoutState.layout = visualElement.measureViewportBox();\n layoutState.layoutCorrected = (0,_utils_geometry_index_js__WEBPACK_IMPORTED_MODULE_2__.copyAxisBox)(layoutState.layout);\n visualElement.notifyLayoutMeasure(layoutState.layout, visualElement.prevViewportBox || layoutState.layout);\n framesync__WEBPACK_IMPORTED_MODULE_0__.default.update(function () { return visualElement.rebaseProjectionTarget(); });\n}", "_bindingCompleteHandler() {\n const that = this;\n\n if (!that.$.listBox) {\n return;\n }\n\n requestAnimationFrame(() => {\n that._setDropDownSize();\n that._positionDetection.checkBrowserBounds();\n });\n }", "function onReady()\n {\n var layout_selector = $(\"#id_layout\");\n if(layout_selector.length == 0) // readonly field.\n return;\n fluent_layouts._select_single_option( layout_selector );\n layout_selector.change( fluent_layouts.onLayoutChange );\n fluent_contents.layout.onInitialize( fluent_layouts.fetch_layout_on_refresh );\n }", "updated () {\n this.dispatchSizeChange()\n }", "function handleRender() {\n\t view._isRendered = true;\n\t triggerDOMRefresh();\n\t }", "function updateLayoutMeasurement(visualElement) {\n if (visualElement.shouldResetTransform())\n return;\n var layoutState = visualElement.getLayoutState();\n visualElement.notifyBeforeLayoutMeasure(layoutState.layout);\n layoutState.isHydrated = true;\n layoutState.layout = visualElement.measureViewportBox();\n layoutState.layoutCorrected = copyAxisBox(layoutState.layout);\n visualElement.notifyLayoutMeasure(layoutState.layout, visualElement.prevViewportBox || layoutState.layout);\n es.update(function () { return visualElement.rebaseProjectionTarget(); });\n}", "function islayoutready() {\n\t\treturn window.innerWidth > 0;\n\t}", "function layoutUpdateHandler(){\r\n currentMode = document.querySelector(\".flexPlayerOuter\").className.split(' ')[1];\r\n switchChat();\r\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "function handleRender() {\n view._isRendered = true;\n triggerDOMRefresh();\n }", "endUpdate(){\n if (this.nativeElement.isRendered) {\n this.nativeElement.endUpdate();\n }\n else\n {\n this.nativeElement.whenRendered(() => {\n this.nativeElement.endUpdate();\n });\n }\n }", "function _checkInView() {\n var viewport = {\n top: 0,\n bottom: getViewportHeight()\n };\n var callbacks = [];\n\n watchingItems.forEach(function (item) {\n var bounds = getBoundingClientRect(item.element[0]);\n\n if (bounds.top < viewport.bottom && bounds.bottom >= viewport.top) {\n callbacks.push(item.callback);\n }\n });\n\n callbacks.forEach(function (callback) {\n callback();\n });\n }", "function lateRender() {\n\t\tsetTimeout( function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\t\t\trenderView();\n\t\t\t\t\t}\n\t\t\t\t}, 0);\n\t}", "__layoutChanged(value, oldValue) {\n if (value === \"\") return\n this.getCSS(value)\n this.getHTML(value)\n }", "function onUpdateReady() {\n ctrl.updateAvailable(true);\n m.redraw();\n }", "function detectChangesInternal(hostView, component) {\n var hostTView = hostView[TVIEW];\n var oldView = enterView(hostView, hostView[HOST_NODE]);\n var templateFn = hostTView.template;\n var viewQuery = hostTView.viewQuery;\n try {\n namespaceHTML();\n createViewQuery(viewQuery, hostView[FLAGS], component);\n templateFn(getRenderFlags(hostView), component);\n refreshDescendantViews();\n updateViewQuery(viewQuery, component);\n }\n finally {\n leaveView(oldView);\n }\n}", "function viewWillUpdate() {\n // update state\n }", "function onResize() {\n\t\t\t\t\tasyncDigestDebounced.add(checkWindowForRebuild);\n\t\t\t\t}", "updateView() {\n this.viewValue = this.getViewFromValue();\n this.renderView();\n }", "function onResize() {\n asyncDigestDebounced.add(checkWindowForRebuild);\n }", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function lateRender() {\n\t\tsetTimeout(function() { // IE7 needs this so dimensions are calculated correctly\n\t\t\tif (!currentView.start && bodyVisible()) { // !currentView.start makes sure this never happens more than once\n\t\t\t\trenderView();\n\t\t\t}\n\t\t},0);\n\t}", "function delayedExpandedLayout() {\n\t//$(document).trigger('beforeExpand');\n\t$(document).trigger('adm_expand');\n}", "function delayedExpandedLayout() {\n\t//$(document).trigger('beforeExpand');\n\t$(document).trigger('adm_expand');\n}", "function waitForCategoryDeleteView() {\n\t\tbrowser.wait(categoryDeleteView.isPresent.bind(categoryDeleteView), 3000, \"Timeout waiting for view to render\");\n\t}", "unlayout() {\n if (\n this.state_ == ResourceState_Enum.NOT_BUILT ||\n this.state_ == ResourceState_Enum.NOT_LAID_OUT ||\n this.state_ == ResourceState_Enum.READY_FOR_LAYOUT\n ) {\n return;\n }\n if (this.abortController_) {\n this.abortController_.abort();\n this.abortController_ = null;\n }\n this.setInViewport(false);\n if (this.element.unlayoutCallback()) {\n this.element.togglePlaceholder(true);\n this.state_ = ResourceState_Enum.NOT_LAID_OUT;\n this.layoutCount_ = 0;\n this.layoutPromise_ = null;\n }\n }", "function triggerDOMRefresh(view){\r\n if (view._isShown && view._isRendered){\r\n if (_.isFunction(view.triggerMethod)){\r\n view.triggerMethod(\"dom:refresh\");\r\n }\r\n }\r\n }", "handleLayout(event) {\n // Store the height of the view\n var {x, y, width, height} = event.nativeEvent.layout;\n this.height = height;\n }", "function update() {\n redrawView(evalContainer, evalVis, evalData);\n redrawView(detailContainer, detailVis, detailData);\n redrawView(messageContainer, messageVis, messageData);\n }", "onViewportResize() {// TODO: Could do something cheaper\n // Refresh without discarding any available layouts\n // this.scheduler.refresh(); // Seems not needed? Will be updated by horizontal scroll anyway\n }", "in_view_cb () {\n if (this.in_view_cbs.length > 0) {\n this.in_view_cbs.forEach((cb) => {\n cb.run();\n });\n } else {\n console.warn(\n 'Watch.js: No functions have been set for when this element comes in to view'\n ); /* RemoveLogging:skip */\n }\n }", "onAfterAttach(msg) {\n super.onAfterAttach(msg);\n this._hasRefreshedSinceAttach = false;\n if (this.isVisible) {\n this.update();\n }\n }", "function onPageChange(layout) {\n onPageUpdate(layout);\n updatePageNavigation();\n updateSettings();\n }", "attached() {\n const that = this;\n\n super.attached();\n\n if (!that.isCompleted) {\n return;\n }\n\n if (that._defaultFooterTemplateApplied) {\n that._addCalendarFooterListeners();\n }\n\n if (that.$.timePickerDropDown) {\n that._addTimePickerListener();\n }\n\n that._positionDetection.dropDownAttached();\n }", "function componentRefresh(adjustedElementIndex){var lView=getLView();ngDevMode&&assertDataInRange(lView,adjustedElementIndex);var hostView=getComponentViewByIndex(adjustedElementIndex,lView);ngDevMode&&assertNodeType(lView[TVIEW].data[adjustedElementIndex],3/* Element */);// Only attached CheckAlways components or attached, dirty OnPush components should be checked\nif(viewAttached(hostView)&&hostView[FLAGS]&(4/* CheckAlways */|8/* Dirty */)){syncViewWithBlueprint(hostView);checkView(hostView,hostView[CONTEXT]);}}", "function waitViewerToLoad() {\n\t\tif(!document.VLVChart)\n\t\t{\n\t\t\t// not loaded, try again in 200ms\n\t\t\tsetTimeout(waitViewerToLoad, 200);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// loaded. Poll events\n\t\t\tobjChart = document.VLVChart;\n\t\t\tPollEvent();\n\t\t\t// execute callback function\n\t\t\tif(cb) {\n\t\t\t\tcb(this);\n\t\t\t}\n\t\t}\n\t}", "onCustomWidgetAfterUpdate(oChangedProperties) {\n if (this._firstConnection){\n this.redraw();\n }\n \n \n }", "function handleVisibilityChange() {\n if (!document.webkitHidden) {\n checkUpdate();\n }\n }", "beginUpdate(){\n if (this.nativeElement.isRendered) {\n this.nativeElement.beginUpdate();\n }\n else\n {\n this.nativeElement.whenRendered(() => {\n this.nativeElement.beginUpdate();\n });\n }\n }", "function handleRender(view){\r\n view._isRendered = true;\r\n triggerDOMRefresh(view);\r\n }", "forceRefreshView() \n {\n this.dispatchEvent(new CustomEvent(\"forceRefreshView\", { detail: null }));\n }", "function refresh() {\n\t\t\tself.getNodePosition();\n\t\t\tself.getViewPortSize();\n\t\t\tcheck(null, {});\n\t\t}", "refresh() {\n this._resizeEventHandler();\n }", "onViewChange() {\n \n }", "_triggerLoaded() {\n\t if (this._alreadyLoaded) {\n\t // Do not trigger event twice\n\t this._triggerUpdated();\n\t return;\n\t }\n\t this._alreadyLoaded = true;\n\t const registry = storage.getRegistry(this._instance);\n\t const events = registry.events;\n\t events.fire('view-loaded', this);\n\t // Trigger onLoad event for child view\n\t if (this.onLoad !== null) {\n\t const onLoad = this.onLoad;\n\t this.onLoad = null;\n\t onLoad();\n\t }\n\t }", "function handleRender(view) {\n view._isRendered = true;\n triggerDOMRefresh(view);\n }", "update() {\n if (!this.valid) {\n if (this.width > 0 && this.height > 0) {\n this.valid = true;\n this.dispatchEvent(Event_1.Event.getEvent(\"loaded\"));\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('loaded', this);\n // this.emit('update', this);\n }\n }\n else {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.dispatchEvent(Event_1.Event.getEvent(\"update\"));\n // this.emit('update', this);\n }\n }", "function updateViews(event) {\n manageContentObjectsByState(event.currentState);\n fillElements(event.currentState);\n setNavigationButtonsDisabledState(event.currentState);\n resetViews();\n }", "check() {\n const el = this.refs.myview,\n rect = el.measure((ox, oy, width, height, pageX, pageY) => {\n this.setState({\n rectTop: pageY,\n rectBottom: pageY + height,\n rectWidth: pageX + width,\n })\n });\n\n const isVisible = (\n this.state.rectBottom != 0 && this.state.rectTop >= 0 && this.state.rectBottom <= window.height &&\n this.state.rectWidth > 0 && this.state.rectWidth <= window.width\n );\n\n // notify the parent when the value changes\n if (this.lastValue !== isVisible) {\n this.lastValue = isVisible;\n this.props.onChange(isVisible);\n }\n }", "function layout_tick() {\n\n // update rect position on drag\n if (mousedown && svg.classed('ctrl')) {\n updateNodePositions();\n drawPaths();\n updateDistances();\n }\n}", "refresh() {\n this.bodyComponent.recalcLayout();\n }", "ngAfterViewChecked() { }", "_changed() {\n reload_articles_on_drawer_close();\n }", "function useComponentDidMountWithLayout(callback) {\n useLayoutEffect(callback, []);\n}", "out_view_cb () {\n if (this.out_view_cbs.length > 0) {\n this.out_view_cbs.forEach((cb) => {\n cb.run();\n });\n } else {\n console.warn(\n 'Watch.js: No functions have been set for when this element goes out of view'\n ); /* RemoveLogging:skip */\n }\n }", "function triggerDOMRefresh(view) {\n if (view._isShown && view._isRendered && isInDOM(view)) {\n if (_.isFunction(view.triggerMethod)) {\n view.triggerMethod('dom:refresh');\n }\n }\n }", "function dOkUpdateEvent() {\n $log.debug('Select constraints for update path Dialog OK button pressed');\n //TODO\n var endPoint = isChecked('vn-update-endpoints-val');\n var constraints = isChecked('vn-update-endpoints-val');\n if (endPoint) {\n var type = 'endpoints';\n } else if (constraints) {\n var type = 'constraints';\n }\n\n handlerMapUpdConstr[showVnInfoMsgUpdateCnstrs] = showVnQueryInfoUpdateConstrts;\n wss.bindHandlers(handlerMapUpdConstr);\n\n handlerMapUpdEnd[showVnInfoMsgUpdateEndpts] = showVnQueryInfoUpdateEndptsHandle;\n wss.bindHandlers(handlerMapUpdEnd);\n\n wss.sendEvent(vnUpdatemsgHandle, {\n vnid: vnName,\n type: type\n });\n\n flash.flash('update path message');\n\n }", "_onUpdateDisplay() {}", "afterupdate (el) {\n console.log('Component was updated')\n }", "function InitMaterialLayout($rootScope, $timeout) {\n $rootScope.$on('$viewContentLoaded', function(event) {\n $timeout(function() {\n var element = document.querySelector('.mdl-layout');\n // This will make sure the MaterialLayout isn't initialized\n // on page load so we can do it manually\n element.classList.add('mdl-js-layout');\n componentHandler.upgradeElement(element, 'MaterialLayout');\n });\n });\n }", "invalidateLayoutCache() {\n // this.debug(\"Mark layout invalid!\");\n\n this.__hasInvalidLayout = true;\n this.__sizeHint = null;\n }", "componentDidUpdate() {\n\t\tthis.processCallbackData();\n\t}", "function resizeHandler() {\n var layout = getLayoutFromSize(container.offsetWidth);\n if (layout !== container.dataset.grid) {\n container.dataset.grid = layout;\n listeners.forEach(function(listener) {\n listener();\n })\n }\n }", "_pollViews() {\n this._pollViewsRecurse(this.views);\n }", "_pollViews() {\n this._pollViewsRecurse(this.views);\n }", "on_resize_complete() {\n // mostly harmless // time_error(`Widget ${this.name} (${this.typename}) does not implement on_resize_complete()`)\n }", "function delayOnVisibilityChange() {\n if ($document[0].hidden) {\n poller.delayAll();\n } else {\n poller.resetDelay();\n }\n }", "function update() {\n\t\t\n\t\t// Call measure each time before we update to make sure all our our layout properties are set correctly\n\t\tmeasure();\n\t\t\n\t\t// Layout all of our primary SVG d3.elements.\n\t\tsvg.attr(\"width\", size.measuredWidth).attr(\"height\", size.measuredHeight);\n\t\tbackground.attr(\"width\", size.measuredWidth).attr(\"height\", size.measuredHeight);\n\t\tplot.attr('transform','translate(' + size.left + ',' + size.top + ')')\n\t\t\n\t\tscope.dispatch.apply('updated', viz);\n\t\t\n\t}", "function doubleCheckHeight(){\r\n for(var i = 1; i < 4; i++){\r\n g_doubleCheckHeightId = setTimeout(adjustToNewViewport, 350 * i);\r\n }\r\n }", "__onLayout(e, key) {\n const {\n height,\n } = e.nativeEvent.layout;\n const {\n onItemPlaced,\n } = this.props;\n this.requestAnimationFrame(() => {\n const {\n items,\n } = this.state;\n const heights = this.__getColumnHeights(\n this.props,\n this.state,\n );\n const item = this.props.items\n .filter((item) => item.key === key)[0];\n const parentKeys = this.props.items\n .map(({ key }) => key);\n const minHeight = Math.min(...heights);\n const column = heights.indexOf(minHeight);\n this.setState(\n {\n // XXX: Here, alongside updating the item position,\n // we also clean out any keys which are no longer\n // referenced by the parent.\n items: Object.entries({\n ...items,\n [key]: {\n height,\n column,\n },\n })\n .filter((entry) => {\n return parentKeys.indexOf(entry[0]) >= 0;\n })\n .reduce(\n (obj, entry) => {\n return ({\n ...obj,\n [entry[0]]: entry[1],\n });\n },\n {},\n ),\n },\n () => {\n return onItemPlaced(\n item,\n );\n },\n );\n });\n }" ]
[ "0.67233354", "0.65272635", "0.6435272", "0.634359", "0.6277275", "0.6096522", "0.60790145", "0.60026866", "0.5986481", "0.5981656", "0.5981656", "0.596828", "0.5964057", "0.59005827", "0.5887196", "0.58841723", "0.58275425", "0.57844794", "0.5735373", "0.56895703", "0.5685335", "0.56605923", "0.56109756", "0.560593", "0.55813336", "0.554613", "0.55375856", "0.55375856", "0.5507251", "0.5490343", "0.5471004", "0.5440698", "0.5440362", "0.5439298", "0.54387915", "0.54238313", "0.54238313", "0.5416101", "0.5401234", "0.53936446", "0.5393429", "0.5391267", "0.5381211", "0.5333669", "0.53268296", "0.53243715", "0.5323986", "0.5316798", "0.5316798", "0.5316798", "0.5316798", "0.5316798", "0.5303125", "0.5303125", "0.52916497", "0.5289434", "0.5288365", "0.5285897", "0.5280422", "0.52755904", "0.52680814", "0.52616787", "0.52604204", "0.52594227", "0.5255705", "0.52513826", "0.5250971", "0.52416295", "0.52373135", "0.52322066", "0.52319634", "0.5220826", "0.52189535", "0.52179855", "0.52141994", "0.5214147", "0.519922", "0.5198193", "0.51958483", "0.519299", "0.5191089", "0.5190007", "0.5187178", "0.51832205", "0.5180315", "0.5178335", "0.5176669", "0.51725197", "0.517171", "0.51668143", "0.5164241", "0.5159044", "0.5151011", "0.5144474", "0.5144474", "0.51360863", "0.5134436", "0.513366", "0.5125739", "0.51244" ]
0.7367081
0
Created and maintained by Natalie Orsi at
function CursorObj(x, y) { this.pos = createVector(x, y); this.yvel = 1; this.xvel = 1; var speed_limit = 2.5; this.sl_sq = speed_limit * speed_limit; this.y_acc = 0; this.x_acc = 0; this.sensitivity = 1; this.up = function() { new_speed = this.yvel - this.y_acc - this.sensitivity; //Check if vectors sum to exceed speed (magnitude) limit if ((new_speed * new_speed + this.xvel * this.xvel) < (this.sl_sq)) { this.y_acc -= this.sensitivity; } } this.down = function() { new_speed = this.yvel + this.y_acc + this.sensitivity; //Check if vectors sum to exceed speed (magnitude) limit if ((new_speed * new_speed + this.xvel * this.xvel) < (this.sl_sq)) { this.y_acc += this.sensitivity; } } this.left = function() { new_speed = this.xvel - this.x_acc - this.sensitivity; //Check if vectors sum to exceed speed (magnitude) limit if ((new_speed * new_speed + this.yvel * this.yvel) < (this.sl_sq)) { this.x_acc -= this.sensitivity; } } this.right = function() { new_speed = this.xvel + this.x_acc + this.sensitivity; //Check if vectors sum to exceed speed (magnitude) limit if ((new_speed * new_speed + this.yvel * this.yvel) < (this.sl_sq)) { this.x_acc += this.sensitivity; } } this.update = function() { this.pos.y += this.y_acc; this.pos.x += this.x_acc; } this.decel = function() { if (this.y_acc > 0) { this.y_acc -= 1; } else if (this.y_acc < 0) { this.y_acc += 1; } if (this.x_acc > 0) { this.x_acc -= 1; } else if (this.x_acc < 0) { this.x_acc += 1; } } this.show = function() { fill(255); ellipse(this.pos.x, this.pos.y, 1, 1); } this.constrain = function() { this.pos.x = constrain(this.pos.x, -max_width, max_width); this.pos.y = constrain(this.pos.y, -max_height, max_height); //max_width^2 + max_height^2 = max_mag^2 } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "transient private protected internal function m182() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "transient final private protected internal function m167() {}", "static private internal function m121() {}", "obtain(){}", "transient private protected public internal function m181() {}", "transient private public function m183() {}", "transient final private internal function m170() {}", "static private protected internal function m118() {}", "static transient final private internal function m43() {}", "static transient final protected internal function m47() {}", "static final private internal function m106() {}", "transient final private protected public internal function m166() {}", "static transient private protected internal function m55() {}", "static transient final private protected internal function m40() {}", "static transient private protected public internal function m54() {}", "static transient final protected public internal function m46() {}", "function _____SHARED_functions_____(){}", "static transient private internal function m58() {}", "transient final private public function m168() {}", "static protected internal function m125() {}", "function _construct()\n\t\t{;\n\t\t}", "constructor () {\r\n\t\t\r\n\t}", "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 }", "static final private protected internal function m103() {}", "static private protected public internal function m117() {}", "static transient private public function m56() {}", "function DWRUtil() { }", "constructor (){}", "function test_candu_graphs_datastore_vsphere6() {}", "constructor() {\n\n\t}", "__previnit(){}", "static final private public function m104() {}", "static transient final private protected public internal function m39() {}", "static transient final protected function m44() {}", "function SeleneseMapper() {\n}", "function Komunalne() {}", "function jessica() {\n $log.debug(\"TODO\");\n }", "function AeUtil() {}", "function kp() {\n $log.debug(\"TODO\");\n }", "static final private protected public internal function m102() {}", "constructor() {\r\n // ohne Inhalt\r\n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "static transient final private protected public function m38() {}", "static transient final private public function m41() {}", "constructor() {\n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }", "constructor() {\n \n }" ]
[ "0.64787865", "0.6409103", "0.6325799", "0.62070125", "0.6174635", "0.6155929", "0.60045713", "0.5754971", "0.5736103", "0.5711076", "0.5698348", "0.56910825", "0.5681116", "0.56491894", "0.558562", "0.5577594", "0.55676657", "0.5567567", "0.5535617", "0.54461586", "0.54426646", "0.5429257", "0.5371522", "0.53665", "0.5358785", "0.52936155", "0.5261302", "0.5256173", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.525284", "0.52131736", "0.52116257", "0.5197101", "0.5183046", "0.51674485", "0.51565415", "0.51162934", "0.51142746", "0.5096373", "0.5081262", "0.5052671", "0.50516665", "0.5040813", "0.5035435", "0.5026007", "0.501472", "0.49979907", "0.49894583", "0.49846327", "0.49846327", "0.49846327", "0.49846327", "0.49846327", "0.49846327", "0.49804807", "0.49772522", "0.49702057", "0.49595398", "0.49595398", "0.49595398", "0.49595398", "0.49595398", "0.49595398", "0.49595398", "0.49595398", "0.49595398" ]
0.0
-1
Should return [[5,3,4,6,7,8,9,1,2], [6,7,2,1,9,5,3,4,8], [1,9,8,3,4,2,5,6,7], [8,5,9,7,6,1,4,2,3], [4,2,6,8,5,3,7,9,1], [7,1,3,9,2,4,8,5,6], [9,6,1,5,3,7,2,8,4], [2,8,7,4,1,9,6,3,5], [3,4,5,2,8,6,1,7,9]]
function sudoku (puzzle) { loopRows // check 1-9 >> 9 of these loopColumns // check 1-9 >> 9 of these loop3x3Squares // check 1-9 >> theres 9 of these }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function test() {\n var arr = [];\n arr[0] = [1, 2, 3, 4, 5];\n arr[1] = [1, 2, 3, 4, 5];\n arr[2] = [1, 2, 3, 4, 5];\n arr[3] = [1, 2, 3, 4, 5];\n arr[4] = [1, 2, 3, 4, 5];\n arr[5] = [1, 2, 3, 4, 5];\n arr[6] = [1, 2, 3, 4, 5];\n arr[7] = [1, 2, 3, 4, 5];\n arr[8] = [1, 2, 3, 4, 5];\n arr[9] = [1, 2, 3, 4, 5];\n arr[10] = [1, 2, 3, 4, 5];\n arr[11] = [1, 2, 3, 4, 5];\n arr[12] = [1, 2, 3, 4, 5];\n arr[13] = [1, 2, 3, 4, 5];\n arr[14] = [1, 2, 3, 4, 5];\n arr[15] = [1, 2, 3, 4, 5];\n arr[16] = [1, 2, 3, 4, 5];\n arr[17] = [1, 2, 3, 4, 5];\n arr[18] = [1, 2, 3, 4, 5];\n arr[19] = [1, 2, 3, 4, 5];\n arr[20] = [1, 2, 3, 4, 5];\n arr[21] = [1, 2, 3, 4, 5];\n arr[22] = [1, 2, 3, 4, 5];\n arr[23] = [1, 2, 3, 4, 5];\n arr[24] = [1, 2, 3, 4, 5];\n arr[25] = [1, 2, 3, 4, 5];\n arr[26] = [1, 2, 3, 4, 5];\n arr[27] = [1, 2, 3, 4, 5];\n arr[28] = [1, 2, 3, 4, 5];\n arr[29] = [1, 2, 3, 4, 5];\n arr[30] = [1, 2, 3, 4, 5];\n arr[31] = [1, 2, 3, 4, 5];\n arr[32] = [1, 2, 3, 4, 5];\n arr[33] = [1, 2, 3, 4, 5];\n\n for (var i = 0; i < 32; i++) {\n arr[i][0] = 0; // Conversion of copy-on-access array should be transparent\n }\n}", "function makeSubSets(arr) {\n\n let sub = [];\n let index = 0;\n if (arr.length >= 3) {\n for (let i = 0; i <= arr.length - 3; i++)\n {\n for (let j = i + 1; j < arr.length - 1; j++)\n {\n for (let k = j + 1; k < arr.length; k++)\n {\n sub[index] = [];\n sub[index].push(arr[i]);\n sub[index].push(arr[j]);\n sub[index].push(arr[k]);\n index++;\n }\n\n }\n\n }\n\n }\n else sub = arr;\n\n return sub;\n}", "function getSubsets(arr){\r\n\t\t\r\n\tlet arrSubsets = [];\r\n\t\r\n\tlet m = 0;\r\n\r\n\tif(arr.length >= 3){\r\n\t\t\r\n\t\tfor( let i = 0; i <= arr.length - 3; i++){\r\n\t\t\t\r\n\t\t\tfor( let j = i + 1; j < arr.length - 1; j++){\r\n\t\t\t\r\n\t\t\t\tfor( let k = j + 1 ; k < arr.length; k++){\r\n\t\t\t\t\t\r\n\t\t\t\t\tarrSubsets[m] = [];\r\n\t\t\t\t\tarrSubsets[m].push(arr[i]);\r\n\t\t\t\t\tarrSubsets[m].push(arr[j]);\r\n\t\t\t\t\tarrSubsets[m].push(arr[k]);\r\n\r\n\t\t\t\t\tm++;\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\r\n\t\t}\r\n\t\r\n\t}\t\r\n\t\r\n\telse arrSubsets=arr;\r\n\r\n\treturn arrSubsets;\r\n\r\n}", "function ex_8_I(a){\n n=Math.sqrt(a.length);\n b=[];\n for(var i=0; i<n; i++){\n b[i]=[];\n for(var j=0;j<n;j++){\n \tb[i][j]=a[n*i+j];\n }\n \n }\n return b;\n\n}", "function generateAll() {\n var res = [[], [], [], [], [], [], [], [], []]\n\n for (var r = 0; r < 9; r++) {\n for (var c = 0; c < 9; c++) {\n var originR = r;\n\n if (r == 1) {\n r = 3\n } else if (r == 2) {\n r = 6\n } else if (r == 3) {\n r = 1\n } else if (r == 5) {\n r = 7\n } else if (r == 6) {\n r = 2\n } else if (r == 7) {\n r = 5\n }\n\n var i = r + c;\n while (i > temp.length - 1) {\n i = i - 9\n }\n\n res[originR][c] = temp[i]\n r = originR\n }\n }\n return res;\n }", "function makePuzzle() {\n fillBox(0, 0);\n fillBox(3, 3);\n fillBox(6, 6);\n fillRemaining(0, 3);\n const mappedArray = [];\n let i = 0;\n let j = 0;\n while (i < 9) {\n while (j < 9) {\n mappedArray.push(puzzleArray[i][j]);\n j++\n }\n j = 0;\n i++;\n }\n return mappedArray;\n}", "function returnBoardByRows(boardByColumns){\n var boardByRows = []\n for (var i=0; i<6;i++){\n row = {content: []};\n for (var j=0; j<7; j++){\n row.content.push(\n boardByColumns[j].content[5-i]\n )\n }\n boardByRows.push(row);\n }\n return boardByRows;\n}", "function subsets(arr){\n if(arr.length === 1) {\n return arr;\n } else if (arr.length === 2) {\n let newArr = [];\n let copiedArr = arr.slice(0);\n\n let subOne = [copiedArr[0]]\n let subTwo = [copiedArr[0], copiedArr[1]];\n let subThree = [copiedArr[1], copiedArr[0]];\n let subFour = [copiedArr[1]];\n\n newArr.push(subOne);\n newArr.push(subTwo);\n newArr.push(subThree);\n newArr.push(subFour);\n return newArr;\n }\n}", "board(num) {\r\n let output = []\r\n let temp = [] \r\n for (let i=0; i<this.string.length; i++) {\r\n temp.push(Number(this.string[i]))\r\n if ((i+1) % num === 0 && i>0) { \r\n output.push(temp)\r\n temp = []\r\n }\r\n }\r\n return output\r\n }", "function subsets(arr) {\n let results = [];\n\n if (arr.length < 1) return [[]]\n\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr.length; j++) {\n let sub = arr.slice(i, j+1);\n\n results.push(sub)\n }\n }\n return results.sort();\n}", "function nextBoards(board){\r\n var res = []\r\n //finds the first empty square\r\n const firstEmpty = findEmptySquare(board) //<--(y, x)\r\n if(firstEmpty != undefined){\r\n const y = firstEmpty[0] \r\n const x = firstEmpty[1]\r\n for(var i = 1; i<=9; i++){\r\n var newBoard = [...board] //to tell javaScript we don't want to have a bunch of boards that point to the exact same board\r\n var row = [...newBoard[y]]\r\n row[x] = i\r\n newBoard[y] = row\r\n res.push(newBoard)\r\n }\r\n }\r\n return res\r\n}", "function matrixGenerator(x, y){\n let array = []\n for(let i=0; i<x; i++){\n let arrayChild = []\n for(let j=0; j<y; j++){\n arrayChild.push(j)\n }\n array.push(arrayChild)\n }\n console.log(array)\n}", "function getBoardCells() {\n \"use strict\";\n var iterator,\n cells = [];\n for (iterator = 0; iterator < 9; iterator += 3) {\n cells = cells.concat(getCells(iterator, iterator + 1, iterator + 2));\n }\n return cells;\n}", "function subSets(arr, n){\n if( arr.length <=3 )return arr;\n let result = [];\n result.push([]);\n \n arr.forEach(function (item){\n let len = result.length;\n for(let i=0; i<len; i++){\n let newArr =result[i].slice(0);\n\n newArr.push(item);\n result.push(newArr)\n }\n})\n return result.filter(elem => elem.length ===n)\n }", "function squareMatrix(n) {\r\n console.log(n)\r\n // 1 to Math.pow(3,2)\r\n let lists = []\r\n let y = 0\r\n let k = Math.pow(n, 2) / 3\r\n console.log(k)\r\n for (let i = 0; i < k; i++) {\r\n let sub = []\r\n for (let j = 0; j < k; j++) {\r\n y += 1\r\n sub.push(y)\r\n }\r\n lists.push(sub)\r\n }\r\n console.log(lists)\r\n}", "function matrix(n) {\n\n// USSR\n// Understand\n // reword - given a number, return an evenly-spiraled matrix \n // inputs - integer\n // outputs - arrays of arrays of integers\n // examples - see above\n// Sudo Chop\n // create empty array of arrays of integers 'results'\n let results = []\n for (let i = 0; i < n; i++) {\n results.push([])\n }\n // create a counter variable that starts at one\n let counter = 1\n // create start and end rows and columns\n let startRow = 0\n let startColumn = 0\n let endRow = n - 1\n let endColumn = n - 1\n // if start column <= end column AND start row <= end row\n while (startColumn <= endColumn && startRow <= endRow) {\n // loop from start column to end column for top row of matrix\n for (i = startColumn; i <= endColumn; i++) {\n // assign counter variable at results[start row][i]\n results[startRow][i] = counter\n // increment counter\n counter++\n }\n // increment start row\n startRow++\n // loop from start row to end row for right column of matrix\n for (i = startRow; i <= endRow; i++) {\n // assign counter variable at results[i][end column]\n results[i][endColumn] = counter\n // increment counter\n counter++\n }\n // decrement end column\n endColumn--\n // repeat for bottom row\n for (let i = endColumn; i >= startColumn; i--) {\n results[endRow][i] = counter\n counter++\n }\n endRow--\n // repeat for start column\n for (let i = endRow; i >= startRow; i--) {\n results[i][startColumn] = counter\n counter++\n }\n startColumn++\n }\n return results\n// Solve / Skip\n// Refactor\n\n}", "function allShuffles(cards){\n if(cards.length==1){\n return [cards];\n }\n var out = []\n for(var i = 0; i < cards.length;i++){\n [cards[0],cards[i]]=[cards[i],cards[0]];\n var temp = allShuffles(cards.slice(1));\n\n for(var shuffle of temp){\n shuffle.push(cards[0])\n out.push(shuffle);\n }\n [cards[0],cards[i]]=[cards[i],cards[0]];\n }\n return out;\n}", "board() {\n let result=[]\n for (let i = 0; i < this.papan.length; i+=9) {\n let row=[]\n for (let j = i; j < (i+9); j++) {\n row.push(this.papan[j])\n }\n result.push(row)\n }\n return result\n }", "function subSets(arr) {\n if (!arr.length) {\n return [[]];\n }\n let front = arr[0];\n let subsets = subSets(arr.slice(1));\n let rest = subsets.map(x => x.concat(front));\n return subsets.concat(rest);\n}", "function getSquare(square) {\n let squareArr = []\n if(square === 1) {\n squareArr.push(getColumn(0,puzzle).slice(0, 3)) \n squareArr.push(getColumn(1,puzzle).slice(0, 3))\n squareArr.push(getColumn(2,puzzle).slice(0, 3));\n squareArr.join().split(\",\");\n }else if(square === 2) {\n squareArr.push(getColumn(0,puzzle).slice(3, 6)) \n squareArr.push(getColumn(1,puzzle).slice(3, 6))\n squareArr.push(getColumn(2,puzzle).slice(3, 6));\n squareArr.join().split(\",\");\n }else if(square === 3) {\n squareArr.push(getColumn(0,puzzle).slice(6, 9)) \n squareArr.push(getColumn(1,puzzle).slice(6, 9))\n squareArr.push(getColumn(2,puzzle).slice(6, 9));\n squareArr.join().split(\",\");\n }else if(square === 4) {\n squareArr.push(getColumn(3,puzzle).slice(0, 3)) \n squareArr.push(getColumn(4,puzzle).slice(0, 3))\n squareArr.push(getColumn(5,puzzle).slice(0, 3));\n squareArr.join().split(\",\");\n }else if(square === 5) {\n squareArr.push(getColumn(3,puzzle).slice(3, 6)) \n squareArr.push(getColumn(4,puzzle).slice(3, 6)) \n squareArr.push(getColumn(5,puzzle).slice(3, 6)) \n squareArr.join().split(\",\");\n }else if(square === 6) {\n squareArr.push(getColumn(3,puzzle).slice(6, 9)) \n squareArr.push(getColumn(4,puzzle).slice(6, 9)) \n squareArr.push(getColumn(5,puzzle).slice(6, 9)) \n squareArr.join().split(\",\");\n }else if(square === 7) {\n squareArr.push(getColumn(6,puzzle).slice(0, 3)) \n squareArr.push(getColumn(7,puzzle).slice(0, 3)) \n squareArr.push(getColumn(8,puzzle).slice(0, 3)) \n squareArr.join().split(\",\");\n }else if(square === 8) {\n squareArr.push(getColumn(6,puzzle).slice(3, 6)) \n squareArr.push(getColumn(7,puzzle).slice(3, 6)) \n squareArr.push(getColumn(8,puzzle).slice(3, 6)) \n squareArr.join().split(\",\");\n }else if(square === 9) {\n squareArr.push(getColumn(6,puzzle).slice(6, 9)) \n squareArr.push(getColumn(7,puzzle).slice(6, 9)) \n squareArr.push(getColumn(8,puzzle).slice(6, 9)) \n squareArr.join().split(\",\");\n }\n //convert array of strings to array of ints\n let mergedArr = [].concat.apply([], squareArr);\n return mergedArr;\n}", "function subsets2(nums) {\n let res = [];\n\n function find(curr, rest, start) {\n res.push(curr);\n for (let i = start; i < rest.length; i++) {\n //console.log(...rest.slice(0, i))\n find(\n [...curr, rest[i]], [...rest.slice(0, i), ...rest.slice(i + 1)],\n start\n );\n start++;\n }\n }\n\n find([], nums, 0);\n\n return res;\n}", "function main(numbers) {\n // Change code below. \n let permArr = [];\n if (numbers.length === 0) return [];\n if (numbers.length === 1) return [numbers];\n\n for (let i = 0; i < numbers.length; i++) {\n const currentNum = numbers[i];\n const remainingNums = numbers.slice(0, i).concat(numbers.slice(i + 1));\n const remainingNumsPermuted = main(remainingNums);\n\n for (let j = 0; j < remainingNumsPermuted.length; j++) {\n const permutedArray = [currentNum].concat(remainingNumsPermuted[j]);\n permArr.push(permutedArray);\n }\n }\n return permArr;\n}", "function forTask8(set){\n let arr = [];\n for(let item of set){\n if(item % 2 == 0){\n arr.push(item);\n }\n }\n return arr;\n}", "function renderlist() {\n\n\n // Question 2\n let array = []\n for (let i = 0; i < 30; i++) {\n array.push(i);\n }\n // Question 3 even numbers\n\n for (let i = 0; i < 30; i+=2) {\n array.push(i);\n }\n\n\n return array.map((value) => list(value));\n\n\n\n}", "function twoDimensionalGenerator(num) {\n var res = []\n for (var i = 0; i < num; i++) {\n var arr = []\n var str = ''\n\n for (var j = 0; j < num; j++) {\n str = 'X'\n arr.push(str)\n }\n \n res.push(arr)\n }\n return res\n}", "function matrixGenerator(str) {\n // your code here\n let result = [];\n let jumlahArr = 1;\n for (let h = 1; h < str.length; h++) {\n if (h * h >= str.length) {\n jumlahArr = h;\n break;\n }\n }\n\n let selisih = jumlahArr * jumlahArr - str.length;\n let indexStr = 0;\n for (let i = 1; i <= jumlahArr; i++) {\n let tempArr = [];\n for (let j = 1; j <= jumlahArr; j++) {\n if (tempArr.length + 1 < jumlahArr) {\n if (selisih > 0) {\n tempArr.push('*');\n selisih--;\n } else {\n tempArr.push(str[indexStr]);\n indexStr++;\n }\n } else {\n result.push(tempArr);\n if (selisih > 0) {\n tempArr.push('*');\n selisih--;\n } else {\n tempArr.push(str[indexStr]);\n indexStr++;\n }\n }\n }\n }\n return result;\n}", "getCombinations(array, size) {\n function c(left, right) {\n function getQuestion({ name, answers }) {\n var random;\n do {\n random = answers[Math.floor(Math.random() * answers.length)];\n } while (taken.get(name).has(random));\n taken.get(name).add(random);\n return { dimension: name, answer: random };\n }\n\n left.forEach((v, i, a) => {\n var temp = [...right, v];\n if (temp.length === size) {\n result.push(temp.map(getQuestion));\n } else {\n c([...a.slice(0, i), ...a.slice(i + 1)], temp);\n }\n });\n }\n\n var result = [],\n taken = new Map(array.map(({ name }) => [name, new Set()]));\n\n c(array, {});\n return result;\n }", "function getPossibles() {\n //Adds all possibles into each array if there is not already a clue\n for (var i = 0; i < 9; i++) {\n for (var j = 0; j < 9; j ++) {\n if (puzzleClues[i][j] === 0) {\n for (var k = 0; k < 9; k ++) {\n possibles[i][j][k] = k + 1;\n }\n }\n }\n }\n\n //Removes possibles based on each clue\n for (var i = 0; i < 9; i++) {\n for (var j = 0; j < 9; j++) {\n if (puzzleClues[i][j] > 0) {\n removePossible(i,j,puzzleClues[i][j]);\n }\n }\n }\n}", "function findAllIncreasingSubArr(numberList) {\n if (!Array.isArray(numberList) || numberList.length <= 1) return [];\n let newArray = [];\n const newResult = [];\n for (let index = 0; index < numberList.length; index++) {\n if (newArray.length > 0 && numberList[index] >= numberList[index + 1]) {\n newArray.push(numberList[index]);\n newResult.push(newArray);\n newArray = [];\n } else if (index === numberList.length - 1 && newArray.length > 1) {\n if (numberList[index] > numberList[index - 1])\n newArray.push(numberList[index]);\n newResult.push(newArray);\n } else {\n newArray.push(numberList[index]);\n }\n }\n // return newResult;\n return newResult.filter((x) => x.length > 2);\n}", "function makeGrid(num1, num2) {\n let newArray = [];\n let newArray2 = [];\n for (let i = 1; i <= num1; i++) {\n newArray.push(i)\n } for (let i = 1; i <= num2; i++) {\n newArray2.push(newArray)\n } return newArray2\n}", "function eightQueens(queens=[], arrangements=[]){\n\tvar x=queens.length;\n\tfor(var y=0; y<8; y++){\n\t\tif(isChessMoveSafeArr([x,y], queens)){\n\t\t\tvar newqueens=queens.slice();\n\t\t\tnewqueens.push([x,y]);\n\t\t\tif(x==7){\n\t\t\t\tarrangements.push(newqueens);\n\t\t\t}else{\n\t\t\t\teightQueens(newqueens, arrangements);\n\t\t\t}\n\t\t}\n\t}\n\treturn arrangements;\n}", "function maps(x){\n let newArray = [];\n for(let i = 0; i < x.length; i++){\n newArray.push(x[i] * 2);\n };\n return newArray;\n}", "function allPossibleSubsetsOfLength3OfArray(arr,leftIndex,middleIndex,rightIndex,res) {\r\n if (leftIndex === arr.length - 3) {\r\n res.push([arr[leftIndex],arr[middleIndex],arr[rightIndex]]);\r\n return res; \r\n } else if (middleIndex === arr.length - 2) {\r\n res.push([arr[leftIndex],arr[middleIndex],arr[rightIndex]]);\r\n allPossibleSubsetsOfLength3OfArray(arr,leftIndex + 1,leftIndex + 2,leftIndex + 3,res);\r\n return res;\r\n } else if (rightIndex === arr.length - 1) {\r\n res.push([arr[leftIndex],arr[middleIndex],arr[rightIndex]]);\r\n allPossibleSubsetsOfLength3OfArray(arr,leftIndex,middleIndex + 1, middleIndex + 2,res);\r\n return res;\r\n } else {\r\n res.push([arr[leftIndex],arr[middleIndex],arr[rightIndex]]);\r\n\r\n allPossibleSubsetsOfLength3OfArray(arr,leftIndex,middleIndex,rightIndex + 1,res);\r\n return res;\r\n }\r\n\r\n \r\n \r\n}", "makeBoard() {\n // TODO: Create and return an 2D Array\n // with `this.heigh` as rows and `this.width` as cols.\n // For example, given a height of 4 and a width of 3, it will generate:\n // [\n // [0, 0, 0],\n // [0, 0, 0],\n // [0, 0, 0],\n // [0, 0, 0],\n // ]\n\n let result = [];\n\n // this.height = rows\n // this.width = columns\n\n for (let i = 0; i < this.height; i++) {\n let row = [];\n for (let j = 0; j< this.width; j++) {\n let element = 0;\n row.push(element);\n }\n result.push(row);\n }\n\n //console.log(result);\n return result;\n\n }", "function sortedSquares(nums) {\n let start = 0\n let end = nums.length - 1\n const result = []\n\n while (start <= end) {\n const startPowTwo = Math.pow(nums[start], 2)\n const endPowTwo = Math.pow(nums[end], 2)\n\n if (startPowTwo < endPowTwo) {\n result.unshift(endPowTwo)\n end--\n } else {\n result.unshift(startPowTwo)\n start++\n }\n }\n\n return result\n}", "function matrix(n, startIndex = 0, array = [], count = 1) {\n if (!array[startIndex]) {\n for (let i = 0; i < n; i++) {\n array.push([])\n }\n }\n stopIndex = n - startIndex\n \n for (let i = startIndex; i < stopIndex; i++) {\n array[startIndex][i] = count\n count++\n }\n\n for (let i = startIndex + 1; i < stopIndex; i++) {\n array[i][stopIndex - 1] = count\n count++\n }\n\n for (let i = stopIndex - 1; i > startIndex; i--) {\n array[stopIndex - 1][i - 1] = count\n count++\n }\n\n for (let i = stopIndex - 1; i > startIndex + 1; i--) {\n array[i - 1][startIndex] = count\n count++\n }\n\n\n if (startIndex < (n / 2) - 1) {\n console.log('masuk if' )\n console.log('n',n);\n console.log('startIndex',startIndex);\n \n return matrix(n, startIndex + 1, array, count)\n } else {\n console.log('return');\n console.log('array', array);\n return array\n }\n}", "function matrix(n) {\n const results = [];\n\n for (let i = 0; i< n ; i++) { \n results.push([])\n }\n\n let counter = 1;\n let startColumn = 0;\n let endColumn = n - 1;\n let startRow = 0;\n let endRow = n - 1;\n\n while (startColumn <= endColumn && startRow <= endRow) {\n //TOP ROW\n for (let i = startColumn; i <= endColumn; i++) {\n results[startRow][i] = counter;\n counter++;\n } \n startRow++;\n //RIGHT COLUMN\n for (let i = startRow; i <= endRow; i++){\n results[i][endColumn] =counter; \n counter++\n }\n endColumn--;\n \n //BOTTOM COLUMN\n for (let i = endColumn; i >= startColumn;i--) {\n results[endRow][i] = counter;\n counter++;\n }\n endRow--;\n \n //START COLUMN\n for(let i = endRow;i >= startRow;i--) {\n results[i][startColumn]= counter;\n counter++;\n }\n startColumn++;\n }\n return results;\n}", "function squaresOfASortedArray(nums) {\n let length = nums.length,\n left = 0,\n right = length - 1,\n index = length - 1,\n result = new Array(nums.length).fill(0)\n while (left <= right) {\n const leftElement = nums[left] * nums[left]\n const rightElement = nums[right] * nums[right]\n if (leftElement > rightElement) {\n result[index] = leftElement\n left++\n } else {\n result[index] = rightElement\n right--\n }\n index--\n }\n return result\n}", "function subsetsOfSet (arr) {\n if (typeof arr !== 'object'){\n return -1;\n }\n if (arr.length <= 1) {\n return arr;\n } else if (arr.length === 2) {\n return [[arr[0]], [arr[1]], arr];\n } else {\n var reducedArr = arr.slice(0, arr.length - 1)\n var holder = subsetsOfSet(reducedArr);\n var result = holder.slice(0)\n result.push([arr[arr.length - 1]])\n for ( let i = 0; i < holder.length; i++) {\n let temp = holder[i].slice()\n temp.push(arr[arr.length - 1]);\n result.push(temp);\n }\n }\n return result;\n}", "function radixSort(nums) {\n const maxDigits = mostDigits(nums);\n for (let k = 0; k <= maxDigits; k++) {\n // bucket - array of 10 arrays \n let digitBuckets = Array.from({ length: 10 }, () => []);\n // in the array\n for (let i = 0; i < nums.length; i++) {\n // what is the digit at k position, starting from k = 0\n let digit = getDigits(nums[i], k);\n // at 7th bucket, put the element 3927\n digitBuckets[digit].push(nums[i]);\n }\n // at 6th time (mostDigits), [-3, 7, 56, 273, 3927, 374829]\n console.log(digitBuckets);\n nums = [].concat(...digitBuckets);\n // [].concat([[1], [2], [3]]) // will get [1][2][3]\n // [].concat(...[[1], [2], [3]]) // will get [1, 2, 3]\n console.log(nums);\n }\n\n return nums;\n\n\n}", "function lis (arr) {\n\tvar d = []\n\tlet len = 1;\n\tlet target = [];\n\tfor (let i = 0; i < arr.length; i++) {\n\t\td[i] = [arr[i]];\n\t\tfor (let j = i - 1; j >= 0; j--) {\n\t\t\tif (d[j][0] <= d[i] && j < i) {\n\t\t\t\td[j].forEach(item => {\n\t\t\t\t\td[i].push(item)\n\t\t\t\t})\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (d[i].length > len) {\n\t\t\tlen = d[i].length;\n\t\t\ttarget = d[i]\n\t\t}\n\t}\n\treturn target.reverse();\n}", "get_board() {\n let board = [];\n let row = [];\n this.nodes.forEach(node => {\n row.push(node.value);\n\n if ((node.index + 1) % this.size == 0) {\n board.push(row);\n row = [];\n }\n });\n\n return board;\n }", "function fn(arr) {\n let\n return arr.reduce((pre, cur, index, arr) => {\n for (let i = 0; i < cur.length; i++) {\n for (let j = index; j < )\n }\n return pre\n }, [])\n}", "function testFlatmap() {\n assert.deepStrictEqual(Flatmap(x => x[0], [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]), [1, 2, 5, 6]);\n assert.deepStrictEqual(Flatmap(x => [x, x + 1], [1, 2, 3, 4]), [1, 2, 2, 3, 3, 4, 4, 5]);\n assert.deepStrictEqual(Flatmap(x => x, [[[1, 2], [3, 4]], [[5, 6], [7, 8]]]), [[1, 2], [3, 4], [5, 6], [7, 8]]);\n return true;\n}", "function spiralTraverse(array) {\n\tlet startRow = 0;\n\tlet endRow = array.length-1;\n\tlet startCol = 0;\n\tlet endCol = array[0].length-1;\n\tlet newArr = [];\n\t\n\twhile (startRow <= endRow && startCol <= endCol) {\n\t\tfor (let i = startCol; i <= endCol; i++) {\n\t\t\tnewArr.push(array[startRow][i])\n\t\t}\n\t\t\n\t\tfor (let i = startRow+1; i <= endRow; i++) {\n\t\t\tnewArr.push(array[i][endCol]);\n\t\t}\n\t\t\n\t\tfor (let i = endCol-1; i >= startCol; i--) {\n\t\t\tif (startRow === endRow) break;\n\t\t\tnewArr.push(array[endRow][i]);\n\t\t}\n\t\t\n\t\tfor (let i = endRow-1; i > startRow; i--) {\n\t\t\tif (startCol === endCol) break;\n\t\t\tnewArr.push(array[i][startCol]);\n\t\t}\n\t\t\n\t\tstartRow++;\n\t\tendRow--;\n\t\tstartCol++;\n\t\tendCol--\n\t}\n\treturn newArr\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}", "function matrix(n) {\n const results = [];\n\n for (let i = 0; i < n; i++) {\n results.push([])\n }\n\n let counter = 1;\n let startColumn = 0;\n let endColumn = n - 1;\n let startRow = 0;\n let endRow = n - 1;\n\n while (startColumn <= endColumn && startRow <= startRow) {\n for (let i = startColumn; i <= endColumn; i++) {\n results[startRow][i] = counter;\n counter++\n }\n startRow++\n\n for (let i = startRow; i <= endRow; i++) {\n results[i][endColumn] = counter;\n counter++\n }\n endColumn--\n\n for (let i = endColumn; i >= startColumn; i--) {\n results[endRow][i] = counter;\n counter++\n }\n endRow--\n\n for (let i = endRow; i >= startRow; i--) {\n results[i][startColumn] = counter;\n counter++\n }\n startColumn++\n }\n\n return results\n\n\n}", "function getSubsets(arr, n) {\r\n\t \r\n\tlet subsets = [];\r\n\t\r\n\tlet gnrtSubsets = function(i, src, got, subsets) {\r\n\r\n if (i == 0) {\r\n\t\t\r\n if (got.length > 0) {\r\n subsets[subsets.length] = got;\r\n }\r\n return;\r\n\t \r\n }\r\n for (let j = 0; j < src.length; j++) {\r\n\r\n gnrtSubsets(i - 1, src.slice(j + 1), got.concat([src[j]]), subsets);\r\n\r\n }\r\n\t\r\n return;\r\n } \r\n \r\n gnrtSubsets(n, arr, [], subsets);\r\n\r\n return subsets;\r\n }", "puzzleToClues()\n {\n let clues = [];\n\n for (let i = 0; i < 9; i++)\n {\n for (let j = 0; j < 9; j++)\n {\n if (this.puzzleString[(i * 9) + j] !== '.')\n {\n // clues.push([i, j, parseInt(this.puzzleString[(i * 9) + j])]);\n // let row = clues[i][0] * 81 + clues[i][1] * 9 + clues[i][2] - 1\n clues.push(i * 81 + j * 9 + parseInt(this.puzzleString[(i * 9) + j]) - 1);\n }\n }\n }\n\n return clues;\n }", "function getPossible(board, row, col) {\n let inRow = getRow(board, row);\n let inCol = getCol(board, col);\n let inQuad = getQuad(board, _QUADS[row][col]);\n //console.log(inRow)\n //console.log(inCol)\n //console.log(inQuad)\n \n let possible = [];\n let used = [];\n\n //every row element that is not possible\n //remove any that have already been added\n for (let r in inRow) {\n let included = false;\n for (let u in used) {\n if (inRow[r] == used[u]) {\n included = true;\n break;\n }\n }\n if (!included) {\n used.push(inRow[r])\n }\n }\n for (let c in inCol) {\n let included = false;\n for (let u in used) {\n if (inCol[c] == used[u]) {\n included = true;\n break;\n }\n }\n if (!included) {\n used.push(inCol[c])\n }\n }\n for (let q in inQuad) {\n let included = false;\n for (let u in used) {\n if (inQuad[q] == used[u]) {\n included = true;\n break;\n }\n }\n if (!included) {\n used.push(inQuad[q])\n }\n }\n\n for (let u in used) {\n if (used[u] == '.') {\n used.splice(u, 1);\n }\n }\n\n for (let num = 1; num < 10; num++) {\n if (!used.includes(num + \"\")) {\n possible.push(num + \"\")\n }\n }\n //console.log(used)\n return possible;\n}", "function chunkArrays(arr) {\n let newArray = [];\n let newSubArray = [];\n\n for (i = 0; i < arr.length; i++) {\n // newSubArray.push(arr[i]);\n if (arr[i] === arr[i + 1]) {\n newSubArray.push(arr[i]);\n console.log(`Found a match arr[${i}]: ${arr[i]}, newSubArray is now: ${newSubArray}`);\n } else {\n newSubArray.push(arr[i]);\n if (newSubArray.length <= 1) {\n newArray.push(arr[i]);\n } else {\n newArray.push(newSubArray);\n }\n newSubArray = [];\n }\n }\n\n return newArray;\n}", "function spiralOrder(matrix) {\n let result = []\n while (matrix.length) {\n // take top\n result = [...result, ...matrix[0]]\n matrix = matrix.slice(1)\n if (!matrix.length) break\n // take right side\n matrix.forEach(row => {\n result.push(row.pop())\n })\n matrix = matrix.filter(row => row.length > 0)\n if (!matrix.length) break\n // take bottom\n result = [...result, ...matrix[matrix.length - 1].reverse()]\n matrix.pop()\n if (!matrix.length) break\n // take left\n let left_items = []\n matrix.forEach(row => {\n left_items.push(row.shift())\n })\n matrix = matrix.filter(row => row.length > 0)\n result = [...result, ...left_items.reverse()]\n if (!matrix.length) break\n }\n return result\n}", "function arrayFlattener(x) {\n const array = [];\n for (let i=0; i<x.length; i++) {\n if (x[i].length > 0){\n\n for (let j=0; j<x[i].length; j++) {\n array.push(x[i][j]);\n }\n }\n else {\n array.push(x[i]);\n }\n }\n return array;\n}", "function getMatrixArr(side){\n var temp;\n var inputLength = $(\"#inputText\").val();\n var result = getEmpyMatrix(inputLength);\n for(var i = 0; i < inputLength; i++){\n for(var j = 0; j < inputLength; j++){\n temp=$(\"#\" + side + i + j).val();\n result[i].push(temp);\n }\n }\n return result;\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 createBoard() {\n let render = (arr)=>{\n for(let i=0;i<ncols;i++){\n arr.push(Math.random()>chance ? false:true)\n }\n }\n let initialBoard =[];\n let solvable = false;\n for(let i=0;i<nrows;i++){\n let arr = []\n render(arr)\n initialBoard.push([...arr])\n }\n while(solvable === false){\n let even = initialBoard.map((row)=>{\n let n = row.reduce((acc,bool)=>{\n return bool ? acc+1:acc\n },0)\n return n\n })\n even.forEach((num,index)=>{\n if(num%2!==0){\n initialBoard[index]=[]\n render(initialBoard[index])\n }\n })\n if(!even.some(num=>num%2!==0)){\n break\n }\n }\n \n // console.log({Board: initialBoard})\n\n return initialBoard;\n }", "function findRotten(grid) {\n const arr = [];\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid[i].length; j++) {\n if (grid[i][j] === 2) arr.push([i, j]);\n }\n }\n return arr;\n}", "function spiralIter(matrix) {\n // -------------------- Your Code Here --------------------\n var fixedMatrix = JSON.parse(JSON.stringify(matrix));\n var array = [];\n for (var i = 0; i < matrix.length; i++) {\n\n if(i === 0){\n fixedMatrix.splice(0, 1);\n\n matrix[i].forEach(element => {\n array.push(element)\n });\n }\n else if(i !== matrix.length-1){\n array.push(matrix[i][matrix[i].length - 1])\n fixedMatrix[i].splice(fixedMatrix[i].length - 1, 1)\n }\n else if(i === matrix.length-1){\n for(var j = matrix[i].length - 1; j > -1; j--){\n array.push(matrix[i][j]);\n }\n }\n\n }\n\n for(var k = matrix.length-2; k > 0; k--){\n array.push(matrix[k][0])\n }\n\n console.log(fixedMatrix)\nreturn array;\n\n\n\n // -------------------- End Code Area ---------------------\n}", "function get2x2optscramble(mn) {\n var e = [15, 16, 16, 21, 21, 15, 13, 9, 9, 17, 17, 13, 14, 20, 20, 4, 4, 14, 12, 5, 5, 8, 8, 12, 3, 23, 23, 18, 18, 3, 1, 19, 19, 11, 11, 1, 2, 6, 6, 22, 22, 2, 0, 10, 10, 7, 7, 0], d = [\n [],\n [],\n [],\n [],\n [],\n []\n ], v = [\n [0, 2, 3, 1, 23, 19, 10, 6, 22, 18, 11, 7],\n [4, 6, 7, 5, 12, 20, 2, 10, 14, 22, 0, 8],\n [8, 10, 11, 9, 12, 7, 1, 17, 13, 5, 0, 19],\n [12, 13, 15, 14, 8, 17, 21, 4, 9, 16, 20, 5],\n [16, 17, 19, 18, 15, 9, 1, 23, 13, 11, 3, 21],\n [20, 21, 23, 22, 14, 16, 3, 6, 15, 18, 2, 4]\n ], r = [], a = [], b = [], c = [], f = [], s = [];\n\n function t() {\n s = [1, 1, 1, 1, 2, 2, 2, 2, 5, 5, 5, 5, 4, 4, 4, 4, 3, 3, 3, 3, 0, 0, 0, 0]\n }\n\n t();\n function mx() {\n t();\n for (var i = 0; i < 500; i++)dm(Math.floor(Math.random() * 3 + 3) + 16 * Math.floor(Math.random() * 3))\n }\n\n function cj() {\n var i, j;\n for (i = 0; i < 6; i++)for (j = 0; j < 6; j++)d[i][j] = 0;\n for (i = 0; i < 48; i += 2)if (s[e[i]] <= 5 && s[e[i + 1]] <= 5)d[s[e[i]]][s[e[i + 1]]]++\n }\n\n function dm(m) {\n var j = 1 + (m >> 4), k = m & 15, i;\n while (j) {\n for (i = 0; i < v[k].length; i += 4)y(s, v[k][i], v[k][i + 3], v[k][i + 2], v[k][i + 1]);\n j--\n }\n }\n\n function sv() {\n cj();\n var h = [], w = [], i = 0, j, k, m;\n for (j = 0; j < 7; j++) {\n m = 0;\n for (k = i; k < i + 6; k += 2) {\n if (s[e[k]] == s[e[42]])m += 4;\n if (s[e[k]] == s[e[44]])m += 1;\n if (s[e[k]] == s[e[46]])m += 2\n }\n h[j] = m;\n if (s[e[i]] == s[e[42]] || s[e[i]] == 5 - s[e[42]])w[j] = 0; else if (s[e[i + 2]] == s[e[42]] || s[e[i + 2]] == 5 - s[e[42]])w[j] = 1; else w[j] = 2;\n i += 6\n }\n m = 0;\n for (i = 0; i < 7; i++) {\n j = 0;\n for (k = 0; k < 7; k++) {\n if (h[k] == i)break;\n if (h[k] > i)j++\n }\n m = m * (7 - i) + j\n }\n j = 0;\n for (i = 5; i >= 0; i--)j = j * 3 + w[i] - 3 * Math.floor(w[i] / 3);\n if (m != 0 || j != 0) {\n r.length = 0;\n for (k = mn; k < 99; k++)if (se(0, m, j, k, -1))break;\n j = \"\";\n for (m = 0; m < r.length; m++)j = \"URF\".charAt(r[m] / 10) + \"\\'2 \".charAt(r[m] % 10) + \" \" + j;\n return j\n }\n }\n\n function se(i, j, k, l, m) {\n if (l != 0) {\n if (a[j] > l || b[k] > l)return false;\n var o, p, q, n;\n for (n = 0; n < 3; n++)if (n != m) {\n o = j;\n p = k;\n for (q = 0; q < 3; q++) {\n o = c[o][n];\n p = f[p][n];\n r[i] = 10 * n + q;\n if (se(i + 1, o, p, l - 1, n))return true\n }\n }\n } else if (j == 0 && k == 0)return true;\n return false\n }\n\n function z() {\n var i, j, k, m, n;\n for (i = 0; i < 5040; i++) {\n a[i] = -1;\n c[i] = [];\n for (j = 0; j < 3; j++)c[i][j] = g(i, j)\n }\n a[0] = 0;\n for (i = 0; i <= 6; i++)for (j = 0; j < 5040; j++)if (a[j] == i)for (k = 0; k < 3; k++) {\n m = j;\n for (n = 0; n < 3; n++) {\n var m = c[m][k];\n if (a[m] == -1)a[m] = i + 1\n }\n }\n for (i = 0; i < 729; i++) {\n b[i] = -1;\n f[i] = [];\n for (j = 0; j < 3; j++)f[i][j] = w(i, j)\n }\n b[0] = 0;\n for (i = 0; i <= 5; i++)for (j = 0; j < 729; j++)if (b[j] == i)for (k = 0; k < 3; k++) {\n m = j;\n for (n = 0; n < 3; n++) {\n var m = f[m][k];\n if (b[m] == -1)b[m] = i + 1\n }\n }\n }\n\n function g(i, j) {\n var k, m, n, o = i, h = [];\n for (k = 1; k <= 7; k++) {\n m = o % k;\n o = (o - m) / k;\n for (n = k - 1; n >= m; n--)h[n + 1] = h[n];\n h[m] = 7 - k\n }\n if (j == 0)y(h, 0, 1, 3, 2); else if (j == 1)y(h, 0, 4, 5, 1); else if (j == 2)y(h, 0, 2, 6, 4);\n o = 0;\n for (k = 0; k < 7; k++) {\n m = 0;\n for (n = 0; n < 7; n++) {\n if (h[n] == k)break;\n if (h[n] > k)m++\n }\n o = o * (7 - k) + m\n }\n return o\n }\n\n function w(i, j) {\n var k, m, n, o = 0, p = i, h = [];\n for (k = 0; k <= 5; k++) {\n n = Math.floor(p / 3);\n m = p - 3 * n;\n p = n;\n h[k] = m;\n o -= m;\n if (o < 0)o += 3\n }\n h[6] = o;\n if (j == 0)y(h, 0, 1, 3, 2); else if (j == 1) {\n y(h, 0, 4, 5, 1);\n h[0] += 2;\n h[1]++;\n h[5] += 2;\n h[4]++\n } else if (j == 2) {\n y(h, 0, 2, 6, 4);\n h[2] += 2;\n h[0]++;\n h[4] += 2;\n h[6]++\n }\n p = 0;\n for (k = 5; k >= 0; k--)p = p * 3 + (h[k] % 3);\n return p\n }\n\n function y(i, j, k, m, n) {\n var o = i[j];\n i[j] = i[k];\n i[k] = i[m];\n i[m] = i[n];\n i[n] = o\n }\n\n z();\n for (var i = 0; i < num; i++) {\n mx();\n ss[i] += sv();\n }\n}", "function nextBigger(n){\n console.log(`\\n INPUT: ${n}`);\n let newArr = n.toString().split('');\n // first char stays the same, but the other digits need to be sorted for the largest one\n let firstNum = newArr[0];\n let shallow = newArr.slice(1, newArr.length);\n console.log('Slice:', shallow);\n console.log(`\\n FIRST NUM:${firstNum}`);\n\n \n let restOfNum = shallow.join(\"\");\n\n let containerArray = [];\n \nconst permutator = (inputArr) => {\n let result = [];\n\n const permute = (arr, m = []) => {\n if (arr.length === 0) {\n result.push(m)\n } else {\n for (let i = 0; i < arr.length; i++) {\n let curr = arr.slice();\n let next = curr.splice(i, 1);\n permute(curr.slice(), m.concat(next))\n }\n }\n }\n\n permute(inputArr);\n console.log(result);\n return result;\n}\n let lastArr = [];\n permutator(shallow).forEach(el => { \n let parsed = el.join('');\n console.log(parsed);\n })\n\n\n\n\n\n}", "function initialGrid() {\n return Array.from({length:6}, (_, i) => Array.from({length:6}, (_, j) => 0));\n}", "function ex_8_I(myarray)\n{\n var m = [];\n var n = Math.sqrt(myarray.length);\n for(var row = 0; row < n; row++)\n {\n m[row] = myarray.slice(row * n, (row+1) * n )\n }\n}", "function matrix(n) {\n //sol#1\n let results = []; \n let count = 1;\n let startColumn = 0, endColumn = n-1, startRow = 0, endRow = n-1; \n\n for (let i = 0; i<n; i++) {\n results.push([]);\n } \n \n while( startColumn <= endColumn && startRow <= endRow ) {\n // Top row\n for(let i= startColumn; i<=endColumn; i++) {\n results[startRow][i] = count;\n count++; \n }\n startRow++;\n\n //Right column\n for(let i=startRow; i<=endRow; i++) {\n results[i][endColumn] = count;\n count++;\n }\n endColumn--; \n \n //Bottom row\n for(let i=endColumn; i>=startColumn; i--){\n results[endRow][i] = count;\n count++;\n }\n endRow--; \n \n //Left column\n for(let i=endRow; i>=startRow; i--) {\n results[i][startColumn] = count;\n count++;\n }\n startColumn++; \n \n }\n \n return results;\n}", "mapFlipDownCards(cards) {\n if (!cards) return;\n let flatArr = this.getFlatten(cards);\n // let flatArr = cards.flat();\n let cardsNumberOnHand = 5;\n let totalLen = flatArr.length;\n // if cards number is under n, split flipdown card into two row;\n if (totalLen <= cardsNumberOnHand) {\n let mid = Math.floor(totalLen / 2);\n return [flatArr.slice(0, mid), flatArr.slice(mid, totalLen)];\n } else {\n let threeRow = [[], [], []];\n flatArr.map((card, index) => threeRow[index % 3].push(card));\n return threeRow;\n }\n }", "function rowSetup(numOfSpeakers){\n switch(numOfSpeakers){\n case 0:\n break;\n case 1:\n return [1];\n break;\n case 2:\n return [2];\n break;\n case 3:\n return [3];\n break;\n case 4:\n return [4];\n break;\n case 5:\n return [3,2];\n break;\n case 6:\n return [3,3];\n break;\n case 7:\n return [4,3];\n break;\n case 8:\n return [3,2,3];\n break;\n case 9:\n return [3,3,3];\n break;\n case 10:\n return [3,4,3];\n break;\n case 11:\n return [4,3,4]\n break;\n case 12:\n return [4,4,4];\n break;\n case 13:\n return [4,4,4,1];\n break;\n case 14:\n return [4,3,4,3];\n break;\n case 15:\n return [3,4,3,2,3];\n break;\n case 16:\n return [4,3,4,3,2];\n break;\n case 17:\n return [3,4,3,4,3];\n break;\n case 18:\n return [4,3,4,3,4];\n break;\n case 19:\n return [3,4,3,4,3,2];\n break;\n case 20:\n return [3,4,3,4,3,3];\n break;\n default:\n return [numOfSpeakers];\n }\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 matrix(myarray){\n var n = Math.sqrt(myarray.length); \n var resarray=[];\n var row =[]; \n for (var i = 0; i < myarray.length;i++){\n row[row.length=myarray[i]];\n if (row.length==n){\n resarray.push(row);\n row= [];\n }\n } \n return resarray;\n}", "function splitUp(arr, blockArr, n) {\n var rest = arr.length % n, // how much to divide\n restUsed = rest, // to keep track of the division over the elements\n partLength = Math.floor(arr.length / n),\n tmpResult = [],\n result = [],\n eachBlock = []; // for each letter of \"IBI\"\n for(var i = 0; i < arr.length; i += partLength) {\n var end = partLength + i,\n add = false;\n\n if(rest !== 0 && restUsed) { // should add one element for the division\n end++;\n restUsed--; // we've used one division element now\n add = true;\n }\n\n tmpResult.push(arr.slice(i, end)); // part of the array\n\n if(add) {\n i++; // also increment i in the case we added an extra element for division\n }\n }\n // tmpResult = [[], [], [], []] length of n\n var j = 0;\n var i = 0;\n var blockLimit = blockArr[j] - 1;\n while (i < tmpResult.length) {\n eachBlock.push(tmpResult[i]);\n if (i == blockLimit) {\n result.push(eachBlock);\n eachBlock = [];\n j++;\n if (j < blockArr.length) {\n blockLimit += blockArr[j];\n }\n }\n i++;\n }\n console.log(result);\n // result = [[[],[]...],[[],...],[[],...]] length of blockArr's length\n return result;\n}", "function spiralTraverse(array) {\n const res = [];\n let start_row = 0;\n let end_row = array.length;\n let start_col = 0;\n let end_col = array[0].length;\n\n while (start_col < end_col && start_row < end_row) {\n // right\n for (let i = start_col; i < end_col; ++i) {\n res.push(array[start_row][i]);\n console.log(\"r\", res);\n console.log({ start_row, end_row, start_col, end_col });\n }\n\n // down\n for (let i = start_row + 1; i < end_row; ++i) {\n res.push(array[i][end_col - 1]);\n console.log(\"d\", res);\n console.log({ start_row, end_row, start_col, end_col });\n }\n\n // left\n for (let i = end_col - 2; i >= start_col; --i) {\n if (start_row === end_row - 1) break;\n res.push(array[end_row - 1][i]);\n console.log(\"l\", res);\n console.log({ start_row, end_row, start_col, end_col });\n }\n\n // up\n for (let i = end_row - 2; i > start_row; --i) {\n if (start_col === end_col - 1) break;\n res.push(array[i][start_col]);\n console.log(\"u\", res);\n console.log({ start_row, end_row, start_col, end_col });\n }\n\n ++start_row;\n --end_row;\n ++start_col;\n --end_col;\n }\n\n return res;\n}", "function convert(puzzle) {\n const possible = {\n rows: [],\n columns: [],\n grids: []\n };\n\n for (var i1 = 0; i1 < constants.size; i1++) {\n const set = new Set(_.range(1, 10));\n const row = puzzle[i1];\n for (var j1 = 0; j1 < constants.size; j1++) {\n if (row[j1] !== null) {\n set.delete(row[j1]);\n }\n }\n possible.rows.push(set);\n }\n\n for (var i2 = 0; i2 < constants.size; i2++) {\n const set = new Set(_.range(1, 10));\n for (var j2 = 0; j2 < constants.size; j2++) {\n if (puzzle[j2][i2] !== null) {\n set.delete(puzzle[j2][i2]);\n }\n }\n possible.columns.push(set);\n }\n\n for (var i3 = 0; i3 < constants.size; i3++) {\n const set = new Set(_.range(1, 10));\n const startingRow = Math.floor(i3 / 3) * 3;\n const endingRow = Math.floor(i3 / 3) * 3 + 3;\n const startingCol = Math.floor(i3 % 3) * 3;\n const endingCol = Math.floor(i3 % 3) * 3 + 3;\n for (var j3 = startingRow; j3 < endingRow; j3++) {\n for (var k3 = startingCol; k3 < endingCol; k3++) {\n if (puzzle[j3][k3] !== null) {\n set.delete(puzzle[j3][k3]);\n }\n }\n }\n possible.grids.push(set);\n }\n\n const remaining = [];\n var count = 0;\n\n for (var r = 0; r < constants.size; r++) {\n const row = [];\n for (var c = 0; c < constants.size; c++) {\n if (puzzle[r][c] !== null) {\n row.push(null);\n } else {\n count = count + 1;\n row.push(intersect(possible.rows[r], possible.columns[c], possible.grids[utils.convertToGrid(r, c)]));\n }\n }\n remaining.push(row);\n }\n\n return {\n possible: possible,\n remaining: remaining,\n count: count,\n pseudoCount: 0\n };\n}", "function permute22(S) { // Refactored and better solution, Easy to understand and easy to Digest\n let A = [...S], output = [];\n\n (function permute(l = 0) {\n if (l === A.length - 1) output.push(A.toString());\n else {\n for (let k = l; k <= A.length - 1; k++) {\n [A[l], A[k]] = [A[k], A[l]];\n permute(l + 1);\n [A[k], A[l]] = [A[l], A[k]];\n }\n }\n })();\n\n return output;\n}", "function generateCombinations (arr) {\n const combinations = []\n const result = []\n\n const n = arr.length\n // keep track index in each of the n arrays\n const indices = new Array(n).fill(0)\n\n while (true) {\n let tmp = []\n\n // store current combination\n for (var i = 0; i < n; i++) { \n tmp.push(arr[i][indices[i]])\n }\n\n combinations.push(tmp.filter(n => n).join(\"-\"))\n\n // find the rightmost array that has more element left after the current element\n var next = n - 1\n while (next >= 0 && indices[next] + 1 >= arr[next].length) {\n next--\n }\n\n // no such array is found so no more combinations left\n if (next < 0) {\n break\n }\n\n // if next element is found then set the indices for next combination\n indices[next]++\n for(i = next + 1; i < n; i++) {\n indices[i] = 0\n }\n }\n\n return combinations.filter(n => n)\n}", "function spiral2() {\n var arr = [];\n var count = 100;\n for(let i = 10; i >= 1; i--) {\n let subArr = [];\n for(let j = 10; j >= 1; j--) {\n if ( i % 2 == 1 ) {\n subArr.push( (i * 10) - j + 1);\n } else {\n subArr.push(count);\n }\n count--;\n }\n arr.push(subArr);\n }\n console.table(arr);\n}", "function MRV(d) {\n \n var mrvlist = [];\n var lowestSize = 10000;\n \n for (var i = 0; i < 9; i++) {\n for (var j = 0; j < 9; j++) {\n value = parseInt(document.getElementById(\"cell\"+i+j)); \n if (!value) { \n if (d[i][j].length <= lowestSize) {\n mrvlist.push([i,j]);\n if (d[i][j].length < lowestSize) {\n mrvlist = [];\n mrvlist.push([i,j]);\n lowestSize = d[i][j].length; \n }\n }\n }\n \n }\n }\n return mrvlist;\n}", "function createGrid(startX, startY){\n let x = startX;\n let y;\n let finalArr = [];\n let tempArr = [];\n\n for(let i=0; i<3; i++){\n y = startY;\n tempArr = [];\n for(let j=0; j<3; j++){\n let coor = [x, y]; \n tempArr.push(coor); \n y++;\n }\n x++;\n finalArr.push(tempArr); \n } \n return finalArr;\n}", "function createFourByFourArray(){\n\n let newShuffleArray = []\n\n let shuffledArray= shuffleArray()\n\n for(let i=0; i< shuffledArray.length; i+=4){\n\n newShuffleArray.push(shuffledArray.slice(i, i+4))\n \n } \n\n return newShuffleArray\n}", "function matrixGenerator(x, y) {\n let matrix = []\n let randomValue \n\n for (let i = 0; i < y; i++) {\n matrix.push([])\n\n\n }\n for (let i = 0; i < x; i++) {\n \n\n for (let i = 0; i < y; i++) {\n matrix[i].push(randomValue = Math.floor(Math.random() *10))\n \n }\n \n }\n\n return matrix\n \n}", "function create_game_board() {\n var arr = [];\n for (var i = 0; i < 12; i++) {\n arr[i] = [];\n for (var j = 0; j < 12; j++) {\n var arr2 = [];\n arr[i].push(arr2);\n }\n }\n\n for (var i = 0; i < 12; i++) {\n for (var j = 0; j < 12; j++) {\n arr[i][j] = true;\n }\n }\n return arr;\n}", "function matrix(n) {\n\tconst results = [];\n\n\tfor (let index = 0; index < n; index++) {\n\t\tresults.push([]);\n\t}\n\n\tlet counter = 1;\n\tlet startColumn = 0;\n\tlet endColumn = n - 1;\n\tlet startRow = 0;\n\tlet endRow = n - 1;\n\n\twhile (startColumn <= endColumn && startRow <= endRow) {\n\t\t// Top Row\n\t\tfor (let index = startColumn; index <= endColumn; index++) {\n\t\t\tresults[startRow][index] = counter;\n\t\t\tcounter++;\n\t\t}\n\t\tstartRow++;\n\n\t\t// Right Column\n\t\tfor (let index = startRow; index <= endRow; index++) {\n\t\t\tresults[index][endColumn] = counter;\n\t\t\tcounter++;\n\t\t}\n\t\tendColumn--;\n\n\t\t// Bottom Row\n\t\tfor (let index = endColumn; index >= startColumn; index--) {\n\t\t\tresults[endRow][index] = counter;\n\t\t\tcounter++;\n\t\t}\n\t\tendRow--;\n\n\t\t// Start Column\n\t\tfor (let index = endRow; index >= startRow; index--) {\n\t\t\tresults[index][startColumn] = counter;\n\t\t\tcounter++;\n\t\t}\n\t\tstartColumn++;\n\t}\n\treturn results;\n}", "getMultipleSurrounds(arr) {\n let output = [];\n\n arr.forEach(tile => {\n let surrounds = tile.getSurrounds();\n\n surrounds.forEach(item => {\n if (!output.includes(item)) {\n output.push(item);\n }\n });\n });\n\n return output;\n }", "function makeTeams() {\n var tempArray = [];\n tempArray = chunkify(studentArray, numTeams, true);\n console.log(\"Here's your array of randomized teams:\", tempArray);\n return tempArray;\n }", "makeBoard() {\n let rows = this.height;\n let columns = this.width;\n let largerArr = [];\n for(let i = 0; i<rows;i++){\n largerArr.push([]);\n for(let z = 0; z<columns; z++){\n largerArr[i][z] = Math.round(Math.random());\n }\n }\n return largerArr;\n }", "function getPermutations(arr) {\n if (arr.length === 2)\n return [\n [arr[0], arr[1]],\n [arr[1], arr[0]],\n ];\n let output = [];\n for (let i = 0; i < arr.length; i++) {\n let permutations = getPermutations(\n arr.slice(0, i).concat(arr.slice(i + 1))\n );\n for (const permutation of permutations) {\n output.push([arr[i]].concat(permutation));\n }\n }\n return output;\n}", "function helper(n, w) {\n assert(n >= 0);\n assert(w >= 0);\n if (n == 0)\n return [[]];\n if (w <= 0)\n return [];\n var results = [];\n var _loop_1 = function (row) {\n var smaller = helper(n - row, row);\n results.push.apply(results, smaller.map(function (part) { return [row].concat(part); }));\n };\n for (var row = Math.min(n, w); row >= 1; row--) {\n _loop_1(row);\n }\n return results;\n }", "function looper (len) {\n\tvar results = [];\n\tfor (var i = 0; i < len -1; i+=2){\n\t\tresults.push(i);\n\t};\n\treturn results.map(function(element){\n\t\treturn element * 3;\n\t})\n}", "function longHand(numbers) {\n numbers = numbers.split(',');\n var longHandArr = [];\n var i;\n\n numbers.forEach(function(element) {\n element = element.split(/\\.\\.|\\-|\\:/).map(Number);\n\n if (element.length === 1) {\n longHandArr.push(getNextNumber(longHandArr, element[0]));\n } else {\n element = longHand(element.join(','));\n\n for (i = element[0]; i <= element[1]; i += 1) {\n longHandArr.push(getNextNumber(longHandArr, i));\n }\n }\n });\n\n return longHandArr;\n}", "function findAllDecreasingSubArr(numberList) {\n if (!Array.isArray(numberList) || numberList.length <= 1) return [];\n let newArray = [];\n const newResult = [];\n for (let index = 0; index < numberList.length; index++) {\n if (newArray.length > 0 && numberList[index] < numberList[index + 1]) {\n newArray.push(numberList[index]);\n newResult.push(newArray);\n newArray = [];\n } else if (index === numberList.length - 1 && newArray.length > 1) {\n if (numberList[index] > numberList[index - 1])\n newArray.push(numberList[index]);\n newResult.push(newArray);\n } else {\n newArray.push(numberList[index]);\n }\n }\n return newResult.filter((x) => x.length > 2);\n}", "function allPairings(list) {\r\n\t// Base case: a list with two elements' only pairing is itself.\r\n\tif (list.length == 2) {\r\n\t\treturn [[list]]\r\n\t}\r\n\t\r\n\t// Recursive case: take each possible pair of elements (i,j) and then\r\n\t// recursively pair the remaining elements.\r\n\tlet pairings = [];\r\n\tlet i = 0;\r\n\t\r\n\tfor (let j = 1; j < list.length; j++) {\r\n\t\tlet remaining = list.concat()\r\n\t\tremaining.splice(i,1)\r\n\t\tremaining.splice(j-1,1)\r\n\t\t\r\n\t\tallPairings(remaining).forEach(p => {\r\n\t\t\tlet pairing = [[list[i], list[j]]]\r\n\t\t\tpairing.push(...p)\r\n\t\t\tpairings.push(pairing)\r\n\t\t})\r\n\t}\r\n\t\r\n\treturn pairings;\r\n}", "getInitialRandomData() {\n const dummyData = [\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', ''],\n ['', '', '', '', '', '', '', '', '']\n ];\n \n let data = [];\n let cols = [], rows=[];\n \n for (let row = 0; row < 9; row ++) {\n for (let col = 0; col < 9; col ++) {\n let showed = Math.floor(Math.random() * 2);\n // let number = this.getRadomValue();\n\n if (showed == 1) {\n let number = this.checkBeforeValue(dummyData, row, col);\n cols.push(number);\n dummyData[row][col] = number;\n }\n else {\n cols.push('');\n }\n }\n data.push(cols);\n cols = [];\n }\n return data;\n }", "function successors(n){\n\tif (n == 1) return [2, 4, 5];\n\tif (n == 2) return [1, 3, 4, 5, 6];\n\tif (n == 3) return [2, 5, 6];\n\tif (n == 4) return [1, 2, 5, 7, 8];\n\tif (n == 5) return [1, 2, 3, 4, 6, 7 ,8, 9];\n\tif (n == 6) return [2, 3, 5, 8 ,9];\n\tif (n == 7) return [4, 5, 8];\n\tif (n == 8) return [4, 5, 6 ,7, 9];\n\tif (n == 9) return [5, 6 , 8];\n}", "function p(a){\n// Give preference to elements with certain criteria, so they have\n// a chance to be closer to the top.\na.sort(ya);for(var b=[],c=0;c<a.length;c++){\n// loop through subrows, starting with the topmost, until the segment\n// doesn't collide with other segments.\nfor(var d=a[c],e=0;e<b.length&&wa(d,b[e]);e++);\n// `j` now holds the desired subrow index\nb[e]?b[e].push(d):b[e]=[d]}return b}", "function subsets(arr) {\n if (arr.length <= 1) {\n return [arr];\n } else {\n const prevSets = subsets(arr.slice(0, arr.length - 1));\n let newEl = arr[arr.length - 1];\n const newSets = prevSets.map( set => {\n let copy = set.slice();\n copy.push(newEl);\n return copy;\n });\n\n return prevSets.concat(newSets).concat([[newEl]]);\n }\n}", "function arrayOfMultiples (num, length) {\n let bucket = [];\n for(let i = 1; i<=length;i++){\n bucket.push(num * i);\n }\n return bucket;\n}", "function chooseGiven(grid) {\n for (var i = 0; i < 9; i++) {\n for (var j = 0; j < 9; j++) {\n if (grid[i][j]) {\n choose(81 * i + 9 * j + parseInt(grid[i][j]));\n solution.push(81 * i + 9 * j + parseInt(grid[i][j]));\n }\n }\n }\n}", "function composeRanges(nums) {\n let ranges = [];\n let i = 0;\n let j = 0;\n while (i < nums.length && j < nums.length) {\n if (nums[j + 1] - nums[j] === 1) j++;\n else {\n if (nums[j] !== nums[i]) ranges.push(`${nums[i]}->${nums[j]}`);\n else ranges.push(`${nums[i]}`);\n j++;\n i = j;\n }\n }\n return ranges;\n}", "function choose2(inputArr) {\n var len = inputArr.length;\n \n function combine(arr) {\n var cur = [];\n var result = [];\n\n for (var i = 0; i < len; i++) {\n for (var j = i + 1; j < len; j++) {\n cur = [arr[i], arr[j]];\n result.push(cur);\n }\n }\n return result;\n }\n\n return combine(inputArr);\n}", "function largestOfFour(arr) {\r\n var results = [];\r\n for (var n = 0; n < arr.length; n++) {\r\n var largestNumber = arr[n][0];\r\n for (var sb = 1; sb < arr[n].length; sb++) {\r\n if (arr[n][sb] > largestNumber) {\r\n largestNumber = arr[n][sb];\r\n }\r\n }\r\n\r\n results[n] = largestNumber;\r\n }\r\n\r\n return results;\r\n}", "function getBoardArray(){\n // get each row of the board\n var grid_rows = [].slice.call(document.querySelectorAll(\".row\"));\n \n grid_rows.forEach(function(row,index){\n var nums;\n board.push([]);\n // each cell of the board\n row_cells = [].slice.call(row.children);\n row_cells.forEach(function(num){\n board[index].push(num.value); \n });\n })\n return board;\n}", "function symbols(num) {\n var arr =[]\n var index = 1\n for(var i = 0; i < num; i++) {\n var fill = []\n for(var j = 0; j < num; j++) {\n fill.push(index)\n index++\n }\n arr.push(fill)\n }\n \n var arr1 = []\n for(var i = 0; i < 1; i++) {\n var fill = []\n for(var j = 0; j < arr[i].length; j++)\n if(arr[i][j] % 2 === 1) {\n fill.push('x')\n }\n else if (arr[i][j] % 2 ===0) {\n hasil = arr[i][j] / 2\n if(hasil % 2 === 1) {\n fill.push('o')\n } else if(hasil % 2 === 0) {\n fill.push('#')\n }\n }\n arr1.push(fill)\n }\n\n for(var i = 1; i < num ; i++) {\n var fill =[]\n // console.log(i)\n if ( i % 2 === 1) {\n for(var j = num-1; j >= 0; j--) {\n fill.push(arr1[0][j])\n }\n } else if ( i % 2 === 0) {\n for(var j = 0; j < num; j++) {\n fill.push(arr1[0][j])\n }\n }\n arr1.push(fill)\n }\n console.log(arr1)\n \n}", "function createGrid(level) {\n let array = [];\n let levelOneArray = [\n 0, 0, 1, 1, 1, 0, 0, 0,\n 0, 0, 1, 4, 1, 0, 0, 0,\n 0, 0, 1, 3, 1, 1, 1, 1,\n 1, 1, 1, 0, 2, 3, 4, 1,\n 1, 4, 0, 3, 3, 1, 1, 1,\n 1, 1, 1, 1, 0, 1, 0, 0,\n 0, 0, 0, 1, 4, 1, 0, 0,\n 0, 0, 0, 1, 1, 1, 0, 0\n ];\n\n let levelTwoArray = [\n 1, 1, 1, 1, 1, 0, 0, 0, 0,\n 1, 0, 0, 0, 1, 0, 0, 0, 0,\n 1, 0, 3, 0, 1, 0, 1, 1, 1,\n 1, 0, 3, 2, 1, 0, 1, 4, 1,\n 1, 1, 1, 3, 1, 1, 1, 4, 1,\n 0, 1, 1, 0, 0, 0, 0, 4, 1,\n 0, 1, 0, 0, 0, 1, 0, 0, 1,\n 0, 1, 0, 0, 0, 1, 1, 1, 1,\n 0, 1, 1, 1, 1, 1, 0, 0, 0\n ];\n\n //Depending on the level, set the grid height for splicing into 2D array\n if (level == 1) {\n gridWidth = 8;\n\n\n } else if (level == 2) {\n //Level 2\n gridWidth = 9;\n }\n\n\n //Push contents of level 1 into 2D array\n if (level == 1) {\n while (levelOneArray.length) {\n //This will create an array of arrays, using the gridWidth to determine max index of each sub-array\n array.push(levelOneArray.splice(0, gridWidth));\n }\n } else if (level == 2) {\n while (levelTwoArray.length) {\n array.push(levelTwoArray.splice(0, gridWidth));\n }\n }\n\n return array;\n}", "function matrix(n) {\n\n function maketheTable(n) {\n const theTable = []\n for (let i = 1; i <= n; i++) {\n theTable.push(new Array(n).fill(0))\n }\n return theTable\n }\n\n let spiralIterator = 1\n while (spiralIterator < n ** 2) {\n spiralIterator += 1\n }\n\n\n\n const theTable = maketheTable(n)\n\n theTable.forEach((row) => {\n console.log(row)\n })\n\n //return theTable\n\n}" ]
[ "0.63921815", "0.61343616", "0.5943706", "0.5927323", "0.59197205", "0.5893557", "0.5875029", "0.5855673", "0.58033496", "0.57939804", "0.5763032", "0.57157457", "0.5675868", "0.5664415", "0.5655421", "0.56474704", "0.56410486", "0.56101435", "0.5598707", "0.5590937", "0.55864996", "0.55860955", "0.55742246", "0.5573165", "0.55630744", "0.554594", "0.55338484", "0.55248773", "0.55128896", "0.5506231", "0.55019826", "0.54982585", "0.5497015", "0.5490078", "0.5478295", "0.5476813", "0.54754806", "0.5473425", "0.5439037", "0.54374933", "0.5437156", "0.5436396", "0.5429922", "0.54262316", "0.54209006", "0.5412803", "0.5412261", "0.54111975", "0.53917545", "0.53914464", "0.5389348", "0.5372231", "0.5365817", "0.5363617", "0.53527033", "0.53361875", "0.5332921", "0.5328963", "0.53271395", "0.53247297", "0.53198075", "0.53177154", "0.531543", "0.53017306", "0.5298412", "0.529615", "0.52793044", "0.5273835", "0.52722496", "0.527173", "0.525787", "0.52505946", "0.5250466", "0.52476263", "0.52414733", "0.5239237", "0.5235544", "0.52349657", "0.52281207", "0.5222748", "0.5219394", "0.52176064", "0.5207601", "0.52020013", "0.5199783", "0.51940304", "0.51931256", "0.51893556", "0.5189009", "0.5185525", "0.51825005", "0.517362", "0.51666", "0.51651555", "0.5156036", "0.51523787", "0.51494133", "0.5146475", "0.5146354", "0.5145657", "0.51451355" ]
0.0
-1
Close when someone clicks on the "x" symbol inside the overlay
function closeNav() { document.getElementById("myNav").style.left = "-100vw"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "close(){Overlay.overlayStack.closeOverlay(this.overlayElement);}", "close() {\n this.overlayManager.close(this.overlayName);\n }", "function onBackdropClick() {\n close();\n }", "function overlayClick() {\n\toverlay.onclick = function() {\n\t\tcloseOverlay();\n\t}\n}", "function closeOverlay() {\r\n $('.ev-overlay').on('click', function() {\r\n $(this).removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n \r\n $('.ev-overlay-content').on('click', function(event) {\r\n event.stopPropagation();\r\n });\r\n $('.ev-vote-cancel').on('click', function() {\r\n $('.ev-overlay').removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n $('.ev-vote-yes').on('click', function() {\r\n $('.ev-overlay').removeClass('open').fadeOut();\r\n $('body').removeClass('ev-overlay-open');\r\n });\r\n}", "close() {\n\n this.overlay.remove();\n this.overlay = null;\n\n }", "function closeSpecialInstructions(){\n\t$('#container').css('z-index', '10');\n\t$('#overlay').hide();\n\t$('#special-instructions').html('');\n}", "clickedOutside(event) {\n if (this.isActive) {\n if (Array.isArray(this.autoClose)) {\n if (this.autoClose.indexOf('outside') >= 0) {\n if (!this.isInWhiteList(event.target)) this.isActive = false;\n }\n\n if (this.autoClose.indexOf('inside') >= 0) {\n if (this.isInWhiteList(event.target)) this.isActive = false;\n }\n }\n }\n }", "function closeHandler() {\n $('#sf_close').click(() => {\n closeOverlay();\n });\n}", "appendClose() {\n\t\t\tlet beatyboxCross = document.createElement('div');\n\t\t\t$(beatyboxCross).attr('class', 'beatybox-close')\n\t\t\t$('.beatybox-container').append(beatyboxCross);\n\t\t\t\n\t\t\t$(beatyboxCross).text('×');\n\n\t\t\t$(beatyboxCross).on('mouseover', ()=>{\n\t\t\t\t$(beatyboxCross).css('cursor','pointer');\n\t\t\t});\n\n\t\t\t$(beatyboxCross).on('click', ()=>{\n\t\t\t\tcontainer.removeContainer();\n\t\t\t});\n\n\t\t}", "function onClickOverlay() {\n if (__WEBPACK_IMPORTED_MODULE_2__context__[\"a\" /* context */].top) {\n var vm = __WEBPACK_IMPORTED_MODULE_2__context__[\"a\" /* context */].top.vm;\n vm.$emit('click-overlay');\n\n if (vm.closeOnClickOverlay) {\n if (vm.onClickOverlay) {\n vm.onClickOverlay();\n } else {\n vm.close();\n }\n }\n }\n}", "function closeLightboxByIcon(xIcon){\n var lightbox = $(xIcon).parent();\n lightbox.css('display', 'none');\n $('#darkBack').css('display', 'none');\n $('body').removeClass('noScroll'); //re-enable scroll for content behind lightbox\n}", "_outsideClickListener(event) {\n const eventPath = event.composedPath();\n\n if (eventPath.indexOf(this.positionTarget) < 0 && eventPath.indexOf(this.$.overlay) < 0) {\n this.opened = false;\n }\n }", "_outsideClickListener(event){if(-1!==event.composedPath().indexOf(this.$.overlay)||this._mouseDownInside||this._mouseUpInside){this._mouseDownInside=!1;this._mouseUpInside=!1;return}if(!this._last){return}const evt=new CustomEvent(\"vaadin-overlay-outside-click\",{bubbles:!0,cancelable:!0,detail:{sourceEvent:event}});this.dispatchEvent(evt);if(this.opened&&!evt.defaultPrevented){this.close(event)}}", "function closeOverlay() { \r\n var close = document.getElementById(\"overlay\");\r\n close.addEventListener('click', e => {\r\n close.style.display = \"none\";});\r\n document.getElementById(\"invitationPlanner\").style.display = \"block\";\r\n}", "function returntomeni() {\r\n if ($(\".overlay-content\").css(\"display\", \"none\")) {\r\n $(\".closebtn\").removeAttr(\"onclick\");\r\n $(\".closebtn\").click(function () {\r\n $(\".newcntnt\").fadeOut(400);\r\n $(\".overlay-content\").show(500);\r\n $(\".overlay-content\").css(\"display\", \"block\");\r\n if ($(\".overlay-content\").css(\"display\", \"block\")) {\r\n $(\".closebtn\").attr(\"onClick\", \"fclose()\");\r\n }\r\n });\r\n }\r\n}", "get XButton() {\n return $('.anticon-close');\n }", "function closePopup() {\n\t\t$('.overlay-bg, .overlay-content').hide(); // hide the overlay\n\t}", "onCloseButtonClick(event) {\n if ((event.type === 'click' || event.type === 'touch')) {\n\n [].forEach.call(this.content.querySelectorAll(this.options.closeButtonsSelector), closeButton => {\n if (closeButton === event.target || closeButton.contains(event.target)) {\n this.callCustom('preEsc');\n event.stopPropagation();\n this.close('onCloseButtonClickEvent');\n this.callCustom('postEsc');\n }\n });\n }\n }", "function outsideClick(e) {\n if (e.target == popup) {\n popup.style.display = \"none\";\n }\n}", "_handleCloseClick() {\n\t\tthis.close();\n\t}", "function closeModalWindow(event){\n let modalWindow = document.querySelector('.modal-container')\n if (event.target.textContent === 'X'){\n modalWindow.style.display = 'none'\n }\n}", "dismiss(e) {\n //TODO this tap still highlights the menu icon behind it :/\n e.stopPropagation();\n this.opened = false;\n this.dispatchEvent(new CustomEvent(\"iron-overlay-closed\", {\n bubbles: true,\n composed: true,\n detail: { canceled: true },\n }));\n }", "function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n \n }", "handleClickOutside() {\n this._closeOptions();\n }", "_handleCloseTriggerClick(e) {\n let $closeTrigger = $(e.target).closest('.sidenav-close');\n if ($closeTrigger.length && !this._isCurrentlyFixed()) {\n this.close();\n }\n }", "function closeOverlay() {\n $('.sf_overlay').remove();\n}", "clickedClose() {\n this.close(\"slide\");\n }", "function _handleClickOutside(event) {\r\n if (this.options.closeMethods.indexOf('overlay') !== -1 && !_findAncestor(event.target, 'ef-modal') &&\r\n event.clientX < this.modal.clientWidth) {\r\n this.close();\r\n }\r\n }", "handleOutsideClick(e) {\n if (this.node) {\n if (!this.node.contains(e.target)) {\n this.props.model.props.model.viewState.showOverlayContainer = false;\n this.props.model.props.model.viewState.overlayContainer = {};\n this.context.editor.update();\n }\n }\n }", "function overrideBubbleCloseClick() {\n infoBubble.close();\n return false;\n}", "function closePopUp () {\n if ( event.target == bell.querySelector('.icon')) {\n list.style.display = 'none'\n }}", "_createCloseModalButton() {\n const self = this;\n this.closeBtn = this.scene.make.text({\n x: this._getGameWidth() - this.padding - 14,\n y: this._getGameHeight() - this.windowHeight - this.padding + 3,\n text: 'X',\n style: {\n font: 'bold 12px Arial',\n fill: this.closeBtnColor\n }\n });\n this.closeBtn.setInteractive();\n\n this.closeBtn.on('pointerover', function () {\n this.setTint(0xff0000);\n });\n this.closeBtn.on('pointerout', function () {\n this.clearTint();\n });\n this.closeBtn.on('pointerdown', function () {\n self.toggleWindow();\n });\n }", "_outsideClickListener(event) {\n if (event.composedPath().indexOf(this.$.overlay) !== -1 || this._mouseDownInside || this._mouseUpInside) {\n this._mouseDownInside = false;\n this._mouseUpInside = false;\n return;\n }\n\n if (!this._last) {\n return;\n }\n\n const evt = new CustomEvent('vaadin-overlay-outside-click', {\n bubbles: true,\n cancelable: true,\n detail: {\n sourceEvent: event\n }\n });\n this.dispatchEvent(evt);\n\n if (this.opened && !evt.defaultPrevented) {\n this.close(event);\n }\n }", "function closeOpDialog(e) {\n e.stopPropagation();\n $(\"#dlgairops\").css(\"display\", \"none\");\n $(\"#dlgoverlay\").css(\"display\", \"none\");\n}", "function closeOnClickOutside(obj, dropDownContent) {\n document.addEventListener(\"click\", (event) => {\n let target = event.target;\n do {\n if (obj.noteElement == target) {\n return;\n }\n target = target.parentNode;\n } while (target);\n dropDownContent.style.display = \"none\";\n });\n}", "function clickOutside(e) {\n e.preventDefault();\n\n if(!$(e.target).closest('.content', this.el).length) {\n $('>a.close', this.el).trigger('click');\n }\n}", "function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n}", "function closeSearch() {\n document.getElementById(\"myOverlay\").style.display = \"none\";\n}", "_close() {\n const that = this;\n\n that._discardKeyboardHover(true);\n\n if (that._minimized && that._minimizedDropDownOpened) {\n that._positionDetection.removeOverlay();\n that.$view.addClass('jqx-visibility-hidden');\n\n if (that._edgeMacFF) {\n that.$.view.style.left = '';\n that.$.view.style.top = '';\n that.$view.addClass('not-in-view');\n }\n\n that.$hamburgerIcon.removeClass('jqx-close-button');\n that._minimizedDropDownOpened = false;\n }\n }", "function handleCloseClick(){\n handleClose()\n }", "_onCloseButtonTap() {\n this.fireDataEvent(\"close\", this);\n }", "_close() {\n const that = this;\n\n that._positionDetection.removeOverlay();\n that._closeSubContainers(2);\n that._discardKeyboardHover(true);\n\n if (that._minimized && that._minimizedDropDownOpened) {\n that.$mainContainer.addClass('jqx-visibility-hidden');\n\n if (that._edgeMacFF) {\n that.$.mainContainer.style.left = '';\n that.$.mainContainer.style.top = '';\n that.$mainContainer.addClass('not-in-view');\n }\n\n that.$hamburgerIcon.removeClass('jqx-close-button');\n that._minimizedDropDownOpened = false;\n }\n }", "handleOutsideClick(e) {\n if (this.node) {\n if (!this.node.contains(e.target)) {\n this.props.model.props.model.viewState.overlayContainer = {};\n this.props.model.props.model.viewState.showOverlayContainer = false;\n this.props.model.props.editor.update(true);\n }\n }\n }", "function magic8ballXClick() {\n\tvar x = document.getElementById('magic8ballwindow');\n\tx.style.display = \"none\";\n}", "function handleClickOutside(event) {\n if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {\n close();\n }\n }", "function onCloseClick() {\n modalEL.classList.remove(\"is-open\");\n imagePlacer(\"\");\n window.removeEventListener(\"keydown\", onEsc);\n window.removeEventListener(\"keydown\", horizontalSlider);\n}", "function clickOnBackdrop(event) {\n if (event.target === lightbox__overlay ) { closeModal()\n }\n}", "clickOutsideListener(event) {\r\n this.elementVisible = true;\r\n \r\n \r\n this.$emit(\"onHighlightChange\");\r\n if (this.debug === true) {\r\n if (this.display == \"\" || this.display == undefined) {\r\n if (this.$el && !this.$el.contains(event.target)) {\r\n this.close();\r\n this.icon = false;\r\n this.Focusinputbox = false;\r\n }\r\n }\r\n } else {\r\n if (this.$el && !this.$el.contains(event.target)) {\r\n this.close();\r\n this.icon = false;\r\n this.Focusinputbox = false;\r\n }\r\n }\r\n }", "w3_close() {\n\t\tthis.mySidenav.style.display = \"none\";\n\t\tthis.overlayBg.style.display = \"none\";\n\t}", "close() {\n this.header.on('mousedown', null);\n super.close();\n }", "function closeBtnEventHandler () {\n if (KH.cur_territory) {\n KH.globalMap.removeLayer(KH.cur_territory)\n KH.cur_territory = undefined\n }\n}", "function handleClickOutside(event) {\n if (ref.current && !ref.current.contains(event.target)) {\n props.setOpen(false);\n }\n }", "function letXClose () {\r\nlet close = document.getElementsByClassName(\"close\")\r\n for (let i = 0; i < close.length; i++) {\r\n close[i].onclick = function() {\r\n let li = this.parentElement;\r\n li.style.display = \"none\";\r\n }\r\n }\r\n}", "'click .close' (event) {\n console.log(\"MODAL CLOSED VIA X\");\n modal.hide();\n }", "onClick(e) {\n\t\tconst { onClose } = this.props;\n\t\tlet targetElement = e.target; // Clicked element\n\n\t\tdo {\n\t\t\tif (targetElement === this.overlayElement) {\n\t\t\t\t// Click inside overlay\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Move up the DOM\n\t\t\ttargetElement = targetElement.parentNode;\n\t\t} while (targetElement);\n\n\t\t// Click outside overlay\n\t\tonClose();\n\t}", "function drawX()\n\t{\n\t\texitWid = that.add('button', {\n\t\t\tid: 'exitButton',\n\t\t\timage: 'VideoExit',\n\t\t\talpha: 0.7,\n\t\t\tdepth: that.depth + 1,\n\t\t\tclick: close\n\t\t},{\n\t\t\twid: bg,\n\t\t\tat: 'center',\n\t\t\tmy: 'center',\n\t\t\tofs: closeOfsX + ' ' + closeOfsY\n\t\t});\n\t}", "function hi(event, crse, lvl){\n \n document.getElementById('closex').click();\n document.getElementById(lvl).click();\n}", "function menu_action_close(e)\n{\n\ttry {\n\t\tif( e.button == 2 || e.button == 3 )\n\t\t{\n\t\t\treturn;\n\t\t}\n\t}\n\tcatch( acold ) {};\n\t\n\tipsmenu.close(e);\n}", "function onCloseBtnClick() {\n ui.toggleClosePopup();\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "function onClose() {\n if (!isActionSheetOpen.current) {\n Navigation.dismissOverlay(componentId);\n }\n }", "_closeModal( e ) {\n if ( document.body.contains( this._overlay ) ) {\n this._overlay.classList.remove( 'visible' );\n setTimeout( () => { document.body.removeChild( this._overlay ); }, 1000 );\n }\n }", "static popup_close() {\n const context = Utils.popup_context.pop();\n if (typeof AGGrid !== 'undefined')\n AGGrid.popGridContext();\n Utils.popEnterContext();\n $('#' + context.id).hide();\n Utils.globalEnterHandler(context.globalEnterHandler);\n Utils.popup_zindex -= 2;\n if (Utils.popup_zindex < 10)\n Utils.popup_zindex = 10;\n }", "function cropperClose() {\n\t$('mb_close_link').addEvent('click', function() {\n\t\tif($('yt-CropperFrame')) $('yt-CropperFrame').remove();\n\t\tif($('mb_Title')) $('mb_Title').remove();\n\t\tif ($('mb_Error')) $('mb_Error').remove();\n\t\tif ($('mb_contents')) $('mb_contents').removeClass('mb_contents');\n\t\tif($('mb_header')) $('mb_header').removeClass('yt-Panel-Primary');\n\t});\n}", "function clickOutside(e){\n if(e.target == butterFinger){\n butterFinger.style.display = 'none';\n } else if(e.target == okotoks){\n okotoks.style.display = 'none';\n } else if(e.target == prism){\n prism.style.display = 'none';\n }\n }", "function handleClickOutside(event) {\n if (ref.current && !ref.current.contains(event.target)) {\n props.setIsOpen(false);\n }\n }", "function onCloseButtonClick(){\n\t\tt.hide();\n\t}", "close() {\n this._qs(\"#close-popup\").addEventListener(\"click\", () => {\n this.exitDock();\n });\n }", "function handleClickOutside(event) {\n if (wrapperRef.current && !wrapperRef.current.contains(event.target)) {\n setPanelOpen(false);\n }\n }", "function handleClickOutside(event) {\n if (ref.current && !ref.current.contains(event.target)) {\n setOpen(false);\n }\n }", "function IOSShiftCloseButton() {\n // If the user is on iOS we need to shift the video close button to avoid overlap with the fullscreen control element\n if(navigator.userAgent.match(/iPhone/i) || navigator.userAgent.match(/iPod/i)) {\n document.getElementById(\"vs-close-button\").style.left = \"50%\"\n }\n}", "close() {\n this._showPopup = false;\n }", "closeWithAction() {\n this.dismissWithAction();\n }", "function closeLightbox(event) {\n\n}", "w3_close() {\n this.mySidebar.style.display = \"none\";\n this.overlayBg.style.display = \"none\";\n }", "close(e, closeFunction){\n if (e.target.className === \"popup-close-btn\"){\n closeFunction();\n }\n }", "function lkyph_force_close_search_overlay() {\n jQuery(\"#search-overlay\").bind(\"click\", function(e) {\n if (jQuery(e.target).parents(\"#search-overlay .search-form\").length <= 0) {\n jQuery(\"#search-overlay\").removeClass(\"in\");\n }\n });\n}", "closePopVertexInfo() {\n\t\tconst options = { popupId: `${HTML_VERTEX_INFO_ID}_${this.svgId}` };\n\t\tPopUtils.metClosePopup(options);\n\t}", "function onClick(ev) {\n if (ev.target.id === overlayId) overlayOff();\n}", "function close_to_del() {\n text_input.value = \"\";\n toggle_visibility(); //put mouse point input search\n if (text_input.value != \"\") {\n btn_close_to_del.style.display = \"flex\";\n } else {\n btn_close_to_del.style.display = \"none\";\n }\n}", "function watchCloseClick() {\n $('.light-box-area').on('click', '.close-button', function() {\n $('.light-box-area').prop('hidden', true);\n $('iframe').attr('src', '');\n });\n}", "function closeOverlayOnOutsideClick(e) { \n\t\tif (jQuery('.formOverlayWrapper').is(':visible')) {\n\t\t\tvar ele = jQuery(e.target);\n\t\t\tif (!ele.hasClass(\"formOverlay\"))\n\t\t\t{\n\t\t\t\tcloseOverlay();\n\t\t\t};\n\t\t};\n\t}", "function closeDialog() {\n let bubble = document.getElementById('gdx-bubble-host')\n if (bubble) {\n bubble.remove()\n }\n definition = \"&zwnj;\"; // Blank character so the box renders the same size\n}", "handleClickOutside(event) {\n if (this.wrapperRef && !this.wrapperRef.contains(event.target)) {\n\n this.closeModal();\n }\n }", "function closeOverlayOnEsc(evt) {\n var evt = (evt) ? evt : ((event) ? event : null);\n\t\n\t// handle ESC key code\n\tif (evt.keyCode == 27) {\n\t\tcloseOverlay();\n\t\t// Force page reload, otherwise the div#main with position absolute will be wrongly displayed\n\t\t// The wrong display happens only when iFrame with anchors are present in the Help Inline Doc.\n\t\twindow.location.href=window.location.href\n\t}\n}", "externalClickCallback() {\n this.opened = false;\n this.behave(\"close\");\n }", "function w3_close() {\n Sidebar.style.display = \"none\";\n overlayBg.style.display = \"none\";\n}", "function close_btn() {\n\n\t//Close window on click\n\t$(\".close-this\").click(function(){\n\t\t$(this).parent().hide();\n\t});\n}", "function closeDropDown(x){\n\tif (\"ontouchstart\" in document.documentElement)\t//if statement checks for touch device\n\t{\n\t\t\n\t\tif (setLastClick() != x && setLastClick() != -1){\n\t\t\tdocument.getElementsByClassName(\"dropdown-content\")[setLastClick()].style.display='none';\n\t\t\tdocument.getElementsByClassName(\"dropdown-content\")[x].style.display='block';\n\t\t}\n\t\telse if (setLastClick() == -1){\n\t\t\tdocument.getElementsByClassName(\"dropdown-content\")[x].style.display='block';\n\t\t}\n\t\telse if (setLastClick() == x){\n\t\t\t\n\t\t\tif (document.getElementsByClassName(\"dropdown-content\")[x].style.display == 'block'){\n\t\t\t\tdocument.getElementsByClassName(\"dropdown-content\")[x].style.display='none';\n\t\t\t}\n\t\t\telse if (document.getElementsByClassName(\"dropdown-content\")[x].style.display == 'none'){\n\t\t\t\tdocument.getElementsByClassName(\"dropdown-content\")[x].style.display='block';\n\t\t\t}\n\t\t}\n\t\tsetLastClick(x);\n\t}\n}", "function w3_close() {\n\t mySidebar.style.display = \"none\";\n\t overlayBg.style.display = \"none\";\n\t}", "function w3_close() {\n\t mySidebar.style.display = \"none\";\n\t overlayBg.style.display = \"none\";\n\t}", "function w3_close() {\n mySidebar.style.display = \"none\";\n overlayBg.style.display = \"none\";\n}", "function w3_close() {\n mySidebar.style.display = \"none\";\n overlayBg.style.display = \"none\";\n}", "function w3_close() {\n mySidebar.style.display = \"none\";\n overlayBg.style.display = \"none\";\n}", "function w3_close() {\n mySidebar.style.display = \"none\";\n overlayBg.style.display = \"none\";\n}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n }", "function closeDrawerMenu() {\n\t\t\t$('.pure-toggle-label').click();\n\t\t}", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = \"none\";\n }\n }", "clickCloseFbxWindowFileSelector() {\n $('.fbxWindowSelector').hide();\n }", "function outsideClick(e) {\n if (e.target == modal) {\n modal.style.display = 'none'\n }\n }" ]
[ "0.73394465", "0.7004397", "0.6806166", "0.67815644", "0.6752815", "0.6725072", "0.6631751", "0.65811694", "0.6576064", "0.65751594", "0.6536907", "0.6497751", "0.6468628", "0.64231944", "0.64206433", "0.64097744", "0.6408323", "0.6369231", "0.63564783", "0.63530755", "0.63508517", "0.6345012", "0.6342607", "0.6318995", "0.63130456", "0.6312849", "0.63095796", "0.6307387", "0.63039917", "0.6298647", "0.6287881", "0.6284896", "0.6275842", "0.62727314", "0.62722576", "0.62658536", "0.62633693", "0.6261433", "0.6261433", "0.6252347", "0.62480646", "0.6242294", "0.6206155", "0.6184798", "0.6184303", "0.61800706", "0.6160837", "0.61567837", "0.6154443", "0.615007", "0.6149471", "0.6140847", "0.61394095", "0.6133456", "0.61326677", "0.613068", "0.61255497", "0.6118639", "0.6111875", "0.6110805", "0.61053544", "0.61053544", "0.6100978", "0.60967004", "0.60877794", "0.6086921", "0.6082858", "0.6077621", "0.60761374", "0.6072047", "0.60706836", "0.60487145", "0.6035763", "0.6034239", "0.6032409", "0.60227567", "0.60172415", "0.6007995", "0.59988856", "0.59966636", "0.5996561", "0.59896344", "0.5979497", "0.5975256", "0.5971046", "0.5970694", "0.59698564", "0.5969637", "0.5966297", "0.59624374", "0.5955745", "0.5955745", "0.59541845", "0.59541845", "0.59541845", "0.59541845", "0.59529495", "0.59444356", "0.5940016", "0.5938817", "0.5934279" ]
0.0
-1
fn for creating the grid
function createGrid(n) { for (var i = 0; i < n; i++) { for (var j = 0; j < n; j++) { $('.container').append('<div class="square"></div>'); } } //set dimensions $('.square').css('height', 960 / n + 'px'); $('.square').css('width', 960 / n + 'px'); //change colors of squares on hover $('.square').mouseenter(function() { $(this).css('background-color', randColor); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeGrid() {\n\n\n}", "function createGrid(width, height) {\n\n}", "createGrids () {\n }", "function createGrid(){\n for (let i=0; i<gridSize; i++) {\n const div = document.createElement('div');\n grid.appendChild(div);\n // Push elements to previously empty cells array\n cells.push(div);\n }\n createLife();\n generateTrees();\n }", "createGrid(starti, startj, endi, endj, level, mapped) {\n for (let i = 0; i < this.rows; i++) {\n\n let rowgrid = [];\n for (let j = 0; j < this.columns; j++) {\n let cell = new Cell(\n i, \n j, \n (i==starti && j==startj), \n (i==endi && j==endj), \n level, \n mapped\n );\n paintCell(cell);\n rowgrid.push(cell);\n }\n this.grid.push(rowgrid);\n }\n }", "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 createGrid(num) {\n for(let i = 0; i < num **2; i++) {\n container.appendChild(cellNode.cloneNode(true));\n }\n gridFormat(container, num);\n startColor(color);\n \n \n}", "function makeGrid() {\nfor (let x = 0; x < rowsNum.value ; x ++) {\n const insertRow = pixelCanvas.insertRow(0) ;\n for (let y = 0 ; y < cellsNum.value ; y ++) {\n insertRow.insertCell(0) ;\n }\n}\n\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 makeGrid() {\n\t\tfor(let col = 0; col < gridHeight; col++){\n\t\t\tconst cellRow = $('<tr></tr>'); //CREATES TABLE ROWS\n\t\t\tcanvas.append(cellRow);\n\t\t\tfor (let row = 0; row < gridWidth; row++){\n\t\t\t\tconst cell = $('<td></td>');\n\t\t\t\tcellRow.append(cell);\n\t\t\t};\n\t\t};\n\t}", "function createGrid() {\n for (let i = 0; i < DIMENSION; ++i) {\n const container = document.querySelector('#gridContainer');\n const row = document.createElement('div');\n\n row.classList.add('row');\n container.appendChild(row);\n\n for (let j = 0; j < DIMENSION; ++j) {\n const cell = document.createElement('div');\n cell.classList.add('cell');\n\n row.appendChild(cell);\n paint(cell);\n }\n }\n}", "function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" <tr></tr>\");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" <td></td>\");\n }\n}", "function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"<div class='cell'></div>\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\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 }", "function defaultGrid(){\n gridSize(24)\n createDivs(24)\n}", "function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('<div class=\"grid-row\"></div>');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('<div class=\"grid-cell\"></div>')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }", "function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('<tr></tr>');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('<td></td>');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function", "function makeGrid(rows, cols) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for (c = 0; c < (rows * cols); c++) {\n let cell = document.createElement(\"div\");\n container.appendChild(cell).className = \"grid-item\";\n cells[c] = cell;\n cells[c].style.backgroundColor = \"white\"\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 makeGrid(HEIGHT,WIDTH) {\n\n// Your code goes here!\nfor (let i = 0; i < HEIGHT; i++) {\n $PCANVA.append('<tr></td>');\n };\n\n for (let i = 0; i < WIDTH; i++) {\n $('tr').append('<td></td>');\n };\n}", "function drawGrid() {\n noFill();\n stroke(230, 50);\n strokeWeight(2);\n\n for (let j = 0; j < config.numRows; j++) {\n for (let i = 0; i < config.numCols; i++) {\n rect(i * colWidth, j * rowHeight, colWidth, rowHeight)\n }\n }\n }", "function makeGrid() {\n removeGrid();\n let rows = gridHeight.val();\n let columns = gridWidth.val();\n //Add Row to the Table\n for (let addRow = 0; addRow < rows; addRow++) {\n grid.append('<tr class=\"tableRow\">');\n };\n //Add column to the table\n for (let addColumn = 0; addColumn < columns; addColumn++) {\n $(\"tr\").each(function() {\n $(this).append('<td class=\"tableCell\">');\n });\n }\n}", "function makeGrid() {\n\t// hide the Grid by defult to show it in an animation style\n\ttable.hide();\n\ttable.empty();\n\n\tconst width = $('#input_width').val() ;\n\tconst height = $('#input_height').val() ;\n\n\t// no create the Grid !!\n\t// create the rows first (height).\n\tfor(var i = 0; i < height; i++) {\n\t\ttable.append('<tr class=\"rows\"></tr>') ;\n\t}\n\t// then we create the columns(width).\n\tfor(var i = 0; i < width; i++) {\n\t\t$('.rows').append('<td class=\"col\"></td>') ;\n\t}\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 createGrid() {\n var gridCanvas = document.createElement('canvas');\n gridCanvas.width = gridSize.cols*gridSize.square;\n gridCanvas.height = gridSize.rows*gridSize.square;\n var gridContext = gridCanvas.getContext('2d');\n\n // pass canvas to external variable so it can be used elsewhere as an image\n gridImage = gridCanvas;\n\n var horizontal;\n var vertical;\n var positionX = 0+(canvas.width/2)-32+320; // starting position of hooks\n var positionY = 0;\n var order;\n\n for (var i = 0; i < gridSize.cols; i++) {\n if (order === true) {\n order = false;\n } else {\n order = true;\n }\n drawCol(gridContext,positionX,order);\n positionX += 64;\n }\n}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}", "function createGrid(rows, cols) {\n let r = 0;\n let c = 0;\n let child_index = 0;\n let grid_size = grid.childElementCount;\n for (r=0; r < rows; r++) {\n for (c=0; c < cols; c++) {\n if (child_index >= grid_size) {\n addCell(child_index);\n }\n child_index++;\n }\n }\n if (start == 0) {\n setStart(0);\n }\n document.documentElement.style.setProperty(\"--rowNum\", rows.toString());\n document.documentElement.style.setProperty(\"--colNum\", cols.toString());\n}", "function makeGrid(h,l) {\n // Remove previous grid if any\n $(grid).children().remove();\n // Loops to draw new Grid\n for (i=0 ; i<h ; i++){ // Loop on each row\n grid.append('<tr></tr'); //Add the row\n for (j=0 ; j<l ; j++){ //Loop on each column\n let currentRow =grid.find('tr').last();\n currentRow.append(\"<td></td>\"); // Add a cell at the end of the current row\n }\n }\n}", "function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('<tr></tr>');\n for (let j = 0; j < width; j++) {\n row.append('<td></td>');\n }\n canvas.append(row);\n }\n}", "function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"<div class='grid'></div>\");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}", "createBdryGrid() {\n this.p.push()\n let rows = this.rows / this.scale\n let cols = this.cols / this.scale\n let cellSize = this.cellSize * this.scale\n\n this.p.stroke(200,200,200)\n\n for (let i=0; i<=cols; i++) {\n let x = this.x + cellSize*i\n this.p.line(x,this.y, x, this.y +this.h)\n \n }\n\n for (let i=0; i<=rows; i++) {\n let y = this.y + cellSize*i\n this.p.line(this.x, y, this.x+this.w, y)\n }\n this.p.pop()\n }", "function makeGrid(){\n\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\n\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\n\n\tfor(var i=0;i<inputHt;i++){\n\t\t$('#pixelCanvas').append(\"<tr id=row\" +i+ \"></tr>\"); //creating rows\n\t\tfor(var j=0;j<inputWt;j++){\n\t\t\t$('#row'+i).append(\"<td></td>\"); //creating columns\n\t\t}\n\t}\n}", "function defineGrid(n){\n\t\tvar boardDiv = document.getElementsByClassName(\"boardCls\")[0] ;\n\t\t$(\"#board\").html(\"\")\n\t\tlet cnt=0 ;\n\t\tfor(let i=0;i<n;i++)\n\t\t{\n\t\t\tvar rowDiv = document.createElement(\"div\") ;\n\t\t\trowDiv.classList.add(\"row\") ;\n\t\t\trowDiv.style.height=(580/n)+\"px\";\n\n\t\t\tfor(let j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tvar singleDiv = document.createElement(\"div\") ;\n\t\t\t\tsingleDiv.classList.add(\"block\") ;\n\t\t\t\tsingleDiv.style.width=(580/n)+\"px\" ;\n\t\t\t\tvar para = document.createElement(\"p\") ;\n\t\t\t\tpara.classList.add(\"number\") ;\n\t\t\t\t\n\t\t\t\tsingleDiv.id=\"block-\"+cnt ;\n\t\t\t\tpara.id=\"blk-\"+cnt;\n\t\t\t\tcnt++ ;\n\t\t\t\tsingleDiv.appendChild(para) ;\n\t\t\t\trowDiv.appendChild(singleDiv) ;\n\t\t\t}\n\t\t\tboardDiv.appendChild(rowDiv) ;\n\t\t}\n\t}", "function makeGridData(rowcount, colcount, tile_size) {\n\tvar data = new Array();\n\tvar xpos = 1; //starting xpos and ypos at 1 so the stroke will show when we make the grid below\n\tvar ypos = 1;\n\tvar width = tile_size.w;\n\tvar height = tile_size.h;\n\tvar click = 0;\n\t\n\t// iterate for rows\t\n\tfor (var row = 0; row < rowcount+1; row++) {\n\t\tdata.push( new Array() );\n\t\t\n\t\t// iterate for cells/columns inside rows\n\t\tfor (var column = 0; column < colcount+1; column++) {\n\t\t\tdata[row].push({\n\t\t\t\trownum: row,\n\t\t\t\tcolnum: column,\n\t\t\t\tx: xpos,\n\t\t\t\ty: ypos,\n\t\t\t\twidth: width,\n\t\t\t\theight: height,\n\t\t\t\tclick: click,\n\t\t\t})\n\t\t\t// increment the x position. I.e. move it over by 50 (width variable)\n\t\t\txpos += width;\n\t\t}\n\t\t// reset the x position after a row is complete\n\t\txpos = 1;\n\t\t// increment the y position for the next row. Move it down 50 (height variable)\n\t\typos += height;\t\n\t}\n\treturn data;\n}", "function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "function createGrid() {\n\t// create 2 rows\n // for (var rows = 0; rows < 2; rows++) {\n // $(document.body).append(\"<div class='cards'>khjhjh</div>\");\n // }\n\t// create 2 tiles inside each row\n\tfor (var columns = 0; columns < 4; columns++) {\n\t $('.cards').append(\"<div class='tile'></div>\");\n\t}\n}", "function createGrid (num)\n\t{\n\t\tfor( var i = 0; i < (num * num); i++)\n\t\t{\n\t\t\tvar $grid = $('<div></div>');\n\t\t\t$('#container').append($grid);\n\t\t}\t\n\n\t\t//Sets grid === to height and width of container\n\t\t//2 is used to account for the margin around the boxes.\n\t\t$('div div').height($('#container').height() / num - 2); \n\t\t$('div div').width($('#container').width() / num - 2);\n\t}", "createGrid() {\n const board = $(this.selector);\n board.empty();\n\n console.log(board);\n for (let x = 0; x < this.ROWS; x++) {\n const row = $('<div>').addClass('row');\n board.append(row);\n for (let y = 0; y < this.COLS; y++) {\n // gives each index of the rows and columns using the attr\n const col = $('<div>').addClass('col empty').attr('data-col', y).attr('data-row', x);\n row.append(col);\n }\n }\n\n }", "function makeGrid(height,width,table){\n for(var r=0;r<height;r++){\n var newRow = table.insertRow(r);\n for(var c =0;c<width;c++){\n newRow.insertCell(c);\n }\n }\n}", "buildGrid() {\n const $game = $(this.selector);\n for (let row = 0; row < this.Rows; row++) {\n const $row = $(\"<div>\")\n .addClass(\"row\");\n //columns must be nested inside of the rows. for-loop will generate columns.\n for (let col = 0; col < this.Cols; col++) {\n const $col = $(\"<div>\")\n .addClass(\"empty column\")\n .attr(\"data-column\", col)\n .attr(\"data-row\", row)\n $row.append($col);\n }\n $game.append($row);\n }\n }", "function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('<tr></tr>');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('<td></td>')\n }\n }\n}", "function makeGrid(){\r\n $('#pixel_canvas').children().remove();\r\n row=$('#input_height').val();\r\n column=$('#input_width').val();\r\n var i=0;\r\n while(i<row){\r\n $('#pixel_canvas').append('<tr></tr>');\r\n for(var j=0;j<column;j++){\r\n $('tr').last().append('<td></td>');\r\n }\r\n i++;\r\n }\r\n }", "function makeGrid(number) {\nfor (i = 0; i < (number * number); i++) {\n container.style.gridTemplateColumns = `repeat(${number}, auto)`;\n const square1 = document.createElement('div');\n square1.classList.add('square1');\n let size = 700/number\n square1.style.width = size;\n square1.style.height = size;\n container.appendChild(square1);\n }\n}", "function makeGrid(cols, rows) {\n for (let i = 0; i < (cols * rows); i++) {\n const div = document.createElement('div');\n div.style.border = '1px solid black';\n container.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${rows}, 1fr)`;\n container.appendChild(div).classList.add('box');\n }\n}", "function createGrid( rows, cols ) {\n\n let html = '';\n const con = document.querySelector('.con');\n\n // Create and Store the Grid\n for( let i = 0; i < rows; i++ ) {\n\n grid[i] = [];\n let rowHtml = '';\n let rowConHtml = `<div class='row' id='${i}'></div>`;\n con.innerHTML += rowConHtml;\n let rowCon = document.getElementById(i.toString());\n\n for( let j=0; j < cols; j++ ) {\n\n let block = new Block(i, j);\n grid[i].push(block);\n rowHtml = `<div class='block' id=${block.id}>&nbsp</div>`\n rowCon.innerHTML += rowHtml;\n\n }\n\n }\n\n // Add each block's neighbors\n for( let i = 0; i < rows; i++ ) {\n\n for( let j = 0; j < cols; j++ ) {\n\n grid[i][j].addNeighbors();\n\n }\n\n }\n\n}", "function createGrid(){\n\tvar totalGridBlocks = totalImagesReturned + (expandedImages*3);\n\tif (totalGridBlocks%4 == 0){\n\t\ttotalClusters = totalGridBlocks/4;\n\t} else {\n\t\ttotalClusters = (totalGridBlocks/4) + 1;\n\t}\n\t$(\".gridContainer\").empty();\n\tfor (i=0;i<totalClusters;i++){\n\t\t$(\".gridContainer\").append(\"<div class='gridCluster' data-cluster='\"+i+\"'><div class='gridBlock block0' data-block='0'></div><div class='gridBlock block1' data-block='1'></div><div class='gridBlock block2' data-block='2'></div><div class='gridBlock block3' data-block='3'></div></div>\");\n\t}\n\tfillGrid();\n}", "function createGrid(rows, cols) {\n // Creo el arreglo de arreglos\n var matrix = new Array();\n\n // Creo los arreglos de los arreglos\n for (var row = 0; row < rows; row++) {\n matrix.push(new Array());\n\n // Creo las celdas\n for (var col = 0; col < cols; col++) {\n matrix[row].push({ x: col, y: row, active: false, empty: true, idx: row * board_cols + col })\n }\n }\n return matrix;\n }", "makeGrid() {\n let grid = []\n for (let row = 0; row < 18; row ++) {\n grid.push([])\n for (let col = 0; col < 10; col ++) {\n grid[row].push(<Square key={`${col}${row}`} color=\"1\" />)\n }\n }\n return grid\n }", "function createGrid() {\n grid = [];\n\n //setup cell size and margins\n let cell, marginX, marginY;\n\n //portrait\n if ((width - margin * 2) * GRID_ROWS / GRID_COLS < height - margin * 2) {\n cell = (width - margin * 2) / GRID_COLS;\n marginX = margin;\n marginY = (height - cell * GRID_ROWS) / 2;\n }\n //landscape\n else {\n cell = (height - margin * 2) / GRID_ROWS;\n marginX = (width - cell * GRID_COLS) / 2;\n marginY = margin;\n }\n\n //populate the grid\n for (let i = 0; i < GRID_ROWS; i++) {\n grid[i] = [];\n for (let j = 0; j < GRID_COLS; j++) {\n let left = marginX + j * cell;\n let top = marginY + i * cell;\n grid[i][j] = new Cell(left, top, cell, cell, i, j);\n }\n }\n}", "function createGrid(){\n var color = '#BDBDBD';\n \n //Creates vertical grid\n for(var i = origin.x; i < canvasWidth; i += step){ //Populates right of the origin\n var line = two.makeLine(i, 0, i, canvasHeight);\n line.linewidth = 1;\n line.stroke = color;\n }\n for(var i = origin.x; i > 0; i -= step){ //Populates left of the origin\n var line = two.makeLine(i, 0, i, canvasHeight);\n line.linewidth = 1;\n line.stroke = color;\n }\n \n \n //Creates horizontal grid\n for(var i = origin.y; i < canvasHeight; i += step){ //Populates above the origin\n var line = two.makeLine(0, i, canvasWidth, i);\n line.linewidth = 1;\n line.stroke = color;\n }\n for(var i = origin.y; i > 0; i -= step){ //Populates below the origin\n var line = two.makeLine(0, i, canvasWidth, i);\n line.linewidth = 1;\n line.stroke = color;\n }\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function createGrid(playerStartPosition) {\n // Using for loop to create grid, because we can specify how long we want it to run for\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // Set cell number based on i (Turn on for development reasons to see cell index)\n //cell.innerHTML = i\n // Add each div to parent grid as children\n grid.appendChild(cell)\n // adds's each cell to an array\n cells.push(cell)\n }\n\n addPlayer(playerStartPosition)\n }", "function createGrid() {\n\n const frame = null; // get a reference to the frame\n\n // Add Code to create the game grid\n for (let i = 0; i < 10 ; i++) {\n buildRow(frame); \n }\n resetGame();\n}", "function makeGrid()\n\t{\n\t\tgridData = []\n\t\tK = 0\n\t\tfor (var i = window.nCells.hori ; i >= 0; i--) {\n\t\t\tgridData.push({x1:K,x2:K,y1:0,y2:screenH()})\n\t\t\tK += window.cellDim.w\n\t\t};\n\t\tK = 0\n\t\tfor (var i = window.nCells.vert ; i >= 0; i--) {\n\t\t\tgridData.push({x1:0,x2:screenW(),y1:K,y2:K})\n\t\t\tK += window.cellDim.h\n\t\t};\n\n\t\tsvg.selectAll(\"line.gridLine\").remove()\n\t\tsvg.selectAll(\"line.gridLine\")\n\t\t\t.data(gridData)\n\t\t\t.enter()\n\t\t\t.append(\"line\")\n\t\t\t.attr('class','gridLine')\n\t\t\t.attr(\"x1\",function(d){return(d.x1)})\n\t\t\t.attr(\"x2\",function(d){return(d.x2)})\n\t\t\t.attr(\"y1\",function(d){return(d.y1)})\n\t\t\t.attr(\"y2\",function(d){return(d.y2)})\n\t\t\t.attr(\"stroke-width\",.2)\n\t\t\t.attr(\"stroke\",'rgb(0,0,0)');\n\t}", "function gridify_the_canvas(canvas){\n\t\n\t\n\tvar counter = 0, row = 0, column = 0 ;\n\t\t\n\tfor(y=0 ; y< canvas.height; y+= gridSpace_height){ \t\n\t\tfor(x=0 ; x < canvas.width; x+= gridSpace_width){ \n\t\t\t\n\t\t\t\n\t\t\tcenterPoint = {'x': column*gridSpace_width + gridSpace_width/2 ,\n\t\t\t\t'y': row*gridSpace_height + gridSpace_height/2 };\n\t\t\tvar topLeft = {'x': x, 'y': y}, topRight = {'x': x +gridSpace_width, 'y': y},\n\t\t\tbottomLeft = { 'x' : x, 'y': y + gridSpace_height }, \n\t\t\tbottomRight = {'x' : x+gridSpace_width, 'y': y + gridSpace_height }\t\n\t\t\t\n\t\t\tvar grid = new createjs.Grid({ 'width' : gridSpace_width,\n\t\t\t 'height' : gridSpace_height, 'row' : row, 'column': column,\n\t\t\t 'centerPoint': centerPoint, 'topLeft': topLeft ,\n\t\t\t 'topRight': topRight, 'bottomLeft': bottomLeft, 'bottomRight': bottomRight,\n\t\t\t 'order': counter, 'name' : 'grid_' + counter\t\t\t \n\t\t\t });\n\t\t\t\n\t\t\tgrids.push( grid);//I want global access to them\n\t\t\tstage.addChild(grid);\n\t\t\t\n\t\t\tcounter++;\n\t\t\tcolumn++; \t\n\t\t\t\n\t\t\t\n\t\t}\n\t\trow++; column = 0;\t\n\t}\n\t\n\t//Lets set some general grid information for snapping\n\tvar number_of_grids_in_one_row = canvas.width / gridSpace_width,\n\t number_of_grids_in_one_column = canvas.height / gridSpace_height;\n\t\t\n\tgridInformation.number_of_grids_in_one_row =number_of_grids_in_one_row;\n\tgridInformation.number_of_grids_in_one_column = number_of_grids_in_one_column;\n\tgridInformation.number_of_grids = number_of_grids_in_one_row\n\t\t* number_of_grids_in_one_column;\n\t\n\tgridInformation.row_index = function(me){\n\t\tvar row_index = [];\n\t\tfor (var i = 0; i <= me.number_of_grids_in_one_column; i++) {\n\t\t\trow_index.push(i);\n\t\t}\n\t\t \n\t\treturn row_index;\t\n\t}(gridInformation)\n\t\n\t\t\t\n\t\t\n}", "function createGrid() {\n grid = [];\n let cell, marginX, marginY;\n\n // Portrait\n if (((width - margin * 2) * GRID_ROWS) / GRID_COLS < height - margin * 2) {\n cell = (width - margin * 2) / GRID_COLS;\n marginX = margin;\n marginY = (height - cell * GRID_ROWS) / 2;\n }\n // Landscape\n else {\n cell = (height - margin * 2) / GRID_ROWS;\n marginX = (width - cell * GRID_COLS) / 2;\n marginY = margin;\n }\n\n // Populate the grid\n for (let i = 0; i < GRID_ROWS; i++) {\n grid[i] = [];\n\n for (let j = 0; j < GRID_COLS; j++) {\n let left = marginX + j * cell;\n let top = marginY + i * cell;\n\n grid[i][j] = new Cell(left, top, cell, cell, i, j);\n }\n }\n}", "drawGrid() {\n translate(this.xOffset, this.yOffset);\n background(color('black'));\n for (let x = 0; x <= this.width; x++) {\n\n for (let y = 0; y <= this.height; y++) {\n fill(color('white'))\n strokeWeight(1);\n rect(x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n\n // Draw the position of the entry\n fill(color('gray'));\n if (this.gridLayout[x][y] != null)\n text(x + \",\" + y + \"\\n\" + this.gridLayout[x][y].name, x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n else\n text(x + \",\" + y + \"\\n\", x * this.boxSize, y * this.boxSize, this.boxSize, this.boxSize);\n }\n }\n }", "function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }", "function makeGrid(height, width) {\n // Firstly clear canvas and then start again\n while (canvas.hasChildNodes()){\n canvas.removeChild(canvas.firstChild);\n }\n // Iterate with given height and width to create the clear canvas\n for(var x = 0; x<height; x++){\n var row = document.createElement('tr');\n canvas.appendChild(row);\n for(var y = 0; y<width; y++){\n var column = document.createElement('td');\n row.appendChild(column);\n }\n }\n\n}", "function makeGrid() {\n\n canvas.innerHTML = '';\n\t\n\t\n // This builds the rows and columns\n var fragment = document.createDocumentFragment();\n\t\n for (let a = 0; a < height.value; a++) {\n var tr = document.createElement('tr');\n\n for (let b = 0; b < width.value; b++) {\n var td = document.createElement('td');\n tr.appendChild(td);\n }\n\n tr.addEventListener('click', clickedBox);\n fragment.appendChild(tr);\n\t\n }\n \n \n \n // Push grid onto DOM\n canvas.appendChild(fragment);\n \n}", "function makeGrid(newNum){\n userInptNum = newNum;\n container.style.gridTemplateRows = userInptNum;\n container.style.gridTemplateColumns = userInptNum;\n\n for (let i = 1; i <= userInptNum; i++){\n for(let j = 1; j <= userInptNum; j++){\n let square = document.createElement('div');\n square.classList.add('square');\n square.style.backgroundColor = \"rgb(250,250,250\";\n square.style.gridRow = i;\n square.style.gridColumn = j;\n container.appendChild(square);\n\n }\n \n }\n getColor();\n \n}", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function makeGrid(){\n\t\tvar startX = 149;\n\t\tvar startY = 119;\n\t\tvar interval = 6;\n\t\tvar nodeArray = [];\n\t\tfor (var i=0; i<660; i+=interval){\n\t\t\tfor (var j=0; j<660; j+=interval){\n\t\t\t\tnodeArray.push({x:startX+i,y:startY+j,city:null});\n\t\t\t}\n\t\t}\n\t\treturn nodeArray;\n\t}", "function makeGrid(gridContainerSize) {\n for (let i = 0; i < gridContainerSize ** 2; i++) {\n cell = document.createElement('div');\n cell.classList.add('cell');\n cell.style.backgroundColor = 'white';\n gridContainer.appendChild(cell);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridContainerSize}, auto)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridContainerSize}, auto)`;\n}", "function makeGrid(x,y) {\n $('#pixel_canvas').empty();\n for(let i=0; i<y; i++){\n let row = $('<tr>');\n $('#pixel_canvas').append(row);\n for(let j=0; j<x; j++){\n $(row).append('<td class=\"cell\"></td>');\n }\n }\n}", "function makeGrid(h,w) {\n for(let i = 1; i <= h; i++) {\n grid.append(\"<tr></tr>\");\n let j = 1;\n while (j <= w){\n $(\"tr\")\n .last()\n .append(\"<td></td>\");\n j++;\n }\n } \n}", "function createGrid() {\n const frame = document.getElementById('frame');\n // Add Code to create the game grid\n for (let i = 0; i < 10 ; i++) {\n buildRow(frame); \n }\n setupGame();\n}", "function createGrid(board){\n if (board === 'board1') {\n var prefix = 'P1'\n } else {\n var prefix = 'P2'\n }\n board = document.getElementById(board)\n var letters = ['A', 'B', 'C','D','E','F','G','H','I','J']\n var tbl = document.createElement('table');\n var tblBody = document.createElement('tbody');\n\n for(var i = 0; i < 10; i++){\n var row = document.createElement('tr');\n for(var j = 0; j < 10; j++){\n var id = prefix + letters[j] + (i + 1);\n var col = document.createElement('td');\n col.setAttribute('id', id);\n col.setAttribute('class', 'box');\n row.appendChild(col);\n }\n tblBody.appendChild(row);\n }\n tbl.appendChild(tblBody);\n board.appendChild(tbl);\n\n\n}", "function makeGrid(nCells) {\n sizeOfCells = getSizeOfCells(maxSize, nCells);\n\n container.style['grid-template'] = \n `repeat(${nCells}, ${sizeOfCells}) / repeat(${nCells}, ${sizeOfCells})`;\n\n for (let i = 0; i < nCells; i++) {\n for (let j = 0; j < nCells; j++) {\n div = document.createElement('div');\n div.classList.add('cell');\n div.setAttribute('data-counter', 10);\n container.appendChild(div);\n }\n }\n}", "function drawGrid(){\n\t\tvar h = gameArea.canvas.height();\n\t\tvar w = gameArea.canvas.width();\n \n\n var paths = {\n strokeStyle : settings.gridColor,\n strokeWidth: .5,\n layer :true,\n name: 'grid'\n };\n \n var pathCount = 0;\n\t\tfor (var y = 0; y <= h; y += h/settings.rows) {\n pathCount++;\n paths[\"p\"+pathCount] = {\n type: 'line',\n x1: 0, y1: y,\n x2: w, y2: y\n };\n\t\t}\n\n\t\tfor (var x = 0; x <= w; x += w/settings.columns) {\n pathCount++;\n paths[\"p\"+pathCount] = {\n type: 'line',\n x1: x, y1: 0,\n x2: x, y2: h\n };\n\t\t}\n gameArea.canvas.drawPath(paths);\n\t}", "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 createGrids() {\n // Clear previous grids\n $(\"#inputGrid\").empty();\n $(\"#outputGrid\").empty();\n\n // Set size for new grids\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n\n $(\"#inputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#inputGrid\").css(\"grid-template-rows\", `${rows}`);\n $(\"#outputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#outputGrid\").css(\"grid-template-rows\", `${rows}`);\n\n let grids = parseInt($(\"#width\").val()) * parseInt($(\"#height\").val());\n\n for (let i = 0; i < grids; i++) {\n $(\"#inputGrid\").append(`<div id=\"input${i}\" style=\"background-color: white;\" onmouseover=paint(this)></div>`);\n $(\"#outputGrid\").append(`<div id=\"output${i}\" style=\"background-color: white;\"></div>`);\n }\n\n NETWORK = new HopfieldNetwork(parseInt($(\"#width\").val()) * parseInt($(\"#height\").val()));\n}", "function createGrid() {\n\t$('.header').append('<div class=\"container\"></div>'); //create container\n var $row = $(\"<div />\", {\n \tclass: 'row'\n\t});\n\tvar $square = $(\"<div />\", {\n \tclass: 'sq'\n\t});\n\n for (var i = 0; i < columns; i++) {\n $row.append($square.clone());\n }\n for (var i = 0; i < rows; i++) {\n $(\".container\").append($row.clone());\n }\n}", "function makeGrid() {\n canvas.find('tbody').remove();\n\n //submit button size changes to fit grid size\n var gridRows = heightInput.val();\n var gridCol = weightInput.val();\n\n //tbody set to the table\n canvas.append('<tbody></tbody>');\n\n var canvasBody = canvas.find('tbody');\n\n //drawing grid rows\n for (var i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n //draw grid col\n for (var i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n }", "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 }", "function agpMakeGrid(evt) {\n // turn off the default event processing for the submit event\n evt.preventDefault();\n // reset the default canvas color to white as the default\n document.getElementById(\"colorPicker\").value = \"#ffffff\";\n\n // remove any existing art work\n let agpPixelCanvas=document.getElementById('pixelCanvas');\n while (agpPixelCanvas.hasChildNodes()) {\n agpPixelCanvas.removeChild(agpPixelCanvas.firstChild);\n }\n\n // retrieve the grid heoght and width\n let agpGridHeight=document.getElementById('inputHeight').value;\n let agpGridWidth=document.getElementById('inputWidth').value;\n\n // create the row elements and within those, the individual table cells\n for (var j=0;j<agpGridHeight;j++){\n let tr=document.createElement('tr');\n agpPixelCanvas.appendChild(tr);\n for (var i=0;i<agpGridWidth;i++){\n // append a table cell to the row in question\n let td=document.createElement('td');\n tr.appendChild(td);\n }\n }\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 createGrid() {\n for (let i = 0; i < gridCellCount; i++) { // this adds id number to each cell / div\n const cell = document.createElement('div')\n cell.setAttribute('id', i)\n // cell.textContent = i\n cells.push(cell)\n grid.appendChild(cell)\n }\n \n // console.log('cells', cells)\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}", "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 makeGrid(){\n\n table.innerHTML =''; //czyszczenie tabeli\n\n const fragment = document.createDocumentFragment(); // DocumentFragment wrapper\n\n for(let h = 0; h < gridHeight.value; h++){\n let tr = document.createElement('tr');\n fragment.appendChild(tr);\n for(let w = 0; w < gridWitdh.value; w++){\n let td = document.createElement('td');\n tr.appendChild(td);\n }\n }\n table.appendChild(fragment);\n colorSet();\n colorClick();\n colorRemove();\n}", "function makeGrid(n,m) {\n\n\tfor(let i=1; i<=n; i++) {\n\t\t//create a row\n\t\t$('#pixelCanvas').append('<tr id=table' + i + '></tr>');\n\n\t\tfor(let j=1; j<=m; j++) {\n\t\t\t//add a td or cell to row\n\t\t\t$('#table' + i).append('<td></td>');\n\t\t}\n\t}\n\n\t//add color to cell when clicked\n\t$('td').click(function addColor() {\n\t\tlet color = $('#colorPicker').val();\n\n\t\tif($(this).attr('style')) {\n\t\t\t$(this).removeAttr('style')\n\t\t} else {\n\t\t\t$(this).attr('style', 'background-color:' + color);\n\n\t\t}\n\t})\n}", "function makeGrid(inputHeight, inputWidth) {\n var grid = '';\n\n for (let i = 0; i < inputHeight; i++) {\n grid += '<tr>';\n for (let w = 0; w < inputWidth; w++) {\n grid += '<td class=\"cell\"></td>';\n };\n grid += '</tr>';\n };\n\n //append grid to the table\n pixelCanvas.innerHTML = grid;\n}", "_make_grid() {\n this.options.grid.element.style.gridTemplateColumns = 'repeat(' + this.options.grid.columns + ', 1fr)';\n for (let i in this.options.symbols) {\n let symbol = document.createElement('div');\n symbol.className = this.options.classes.symbol;\n symbol.id = this.options.classes.symbol + '_' + i;\n symbol.textContent = this.options.symbols[i];\n this.options.grid.element.appendChild(symbol);\n }\n if (!this.options.grid.borders) set_css_var('--grid-border-size', '0');\n this._resize();\n window.onresize = this._resize.bind(this);\n }", "function makeCells() {\n let rowsI = document.getElementById('rows-input');\n let columnsI = document.getElementById('columns-input');\n let cellAmount = rowsI.value * columnsI.value;\n console.log(rowsI.value);\n console.log(columnsI.value);\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\n for (i = 0; i < cellAmount; i++){\n let cell = document.createElement('div');\n cell.className = 'cell';\n cell.id = `cell-${i}`;\n board.appendChild(cell);\n }\n}", "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "function makeGrid(height, width) {\n // set size of canvas\n for (var i = 0; i < height.value; i++) {\n const row = canvas.insertRow(i); // calls the function to set size rows\n for (var j = 0; j < width.value; j++) {\n const cell = row.insertCell(j); // cal the function to set size of insertCell\n cell.addEventListner(\"click\", fillSquare);\n }\n }\n}", "function createGrid() {\n for (let i=1; i<=gridSize; i++){\n var div = document.createElement(\"div\");\n div.id = 'n' + i;\n div.innerText = i;\n document.getElementById(\"target\").appendChild(div);\n }\n}", "function makeGrid() {\n\n let h = height.value;\n let w = width.value;\n\n // Clear table\n for (let i = table.rows.length; i > 0 ; i--) {\n table.deleteRow(i - 1);\n }\n\n for (let y = 0; y < h; y++) {\n const newTr = document.createElement('tr');\n table.appendChild(newTr);\n for (let x = 0; x < w; x++) {\n const newTd = document.createElement('td');\n table.lastChild.appendChild(newTd);\n }\n }\n\n let cell = table.querySelectorAll('td');\n\n for (let i = 0; i < cell.length; i++) {\n cell.item(i).addEventListener('click', function () {\n this.style.backgroundColor = color.value;\n });\n }\n}", "function buildGrid() {\n var grid = [];\n for (var row = 0; row < height / unit; row++) {\n grid.push([]);\n for (var col = 0; col < width / unit; col++) {\n grid[row].push(false);\n }\n }\n return grid;\n }", "function createGrid() {\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // cell.innerText = i\n grid.appendChild(cell)\n cells.push(cell)\n\n // generate borders and map\n if (level === 'beginner') {\n if (i < width || (i % width === 0 && i !== 55) || (i % width === width - 1 && i !== 65) || i + width > width * width - 1 || borderArray.includes(i)) {\n cell.classList.add(borderClass)\n } else if (i === 27) {\n cell.classList.add(fossilClass)\n } else if (i === 20 || i === 100) {\n cell.classList.add(netClass)\n } else if (i === 48 || i === 50) {\n cell.classList.add(fenceClass)\n } else if (!cell.classList.contains(borderClass) && !cell.classList.contains(fossilClass) && !cell.classList.contains(netClass) & !cell.classList.contains(fenceClass) && i !== 59 & i !== 60 & i !== 61) {\n cell.classList.add(foodClass)\n }\n\n grabLives[2].classList.add(hiddenClass)\n\n if (i === 58) {\n centerText = document.createElement('div')\n cell.appendChild(centerText)\n center = document.createElement('p')\n centerText.appendChild(center)\n centerText.classList.add('center-text')\n centerText.classList.add(hiddenClass)\n }\n }\n }\n\n center.innerText = 'Welcome to Animal Crossing, PacMan Edition. \\n Press Start to begin!'\n centerText.classList.remove(hiddenClass)\n center.classList.add('welcome')\n\n addPlayer(playerStartPosition)\n console.log('player added at start')\n addGhost(scorpianStartPosition, scorpianClass)\n addGhost(tarantulaStartPosition, tarantulaClass)\n addGhost(waspStartPosition, waspClass)\n }", "function makeGrid() {\r\n newCanvas.innerHTML = \"\";\r\n for (let h = 0; h < gridHeight.value; h++) {\r\n const rows = document.createElement(\"tr\");\r\n newCanvas.insertAdjacentElement(\"afterbegin\", rows);\r\n for (let w = 0; w < gridWidth.value; w++) {\r\n const cells = document.createElement(\"td\");\r\n cells.addEventListener(\"click\", function () {\r\n cells.style.backgroundColor = cellColor.value;\r\n });\r\n rows.appendChild(cells);\r\n }\r\n }\r\n}", "function gridGenerate(numRow, numColumn, output){\n\n //Variabile che registra la larghezza del quadrato in base al NUMERO\n //delle colonne da generare\n var modWidth = numColumn;\n var addRow;\n var addSquare;\n\n for (var i = 0; i < numRow; i++) {\n addRow = $('#myTemplate .row').clone();\n\n for (var j = 0; j < numColumn; j++) {\n addSquare = $('#myTemplate .square').clone();\n\n addSquare.css( \"width\", \"calc(100% /\"+numColumn+\" - 5px)\" );\n addRow.append(addSquare);\n\n }\n output.append(addRow);\n\n console.log(\"RigaGenerata con quadrati interni\", addRow);\n }\n\n}", "function createGrid(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n}", "function drawGrid() {\n\t\t\t// add container styles\n\t\t\t$container.addClass('container gantt');\n\t\t\t\n\t\t\t// empty container\n\t\t\t$container.empty();\n\t\t\t\t\t\t\n\t\t\t// render contents into container\n\t\t\t$container.append(gridTmpl(controller));\t\n\t\t\tinitEls();\n\t\t\t\n\t\t\t// adjust layout components\n\t\t\tadjustLayout();\n\t\t\tinitHScroller();\t\t\t\n\t\t}", "function createGrid(size = 4) {\n \n if ( size > 64 || isNaN(size)) return alert('the number has to be less than 64');\n \n for (let i = 0 ; i<size*size; i++){\n const createDivs = document.createElement('div');\n createDivs.style.width = `${(100/size)-0.4}%`;\n createDivs.classList.add('grid');\n main.appendChild(createDivs);\n}\n mouseOver();\n}", "function grid() {\n\tvar spaceX = 64;\n\tvar spaceY = spaceX;\n\n\tstroke(200);\n\tfor (var i = 64; i < width; i += 64) {\n\t\tline(i, 0, i, height);\n\t}\n\tfor (var i = 64; i < height; i += 64) {\n\t\tline(0, i, width, i);\n\t}\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}" ]
[ "0.8553344", "0.85037625", "0.84827507", "0.7795531", "0.7753312", "0.7719408", "0.7676123", "0.7655384", "0.7632385", "0.7601156", "0.75957614", "0.75624585", "0.755135", "0.7548448", "0.7548448", "0.7548448", "0.7548448", "0.7543822", "0.750867", "0.75029343", "0.74987143", "0.7498", "0.7480961", "0.745848", "0.74559283", "0.7447373", "0.7442762", "0.7440537", "0.74388593", "0.74213254", "0.7417349", "0.74164927", "0.7411089", "0.73866266", "0.73843443", "0.7369933", "0.7359859", "0.73505396", "0.7343423", "0.7329239", "0.7318956", "0.73097736", "0.73062325", "0.7296827", "0.7294604", "0.7281752", "0.72733617", "0.7269968", "0.72687554", "0.72555715", "0.72536767", "0.72507197", "0.72181296", "0.7209686", "0.7201093", "0.71979654", "0.7197809", "0.7189626", "0.7181214", "0.7179938", "0.7170619", "0.71700305", "0.7166017", "0.71620786", "0.7156825", "0.71523714", "0.71502656", "0.7148336", "0.71479356", "0.7145642", "0.7144244", "0.71324813", "0.71254265", "0.7124775", "0.7120655", "0.71200734", "0.71054715", "0.7091251", "0.7090721", "0.7082579", "0.70801663", "0.70766455", "0.7070419", "0.70680237", "0.7055283", "0.7054881", "0.7051679", "0.70490193", "0.7043762", "0.70401984", "0.7040045", "0.70372087", "0.70323116", "0.7031332", "0.7008877", "0.6986076", "0.6983307", "0.6981575", "0.6980856", "0.69801", "0.69775194" ]
0.0
-1
remove square divs and create new grid
function reset(n) { $('.container > div').remove(); createGrid(n); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearGrid(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n changeSquareColor();\n}", "function removeGridChilds() {\n while (sketchContainer.firstChild) {\n sketchContainer.removeChild(sketchContainer.lastChild);\n }\n}", "function removegrid(size) {\n for (let i = 1; i < (size + 1); i++) { \n const removeDiv = document.getElementById(`grid${i}`);\n removeDiv.remove();\n }\n}", "function clearGrid(){\n\t$(\"div.pixel\").remove();\n}", "function deleteDivs() {\n let grid = Array.from(container.childNodes);\n grid.forEach((element) => {\n container.removeChild(element); \n })\n}", "function newSize(number) { \n let squareAll = document.querySelectorAll(\".square1\");\n squareAll.forEach(function(square1) {\n square1.remove();\n })\n makeGrid(number);\n }", "function deleteSquares(){\n let grid = document.getElementById('grid');\n while(grid.firstChild){\n grid.removeChild(grid.firstChild);\n }\n}", "function cleanGrid(){\n while (canvasBox.hasChildNodes()){\n canvasBox.removeChild(canvasBox.firstChild);\n }\n}", "function removeGrid() {\n console.log(\"REDRAW\");\n const list = document.getElementsByClassName(\"grid-row\");\n for (let i = list.length - 1; 0 <= i; i--)\n if (list[i] && list[i].parentElement)\n list[i].parentElement.removeChild(list[i]);\n gridSize();\n}", "function removeCubesFromGrid(size){\n for(i = 0; i < size * size; i++){\n document.getElementById(i).remove();//removing cubes\n }; \n}", "function createGrid(num, colour){\n $('.wrapper > div').remove();\n for(var i = 0; i < num * num; i++){\n $newdiv = $('<div class=\"square\" />');\n $squareSize = 480 / num\n $('.wrapper').append($newdiv);\n $('.square').css(\"width\", $squareSize);\n $('.square').css(\"height\", $squareSize);\n $('.square').css(\"background-color\", \"#CFCFCF\");\n }\n}", "function removeBoardPaint() {\n let getHeightDivs = document.querySelectorAll('.tr');\n for (let index = 0; index < getHeightDivs.length; index += 1) {\n getHeightDivs[index].remove();\n }\n}", "function clearGrid() {\n while(container.firstChild) {\n container.removeChild(container.firstChild);\n }\n}", "function deleteGrid(){\n var myNode = document.getElementById('grid-container');\n while(myNode.firstChild){\n myNode.removeChild(myNode.firstChild);\n }\n // RESET COLOR TO DEFAULT\n rainbowColor = false;\n darkenColor = false;\n}", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function ChangeGrid() {\n\n let userGrid = prompt(\"Choose a desired grid\");\n let pixels = 100 / userGrid;\n let columns = pixels + \"% \";\n\n for (var i = 0; i < userGrid - 1; i++) {\n\n columns += pixels + \"% \";\n\n }\n\n bigContainer.style.gridTemplateColumns = columns;\n bigContainer.querySelectorAll('*').forEach(n => n.remove());\n\n for (var i = 0; i < userGrid; i++) {\n\n LoadDivs(userGrid);\n\n }\n\n ClearFunction();\n\n}", "function removeGrid() {\n for (var i = 0; i<= gridGroup.children.length-1; i++) {\n gridGroup.children[i].remove();\n }\n gridGroup.remove();\n}", "function drawCleanNtGrid() {\n\tlet nextTetroInnerHTML = ''\n\tfor (let y = 0; y < 4; y++) {\n\t\tfor (let x = 0; x < 4; x++) {\n\t\t\tnextTetroInnerHTML += '<div class=\"cell\" style=\"opacity:0.25;\"></div>'\n\t\t}\n\t\tnextTetroInnerHTML += '<br/>'\n\t}\n\tnextTetroElem.innerHTML = nextTetroInnerHTML\n\tntCells = Array.from(nextTetroElem.querySelectorAll('.cell'))\n\twhile (ntCells.length) ntCellsArr.push(ntCells.splice(0, 4))\n}", "function reset(){\n while(gridSquare.firstChild){\n gridSquare.removeChild(gridSquare.firstChild);\n }\n}", "function clearGrid() {\n while (grid.firstChild) {\n grid.removeChild(grid.firstChild);\n }\n }", "function removeGrid() {\n grid.empty();\n}", "function removeDivFromGrid() {\n while (true) {\n let div = document.querySelector('#cell');\n if (grid.contains(div)) {\n grid.removeChild(div);\n } else {\n break;\n }\n }\n}", "function clearGrid(){\n while (container.hasChildNodes()){\n container.removeChild(container.firstChild);\n }\n}", "function clearScreen() {\n const squares = document.querySelectorAll('.square');\n // Remove squares from DOM\n squares.forEach((square) => {\n square.remove();\n });\n const userSquares = prompt(\"Enter number of squares per side\");\n createGrid(userSquares);\n}", "function createGrid(size) {\n var wrapper = $('#wrapper'),\n squareSide = 600 / size;\n $(wrapper).empty();\n for (var i = 0; i < size; i++) {\n for (var j = 0; j < size; j++) {\n $(wrapper).append('<div class=square id=xy_' + i + '_' + j + '></div>');\n\n }\n }\n\n //Single square size setting\n $('.square').css({\n \"height\": squareSide + \"px\",\n \"width\": squareSide + \"px\"\n\n });\n }", "function resetGridPixels() {\n const innerDivArray = Array.from(document.querySelectorAll(\".innerDiv\"));\n const outerDivArray = Array.from(document.querySelectorAll(\".outerDiv\"));\n const sketchPad = document.querySelector(\".sketch-pad\");\n sketchPad.innerHTML = \"\";\n}", "function clearGrid() {\n while (grid.firstChild){\n grid.removeChild(grid.firstChild);\n }\n}", "function deleteGrid(grid) {\n\tgrid.classList.remove('wall-grid');\n\tgrid.classList.remove('point-grid');\n\tgrid.classList.remove('pacman-grid');\n\tgrid.classList.add('empty-grid');\n\n\tgrid.removeAttribute('style');\n\tgrid.innerHTML = '';\n\tgrid.style.border = '1px solid #E5E5E5';\n\tgrid.style.backgroundColor = '#FFF';\t\n}", "function clearGrid(){\n $(\".grid\").remove();\n}", "function makeGrid(gridSize) {\n\n // Clear out any html in main.\n gridContainer.innerHTML = \"\";\n\n let fragment = new DocumentFragment();\n\n // Create divs.\n for(let i = 0; i < gridSize; i++) {\n for(let j = 0; j < gridSize; j++) {\n const square = document.createElement(\"div\");\n square.classList.add(\"square\");\n square.setAttribute(\"filled\", false);\n \n square.style.width = (500 / gridSize) + \"px\";\n square.style.height = (500 / gridSize) + \"px\";\n \n fragment.appendChild(square);\n }\n }\n\n // Set up hover event listeners.\n fragment.querySelectorAll('.square').forEach(function(square) {\n square.addEventListener(\"mouseover\", function(){\n if (eraseMode == true) {\n square.style.backgroundColor = \"white\";\n square.setAttribute(\"filled\", false);\n } else {\n\n // If square is already filled reset sat, and opacity for that square.\n if (square.getAttribute(\"filled\") === \"true\") {\n square.style.filter = `none`;\n square.style.opacity = 100;\n }\n\n if (colorChoice === \"rainbow\") {\n square.style.backgroundColor = rainbowColors[getRandomInt(0, rainbowColors.length - 1)];\n square.setAttribute(\"filled\", true);\n } else {\n square.style.backgroundColor = colorChoice;\n square.setAttribute(\"filled\", true);\n }\n }\n });\n });\n\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n gridContainer.append(fragment);\n}", "function clearSqr () {\n //function that clears all squares\n const clearSqr = document.getElementsByClassName('square')\n for (let i = clearSqr.length-1; i>=0; i--) {\n clearSqr[i].remove();\n }\n //function that creates new squares\n let sqrNum = prompt('Enter number of squares between 4-64')\n let newNum = Math.pow(sqrNum,2)\n for (let i=0; i<newNum; i++){\n createSquare()\n\n//gives square a color whwn mouse enters a square \nlet columns = container.style.setProperty('grid-template-columns', 'repeat(' + sqrNum + ', 1fr)');\nlet rows = container.style.setProperty('grid-template-rows', 'repeat(' + sqrNum + ', 1fr)');\n };\n changeColor()\n}", "function clearGrid() {\n const gridArray = Array.from(gridContainer.childNodes);\n gridArray.forEach((element) => {\n gridContainer.removeChild(element);\n });\n}", "function emptyGrid() {\n while (grid.hasChildNodes()) {\n grid.removeChild(grid.children[0]);\n }\n}", "function cleanGrid(){\n\t$(\"div.pixel\").css({\"background-color\": \"#FFFFFF\"});\n}", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function clearBoard(event) {\n\t\tfor (i = 0; i < squares.length; i++) {\n\t\t\tsquares[i].className = \"col-sm-2 unUsedSquare\";\n\t\t\tsquares[i].style.backgroundColor= \"white\";\n\t\t\tsquares[i].innerHTML=\"\";\n\t\t}\n\t}", "function createGrid() {\n\t$('.header').append('<div class=\"container\"></div>'); //create container\n var $row = $(\"<div />\", {\n \tclass: 'row'\n\t});\n\tvar $square = $(\"<div />\", {\n \tclass: 'sq'\n\t});\n\n for (var i = 0; i < columns; i++) {\n $row.append($square.clone());\n }\n for (var i = 0; i < rows; i++) {\n $(\".container\").append($row.clone());\n }\n}", "function createNewDivGrid(divNumber){\n $(\"#inner-wrapper\").empty();\n for(i = 1; i <= divNumber; i++){\n $(\"#inner-wrapper\").append(columnDiv);\n for(j = 1; j <= divNumber; j++){\n $(\".row-wrapper\").last().append(gridDiv);\n }\n }\n}", "function clearGrid() {\n const gridArray = Array.from(gridContainer.childNodes);\n gridArray.forEach((element) => {\n gridContainer.removeChild(element);\n });\n}", "function createGrid(size) {\n\tif (gridBlocks.length > 0) {\n\t\tfor (let block = 0; block < gridBlocks.length; block++) {\n\t\t\tcontainer.removeChild(gridBlocks[block]);\n\t\t}\n\n\t\tgridBlocks = [];\n\t}\n\n\tcontainer.style['grid-template-columns'] = `repeat(${size}, 1fr)`;\n\n\tfor (let i = 0; i < (size * size); i++) {\n\t\tconst gridBlock = document.createElement('div');\n\t\tgridBlock.style.width = `${480 / size}`;\n\t\tgridBlock.style.height = `${480 / size}`;\n\t\tgridBlock.style.border = '1px solid rgba(0, 0, 0, 0.3)';\n\t\tcontainer.appendChild(gridBlock);\n\n\t\tgridBlocks.push(gridBlock);\n\t}\n\n\tcheckForClick();\n\n}", "function clearPrevGrid(){\n // Select all the squares\n let squares = qsa(\".square\");\n // Remove the contents of all squares\n for (let i = 0; i < squares.length; i++) {\n squares[i].remove();\n }\n // Clear any remaining time on timer\n if (timer) {\n clearTimeout(timer);\n }\n // Deselect any numbers still selected\n for (let i = 0; i < id(\"number-selector\").children.length; i++) {\n id(\"number-selector\").children[i].classList.remove(\"selected\");\n }\n // Clear all selected variables\n selectedNumber = null;\n selectedSquare = null;\n}", "remakeGrid(){\n let grid = document.getElementById('gridEl');\n let newGrid = grid.cloneNode(true); \n grid.innerHTML = '';\n grid.parentNode.replaceChild(newGrid, grid);\n }", "function clearGrids() {\n $(\"#inputGrid > div\").each(function(index, item) {\n $(item).css(\"background-color\", \"white\");\n });\n\n $(\"#outputGrid > div\").each(function(index, item) {\n $(item).css(\"background-color\", \"white\");\n });\n}", "function renderGrids(x){\n\t\tfor (var i = 0; i < x; i++){\n\t\t\tvar pixels = document.createElement('div');\n\t\t\tpixels.className = 'miniDiv';\n\t\t\tcontainer.appendChild(pixels);\n\t\t}\n\t}", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function createDivs(gridDimension, canvasSize) {\n $(\".container\").children().remove();\n $(\".container\").append(\"<table>\");\n for(i=0; i< gridDimension; i++) {\n $(\".container\").append(\"<tr>\");\n for(j=0; j < gridDimension; j++) {\n $(\".container\").append(\"<td></td>\")\n $(\"td\").css(\"height\", canvasSize/gridDimension);\n $(\"td\").css(\"width\", canvasSize/gridDimension);\n }\n $(\".container\").append(\"</tr>\");\n }\n $(\".container\").append(\"</table>\");\n drawOnCanvas(getColor());\n}", "function removeSquares() {\r\n const selectSquares = document.querySelectorAll('.squares');\r\n selectSquares.forEach((e) => e.remove());\r\n}", "function clearGrid () {\n squares.forEach(square => {\n square.removeEventListener('mouseenter', paintSquare);\n square.style.backgroundColor = 'rgb(228, 166, 125)';\n square.addEventListener('mouseenter', paintSquare);\n });\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function createGrid(squaresPerSide) {\r\n for (i = 0; i < squaresPerSide * squaresPerSide; i++) {\r\n const square = document.createElement('div');\r\n square.classList.add('square');\r\n square.style.width = (750 / squaresPerSide - 2).toString() + 'px';\r\n square.style.height = (750 / squaresPerSide - 2).toString() + 'px';\r\n container.appendChild(square);\r\n }\r\n}", "function deleteGrid() {\n while (gridContainer.firstChild) {\n // gridContainer.removeEventListener('mousedown', sketch);\n // gridContainer.removeEventListener('mouseenter', sketch);\n gridContainer.lastChild = null;\n gridContainer.removeChild(gridContainer.lastChild);\n console.log('deleted');\n }\n}", "function Layout(){\r\n for(let i=0;i<squares.length;i++)\r\n {\r\n let divs = document.createElement(\"div\")\r\n grid.appendChild(divs)\r\n square.push(divs)\r\n if(squares[i]===1) square[i].classList.add(\"wall\")\r\n else if(squares[i]===0) square[i].classList.add(\"pac-dots\")\r\n else if(squares[i]===3) square[i].classList.add(\"power-pellet\")\r\n else if(squares[i]===2) square[i].classList.add(\"ghost-liar\")\r\n }\r\n}", "function clearGrid (){\n for (let i = 0; i < 625; i++){\n cells[i].classList = null\n \n }\n }", "function removePathingVisuals() {\n for (const node of grid.childNodes) {\n if (node.classList.contains(\"square\")) {\n node.classList.remove(\"square-open\");\n node.classList.remove(\"square-closed\");\n node.classList.remove(\"square-on-path\");\n }\n }\n pathVisualsPresent = false;\n}", "function clearGrid() {\n\t$('.box').css('background', '#faebd7');\n}", "function createChildDivs(gridSize) {\n for (let i = 1; i <= (gridSize * gridSize); i++) {\n squareDiv[i] = document.createElement(\"div\");\n }\n newGrid(gridSize)\n}", "function removeGrid(id){\n id++;\n for(var i = 0; i < row; i++){\n for(var j = 0; j < col; j++){\n document.getElementById(`p${id}-${i}-${j}`).removeEventListener(\"click\", markCoordinates);\n }\n }\n}", "function clearBoard() {\n\tdocument.getElementById('gridClear').play();\n\tfor(x = 0; x < 7; x++){\n\t\tfor(y = 0; y < 6; y++) {\n\t\t\tgrid[x][y] = null;\n\t\t\t$('#'+(x+1)+'_'+(y+1)).css('visibility', 'hidden');\n\t\t}\n\t}\n}", "clearCells(){\n var cells = this.GRID_DIV.children;\n for (var i = 0; i < cells.length; i++) {\n var cell = cells[i];\n cell.style.backgroundColor = \"white\";\n }\n this.saveLocally();\n }", "function generateGrid(blocks){\n //subtracting by 10 due to the px values associated with the padding and margin properties\n var gridSquareHeightAndWidth = Math.floor(960/blocks)-10;\n var toAdd = document.createDocumentFragment();\n for(let x=1; x<=blocks; x++){\n for(let y=1; y<=blocks; y++){\n var gridSquare = document.createElement(\"div\");\n gridSquare.id = \"grid-square\";\n gridSquare.style.width = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.height = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.backgroundColor = \"white\";\n gridSquare.addEventListener(\"mouseover\", e => {\n e.target.style.backgroundColor = \"black\";\n })\n toAdd.appendChild(gridSquare);\n }\n }\n document.getElementById(\"container\").appendChild(toAdd); \n}", "function createGrid(){\n\tvar totalGridBlocks = totalImagesReturned + (expandedImages*3);\n\tif (totalGridBlocks%4 == 0){\n\t\ttotalClusters = totalGridBlocks/4;\n\t} else {\n\t\ttotalClusters = (totalGridBlocks/4) + 1;\n\t}\n\t$(\".gridContainer\").empty();\n\tfor (i=0;i<totalClusters;i++){\n\t\t$(\".gridContainer\").append(\"<div class='gridCluster' data-cluster='\"+i+\"'><div class='gridBlock block0' data-block='0'></div><div class='gridBlock block1' data-block='1'></div><div class='gridBlock block2' data-block='2'></div><div class='gridBlock block3' data-block='3'></div></div>\");\n\t}\n\tfillGrid();\n}", "function clearGrid(){\n console.log(\"clearGrid\")\n for (let i = 0; i < GRID_ROW_SIZE; i++) { \n for (let j = 0; j < GRID_COL_SIZE; j++) {\n Grid[i][j].State = \"NULL\"\n Grid[i][j].VisitedAt = -1\n document.getElementById(Grid[i][j].id).innerHTML=\"\";\n \n }\n }\n Grid[0][0].State = \"Start\"\n Grid[GRID_ROW_SIZE-1][GRID_COL_SIZE-1].State = \"End\"\n document.getElementById(Grid[0][0].id).innerHTML=\"<div class='startpoint'></div>\";\n document.getElementById(Grid[GRID_ROW_SIZE-1][GRID_COL_SIZE-1].id).innerHTML=\"<div class='endpoint'></div>\";\n \n}", "function deleteBoard(){\n\tif(grid != null){\n \t\tdocument.body.removeChild(grid);\n \t}\n}", "function removeShape() {\n for (var row = 0; row < currentShape.shape.length; row++) {\n for (var col = 0; col < currentShape.shape[row].length; col++) {\n if (currentShape.shape[row][col] !== 0) {\n grid[currentShape.y + row][currentShape.x + col] = 0;\n }\n }\n }\n}", "function clearGrid(squareContent) {\n squareContent.style.backgroundColor = '#FFFFFF';\n}", "function generateLayout() {\n let game = document.getElementById('game')\n let gap, rows\n\n game.innerHTML = ''\n\n for (let r = 0; r < gridSize; r++) {\n let rowDiv = document.createElement('div')\n\n rowDiv.className = 'row'\n\n for (let c = 0; c < gridSize; c++) {\n let tile = document.createElement('div')\n\n tile.className = 'tile'\n tile.id = `${c},${r}`\n tile.onclick = () => {\n whackYagoo([c, r])\n }\n\n gap = 90 / (gridSize * 2 - 1)\n tile.style.width = `${gap}vmin`\n tile.style.height = `${gap}vmin`\n tile.style.clipPath = `circle(${gap / 2}vmin at center)`\n rowDiv.appendChild(tile)\n }\n\n game.appendChild(rowDiv)\n }\n\n game.style.rowGap = `${gap}vmin`\n rows = document.getElementsByClassName('row')\n for (let i = 0; i < rows.length; i++) {\n rows[i].style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`\n rows[i].style.columnGap = `${gap}vmin`\n }\n}", "function removeRemoves() {\n if (doubleAchieved == true) {\n for (var doubleRow = 0; doubleRow <= 3; doubleRow++) {\n for (var doubleColumn = 0; doubleColumn <= 3; doubleColumn++) {\n if (removeArray[doubleRow][doubleColumn] == \"remove\") {\n $(document.getElementById(\"tile-\" + (4 * doubleRow + doubleColumn + 1).toString())).remove();\n tileArray[doubleRow][doubleColumn] = null;\n removeArray[doubleRow][doubleColumn] = null;\n }\n }\n }\n doubleAchieved = false;\n }\n }", "function setTracksGridContainer() {\n \n let emptySpaceCount = 0;\n\n for (let i = 0; i < rows; i++) {\n soundGrid[i] = []; // Make soundGrid a 2D array\n for (let j = 0; j < columns; j++) {\n \n let trackEmptySpace = document.createElement(\"div\");\n trackEmptySpace.ondragover = onDragOver;\n trackEmptySpace.ondragleave = onDragLeave;\n trackEmptySpace.ondrop = onDrop;\n trackEmptySpace.classList.add(\"track-empty-space\");\n trackEmptySpace.id = \"empty-space--\" + emptySpaceCount++;\n \n tracksGridContainer.appendChild(trackEmptySpace);\n\n // Adds a -1 instead of an empty audio buffer \n // to help keep track of empty spaces\n soundGrid[i][j] = -1;\n }\n }\n }", "function makeGrid() {\n\tevent.preventDefault();\n\tconst height = document.getElementById(\"input_height\").value;\n\tconst width = document.getElementById(\"input_width\").value;\n\tlet table = document.getElementById(\"pixel_canvas\");\n\tconst delELeCell = document.getElementsByClassName(\"cell\");\n\t//console.log(delELeCell.length);\n\tlet k = delELeCell.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delELeCell[k].parentNode;\n\t\tparent.removeChild(delELeCell[k]);\n\t\tk--;\n\t}\n\n\tconst delRow = document.getElementsByClassName(\"row\");\n\tk = delRow.length - 1;\n\twhile(k >= 0){\n\t\tconst parent = delRow[k].parentNode;\n\t\tparent.removeChild(delRow[k]);\n\t\tk--;\n\t}\n\n\tfor(let i = 0; i < height; i++){\n\t\tconst row = document.createElement(\"tr\");\n\t\trow.setAttribute(\"id\", `row_${i}`);\n\t\trow.setAttribute(\"class\", \"row\");\n\t\ttable.appendChild(row);\n\t\t//const findRow = document.getElementById(`row_${}`)\n\t\tfor(let j = 0; j < width; j++){\n\t\t\tconst column = document.createElement(`td`);\n\t\t\tcolumn.setAttribute(\"id\", `cell_${i}_${j}`);\n\t\t\tcolumn.setAttribute(\"class\", \"cell\");\n\t\t\trow.appendChild(column);\n\t\t}\n\t}\n\tconst buttonLen = document.getElementsByTagName(\"button\");\n\tif(buttonLen.length === 0){\n\t\tconst button = document.createElement(\"button\");\n\t\tconst text = document.createTextNode(\"Reset\");\n\t\tbutton.appendChild(text);\n\t\tdocument.getElementsByTagName(\"body\")[0].appendChild(button);\n\t}\n}", "function newGrid(gridSize) {\n // Set parent style as grid\n removeAllChildNodes(squareDivContainer);\n squareDivContainer.style.grid = `repeat(${gridSize}, 1fr) / repeat(${gridSize}, 1fr)`;\n // Assign column and row numbers to each of the squares\n for (let column = 1; column <= gridSize; column++) {\n for (let row = 1; row <= gridSize; row++) {\n // Stylize each of the squares\n let sqNmbr = row + gridSize * (column - 1);\n squareDiv[sqNmbr].style.cssText = `grid-column: ${column}; \n grid-row: ${row}; border: 1px solid #E5EAF5; background-color: white`;\n squareDiv[sqNmbr].setAttribute(\"class\", \"square-div\");\n // Append the squares to the parent div container\n squareDivContainer.appendChild(squareDiv[sqNmbr]);\n }\n hoverColor();\n }\n}", "function makeGrid(){\n var rowNumber = prompt(\"How many rows on the grid?\");\n var sideSize = 700 / rowNumber;\n var elementNumber = \" \";\n for (var i = 0; i < rowNumber * rowNumber; i++){\n elementNumber += \"<div class = 'square'></div>\";\n }\n $(document).ready(function() {\n $('.square').remove(); //clears grid \n $('body').find(\"#container\").append(elementNumber);\n $('.square').css({\"height\": sideSize + 'px', \"width\": sideSize + 'px'});\n $(document).on('mouseenter', '.square', function() {\n $(this).css(\"background-color\", \"#255E69\");\n });\n });\n}", "function makeGrid(squaresPerSide) {\n\n //Add div rows(basically tr), to act as rows\n for (var i = 0; i < squaresPerSide; i++) {\n $('#pad').append('<div class=\"row\"></div>');\n }\n\n //Add div squares(basically td), to ever row\n for (var i = 0; i < squaresPerSide; i++) {\n $('.row').append('<div class=\"square\"></div>');\n }\n\n //Set square size= giant grid div divided by sqperside\n var squareDimension = $('#pad').width() / squaresPerSide;\n $('.square').css({\n 'height': squareDimension,\n 'width': squareDimension\n });\n}", "function createGame() {\n for (var i = 0; i < 3; i++) {\n var rowDiv = document.createElement(\"div\");\n rowDiv.classList.add(\"row\");\n\n for (var j = 0; j < 3; j++) {\n var gridDiv = document.createElement(\"div\");\n gridDiv.id = \"square_\" + i + \"_\" + j;\n gridDiv.classList.add(\"col-lg-4\");\n gridDiv.classList.add(\"col-sm-4\");\n gridDiv.classList.add(\"col-4\");\n gridDiv.classList.add(\"blank\");\n $('<img/>').attr('src', blankImg).addClass('img-responsive').appendTo(gridDiv);\n rowDiv.appendChild(gridDiv);\n }\n\n document.getElementById(\"playarea\").appendChild(rowDiv);\n if (i < 2) {\n $(\"<br>\").appendTo(document.getElementById(\"playarea\"));\n }\n }\n}", "function resetGrid() {\n gridPositionsi = [0];\n gridPositionsj = [0];\n userMoves = [0];\n id =0;\n $('.gridsquare'+width).removeClass('cursor'+width);\n $('.gridsquare'+width).removeClass('correct-square')\n $('.gridsquare'+width).removeClass('incorrect-square');\n $('#0').html('<div class=\"cursor'+width+'\"></div>');\n $('.cursor'+width).addClass('animated infinite pulse')\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 createGrid(squareNumber) {\n container.setAttribute('id', 'container');\n container.style.cssText = `margin: 0 auto; \n background-color: rgb(228, 166, 125);\n width: ${width}px;\n height: ${height}px;\n display: grid;\n cursor: crosshair;\n box-shadow: -1px 2px 12px 5px rgb(112, 80, 80);\n grid-template-columns: repeat(${squareNumber}, ${parseInt(height) / squareNumber}px);\n grid-template-rows: repeat(${squareNumber}, ${parseInt(width) / squareNumber}px);`;\n gameWindow.appendChild(container);\n\n for (let i = 1; i <= squareNumber; i++) {\n for (let j = 1; j <= squareNumber; j++) {\n const newDiv = document.createElement('div');\n newDiv.setAttribute('class', 'item');\n newDiv.style['text-align'] = 'center';\n newDiv.style['grid-area'] = `${i} / ${j} / span 1 / span 1`;\n newDiv.style.opacity = '0.0';\n //newDiv.style.border = '.5px dotted grey';\n container.appendChild(newDiv);\n console.log(`Created a div with row: ${i} and column: ${j}`);\n squares.push(newDiv);\n // puts an event listener on all divs that constantly listens for the paintSquare function on mouseenter\n newDiv.addEventListener('mouseenter', paintSquare);\n }\n }\n}", "function eraseGrid(){ \n grid.innerHTML = '';\n buildGrid(selectedSize);\n}", "clearBoard () {\n $('.mushroom-container').empty();\n }", "function createDivs(maxRow) {\n var wrapperDiv = document.getElementById('mazeWrapper');\n var rowDiv;\n\tfor (var i=0; i < maxRow; i++) {\n\t var thisDiv = document.createElement('div');\n thisDiv.id = 'mazeRow-' + i;\n thisDiv.className = 'row';\n \t wrapperDiv.appendChild(thisDiv);\n for (var j=0; j < maxColumn; j++) {\n rowDiv = document.getElementById('mazeRow-' + i);\n var thisColumnDiv = document.createElement('div');\n thisColumnDiv.id = (i*maxRow)+j;\n thisColumnDiv.className = 'mazehole';\n //if a shape other then square is chosen\n var shape = $('#shapeChoice').val();\n thisColumnDiv.classList.add(shape);\n rowDiv.appendChild(thisColumnDiv);\n }\n }\n}", "function displayGrid(n) {\n var viewportSize = $(window).height();\n var heightLimit = viewportSize*.75;\n $('.wrapper').width(heightLimit);\n // Hacky element here to remove the 2 pixels of border\n var boxSize = (heightLimit/n) - 2;\n var wrapper = $('.wrapper').html(\"\");\n for (var i=0;i<n;i++){\n for (var j=0;j<n;j++){\n wrapper.append($('<div></div>').addClass('tile').width(boxSize).css('padding-bottom', boxSize));\n }\n //wrapper.append($('<div></div>').css('clear', 'both'));\n }\n wrapper.append($('<div></div>').css('clear', 'both'));\n}", "function resetBoard() {\n board = [];\n $(__BOARD__).children().remove();\n let nbTilesBuilt = 0;\n let arrayTmp = [];\n board.push(arrayTmp);\n let index1D = 0;\n let index2D = -1;\n while(nbTilesBuilt < nbTiles) {\n if(index2D !== 0 && index2D % (nbColumns - 1) === 0) {\n arrayTmp = [];\n board.push(arrayTmp);\n index1D++;\n index2D = 0;\n } else {\n index2D++;\n }\n arrayTmp.push(__BLACK_TILE_CLASS__);\n $(__BOARD__).append(\"<div data-index-1d='\" + index1D + \"' data-index-2d='\" + index2D + \"' class='\" + __BLACK_TILE_CLASS__ +\n \"' style='width:\"+ sizeTile +\"px; height:\"+ sizeTile +\"px;'></div>\");\n nbTilesBuilt++;\n }\n}", "function buildSweeperGrid() {\n\n var gameArea = document.getElementById('game');\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(game.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n row.classList.add('flex');\n console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(game.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('w-16');\n cell.classList.add('h-16');\n\n\n cell.classList.add('cell');\n cell.classList.add('border');\n cell.classList.add('border-black');\n cell.classList.add('m-0');\n row.appendChild(cell);\n\n console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\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 changePixels() {\n let pixels = slider.value;\n\n let gridPixels = container.querySelectorAll('div');\n gridPixels.forEach(cell => cell.remove());\n\n makeRows(pixels, pixels, currColor);\n}", "function clearPlayArea () {\n // queryselect only after the divs have been added. else it only consists of bottombun\n ingredients = document.querySelectorAll('.ingredients')\n ingredients.forEach(function (el) {\n if (el.id !== 'bottombun') { // remove everything leaving bottom div\n el.parentNode.removeChild(el)\n }\n })\n }", "function resetPuzzlePieces(){\n //empty the thumbnail container\n // debugger;\n \tpiecesBoards.innerHTML = \"\";\n \tcreatePuzzlePieces(this.dataset.puzzleref);\n // foreach has specify a callback function in the array\n // empty the drop zones\n dropZones.forEach(zone => {\n // removeChild\n while (zone.firstChild) zone.removeChild(zone.firstChild);\n // ouputs a message and writes into the console of the browser Chrome\n console.log(\"Ciao, see you later!\");\n });\n }", "function createGrid(){\n\n etchContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n \n for (let i = 0; i < gridSize * gridSize; i++){\n let etchSquareDiv = document.createElement(\"div\");\n etchSquareDiv.className = 'etchSquare';\n\n //add listener to change the color, for the sketching purposes\n etchSquareDiv.addEventListener(\"mouseenter\", function(){\n etchSquareDiv.style.backgroundColor = 'black';\n })\n\n etchContainer.appendChild(etchSquareDiv);\n } \n}", "function initializeDivs(numPerSide) {\t\n\tvar wrapper = $(\"#wrapper\");\n\twrapper.empty();\n\tvar size = squareSize(numPerSide);\n\tvar count = 0;\n\tfor (var i=0; i < numPerSide; i++) {\n\t\tfor (var j=0; j < numPerSide; j++) {\n\t\twrapper.append(\"<div id=\\\"\"+i+\"\\\" class=\\\"canvasSquare\\\"></div>\");\n\t\tcount++;\n\t\t}\n\t}\n\t$(\".canvasSquare\").width(size);\n\t$(\".canvasSquare\").height(size);\n\t$(\".canvasSquare\").css({\"float\": \"left\", \"border\":\"none\", \"margin\": \"0px auto\"})\n\tselectMode();\n}", "function resetGrid(){\n let divCount = prompt(\"How many boxes per side do you need?\");\n clearGrid();\n createGrid(divCount);\n}", "function cleardisplay(){\n $('.textbox-row').closest('.row-fluid').remove();\n $(\".firstDiv\").remove();\n $('.side-labels').empty();\n $(\".start-row\").empty();\n $(\".chart-container\").remove();\n $(\".continue-row\").remove();\n chart = [];\n }", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n const square = document.createElement(\"div\");\n //put this child into the gird\n grid.appendChild(square);\n squares.push(square);\n\n // Assigning a random colour to each div\n let randomColor = Math.floor(Math.random() * coloursOfCancy.length);\n square.style.backgroundImage = coloursOfCancy[randomColor];\n\n //To drag each square and give unique ID to each cell so we can see which square is actually moved.\n square.setAttribute(\"draggable\", \"true\");\n square.setAttribute(\"id\", i);\n }\n }", "function reset(grids){\n grids.forEach((grid) => {\n grid.style.backgroundColor = \"white\";\n });\n\n let size = prompt(\"Enter the size of the new grid: \");\n\n //Check to see if size enter > 100\n while(size > 100 || size < 0){\n size = prompt(\"The entered size must be <= 100 and > 0. Enter the size of the new grid: \");\n }\n\n //remove the old grid\n grids.forEach((grid) => {\n grid.remove();\n });\n\n let container = document.querySelector(\"#container\");\n\n //rebuild the new grid\n container.style.cssText = `grid-template-columns: repeat(${size}, ${960/size}px);\n grid-template-rows: repeat(${size}, ${960/size}px)`;\n /* Create div cell */\n for(let i = 0; i < size; i++){\n for(let j = 0; j < size; j++){\n let div = document.createElement(\"div\");\n div.classList.add(\"grid_cell\");\n div.setAttribute(\"id\", i.toString()+\"_\"+j.toString());\n div.style.cssText = `grid-column: ${i+1} / ${i+2}; grid-row: ${j+1} / ${j+2}; border-style: solid;\n background-color: white`;\n container.appendChild(div);\n }\n }\n\n //re-add the hovering function\n grids = document.querySelectorAll(\".grid_cell\");\n\n //add event listener to each grid to change color when mouse hover over\n grids.forEach((grid) => {\n grid.addEventListener('mouseover', () => {\n draw(grid);\n });\n });\n}", "function generateGrid(squares) {\n\n container.style.setProperty(\"grid-template-columns\", \"repeat(\" + squares + \", 1fr)\");\n container.style.setProperty(\"grid-template-rows\", \"repeat(\" + squares + \", 1fr)\");\n \n //creates the ammount of divs necessary to fill the entire grid\n for (let i = 1; i <= squares * squares; i++) {\n const div = document.createElement(\"div\");\n div.classList.add(\"pixels\");\n div.style.border = \"1px solid rgba(0,0,0,0.5)\";\n \n container.appendChild(div);\n }\n \n //creates a nodelist as a global variable, of all the squares in the grid\n window.pixels = document.querySelectorAll(\".pixels\");\n\n //currentPen points to the function that determine the behavior of the pen\n pixels.forEach(currentPen);\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function clearGrid(){\n var table = document.getElementById(\"pixelCanvas\");\n var cells = document.getElementsByClassName(\"cell\");\n if(cells.length > 0){\n // remove table body\n table.firstElementChild.remove()\n }\n}", "function buildGrid(size){\n \n let squareSize = document.getElementById('grid').clientWidth / size;\n //Creating the square and defining his size\n for(let i=1 ; i<=size*size;i++){ \n let square = document.createElement('div')\n grid.appendChild(square);\n square.classList.add('square-grid');\n square.style.width = squareSize + \"px\";\n square.style.height = squareSize + \"px\";\n //Rounding square grid corners\n if(i==1){\n square.style.borderTopLeftRadius = \"10px\";\n }else if(i==size){\n square.style.borderTopRightRadius = \"10px\";\n }else if(i==size*size-size+1){\n square.style.borderBottomLeftRadius = \"10px\";\n }else if(i==size*size){\n square.style.borderBottomRightRadius = \"10px\";\n }\n }\n \n}", "function makeGrid() {\n\tvar grid = $('#grid');\n\t// Capture grid height and width and limit it to 1 to 30\n\tvar height = Number($('#grid-height').val());\n\t$('#win').removeClass('win-is-visible');\n\tif (height > 30) {\n\t\theight = 30;\n\t}\n\tif (height < 1) {\n\t\theight = 1;\n\t}\n\tvar width = Number($('#grid-width').val());\n\tif (width > 30) {\n\t\twidth = 30;\n\t}\n\tif (width < 1) {\n\t\twidth = 1;\n\t}\n\t// Reset game variables\n\tgrid.html('');\n\tgridArr = [];\n\ttilesFound = 0;\n\tnonogram = false;\n\t// Construct grid in dom and gridArr variable\n\tgrid.prepend('<div id=\\'y-numbers\\'</div>');\n\tfor (var x = 0; x < width + 1; x++){\n\t\tx == 0 ? $('#y-numbers').append('<div id=\\'corner\\'></div>') : \n\t\t\t$('#y-numbers').append('<div id=\\'column-'+ (x - 1) +'\\'><ul></ul></div>');\n\t}\n\tfor (var y = 0; y < height; y++){\n\t\tgrid.append('<div id='+ y +'-row></div>');\n\t\tgridArr.push([]);\n\t\tfor (var x = 0; x < width + 1; x++){\n\t\t\tif (x === 0){\n\t\t\t\t$('#'+ y +'-row').append('<div id=\\'row-'+ y +'\\'><ul></ul></div>');\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$('#'+ y +'-row').append('<div class=\\'pixel '+ (x - 1) +'\\' data-isPixel = \\'false\\' data-y='+ y +' data-x='+ (x - 1) +' onclick=\\'handlePixel(this)\\'></div>');\n\t\t\t\tgridArr[y].push(0);\n\t\t\t}\n\t\t}\n\t}\n\t// Append color picker and nonogramify buttons\n\t$('#grid').append('<div id=\"color-picker\"><p>Color Picker</p><input id=\"grid-color\" type=\"color\"></div><button id=\"nonogramify\" onclick=\"nonogramify()\">Create Nonogram</button>');\n}", "function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('<div class=\"grid-row\"></div>');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('<div class=\"grid-cell\"></div>')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }", "removeTwoPieces () {\n var div = document.createElement('img')\n var div2 = document.createElement('img')\n div.id = this.divCounter++\n div2.id = this.divCounter++\n div.style.height = this.att1\n div.style.width = this.att2\n div.style.margin = this.margin\n div2.style.height = this.att1\n div2.style.width = this.att2\n div2.style.margin = this.margin\n div.src = this.empty\n div2.src = this.empty\n this.holder.replaceChild(div, this.imageHolders[this.firstIndex])\n this.holder.replaceChild(div2, this.imageHolders[this.secondIndex])\n this.tracker[this.firstIndex] = false\n this.tracker[this.secondIndex] = false\n }", "function replaceGrid() {\n nCells = prompt('Enter a number between 1 and 50');\n if (nCells > 50 || nCells < 1) {\n if (typeof(nCells) != 'object') {\n alert(\"Not in range!\");\n }\n } else {\n while (container.hasChildNodes()) {\n container.removeChild(container.firstChild);\n }\n // Remove old grid\n makeGrid(nCells);\n draw();\n // Establish new grid\n }\n}" ]
[ "0.7590309", "0.74371094", "0.74180007", "0.7365515", "0.72825736", "0.72205514", "0.71836823", "0.7170739", "0.712996", "0.7052991", "0.69689775", "0.6905739", "0.6900515", "0.6884381", "0.6874816", "0.68734795", "0.6867835", "0.68676376", "0.681842", "0.67905647", "0.6788807", "0.6785186", "0.67718494", "0.67694056", "0.67615926", "0.6758979", "0.6717786", "0.6663587", "0.6645406", "0.66065556", "0.6582699", "0.6563103", "0.6544967", "0.6543783", "0.65398246", "0.65325415", "0.65294445", "0.65259546", "0.6517204", "0.6508102", "0.6499605", "0.6478323", "0.6468246", "0.644173", "0.64386517", "0.642965", "0.6425739", "0.64153284", "0.64110106", "0.64072543", "0.6404302", "0.6402849", "0.6396695", "0.639446", "0.6380786", "0.63765305", "0.6368064", "0.63659966", "0.636258", "0.6358559", "0.63528603", "0.63391834", "0.6336957", "0.63345397", "0.6333529", "0.6332072", "0.6318885", "0.6316158", "0.63136125", "0.6311751", "0.62858564", "0.6282675", "0.6262393", "0.6256913", "0.62412846", "0.6235041", "0.62329787", "0.6225549", "0.62242055", "0.6218543", "0.620975", "0.6208219", "0.62034726", "0.6202013", "0.6199235", "0.6194715", "0.61907", "0.6185645", "0.61779094", "0.61743987", "0.61698395", "0.61681944", "0.6167033", "0.61669517", "0.6163087", "0.6155351", "0.61529887", "0.61396885", "0.61384755", "0.61317337" ]
0.6410736
49
This function should run as soon as the page loads and update the correct student info
function populateStudentInfo({ name, grade, advisor, major, graduationYear, imageUrl }) { updateStudentName(name) updateStudentGradeLevel(grade) updateStudentAdvisor(advisor) updateMajor(major) updateStudentGraduationYear(graduationYear) updateStudentImage(imageUrl) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeStudentInfo() {\n\tgetCurrentUser();\n\t// ID of tag to locate in the users xml file\n\tvar s_info = [\"GPA\",\"FirstName\", \"LastName\", \"ID\", \"completed\", \"inprogress\"];\n\t// ID of the element on the home.html page\n\tvar docID = [\"doc_GPA\",\"doc_User\", \"doc_completed\", \"doc_inprogress\", \"doc_UName\"];\n\n\tupdateStudentInfo(s_info[0], docID[0]);\t//GPA\n\tupdateStudentInfo(s_info[3], docID[1]);\t//Username (ID)\n\tupdateStudentInfo(s_info[4], docID[2]);\t//completed coursed\n\tupdateStudentInfo(s_info[5], docID[3]);\t//courses in progress\n\tupdateStudentInfo(s_info[1], docID[4]);\t//User name\n}", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "updateStudent() {\n\n\t}", "function updateStudent() {\n var student = $scope.selectedStudent;\n if ($scope.includeSiblings === true) {\n updateSiblings(student);\n }\n var updatedStudent = StudentsModel.updateStudent(student);\n updateMarkerPosition(student.id);\n loadStudents();\n $scope.showEdit = false;\n $scope.includeSiblings = false;\n gotoTop();\n }", "function getStudentInfo () {\n\t//get the currentProblemIndex\n\tcurrentProblemIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].currentproblemindex;\n\tif (currentProblemIndex == undefined) {\n\t\tcurrentProblemIndex == 0;\n\t\tMeteor.call('updateStudentModel', 'currentproblemindex', 0);\n\t}\n\n\t//get the partialProblems\n\tpartialProblems = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproblems;\n\tif (partialProblems == undefined) {\n\t\tmakeProblems();\n\t\tMeteor.call('updateStudentModel', 'partialproblems', partialProblems);\n\t}\n\n\t//get the currentProblem\n\tcurrentProblem = partialProblems[currentProblemIndex];\n\n\t//get the partialproofcolor\n\tcolorIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproofcolor;\n\tif (colorIndex == undefined) {\n\t\tcolorIndex = 0;\n\t\tMeteor.call('updateStudentModel', 'partialproofcolor', 0);\n\t}\n\tdocument.getElementById('colorSelectPartial').selectedIndex = colorIndex;\n\tvar currentdragcolorname = colorSchemes[colorIndex].dragcolorname;\n\tvar currentdropcolorname = colorSchemes[colorIndex].dropcolorname;\n\tvar currentrulecolorname = colorSchemes[colorIndex].rulecolorname;\n\tchangeColors(colorSchemes[colorIndex]);\n\tvar currenthtml = $('#ruleInstructionsPartial').html();\n\tvar newhtml = currenthtml.replace(currentdragcolorname, colorSchemes[colorIndex].dragcolorname);\n\tnewhtml = newhtml.replace(currentdropcolorname, colorSchemes[colorIndex].dropcolorname);\n\tnewhtml = newhtml.replace(currentrulecolorname, colorSchemes[colorIndex].rulecolorname)\n\t$('#ruleInstructionsPartial').html(newhtml);\n}", "function updateCurrentStudent(position){\n $('#studentName').text(peopleArray[position].name);\n $('#studentGithub').html(\"<a href='\" + peopleArray[position].github + \"'>\"+peopleArray[position].github+\"</a>\");\n $('#studentShoutout').text(peopleArray[position].shoutout);\n}", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "function loadStudent(data) {\n\t\t$(\".js-next-student\").attr(\"data-id\", data[\"id\"]);\n\t\t$(\".js-previous-student\").attr(\"data-id\", data[\"id\"]);\n\t\tvar $student_name = $(\".studentName\").html('');\n\t\t$student_name.append(\"<h3>\" + data.first_name + \" \" + data.last_name + \"</h3>\");\n\t\t\n\t\tvar $classrooms = $(\".studentClassrooms\").html(''); \n\t\tdata['classrooms'].forEach(function(classroom) {\n\t\t\tsubject = classroom.subject\n\t\t\t$classrooms.append(`<tr><td>${subject}`);\n\t\t});\n\t}", "function autoFillStudentInfo() {\n\t\tvar httpRequest = new XMLHttpRequest();\n\t\thttpRequest.open(\"GET\", \"../PHP/studentSubmit.php\");\n\t\thttpRequest.send();\n\t\thttpRequest.onreadystatechange = function() {\n\t\t\tif (this.readyState == 4 && this.status == 200) {\n\t\t\t\tvar json = JSON.parse(httpRequest.responseText);\n\t\t\t\tstudentID.value = json['id'];\n\t\t\t\tfirstName.value = json['firstName'];\n\t\t\t\tlastName.value = json['lastName'];\n\t\t\t\tQCEmail.value = json['email'];\n\t\t\t}\n\t\t}\n\t}", "function onModifyStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentFirstNameModified.value = student.firstname;\n txtStudentLastNameModified.value = student.lastname;\n txtStudentEMailModified.value = student.email;\n dialogModifyStudent.showModal();\n }", "function editStudent() {\n\t// console.log('editing student!');\n\tgetMultipleValuesFromStorage(['CATEGORY', 'ADMISSION_DATE'])\n\t.then(function(keys) {\n\t\tvar cat = keys[0];\n\t\tvar date = keys[1];\n \n\t\tvar FT = getFieldTranslator();\n\n\t\t// student category\n\t\tif (cat !== \"\") {\n\t\t\tinsertValue( getDC( {\"CATEGORY\": cat}, FT, 'STUDENT_CATEGORY'), 'student_student_category_id' );\n\t\t}\n\n\t\t// admission date\n\t\tif (date !== \"\") {\n\t\t\tinsertValue( date, 'student\\\\[admission_date\\\\].calendar_field' );\t\n\t\t}\n\n\t\t// increment studentCount in firebase database:\n\t\tincrementStudentCount(1, 'FIXED');\n\n\t\t// submit form -> redirects back to student/profile/id\n\t\t$('input[name=\"commit\"]').click();\n\t})\n\t.catch(function(error) {\n\t\tThrowError({\n\t\t\tmessage: error,\n\t\t\terrMethods: ['mConsole', 'mAlert']\n\t\t});\n\t});\n}", "function viewStudent(id, name, guardian, occupation, phone, dob, rel, address)\n{\n\t$('#stID').html(id);\n\t$('#stName').html(name);\n\t$('#dob').html(dob);\n\t$('#religion').html(rel);\n\t$('#address').html(address);\n\t$('#gName').html(guardian);\n\t$('#occupation').html(occupation);\n\t$('#phone').html(phone);\n}", "function updateStudentList() {\n for (var list = 0; list < student_array.length; list++) {\n $(\"#tableBody\").empty();\n }\n /**\n * addStudentToDom - take in a student object, create html elements from the values and then append the elements\n * into the .student_list tbody\n * @param studentObj\n */\n\n /**\n * reset - resets the application to initial state. Global variables reset, DOM get reset to initial load state\n */\n\n /**\n * set global variables to 0\n */\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 };\n reset();\n}", "function setInfo() {\n var name = document.querySelector(\"#name_form_student\");\n name.value = local_user.name;\n var account_number = document.querySelector(\"#no_cuenta_form_student\");\n account_number.value = local_user.num_account;\n var career = document.querySelector(\"#carrer_form_student\");\n career.value = local_user.career;\n var email = document.querySelector(\"#email_form_student\");\n email.value = local_user.email;\n var semester = document.querySelector(\"#semester_form_student\");\n semester.value = local_user.semester;\n\n}", "function updateStudentInfo(event) {\n\t\n\tvar id = event.name;\n\tvar name = $('#editStudentName').val();\n\tvar age = $('#editStudentAge').val();\n\tvar gender = $('#editStudentGender').find(\":selected\").text();\n\tvar classAverage = $('#editStudentClassAverage').val();\n\n\t\n\tvar editData = {\n\n\t\toldName : $(\"#btnEditStudent\").attr(\"name\"), \n\t\tstudentName: name,\n\t age: age,\n\t gender: gender,\n\t classAverage: classAverage\n\t\t\n\t}\n\n\t$.ajax({\n\t\ttype: 'PUT',\n\t\turl: '/api/editstudent',\n\t\tdata: editData,\n\t\tdataType: 'JSON'\n\t}).done(function(response) {\n\t\t\n\t\t// Check for success\n\t\tif (response.msg === '') {\n\n\t\t} else {\n\t\t\talert(response.msg);\n\t\t}\n\n\t\t// Update table\n\t\t$('#myModal').modal('hide');\n\t\tpopulateTable(function() {\n\t\t\tupdateClassStats();\n\t\t});\n\t});\n\t\n}", "function updateStudent(id) {\n let list = students[id - 1];\n console.log(list);\n setName(list.name)\n setRollNo(list.rollno)\n setStudentID(list.id)\n setFlag(false);\n }", "function update_enrollment() {\n\tvar student = [];\n\t\n\t$('#area_students').hide();\n\t$('#area_loader').show();\n\t\n\t$(\"tbody\").children(\"tr\").each(function (index) {\n\t\tstudent[index] = { id : $(this).attr(\"id\"),\n\t\t\t\t enrolled : $(this).find(\"input\").prop(\"checked\") ? STUDENT_IS_ENROLLED : STUDENT_NOT_ENROLLED};\n\t});\n\t\n\t$.ajax({\n\t\turl: \"ajax/update_enrollment.php\",\n\t\ttype: \"POST\",\n\t\tdata : {\n\t\t\tclass_id : class_id,\n\t\t\tstudent : student\n\t\t},\n\t\tsuccess : function (student_list) {\n\t\t\t$(\"#tbl_students\").html(student_list);\n\t\t\twindow.scroll(0,0);\n\t\t\tupdate_row_click_events();\n\t\t\t\n\t\t\t$('#area_students').animate({ scrollTop: 0 }, 1);\n\t\t\t$('#area_loader').hide();\n\t\t\t$('#area_students').show();\n\t\t\t\n\t\t}\n\t});\n}", "function updateStudent() {\n studentString = JSON.stringify(Student.all);\n localStorage.setItem(\"studentinfo\", studentString);\n}", "function studentInfo(data)\r\n{\r\n $('#slider-student-name').text(data.Firstname +' '+ data.Lastname);\r\n $('#nav-user-name').text(data.Firstname +' '+ data.Lastname);\r\n $('#cach').text(data.myBalance +' JD');\r\n $('#No-num').val(data.ID);\r\n $('#f-name').val(data.Firstname);\r\n $('#father-name').val(data.Fathername);\r\n $('#l-name').val(data.Lastname);\r\n $('#uni-name').val(data.university);\r\n $('#email').val(data.email);\r\n $('#phone').val(data.phonenumber);\r\n\r\n \r\n\r\n\r\n\r\n\r\n}", "function fetchStudents() {\n\t// retrieve the students\n\tadmin.standard.students = new StudentsA();\n\tadmin.conserving.students = new StudentsB();\n\n\t// making calculations and groupings\n\tfunction adminSetup(group, students) {\n\t\tadmin[group].avgTime = avgTime(admin[group].students)\n\t\tadmin[group].explanations = complieExplanations(students);\n\t\tadmin[group].avgScores = avgScores(students, 'quality').concat(avgScores(students, 'natural'));\n\t}\n\n\t// fetch and display the standard students\n\tadmin.standard.students.fetch().then(function(students) {\n\t\tadminSetup('standard', students)\n\t\t$('.standard').click();\n\t})\n\n\t// just fetch the conserving students\n\tadmin.conserving.students.fetch().then(function(students) {\n\t\tadminSetup('conserving', students)\n\t});\n}", "function display(){\n\n dom.name.innerHTML = students[studentNum].name;\n dom.address.innerHTML = students[studentNum].address.street + \" \" + students[studentNum].address.city;\n dom.grades.innerHTML = avg();\n\n //after show student1, go to student2\n studentNum++;\n\n if (studentNum == students.length){\n studentNum = 0;\n }\n\n }", "function fill_student_fields()\r\n{\r\n const url = new URL(window.location.href);\r\n if ( url.searchParams.get('id'))\r\n\t\t{\r\n const id = url.searchParams.get('id');\r\n $.get('./api/student/'+id, (data) => {\r\n $('#id_to_edit').html(id);\r\n $('#id').val(id);\r\n $('#first_name').val(data.first_name);\r\n\t\t\t\t$('#last_name').val(data.last_name);\r\n\t\t\t\tlet date_birth = data.date_birth.slice(6,10)+'-'+data.date_birth.slice(3,5)+'-'+data.date_birth.slice(0,2);\r\n\t\t\t\t$('#date_birth').val( date_birth);\r\n\t\t\t\tif ( data.phone_number_id == data.mother_phone){\r\n\t\t\t\t\tdocument.getElementById('phone_number_id_mother').checked=true;\r\n\t\t\t\t\tdocument.getElementById('phone_number_id_father').checked=false;\r\n\t\t\t\t}else if ( data.phone_number_id == data.father_phone){\r\n\t\t\t\t\tdocument.getElementById('phone_number_id_mother').checked=false;\r\n\t\t\t\t\tdocument.getElementById('phone_number_id_father').checked=true;\r\n\t\t\t\t}\r\n\t\t\t\t$('#mother_name').val(data.mother_name);\r\n $('#mother_email').val(data.mother_email);\r\n $('#mother_phone').val(data.mother_phone);\r\n $('#father_name').val(data.father_name);\r\n $('#father_email').val(data.father_email);\r\n $('#father_phone').val(data.father_phone);\r\n $('#class').val(data.class);\r\n $('#school').val(data.school);\r\n $('#diagnosis').val(data.diagnosis);\r\n $('#dedicated_kindergarten').val(data.dedicated_kindergarten);\r\n $('#communications_clinician').val(data.communications_clinician);\r\n $('#remedial_teaching').val(data.remedial_teaching);\r\n $('#dyslexia_parent_family').val(data.dyslexia_parent_family);\r\n $('#dyslexia_brothers_family').val(data.dyslexia_brothers_family);\r\n $('#Remarks').val(data.Remarks);\r\n }) \r\n }\r\n}", "function setIndividualStudent(student) {\n\t\t\t\t\t\t\tvar data = filterDataByStudent(jsonData, student);\n\t\t\t\t\t\t\t$scope.individualStudent = ((data[0] !== null) && (data[0] !== undefined)) ? data[0]\n\t\t\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\t}", "function moveToStep2(student) {\n if (student != null) {\n $('#name').val(student.name);\n $('#gender').val(student.gender);\n $('#birthday').val(student.birthday);\n $('#phone').val(student.phone);\n }\n}", "function show_all_students_activity(){\n\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX BEGIN show_all_students_activity XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n\n // POPULATE DATA to RESULTS TABLE\n // var selected_course_id = checkLocalStorage('current_course');\n var selected_course_id = 2;\n\n // console.log('LOCAL STORAGE current_course ' +selected_course_id);\n \n // ajax URLs\n url_course_students = 'http://www.privacyvector.com/api/lumiousreports/students/'+selected_course_id;\n url_student_data = 'http://www.privacyvector.com/api/lumiousreports/studentdata/';\n\n // store results from these static URLs as objects to use with promises\n var students = $.getJSON(url_course_students);\n\n // declare variables for student object\n var student_id = null;\n var student_firstname = null;\n var student_lastname = null;\n var student_email = null;\n var student_username = null;\n var student_firstaccess = null;\n var student_lastaccess = null;\n\n // wait for student ajax request to complete before we proceed\n $.when(students).done(function(studentobject) {\n\n // dig down to the responseText object\n //var s = $.parseJSON(studentobject[1]);\n\n console.info(\"Student Data for Course \" + selected_course_id);\n console.info(studentobject);\n\n // loop through the student object\n jQuery.each(studentobject, function(i, sdata) {\n \n student_id = sdata.id;\n student_firstname = sdata.firstname;\n student_lastname = sdata.lastname;\n student_email = sdata.email;\n student_username = sdata.username;\n student_firstaccess = sdata.firstaccess;\n student_lastaccess = sdata.lastaccess;\n\n console.log(\"Checking data for Student ID: \" + student_id);\n\n var student_stress = 'not_set';\n var student_instructor_comments = 'not_set';\n var student_instructor_comments_trimmed = 'not_set';\n var firstaccess_dateVal = student_firstaccess;\n\n // Format Date\n if (firstaccess_dateVal == 0) {\n var firstaccess_formatted_date = 'Never';\n }else{\n var firstaccess_formatted_date = moment.unix(firstaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n }; \n var lastaccess_dateVal = student_lastaccess;\n if (lastaccess_dateVal == 0) {\n var lastaccess_formatted_date = 'Never';\n }else{\n var lastaccess_formatted_date = moment.unix(lastaccess_dateVal).format('MMMM Do YYYY, h:mm:ss a'); \n };\n\n // ajax call to get student data details\n var studentdata = $.getJSON(url_student_data + student_id);\n\n // Store Details in DNA table values\n sdata['ID'] = student_id;\n sdata['FIRSTNAME'] = student_firstname;\n sdata['LASTNAME'] = student_lastname;\n sdata['EMAIL'] = student_email;\n sdata['USERNAME'] = student_username;\n sdata['FIRSTACCESS'] = student_firstaccess;\n sdata['FIRSTACCESSFORMATTEDDATE'] = firstaccess_formatted_date;\n sdata['LASTACCESS'] = student_lastaccess;\n sdata['LASTACCESSFORMATTEDDATE'] = lastaccess_formatted_date;\n\n // when ajax call is done\n $.when(studentdata).done(function(studentdataobject) {\n\n console.log(\"student data details: \");\n console.log(studentdataobject);\n\n // Student Notes Content - get array values, manipulate to clean up and use as comments and stress level\n var student_posts = studentdataobject.user[\"posts\"];\n \n console.log(student_posts);\n\n // ensure the posts object contains usable data\n if(student_posts != undefined){\n $.each(student_posts, function (index, x) {\n console.log('comment content: ' +x.content + ' publishstate: ' + x.publishstate );\n student_instructor_comments = x.content;\n student_instructor_comments_trimmed = student_instructor_comments.trim(); // remove whitespace\n student_instructor_comments_trimmed = student_instructor_comments.substr(2); // remove first 2 digits for stress level\n student_stress = student_instructor_comments.substring(0, 2); // take first 2 digits, use as stress setting\n console.log('Stress content: ' +student_stress + ' student_instructor_comments_trimmed: ' + student_instructor_comments_trimmed );\n \n // Add Labels to stress levels\n if ( student_stress == '20' || student_stress == 'Be' || student_stress == 'Jo' ) {\n // If entry is a default entry then update the text \n sdata['STUDENTSTRESS'] = '<span class=\"content_not_available\">N/A</span>';\n sdata['STUDENTINSTRUCTORCOMMENTS'] = '<span class=\"content_not_available\">No Comment</span>';\n \n }else{\n // Pass the stress levels html to the data object for dna with the correct label wrapping\n if (student_stress >= 7) {student_stress = '<span class=\"student-stress danger label\">'+student_stress+'</span>';};\n if (student_stress < 7) {student_stress = '<span class=\"student-stress warning label\">'+student_stress+'</span>';};\n if (student_stress < 4) {student_stress = '<span class=\"student-stress success label\">'+student_stress+'</span>';};\n sdata['STUDENTSTRESS'] = student_stress;\n sdata['STUDENTINSTRUCTORCOMMENTS'] = student_instructor_comments_trimmed;\n }\n console.log(student_stress);\n console.log(student_instructor_comments_trimmed);\n });\n } // if(student_posts != undefined){\n \n\n var activity_log =[];\n activity_log = studentdataobject.user[\"logstore\"];;\n console.log(' ^^^^ activity_log ^^^^^^^');\n console.log(activity_log);\n\n var activity_array = [];\n \n // Pull Data from Multiple Activties Endpoint \n jQuery.each(activity_log, function(i, adata) {\n var a_row = '<tr>';\n var quizdata = [];\n var quizobject = [];\n \n\n console.log('activity_log DATA');\n activity_time = adata.timecreated;\n activity_moment = moment.unix(activity_time).format(\"YYYY/MM/DD hh:mm:ss\");\n activity_id = adata.id;\n activity_name = adata.action;\n activity_table = adata.objecttable;\n activity_id = adata.objectid;\n activity_course = adata.courseid;\n\n\n \n // @TODO - add catch for failed return - i.e. if no courese id exists\n // @TODO - add new base_url for privacyvector\n\n // EXAMPLE http://www.privacyvector.com/api/lumiousreports/courselookup/4\n \n // var course_url = base_url + 'lumiousreports/courselookup/'+activity_course;\n var course_url = 'http://www.privacyvector.com/api/lumiousreports/courselookup/'+activity_course;\n var coursedata = $.getJSON(course_url);\n\n $.when(coursedata).done(function(courseobject) {\n if (course_name = 'undefined') {\n course_name = '';\n };\n \n var course_name = null; \n course_name = courseobject[0];\n course_name = course_name.fullname;\n console.log('COURSE NAME: '+course_name);\n \n var quiz_name = null; \n if (adata.objecttable == 'quiz_attempts') {\n \n console.log('activity_table SWITCH: '+activity_table);\n var quiz_url = base_url + 'lumiousreports/quizlookup/'+adata.objectid;\n console.log('quiz_url '+quiz_url);\n\n var quizdata = $.getJSON(quiz_url);\n $.when(quizdata).done(function(quizobject) {\n console.log('DOING quizdata JSON call');\n console.log('quizobject');\n console.log(quizobject);\n var quiz_data = quizobject[0];\n console.log(quiz_data);\n var quiz_name = quiz_data.name;\n // quiz_name = quizobject.name;\n // console.log('QUIZ NAME: '+quiz_name);\n // wait for quiz name response before sending result\n a_row += '<th>'+adata.id+'</th>';\n a_row += '<th>'+student_firstname+' '+student_lastname+'</th>';\n a_row += '<th>'+adata.action+'</th>';\n a_row += '<th>'+adata.courseid+' '+course_name+'</th>';\n a_row += '<th>'+adata.objecttable+'</th>';\n a_row += '<th><span>(ID '+adata.objectid+')</span> '+quiz_name+'</th>';\n a_row += '<th><span class=\"hidden\">'+activity_time+'</span>'+activity_moment+'</th>';\n // add the readable data to the table rows \n $('#tbody_activity_result').append(a_row);\n }); // end $.when\n }\n else{\n a_row += '<th>'+adata.id+'</th>';\n a_row += '<th>'+student_result['firstname']+' '+student_result['lastname']+'</th>';\n a_row += '<th>'+adata.action+'</th>';\n a_row += '<th>'+adata.courseid+' '+course_name+'</th>';\n a_row += '<th>'+adata.objecttable+'</th>';\n a_row += '<th><span>(ID '+adata.objectid+')</span></th>';\n a_row += '<th><span class=\"hidden\">'+activity_time+'</span>'+activity_moment+'</th>';\n // add the readable data to the table rows \n $('#tbody_activity_result').append(a_row);\n } // end if\n \n }); // end $.when\n\n a_row += '</tr>';\n }); // end each.activity_log\n }); // END $.when(studentdata).d\n }); // jQuery.each(studentobject,\n // $('#loading_gif').hide();\n });\n console.log('===XXXXXXXXXXXXXXXXXXXXXXXXXX END show_all_students_activity XXXXXXXXXXXXXXXXXXXXXXXXXXX====');\n}", "function updatePage(data){\n //console.log(data);\n document.getElementById(\"uNameSpan\").innerHTML = data.userName;\n document.getElementById(\"fNameSpan1\").innerHTML = \" \" + data.fName;\n document.getElementById(\"fNameSpan2\").innerHTML = \" \" + data.fName;\n document.getElementById(\"fNameSpan3\").innerHTML = \" \" + data.fName;\n document.getElementById(\"lNameSpan1\").innerHTML = \" \" + data.lName;\n document.getElementById(\"lNameSpan2\").innerHTML = \" \" + data.lName;\n document.getElementById(\"lNameSpan3\").innerHTML = \" \" + data.lName;\n}", "function displayStudent(student) {\n //create clone\n const clone = document.querySelector(\"template#student\").content.cloneNode(true);\n\n //set clone data\n clone.querySelector(\"[data-field=firstname]\").textContent = student.firstName;\n clone.querySelector(\"[data-field=lastname]\").textContent = student.lastName;\n clone.querySelector(\"[data-field=middlename]\").textContent = student.middleName;\n clone.querySelector(\"[data-field=nickname]\").textContent = student.nickName;\n clone.querySelector(\"#profile\").src = \"./images/\" + student.photo;\n clone.querySelector(\"[data-field=house]\").textContent = student.house;\n\n //PREFECT\n if (student.prefect === true) {\n clone.querySelector(\"[data-field=prefect]\").classList.add(\"color\");\n document.querySelector(\".pop\").classList.add(\"color\");\n } else {\n clone.querySelector(\"[data-field=prefect]\").classList.remove(\"color\");\n }\n\n //CLICK PREFECT\n clone.querySelector(\"[data-field=prefect]\").onclick = () => {\n clickAddAsPrefect(student);\n };\n\n //INQ SQUAD\n if (student.inqS === true) {\n clone.querySelector(\"[data-field=inqs]\").classList.add(\"color\");\n } else {\n clone.querySelector(\"[data-field=inqs]\").classList.remove(\"color\");\n }\n\n //CLICK INQS\n clone.querySelector(\"[data-field=inqs]\").onclick = () => {\n clickAddAsInqS(student);\n };\n clone.querySelector(\"#profile\").onclick = () => {\n showStudentDetails(student);\n };\n\n //EXPELL CLICK\n clone.querySelector(\"[data-field=expell]\").onclick = () => {\n expell(student);\n };\n\n function clickAddAsPrefect(student) {\n if (student.prefect === true) {\n student.prefect = false;\n } else {\n prefectToggle(student);\n }\n //UPDATE LIST\n buildList();\n }\n\n function clickAddAsInqS(student) {\n if (student.inqS === true) {\n student.inqS = false;\n } else {\n inqSToggle(student);\n }\n //UPDATE LIST\n buildList();\n }\n //APPEND CLONE TO LIST\n document.querySelector(\".table-body\").appendChild(clone);\n}", "function fetchStudents() {\n $.get(apiUrl + \"students.json\").then(renderStudents);\n}", "function getAndDisplayStudents() {\n getStudents(displayStudents);\n}", "function appendToDom() {\n $(\"#student\").children().css(\"display\", \"none\");\n $(\"#studentName\").text(currentStudent.name).fadeIn(1200);\n $(\"#gitUsername\").text(\"GIT Username: \" + currentStudent.git_username).fadeIn(1200);\n $(\"#shoutout\").text(currentStudent.shoutout).fadeIn(1200);\n }", "function getStudents() {\n $.getJSON(\"data/students.json\", function(data) {\n students = data.students;\n studentsFullList = data.students;\n populateAbsentModal();\n });\n }", "function _refreshStudentData() {\n $http({\n method: 'GET',\n url: '/students'\n }).then(\n function(res) { // success\n $scope.students = res.data;\n },\n function(res) { // error\n console.log(\"Error: \" + res.status + \" : \" + res.data);\n }\n );\n }", "function loadStudents() {\n API.getStudents()\n .then(res => \n setStudents(res.data)\n )\n .catch(err => console.log(err));\n }", "function loadSchoolInfo() {\n const schoolSearch = document.getElementById('school-search').value;\n\n // Get School Data from API.\n fetch(getLink(schoolSearch))\n .then((response) => response.text())\n .then((data) => {\n const parsedData = JSON.parse(data);\n const schools = parsedData['results'];\n\n // Get main campus\n const dataResults = getMainCampus(schools);\n\n // Basic School Information Variables.\n const ownership = getOwnership(dataResults);\n const name = getSchoolInfo(dataResults, 'name');\n const city = getSchoolInfo(dataResults, 'city');\n const state = getSchoolInfo(dataResults, 'state');\n\n // Cost Statistics Variables.\n const inStateTuition = getCostInfo(dataResults, 'in_state');\n const outOfStateTuition = getCostInfo(dataResults, 'out_of_state');\n\n // Admissions Statistics Variables.\n const acceptanceRate = getAcceptanceRate(dataResults);\n const avgSat = getSatInfo(dataResults, 'average.overall');\n const avgAct = getActInfo(dataResults, 'midpoint.cumulative');\n\n // Student Statistic Variables.\n const numStudents = getNumStudents(dataResults);\n const numMen = getGender(dataResults, 'men') * numStudents;\n const numWomen = getGender(dataResults, 'women') * numStudents;\n const graduationRate4yr = getGraduationRate(dataResults);\n const numWhiteStudents = getRace(dataResults, 'white') * numStudents;\n const numAsianStudents = getRace(dataResults, 'asian') * numStudents;\n const numBlackStudents = getRace(dataResults, 'black') * numStudents;\n const numHispanicStudents =\n getRace(dataResults, 'hispanic') * numStudents;\n const numIndigenousStudents =\n getRace(dataResults, 'aian') * numStudents;\n const numMultiracialStudents =\n getRace(dataResults, 'two_or_more') * numStudents;\n const numUnreportedRaceStudents = (getRace(dataResults, 'unknown') +\n getRace(dataResults, 'non_resident_alien')) * numStudents;\n\n // Name Section.\n schoolHeader = document.getElementById('school-name');\n schoolHeader.innerHTML = '';\n schoolHeader.append(dataResults['school.name']);\n\n // Description Section.\n const schoolDesc = document.getElementById('school-desc');\n schoolDesc.innerHTML = '';\n schoolDesc.append(`${name} is a ${ownership} University \n in ${city}, ${state}`);\n\n // Cost Section.\n const costDiv = document.getElementById('cost');\n costDiv.innerHTML = '';\n costDiv.append(`In-State Tuition: $${inStateTuition}`);\n costDiv.append(`Out-of-State Tuition: $${outOfStateTuition}`);\n\n // Admissions Section.\n const admissionsDiv = document.getElementById('admissions');\n admissionsDiv.innerHTML = '';\n admissionsDiv.append(`Acceptance Rate: ${acceptanceRate}%`);\n admissionsDiv.append(`Average SAT Score: ${avgSat}`);\n admissionsDiv.append(`Average ACT Score: ${avgAct}`);\n\n // Students Section.\n const studentsDiv = document.getElementById('students');\n studentsDiv.innerHTML = '';\n studentsDiv.append(`Population: ${numStudents} Students`);\n studentsDiv.append(`4 Year Graduation Rate: ${graduationRate4yr}%`);\n\n // Draw charts.\n drawRaceChart(numWhiteStudents, numAsianStudents, numBlackStudents,\n numHispanicStudents, numIndigenousStudents, numMultiracialStudents,\n numUnreportedRaceStudents);\n drawGenderChart(numMen, numWomen);\n });\n}", "function refreshStudent() {\n $('.loadMe').each(function(){\n //if statement here\n // use $(this) to reference the current div in the loop\n var student = loadActiveStudent();\n var prop = $(this).attr('name');\n if ( student[prop] ) {\n $(this).html(student[prop]);\n } else {\n $(this).html(\"\");\n }\n });\n}", "function initStudentObject() {\n\t\t\t\tif (!StudentSvc.current) {\n\t\t\t\t\t// There may be an existing student id so try and load\n\t\t\t\t\tif (_.isEmpty($stateParams.id)) {\n\t\t\t\t\t $scope.model = StudentSvc.init({});\n\t\t\t\t\t initWizardObject(); // Init wizard\n\t\t\t\t\t} else {\n\t\t\t\t\t StudentSvc.read($stateParams.id, {}, true).then(\n\t\t\t\t\t \tfunction(studentDoc) {\n\t\t\t\t\t\t \t$scope.model = studentDoc;\n\t\t\t\t\t\t \tinitWizardObject(); // Init wizard\n\t\t\t\t\t \t}\n\t\t\t\t\t );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function fill_students_table( student_id )\r\n{\r\n\tlet url;\r\n\tif ( !student_id )\r\n\t\turl = './api/students/list';\r\n\telse\r\n\t\turl = './api/student/' + student_id;\r\n\tget_data_list( url, build_students_table, show_alert );\r\n}", "SET_STUDENT_DETAILS(state, data) {\n state.studentDetails = data;\n }", "function populate(section){\r\n \tif (section != null) {\r\n $.getJSON(\"../users/in_section.json?sn=\" + section,\r\n function(json) {\r\n $(\"#students\").empty();\r\n if (json.length > 0)\r\n for (i = 0; i<json.length; i++)\r\n $(\"#students\").append(\"<li class='clickable ui-widget-content clicker' value='\" + json[i][0]+\"'>\"+json[i][2]+\", \"+json[i][1]+\" (\"+json[i][0]+\")</li>\");\r\n else\r\n $(\"#students\").append(\"<li id='noAssign' class='clickable ui-widget-content'>\"+\"There are no students in section.\"+\"</li>\");\r\n });\r\n } \t\r\n }", "function _refreshStudentData() {\n $http({\n method : 'GET',\n url : 'http://localhost:8080/studentList/EnrolledStudents'\n }).then(function successCallback(response) {\n $scope.students = response.data;\n }, function errorCallback(response) {\n console.log(response.statusText);\n });\n }", "function checkin_student(obj) {\n var roll_no = obj.id.split(\"_\")[1];\n var url = new URL(window.location.href);\n var project_name = url.searchParams.get('f');\n\n var query_string = \"?f=\" + project_name + \"&roll_no=\" + roll_no; //name is name_of_student\n\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n if (this.responseText.split(\":\").length == 3) {\n document.getElementById('checkin_' + roll_no).innerText = this.responseText; //update checkin time for student on the Index.html \n document.getElementById('checkin_' + roll_no).setAttribute('disabled', 'disabled'); //disables check_in button \n document.getElementById('reset_' + roll_no).removeAttribute('disabled'); //re-enables check_in button\n } else {\n alert(this.responseText);\n }\n }\n };\n xmlhttp.open(\"GET\", CHECKIN_API_ENDPOINT + query_string, true);\n xmlhttp.send();\n}", "function editStudent(id, name, guardian, occupation, phone, dob, rel, address){\n\t$('#stIDEdit').val(id);\n\t$('#stNameEdit').val(name);\n\t$('#dobEdit').val(dob);\n\t$('#religionEdit').val(rel);\n\t$('#addressEdit').val(address);\n\t$('#gNameEdit').val(guardian);\n\t$('#occupationEdit').val(occupation);\n\t$('#phoneEdit').val(phone);\n}", "function refreshStudentEvalResultView(){\n\t\t\n\t\tdocument.getElementById(\"student_side_list_pergrade\").innerHTML = \"\";\n\t}", "function updatePage(collegeData) {\n\n // Loop through and build elements for the defined number of colleges\n for (var i = 0; i < collegeData.results.length; i++) {\n // Get specific college info for current index\n\n // var college = collegeData.results[i];\n\n // Create the list group to contain the colleges and add the college content for each\n var $collegeList = $(\"<ul>\");\n $collegeList.addClass(\"list-group\");\n\n // This is the college search parameters that will append to $collegeList\n\n // University's ID\n // var collegeID = college.id;\n // // Testing variable to see if the data from the object\n // console.log(collegeID);\n\n // // University's Name\n // var collegeName = college[\"school.name\"];\n // console.log(collegeName);\n\n // // University's URL\n // var collegeURL = college[\"school.school_url\"];\n // console.log(collegeURL);\n\n var $collegeListItem = $(\"<li class='list-group-item collegeGroups'>\");\n\n $collegeListItem.append(`<p>${collegeData.results[i].id}</p>`);\n // This is where the heart icon is placed and this will activate the api-route function as well as saving the user data.\n $collegeListItem.append(`<i data-favID = ${collegeData.results[i].id} class=\"favorite fa fa-heart\"></i>`);\n $collegeListItem.append(`<p>${collegeData.results[i][\"school.name\"]}</p>`);\n $collegeListItem.append(`<p>${collegeData.results[i][\"school.state\"]}</p>`);\n $collegeListItem.append(`<p>${collegeData.results[i][\"school.school_url\"]}</p>`);\n $collegeList.append($collegeListItem);\n // Add the newly created element to the DOM\n $(\"#college-section\").append($collegeList);\n }\n }", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "function displayStudent(classID) {\n\n if (window.XMLHttpRequest) {\n xmlhttp = new XMLHttpRequest();\n } else {\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"Courses\").innerHTML = this.responseText;\n }\n };\n xmlhttp.open(\"GET\",\"search.php?all-student=\" + classID,true);\n xmlhttp.send();\n this.courseInfoShow();\n }", "function updateView(res){\n let user = res[0]\n const name = document.querySelector(\"#displayname\")\n const email = document.querySelector('#displayemail')\n const intro = document.querySelector('#displayintro')\n const table = document.querySelector('#coursetable')\n name.innerHTML = user.name + \" \" + \"<small>\" + \" \" + user.programs + \" \" + \"</small>\" + \"<small>\" + user.year + \" year student.\" +\"</small>\"\n email.innerText = user.email\n // program.innerText = user.programs\n // year.innerText = user.year\n intro.innerText = user.selfIntro\n addCourse(user, table)\n}", "function init() {\n studentSrv.getStudents().then(function (result) {\n for (let stu in result.data) {\n $scope.manifest.push(result.data[stu]);\n $scope.getStudentCalls.push($http.get(`/api/v1/students/${result.data[stu]}.json`)\n .then(function(result) {\n result.data.id = $scope.manifest[stu];\n result.data.startDate = new Date(result.data.startDate);\n $scope.students.push(result.data);\n }\n ));\n }\n });\n $scope.checkCookies();\n }", "function loadStudents () {\n $scope.students = StudentsModel.getStudents(); // Populate array of all students.\n }", "function loadFirstPage(){\n\t\t\tcounter = studentItemLength;\n\t\t\tclearClass();\n\t\t\t$('.student-item').each(function () {\t\t\t\n\t\t\tcreateClass(this); \n\t\t\t});\n\t\t\tnavBar(counter);\n\t\t\tshowStudents(1);\n\t\t\tclickingPageNumber();\n}", "function fetchStudents2() {\n $.get(apiUrl + \"students.json\").then(students => {\n students.forEach(student => $(\"#neato\").append(student.name));\n });\n}", "function addstudent(event) {\n event.preventDefault();\n clicks++;\n if (clicks == 1 && !studentString) {\n makingHeader();\n }\n if (clicks >= 1) {\n stdname = event.target.stdname.value;\n studentId = event.target.stdID.value;\n gender = event.target.gender.value;\n parentId = event.target.prntID.value;\n var firtstSub = document.getElementById(\"math\");\n //first subject\n grade1 = event.target.firstExam.value;\n grade2 = event.target.secondExam.value;\n grade3 = event.target.thirdExam.value;\n mathMark = [];\n mathMark.push(grade1, grade2, grade3);\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n //second subjiect\n gradeE1 = event.target.FirstExamEnglish.value;\n gradeE2 = event.target.secondExamEnglish.value;\n gradeE3 = event.target.ThirdExamEnglish.value;\n englishMark = [];\n englishMark.push(gradeE1, gradeE2, gradeE3);\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n feedBack = event.target.feedback.value;\n //third subject\n gradeS1 = event.target.firstExamScience.value;\n gradeS2 = event.target.secondExamScience.value;\n gradeS3 = event.target.ThirdExamScience.value;\n scienceMark = [];\n scienceMark.push(gradeS1, gradeS2, gradeS3);\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n // avg.push(avg);\n }\n STD = new Student(stdname, studentId, gender, parentId, mathMark, englishMark, scienceMark, feedBack, mathTotal, scienceTotal, englishTotal, avg);\n renderTable();\n updateStudent();\n}", "function displayStudent2(alu){\n\n//var alu = JSON.parse('[{ \"Name\":\"John\", \"Age\":31,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"A\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"A\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"-A\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"Nothing yet\"}]},{ \"Name\":\"Alfredo\", \"Age\":34,\"Gender\":\"Male\",\"Courses\":[{ \"season\":\"Winter\", \"name\":\"CIT-160\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"WDD-100\", \"finalGrade\":\"B\" },{ \"season\":\"Fall\", \"name\":\"CIT-230\", \"finalGrade\":\"B\" },{ \"season\":\"Winter\", \"name\":\"CIT-261\", \"finalGrade\":\"B\"}]}]');\n\n\n\n //read each object inside of Array.\n var y;\n var txt = \"\";\n var txt2 = \"\";\n var txt3 = \"\";\n var stu = \"\";\n\n\n //var stu = \"Name: \"+alu.Name+\" - Age:\"+alu.Age+\" - Gender: \"+alu.Gender;\n for (i=0; i < alu.length;i++){\n for(y in alu[i].Courses){\n //var al = alu[i];\n var stu = \"Name: \"+alu[i].Name+\" - Age:\"+alu[i].Age+\" - Gender: \"+alu[i].Gender+\"<br>\";\n\n\n txt2 += \"Season: \"+alu[i].Courses[y].season+\" - Course: \"+alu[i].Courses[y].name + \" - Final Grade: \"+alu[i].Courses[y].finalGrade+\"<br> \";\n\n //this allows to add the name of the student only one time. \n var cant = (alu[i].Courses.length - 1); \n\n if(y == cant){\n txt3 += \"<strong>\"+stu+\"</strong>\"+\"<br>\"+txt2;\n txt3=txt3+\"<br>\";\n document.getElementById(\"listStu2\").innerHTML = \"<br><br>\"+txt3+\"<br><br>\";\n txt2 = \"\";\n }\n }\n\n }\n\n}", "function apendlist(NoExpelledStuds) {\n document.querySelector(\".listhere\").innerHTML = \"\";\n NoExpelledStuds.forEach(e => {\n const template = document.querySelector(\".studentlist-template\").content;\n const clone = template.cloneNode(true);\n const sname = clone.querySelector(\".studentdetails\");\n const firstname = e.firstName;\n const middleName = e.middleName;\n const lastname = e.lastName;\n sname.innerHTML = firstname + `&nbsp` + middleName + `&nbsp` + lastname;\n clone.querySelector(\".studentdetails\").setAttribute(\"data-id\", e.id);\n document.querySelector(\".listhere\").appendChild(clone);\n });\n clickonStud();\n document.querySelector(\".filter\").click();\n clickonData(\"General\", studentArray);\n clickonFilter();\n}", "function updateProfile(){\n\tprofileString = 'UpdateProfile=True' + '&Year=' + $(\"#pYear\").val() +\n\t\t\t'&TaExp=' + $(\"#pTAExp\").val() + '&TaVol=' + $(\"#pTAVol\").val() +\n\t\t\t'&TaWhy=' + $(\"#pTAWhy\").val() + '&Choice1=' + $(\"#course1\").val() + \n\t\t\t'&Choice2=' + $(\"#course2\").val() + '&Choice3=' + $(\"#course3\").val() +\n\t\t\t'&Choice4=' + $(\"#course4\").val() + '&Choice5=' + $(\"#course5\").val() +\n\t\t\t'&Status=' + $(\"#studentStatus\").val() + '&Email=' + $(\"#userEmail\").val() +\n\t\t\t\"&Profiles\";\n\tdisplayPageInfo(profileString);\n\tconsole.log(profileString);\n\tsetTimeout(function() {\n \tgetProfile('MyProfile');\n \t}, 100);\n}", "function updateInfo() {\n let newVals = grabFormValues();\n $.ajax({\n dataType: 'json',\n type: 'PUT',\n data: newVals,\n async: false,\n url: 'api/employees/' + curUser._id,\n success: function(response) {\n console.log(response);\n localStorage.setItem('currentUser', JSON.stringify(response));\n curUser = JSON.parse(localStorage.getItem('currentUser'));\n showInfo();\n },\n });\n }", "function addNewStudent() {\n StudentsModel.addStudent($scope.NewStudent);\n addNewSiblings();\n loadStudents();\n $scope.NewStudent = {};\n gotoTop();\n }", "function updateSemester(clicked) {\n // code goes here\n semester = clicked.innerHTML\n}", "function updatePage() {\n\n // Summary Profile\n let nameElement = document.getElementById(\"comapnyName\");\n nameElement.innerText = \" \"+companyName;\n let marketCapElement = document.getElementById(\"marketCap\");\n marketCapElement.innerText = \" \"+marketCap;\n let industryElement = document.getElementById(\"industry\");\n industryElement.innerText = \" \"+industry;\n let sectorElement = document.getElementById(\"sector\");\n sectorElement.innerText = \" \"+sector;\n let websiteElement = document.getElementById(\"website\");\n websiteElement.innerText = \" \"+website;\n // Income Statement\n let totalRevenueElement = document.getElementById(\"totalRevenue\");\n totalRevenueElement.innerText = \" \"+totalRevenue;\n let totalEBITDAElement = document.getElementById(\"ebitda\");\n totalEBITDAElement.innerText = \" \"+totalEBITDA;\n let grossMarginElement = document.getElementById(\"grossMargin\");\n grossMarginElement.innerText = \" \"+grossMargin;\n // Balance Sheet Info\n let totalCashElement = document.getElementById(\"totalCash\");\n totalCashElement.innerText = \" \"+totalCash;\n let totalDebtElement = document.getElementById(\"totalDebt\");\n totalDebtElement.innerText = \" \"+totalDebt;\n let debtTwoEquityElement = document.getElementById(\"debtTwoEquity\");\n debtTwoEquityElement.innerText = \" \"+debtTwoEquity;\n\n}", "function showPage(list, page) {\r\n // create two variables which will represent the index for the first and last student on the page\r\n const startIndex = (page * 9) - 9;\r\n const endIndex = (page * 9);\r\n\r\n \r\n\r\n // select the element with a class of `student-list` and assign it to a variable\r\n const studentList = document.querySelector('.student-list');\r\n\r\n\r\n\r\n \r\n // set the innerHTML property of the variable you just created to an empty string\r\n studentList.innerHTML = '';\r\n \r\n // loop over the length of the `list` parameter\r\n for ( let i = 0; i < list.length; i++ ) {\r\n // inside the loop create a conditional to display the proper students\r\n // create the elements needed to display the student information\r\n if( i >= startIndex && i < endIndex) {\r\n studentList.innerHTML += `\r\n <li class=\"student-item cf\">\r\n <div class=\"student-details\">\r\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\">\r\n <h3> ${list[i].name.first} ${list[i].name.last} </h3>\r\n <span class=\"email\">${list[i].email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">Joined ${list[i].registered.date}</span>\r\n </div>\r\n </li>\r\n `;\r\n\r\n };\r\n \r\n };\r\n \r\n }", "function loadStudentExamData(name, code) {\n document.getElementById('examSpecific').style.display = \"none\";\n document.getElementById('student-exam-data').style.display = \"initial\";\n document.body.style.backgroundImage = \"none\";\n var answer = \"\";\n var finalId;\n\n //linear-gradient(135deg, rgb(245, 247, 250) 0%, rgb(195, 207, 226) 100%);\n\n var table = document.getElementsByClassName('table');\n for(var i = 0; i < table.length; i++) {\n table[i].style.display = \"none\";\n }\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Students\").once('value', function(snapshot) {\n for(var info in snapshot.val()) {\n var data = snapshot.val()[info];\n var id = data.split(\";\")[0];\n var fullName = data.split(\";\")[1];\n\n if(name == fullName) {\n finalId = id;\n }\n }\n });\n\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code).once('value', function(snapshot) {\n var data = (snapshot.val().responses[name][Object.keys(snapshot.val().responses[name])[0]]);\n\n document.getElementById('resetStatus').onclick = function() {\n for(var takenKey in snapshot.val().taken) {\n var id = (snapshot.val().taken[takenKey]);\n\n if(id == finalId) {\n firebase.database().ref(\"Teachers/\" + userName + \"/Classes/\" + sessionStorage.getItem(\"className\") + \"/Exams/\" + code + \"/taken/\").child(takenKey).remove()\n }\n }\n\n swal(\"Success!\", name + \"'s taken status has been reset. \" + name + \" should be able to retake exam now.\", 'success')\n }\n\n var studentPoints = data.totalScore / 100 * snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score-num').innerHTML = (studentPoints).toFixed(0) + \" / \" + snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints;\n document.getElementById('score').innerHTML = data.totalScore + \"%\";\n\n var corrAnswer = \"\";\n sessionStorage.setItem(\"totalPointsExcludingFr\", 0);\n\n for(var i = 0; i < Object.keys(data.answers).length; i++) {\n\n if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"tf\") {\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices[0];\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"mc\"){\n corrAnswer = snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].checked;\n }\n else if(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].type == \"fr\") {\n corrAnswer = \"\";\n }\n createGradedQuestion(\n // PARAM: studAnswer\n data.answers[i].split(\";\")[1],\n // PARAM: corrAnswer\n corrAnswer,\n // PARAM: numAnswerChoices\n Object.keys(snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].choices).length,\n // PARAM: numPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i].points,\n // PARAM: questions\n snapshot.val()[Object.keys(snapshot.val())[0]].questions[i],\n // PARAM: studName\n name,\n // PARAM: examCurrentCode\n code,\n // PARAM: examTotalPoints\n snapshot.val()[Object.keys(snapshot.val())[0]].examTotalPoints\n );\n }\n });\n}", "function allStudentsInfoCallBack(students) {\n\n //successful generation of students\n if (students != null && typeof(students.Error)=='undefined') {\n \n message('#allStudentNo', students.length, 'brown');\n\n //students exist in the database\n if (students.length > 0) {\n message('#spanAllStudents', '', 'black'); //reset to default text color\n \n var output = '<table id=\"allTable\" class=\"table table-striped table-responsive text-center\">';\n output += '<thead> <tr> <th class=\"text-center\">S/N</th> <th class=\"text-center largeFont\">Students\\' Information</th> </tr> </thead> <tbody>';\n \n for (var i = 0; i < students.length; i++) {\n output += '<tr> <td class=\"largeFont\">' + (i + 1) + '</td>';\n output += '<td> <table class=\"table\"> <tbody>';\n output += '<tr class=\"success\"> <td> <em>Name</em></td> <td>' + students[i].LastName + ',&nbsp;' +\n students[i].FirstName + '&nbsp;' + students[i].MiddleName + '</td></tr>';\n output += '<tr class=\"info\"> <td> <em>Matriculation Number</em></td> <td>' + students[i].MatricNo + '</td> </tr>';\n output += '<tr> <td><em>Student Unique ID</em></td> <td>' + students[i]._id + '</td> </tr>';\n output += '<tr> <td> <em>Faculty</em></td> <td>' + students[i].Faculty + '</td> </tr>';\n output += '<tr> <td><em>Department</em></td> <td>' + students[i].Department + '</td> </tr>';\n output += '<tr> <td> <em>Level</em></td> <td>' + students[i].Level + '</td> </tr>';\n output += '<tr> <td> <em>Date of Birth</em></td><td>' + formatDate(students[i].DateOfBirth) + '</td></tr>';\n output += '<tr> <td> <em>Mobile Number</em></td> <td>' + students[i].PhoneNo + '</td> </tr>';\n output += '<tr> <td> <em>Email Address</em></td><td> ' + students[i].Email + '</td></tr>';\n output += '<tr> <td> <em>Date Registered</em></td><td>' + formatDate(students[i].DateReg) + '</td></tr>';\n output += '</tbody> </table> <br/></td> </tr>';\n }\n output += '</tbody></table>';\n \n $('#spanAllStudents').html(output);\n }\n //no student in the database\n else {\n message('#spanAllStudents', 'No Registered Student Available', 'brown');\n $('#spanAllStudents').addClass('fontMsg'); \n }\n }\n\n //exceptional situation from ajax call or from server\n else {\n $('#spanAllStudents').addClass('fontMsg');\n if (students == null) {\n message('#spanAllStudents', ajaxErrMsg, 'red');\n }\n else {\n message('#spanAllStudents', students.Error, 'red');\n } \n }\n}", "async function getstudent(name) {\n let rawdata = await fetch(`https://kavin-mentor.herokuapp.com/students/${name}`);\n let studentdata = await rawdata.json();\n\n let ul = document.getElementById('students');\n ul.innerHTML = '';\n\n studentdata.forEach((student) => {\n let li = document.createElement('li');\n li.innerHTML = student.name;\n ul.append(li);\n });\n\n document.getElementById('studentdetailsdiv').style.display = (document.getElementById('studentdetailsdiv').style.display === 'block') ? 'none' : 'block';\n}", "function init() {\n makeStudent();\n appendToDom();\n carouselMaker();\n moveCarousel();\n timer = setInterval(nextStudent, INTERVAL);\n }", "function renderStudForm(data) {\n $('#studId').val(data.id);\n $('#first_name').val(data.first_name);\n $('#last_name').val(data.last_name);\n \n $('#gender').find(`option[value=${data.gender}]`).prop('selected', true);\n $('#gender').formSelect();\n \n $('#grade').find(`option[value=${data.grade}]`).prop('selected', true);\n $('#grade').formSelect();\n \n $('#textarea_allergies').val(data.allergies);\n // add the focus to the alleriges so the test does not lay ontop of the lable\n $('#textarea_allergies').focus();\n // change back to first name so focus is at top of form\n $('#first_name').focus();\n }", "function updateInstructorInfo(nameMap, text, foundLocal) {\n\n\tvar tdIndexInstructor = nameMap.tdIndexInstructor;\n\tvar lname = nameMap.lname;\n\tvar name = nameMap.name;\n\n\tif(text.indexOf('No results were found') > -1) {\n\t\tfor(var tdIndex=0, tc = nameMap.td.length; tdIndex < tc; tdIndex++) {\n\t\t\tnameMap\n\t\t\t.td[tdIndex]\n\t\t\t.attr('title','No record found in the directory')\n\t\t}\n\t\tif(localStorage.getItem('sched.param(debug)') !== '0') {\n\t\t\tconsole.log('Employee directory has no record for \\'' + lname + '\\'');\n\t\t}\n\t}\n\telse {\n\t\tfor(var tdIndex=0, tc = nameMap.td.length; tdIndex < tc; tdIndex++) {\n\t\t\tnameMap\n\t\t\t.td[tdIndex]\n\t\t\t.addClass('td-tooltip')\n\t\t\t.empty();\n\t\t}\n\t\tvar tipContent =\n\t\t\t$('<div>')\n\t\t\t.addClass('name-tooltip')\n\t\t\t.append(text)\n\t\t\t.append(\n\t\t\t\t$('<span>')\n\t\t\t\t.html(\n\t\t\t\t\t'<br><br>See all employees having last name starting with \\'' +\n\t\t\t\t\t'<a href=\"https://gsw.edu/searchDirectory/employee/search.php?name=' + lname + '\" ' +\n\t\t\t\t\t'target=\"_blank\">' + lname + '</a>\\''\n\t\t\t\t)\n\t\t\t);\n\t\tvar a = $('<a>')\n\t\t\t.attr('href','')\n\t\t\t.click(function(){\n\t\t\t\t/*\n\t\t\t\tif($('#container').hasClass('blur')) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t*/\n\t\t\t\tvar clickElement = $(this);\n\t\t\t\t//-- Create tooltip container if does not exist\n\t\t\t\tif($('div.tooltip-container').length === 0) {\n\t\t\t\t\t$('#topOfThePage')\n\t\t\t\t\t.after(\n\t\t\t\t\t\t$('<div>')\n\t\t\t\t\t\t.addClass('tooltip-container')\n\t\t\t\t\t\t.addClass('no-print')\n\t\t\t\t\t\t.click(function(){\n\t\t\t\t\t\t\t$(this).remove();\n\t\t\t\t\t\t})\n\t\t\t\t\t)\n\t\t\t\t}\n\t\t\t\tvar toolTipContainer =\n\t\t\t\t\t$('div.tooltip-container')\n\t\t\t\t\t.html(tipContent)\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'position' : 'absolute'\n\t\t\t\t\t})\n\t\t\t\tif(isMobile()) {\n\t\t\t\t\ttoolTipContainer\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'left' : ($(window).width() - toolTipContainer.width())/2,\n\t\t\t\t\t\t'top' : ($(window).height() - toolTipContainer.height())/2 + $(window).scrollTop()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\ttoolTipContainer\n\t\t\t\t\t.css({\n\t\t\t\t\t\t'top' : clickElement.offset().top - toolTipContainer.height(),\n\t\t\t\t\t\t'left' : clickElement.offset().left - toolTipContainer.width()\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t})\n\t\t\t.text(name)\n\t\t\t.appendTo(nameMap.td);\n\t}\n}", "function showDetails(student) {\n console.log(\"name has been clicked\");\n document.querySelector(\"#student-details-modal\").style.display = \"block\";\n\n document.querySelector(\"[data-student-modal=name]\").textContent =\n student.firstName;\n document.querySelector(\n \"[data-student-modal=blood]\"\n ).textContent = `Blood status: ${student.bloodType}`;\n\n if (student.house === \"Gryffindor\") {\n document.querySelector(\n \".student-details-model-content\"\n ).style.backgroundImage = \"url(images/gryffindor-bg.svg)\";\n } else if (student.house === \"Hufflepuff\") {\n document.querySelector(\n \".student-details-model-content\"\n ).style.backgroundImage = \"url(images/hufflepuff-bg.svg)\";\n } else if (student.house === \"Ravenclaw\") {\n document.querySelector(\n \".student-details-model-content\"\n ).style.backgroundImage = \"url(images/ravenclaw-bg.svg)\";\n } else {\n document.querySelector(\n \".student-details-model-content\"\n ).style.backgroundImage = \"url(images/slytherin-bg.svg)\";\n }\n\n if (student.middleName === \"\") {\n document.querySelector(\"[data-student-modal=middlename]\").style.display =\n \"none\";\n } else {\n document.querySelector(\"[data-student-modal=middlename]\").textContent =\n student.middleName;\n }\n if (student.nickName === \"\") {\n document.querySelector(\"[data-student-modal=nickname]\").style.display =\n \"none\";\n } else {\n document.querySelector(\"[data-student-modal=nickname]\").textContent =\n student.nickName;\n }\n\n document.querySelector(\"[data-student-modal=lastname]\").textContent =\n student.lastName;\n\n document.querySelector(\"[data-student-modal=img] img\").src = student.img;\n\n if (student.expelled === true) {\n document.querySelector(\"[data-student-modal=expel]\").textContent =\n \"Expelled: Yes\";\n }\n\n if (student.prefect === true) {\n document.querySelector(\"[data-student-modal=prefect] img\").src =\n \"images/prefect-chosen.svg\";\n }\n if (student.squad === true) {\n document.querySelector(\"[data-student-modal=squad] img\").src =\n \"images/squad-chosen.svg\";\n }\n window.onclick = function (event) {\n if (event.target == document.querySelector(\"#student-details-modal\")) {\n document.querySelector(\"#student-details-modal\").style.display = \"none\";\n document.querySelector(\"[data-student-modal=middlename]\").style.display =\n \"initial\";\n document.querySelector(\"[data-student-modal=nickname]\").style.display =\n \"initial\";\n document.querySelector(\"[data-student-modal=prefect] img\").src =\n \"images/prefect-inactive.svg\";\n document.querySelector(\"[data-student-modal=squad] img\").src =\n \"images/squad-inactive.svg\";\n document.querySelector(\"[data-student-modal=expel]\").textContent =\n \"Expelled: No\";\n }\n };\n}", "function showPage(list, page) {\n //index for first student on page\n let startIndex = (page * pageItems) - pageItems;\n //index for last student on page\n let endIndex = page * pageItems;\n //variable for HTML to be inserted\n let studentItem = \"\"; \n //Clears studentListVariable\n studentList.innerHTML = \"\";\n \n //Loops through list to display each student\n for(let i=0; i < list.length; i++) {\n if (i >= startIndex && i < endIndex) {\n studentItem = `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.large}\" alt=\"Profile Picture\" />\n <h3>${list[i].name.first} ${list[i].name.last}</h3> \n <span class=\"email\">${list[i].email}</span>\n </div> \n <div class=\"joined-details\">\n <span class=\"date\">${list[i].registered.date}</span>\n </div>\n </li>\n `;\n //Inserts HTML into document\n studentList.insertAdjacentHTML(\"beforeend\", studentItem);\n }\n }\n}", "function showPage(list, page){\n // Those variables generate the index for the first and last student on the page\n let startIndex = (page * studentsPerPage) - studentsPerPage;\n let endIndex = page * studentsPerPage;\n\n // Select \"student-list\" and empty it\n let studentList = document.querySelector('.student-list');\n studentList.innerHTML = '';\n\n // Fill list with information with a loop\n for (i = startIndex; i < endIndex; i++){\n if(list[i]){\n studentList.innerHTML += `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=\"${list[i].picture.thumbnail}\" alt=\"Profile Picture\">\n <h3>${list[i].name.first} ${list[i].name.last}</h3>\n <span class=\"email\">${list[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">Joined ${list[i].registered.date}</span>\n </div>\n </li>`\n }\n}\n\n}", "async loadDetails(uuObject, studentDao) {\n if (uuObject.studentMap) {\n const studentListIdArray = [];\n for (let student in uuObject.studentMap) {\n studentListIdArray.push(uuObject.studentMap[student].id);\n }\n\n const studentsDetails = await studentDao.listByIds(uuObject.awid, studentListIdArray, DEFAULT_PAGE_INFO);\n if (studentsDetails && studentsDetails.itemList) {\n studentsDetails.itemList.forEach((student) => {\n uuObject.studentMap[student.uuIdentity].studentDetail = student;\n });\n }\n }\n return uuObject;\n }", "function getStudentIdInfo() {\n StudentService.fetchStudentIdInfo()\n .success(function (data) {\n console.log('fetchStudentIdInfo data success');\n console.log(data);\n\n vm.studentInfo = data;\n\n vm.valid = data.valid;\n vm.netname = data.netname;\n vm.pending = data.pending;\n\n $rootScope.valid = data.valid;\n $rootScope.pending = data.pending;\n\n if (vm.valid == false && vm.pending == false) {\n $state.go('app.camera');\n }\n\n vm.updatePicture = data.updatePicture;\n $rootScope.canUpdate = data.updatePicture;\n\n //variables to be displayed on id\n vm.profilePicture = data.profilePicture;\n vm.firstName = data.firstName;\n vm.lastName = data.lastName;\n parseDate(data.dob);\n vm.id = data.id;\n vm.uGradStatus = data.uGradStatus;\n parseExpirationDate(data.expireDate);\n })\n .error(function (error) {\n console.log('fetchStudentIdInfo data error');\n });\n }", "function showPage(list, page) {\r\n // create two variables which will represent the index for the first and last student on the page\r\n /* startIndex = (page parameter * items per page) - items per page \r\n endIndex = page parameter * items per page */\r\n startIndex = page * 9 - 9;\r\n endIndex = page * 9;\r\n // select the element with a class of `student-list` and assign it to a variable\r\n studentList = document.querySelector(\".student-list\");\r\n\r\n // set the innerHTML property of the variable you just created to an empty string\r\n studentList.innerHTML = \" \";\r\n // loop over the length of the `list` parameter\r\n for (let i = 0; i < list.length; i++) {\r\n // inside the loop create a conditional to display the proper students\r\n if (i >= startIndex && i < endIndex) {\r\n // inside the conditional:\r\n // create the elements needed to display the student information\r\n let pickPerson = data[i];\r\n let studentItem = `<li class = \"student-item cf\"> \r\n <div class = \"student-details\"> \r\n <img class=\"avatar\" src=\"${pickPerson.picture.large}\" alt=\"Profile Picture\">\r\n <h3>${pickPerson.name.first} ${pickPerson.name.last}</h3> <span class=\"email\">${pickPerson.email}</span>\r\n </div>\r\n <div class=\"joined-details\">\r\n <span class=\"date\">${pickPerson.registered.date}</span>\r\n </div>\r\n </li> `;\r\n // insert the above elements\r\n studentList.insertAdjacentHTML(\"beforeend\", studentItem);\r\n }\r\n }\r\n}", "function studentResults() {\n\n //Gather input\n //var sizeCharge = parseFloat($(\"select#size option:selected\").data(\"price\"));\n //let size = $(\"select#size option:selected\").val();\n //calculate value of percent grade\n let pointsEarned = parseFloat($(\"input#pointsEarned\").val());\n let pointsPossible = parseFloat($(\"input#pointsPossible\").val());\n //calculate number grade to two decimal points\n let pointsPercent = ((pointsEarned / pointsPossible) * 100).toFixed(2);\n\n //set up object and fill it with properties of the student and their grade\n let studentInfo = {\n firstName: $(\"input#firstName\").val(),\n lastName: $(\"input#lastName\").val(),\n pointsPercent: pointsPercent\n //grade: letterGrade\n };\n\n //push student into into class array\n Students.push(studentInfo);\n}", "function saveNewStudent(id, name, js, android, className) {\n \n let newStudent = {\n id: id,\n name: name,\n score: {\n js: js,\n android: android\n },\n class: className\n }\n console.log(1, newStudent);\n console.log(2, ListStudents);\n console.log(3, Students);\n\n\n ListStudents.push(newStudent);\n localStorage.setItem('items', JSON.stringify(ListStudents));\n this.loadStudent(ListStudents);\n document.getElementById(\"idStudent\").value = \"\";\n document.getElementById(\"studentName\").value = \"\";\n document.getElementById(\"className\").value = \"\";\n document.getElementById(\"jsScore\").value = \"\";\n document.getElementById(\"androidScore\").value = \"\";\n\n \n document.getElementById(\"addStudent\").style.display=\"none\";\n document.getElementById(\"showInforStudents\").style.display=\"block\";\n\n \n}", "function searchStudents() {\n\t\tclearClass();\n\t\t$('.no-student').hide();\n\t\t$('.student-item').hide();\n\t\tcounter = 0;\n\t\tcount = 1;\n\t\tvar input = $('input').val();\n\t\tinput = input.toLowerCase();\n\t\tif(input.length === 0){\n\t\t\tloadFirstPage();\n\t\t\t\n\t\t}else{\n\t\t\tfor(i = 1; i <=studentItemLength; i++){\n\t\t\t\t\n\t\t\t\tvar name = $('.student-item:nth-child('+ i + ') h3').html();\n\t\t\t\tname = name.toLowerCase();\n\t\t\t\tvar email = $('.student-item:nth-child('+ i + ') .email').html();\n\t\t\t\temail = email.toLowerCase();\n\t\t\t\tvar nameOutput = name.indexOf(input);\n\t\t\t\tvar emailOutput = email.indexOf(input);\n\t\t\t\tif((nameOutput !== -1) || (emailOutput !== -1)){\n\t\t\t\t\tvar item = $('.student-item:nth-child(' + i + ')');\n\t\t\t\t\tcreateClass(item);\n\t\t\t\t\tcounter ++;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tif(counter === 0){\n\t\t\t\t$('.no-student').show();\n\t\t\t}\n\t\t\tnavBar(counter);\n\t\t\tshowStudents(1);\n\t\t\tclickingPageNumber();\n\t\t\t\n\t\t}\n\t\n}", "function getAllStudentsNotEnrolled(){\n\t\t\n\tvar getStudentsSettings={\n\t\t\t\"type\":\"GET\",\n\t\t\t\"async\": true,\n\t\t\t\"dataType\":\"json\",\n\t\t\t\"url\":\"api/student/enrollment?class=unenrolled\",\n\t\t\t\"headers\":{\n\t\t\t\t\"cache-control\":\"no-cache\"\n\t\t\t}\n\t\t};\n\t\t\n\t$.ajax(getStudentsSettings).success(function(response){\n\t\tconsole.log(JSON.stringify(response));\n\t\tif(response.status=='failed' || status=='failed'){\n\t\t\t\n\t\t\t$('.studentListnotEnrolled').html(\"\");\n\t\n\t\t\t$('.noUnenrolled').html(\"\");\n\t\t\tvar appendNotStu='<p class=\"alert alert-warning\">You have not added any students</p>';\n\t\t\t$('.noUnenrolled').append(appendNotStu);\n\t\t}\n\t\n\telse{\n\t\t$('.noUnenrolled').hide();\n\t\t$('.studentListnotEnrolled').html(\"\");\n\t\t//console.log(JSON.stringify(response));\n\t $.each(response, function(key, value){\n\t\t \n\t\t \t\n\t\t\tvar appendData='<tr>'+\n\t\t\t\t\t\t'<td>'+value.f_name+' '+value.l_name+'</td>'+\n\t\t\t\t\t\t'<td>'+value.username+'</td>'+\n\t\t\t\t\t\t'<td>'+value.dob+'</td>'+\n\t\t\t\t\t\t'<td><a data-sid=\"'+value.student_id+'\" class=\"btn btn-xs btn-light editStudent\" href=\"#\" data-target=\"#editStudent\" data-toggle=\"modal\">View</a></td>'+\n\t\t\t\t\t\t'<td><a data-sid=\"'+value.student_id+'\" class=\"btn btn-xs btn-light deleteStudent\" href=\"#\" data-target=\"#deleteStudent\" data-toggle=\"modal\"><i class=\"fa fa-times\"></i></a></td>'+\n\t\t\t\t\t\t'<td><input type=\"checkbox\" data-sid=\"'+value.f_name+' '+value.l_name+'\" value=\"'+value.student_id+'\" class=\"selectUnStudent\" /></td>'+\n\t\t\t\t\t'</tr>';\n\t\t\t$('.studentListnotEnrolled').append(appendData);\n\t\n\t\t\t\n\t\t});\n\t}\n\t\t\n\t\t\n\t\t//enroll student\n\t\t\t$('a.enrollBtn').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\tenrollStudent(student_id);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t//mutiple enroll\n\t\t$('button.enrollMultiple').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\n\t\t\n\t\n\t\t\t$('.notification').hide();\n\t\t\tmultienrollStudent();\n\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\n\t\t\t//delete student\n\t\t\t\t$('a.deleteStudent').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\tvar elementRemove=$(this).parent().parent();\n\t\t\t\tremoveStudent(student_id, elementRemove);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\n\t\t\t//veiw individual student details\n\t\t\t$('a.editStudent').click( function(e){\n\t\t\t\te.preventDefault();\n\t\t\t\tvar student_id =$(this).attr(\"data-sid\");\n\t\t\t\t\n\t\t\t\tveiwDetails(student_id);\n\t\t\t\t\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t$('#selectAllChildren').click( function(){\n\t\t\t\t\t\n\t\t\t\t\t $('input.selectUnStudent:checkbox').not(this).prop('checked', this.checked);\n\t\t\t\t});\n });\n\t\t\n\t\n\n}", "function makeStudent() {\n currentStudent = studentsObject.sigmanauts[indexId];\n }", "function updateReportCard() {\n updateDropdownLabel()\n reportCardTable.innerHTML = ``\n\n // add your code here\n addReportCardHeaders();\n let i = 1;\n studentData[semester].forEach(element => {\n addCourseRowToReportCard(element,i);\n i++;\n });\n // addCourseRowToReportCard(studentData[semester][0],1);\n\n}", "function insertData(std) {\r\n //Responds to the table that will be filled.\r\n const table = document.querySelector(\".students-table\");\r\n \r\n //Every time insertData() is called, a new row is added to the table.\r\n let newRow = table.insertRow(table.length);\r\n \r\n //Creating 5 row cells that will be filled with data.\r\n cell0 = newRow.insertCell(0);\r\n cell1 = newRow.insertCell(1);\r\n cell2 = newRow.insertCell(2);\r\n cell3 = newRow.insertCell(3);\r\n cell4 = newRow.insertCell(4);\r\n \r\n //First 4 cells contain the object's values.\r\n cell0.innerText = std['fname'];\r\n cell1.innerText = std['lname'];\r\n cell2.innerText = std['birthdate'];\r\n cell3.innerText = std['fees'];\r\n \r\n //Last cells contains the edit/delete/save buttons for data manipulation.\r\n cell4.innerHTML = ` <button type=\"button\" class=\"btn-edit-course\" onClick=\"onEdit(this)\">Edit</button>\r\n <button type=\"button\" class=\"btn-del-course\" onClick=\"onDelete(this)\">Delete</button>\r\n <button hidden type=\"button\" class='btn-save-course' onClick=onSave(this)>Save</button>`;\r\n \r\n //Global variables that respond to each manipulation button for later use.\r\n editBtn = document.querySelectorAll('.btn-edit-course');\r\n delBtn = document.querySelectorAll('.btn-del-course');\r\n saveBtn = document.querySelectorAll('.btn-save-course');\r\n\r\n //Checking\r\n console.log(students);\r\n}", "function initNewSt() {\n $scope.newStudent = {\n stName: '',\n stGPA: ''\n };\n }", "function getTableInfo(objs)\n{ \n let table = document.getElementById(\"detailtbl\");\n table.innerHTML = \"\";\n //generates the table.\n let row = table.insertRow(table.rows.length);\n let cell1 = row.insertCell(0);\n let cell2 = row.insertCell(1);\n cell1.innerHTML = \"Course ID\";\n cell2.innerHTML = objs.CourseId;\n populateTable(table, row, objs);\n \n $('#register').attr(\"href\", \"register.html?id=\" + objs.CourseId); \n $('#register').click(function() {\n document.location.href=\"register.html?id=\" + objs.CourseId;\n });\n\n $('#cancel').click(function() {\n document.location.href=\"courses.html\";\n });\n \n showStudents(objs);\n}", "function updateStudent(studentId = null)\r\n{\r\n\tif(studentId) {\r\n\t\t$('#editRegisterDate').calendarsPicker({\r\n\t\t\tdateFormat: 'yyyy-mm-dd'\r\n\t\t});\r\n\t\t\r\n\t\t$('#editDob').calendarsPicker({\r\n\t\t\tdateFormat: 'yyyy-mm-dd'\r\n\t\t});\r\n\r\n\t\t$(\"#editPhoto\").fileinput({\r\n\t\t\toverwriteInitial: true,\r\n\t\t maxFileSize: 1500,\r\n\t\t showClose: false,\r\n\t\t showCaption: false,\r\n\t\t showBrowse: false,\r\n\t\t browseOnZoneClick: true,\r\n\t\t removeLabel: '',\r\n\t\t removeIcon: '<i class=\"glyphicon glyphicon-remove\"></i>',\r\n\t\t removeTitle: 'Cancel or reset changes',\r\n\t\t elErrorContainer: '#kv-avatar-errors-2',\r\n\t\t msgErrorClass: 'alert alert-block alert-danger',\r\n\t\t defaultPreviewContent: '<img src=\"'+base_url+'assets/images/default/edit_avatar.png\" alt=\"Your Avatar\" style=\"width:208px;height:200px;\"><h6 class=\"text-muted\">Click to select</h6>',\r\n\t\t layoutTemplates: {main2: '{preview} {remove} {browse}'},\t\t\t\t\t\t\t\t \r\n\t\t\tallowedFileExtensions: [\"jpg\", \"png\", \"gif\", \"JPG\", \"PNG\", \"GIF\"]\r\n\t\t});\r\n\r\n\t\t$(\".form-group\").removeClass('has-error').removeClass('has-success');\r\n\t\t$('.text-danger').remove();\r\n\t\t// photo\r\n\t\t$('#edit-upload-image-message').html('');\r\n\t\t$(\".fileinput-remove-button\").click();\t\r\n\r\n\t\t// information\r\n\t\t$('#edit-personal-student-message').html('');\r\n\t\t\r\n\r\n\t\t$.ajax({\r\n\t\t\turl: base_url + 'student/fetchStudentData/'+studentId,\r\n\t\t\ttype: 'post',\r\n\t\t\tdataType: 'json',\r\n\t\t\tsuccess:function(response){\r\n\t\t\t\t$(\"#editFname\").val(response.fname);\r\n\t\t\t\t$(\"#editLname\").val(response.lname);\r\n\t\t\t\t$(\"#editDob\").val(response.dob);\r\n\t\t\t\t$(\"#editAge\").val(response.age);\r\n\t\t\t\t$(\"#editContact\").val(response.contact);\r\n\t\t\t\t$(\"#editEmail\").val(response.email);\r\n\t\t\t\t$(\"#editAddress\").val(response.address);\r\n\t\t\t\t$(\"#editCity\").val(response.city);\r\n\t\t\t\t$(\"#editCountry\").val(response.country);\r\n\t\t\t\t$(\"#editRegisterDate\").val(response.register_date);\r\n\t\t\t\t$(\"#editClassName\").val(response.class_id);\r\n\r\n\t\t\t\t$(\"#editSectionName\").load('student/fetchClassSection/'+response.class_id, function(i) {\r\n\t\t\t\t\t$(\"#editSectionName\").val(response.section_id);\r\n\t\t\t\t});\t\t\t\t\r\n\r\n\t\t\t\t$(\"#student_photo\").attr('src', base_url + response.image);\r\n\r\n\t\t\t\t$(\"#editClassName\").unbind('change').bind('change', function() {\r\n\t\t\t\t\tvar class_id = $(this).val();\r\n\t\t\t\t\t$(\"#editSectionName\").load('student/fetchClassSection/'+class_id);\r\n\t\t\t\t});\r\n\r\n\t\t\t\t// submit the teacher information form\r\n\t\t\t\t$(\"#updateStudentInfoForm\").unbind('submit').bind('submit', function() {\r\n\t\t\t\t\tvar form = $(this);\r\n\t\t\t\t\tvar url = form.attr('action');\r\n\t\t\t\t\tvar type = form.attr('method');\r\n\r\n\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\turl: url + '/' + studentId,\r\n\t\t\t\t\t\ttype: type,\r\n\t\t\t\t\t\tdata: form.serialize(),\r\n\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\tsuccess:function(response) {\r\n\t\t\t\t\t\t\tif(response.success == true) {\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(\"#edit-personal-student-message\").html('<div class=\"alert alert-success alert-dismissible\" role=\"alert\">'+\r\n\t\t\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\r\n\t\t\t\t\t\t\t\t response.messages + \r\n\t\t\t\t\t\t\t\t'</div>');\t\t\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\tmanageStudentTable.ajax.reload(null, false);\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// refresh the section table \r\n\t\t\t\t\t\t\t\t$.each(studentSectionTable, function(index, value) {\r\n\t\t\t\t\t\t\t\t\tstudentSectionTable[index].ajax.reload(null, false);\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\t$('.form-group').removeClass('has-error').removeClass('has-success');\r\n\t\t\t\t\t\t\t\t$('.text-danger').remove();\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\telse {\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif(response.messages instanceof Object) {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$.each(response.messages, function(index, value) {\r\n\t\t\t\t\t\t\t\t\t\tvar key = $(\"#\" + index);\r\n\r\n\t\t\t\t\t\t\t\t\t\tkey.closest('.form-group')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('has-error')\r\n\t\t\t\t\t\t\t\t\t\t.removeClass('has-success')\r\n\t\t\t\t\t\t\t\t\t\t.addClass(value.length > 0 ? 'has-error' : 'has-success')\r\n\t\t\t\t\t\t\t\t\t\t.find('.text-danger').remove();\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t\t\tkey.after(value);\r\n\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 {\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$(\"#edit-personal-student-message\").html('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">'+\r\n\t\t\t\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\r\n\t\t\t\t\t\t\t\t\t response.messages + \r\n\t\t\t\t\t\t\t\t\t'</div>');\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\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} // /success\r\n\t\t\t\t\t}); // /ajax\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}); // /submit the teacher information form\r\n\r\n\t\t\t\t// submit the teacher photo form\r\n\t\t\t\t$(\"#updateStudentPhotoForm\").unbind('submit').bind('submit', function() {\t\t\t\t\t\r\n\t\t\t\t\tvar form = $(this);\r\n\t\t\t\t\tvar formData = new FormData($(this)[0]);\r\n\t\t\t\t\tvar url = form.attr('action') + '/' + studentId;\r\n\t\t\t\t\tvar type = form.attr('method');\r\n\r\n\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\turl : url,\r\n\t\t\t\t\t\ttype : type,\r\n\t\t\t\t\t\tdata: formData,\r\n\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\tcache: false,\r\n\t\t\t\t\t\tcontentType: false,\r\n\t\t\t\t\t\tprocessData: false,\r\n\t\t\t\t\t\tasync: false,\r\n\t\t\t\t\t\tsuccess:function(response) {\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\tif(response.success == true) {\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$(\"#edit-upload-image-message\").html('<div class=\"alert alert-success alert-dismissible\" role=\"alert\">'+\r\n\t\t\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\r\n\t\t\t\t\t\t\t\t response.messages + \r\n\t\t\t\t\t\t\t\t'</div>');\t\t\r\n\r\n\t\t\t\t\t\t\t\tmanageStudentTable.ajax.reload(null, false);\r\n\r\n\t\t\t\t\t\t\t\t// refresh the section table \r\n\t\t\t\t\t\t\t\t$.each(studentSectionTable, function(index, value) {\r\n\t\t\t\t\t\t\t\t\tstudentSectionTable[index].ajax.reload(null, false);\r\n\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t$('.form-group').removeClass('has-error').removeClass('has-success');\r\n\t\t\t\t\t\t\t\t$('.text-danger').remove();\t\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t\t$(\".fileinput-remove-button\").click();\t\r\n\r\n\t\t\t\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\t\t\t\turl: 'student/fetchStudentData/'+studentId,\r\n\t\t\t\t\t\t\t\t\ttype: 'post',\r\n\t\t\t\t\t\t\t\t\tdataType: 'json',\r\n\t\t\t\t\t\t\t\t\tsuccess:function(response) {\r\n\t\t\t\t\t\t\t\t\t\t$(\"#student_photo\").attr('src', '../' + response.image);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t});\t\t\t\t\t\t\t\r\n\r\n\t\t\t\t\t\t\t}\t\r\n\t\t\t\t\t\t\telse {\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$(\"#edit-upload-image-message\").html('<div class=\"alert alert-warning alert-dismissible\" role=\"alert\">'+\r\n\t\t\t\t\t\t\t\t '<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-label=\"Close\"><span aria-hidden=\"true\">&times;</span></button>'+\r\n\t\t\t\t\t\t\t\t response.messages + \r\n\t\t\t\t\t\t\t\t'</div>');\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} // /else\r\n\t\t\t\t\t\t} // /success\r\n\t\t\t\t\t}); // /ajax\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}); // /submit the teacher photo form\r\n\r\n\t\t\t} // /success\r\n\t\t}); // /ajax\r\n\r\n\t} // /if \r\n}", "function nextStudent() {\n if (indexId < studentsObject.sigmanauts.length - 1) {\n indexId ++; //increment indexId if < total student in studentsObject\n } else {\n indexId = 0; //if at end of array, set indexId back to 0\n }\n makeStudent(); //reassign new student to currentStudent\n appendToDom(); //add info from currentStudent to DOM\n resetTimer(); //reset timer :)\n moveCarousel();\n }", "function getStudent() {\n studentString = localStorage.getItem(\"studentinfo\");\n if (studentString ) {\n Student.all = JSON.parse(studentString);\n makingHeader();\n ///---------------------------------------------------------------------------------------\n for (var b = 0; b < Student.all.length; b++) {\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = Student.all[b].studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = Student.all[b].studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = Student.all[b].gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = Student.all[b].parentId;\n \n\n\n for (var i = 0; i < 3; i++) {\n\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = Student.all[b].mathMark[i];\n total = total + parseInt(mathMark[i]);\n mathTotal += parseInt(Student.all[b].mathMark[i])\n\n }\n\n for (var i = 0; i < 3; i++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = Student.all[b].englishMark[i];\n total = total + parseInt(englishMark[i]);\n englishTotal += parseInt(Student.all[b].englishMark[i]);\n\n }\n\n for (var i = 0; i < 3; i++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n td6.textContent = Student.all[b].scienceMark[i]\n total = total + parseInt(scienceMark[i]);\n scienceTotal += parseInt(Student.all[b].scienceMark[i]);\n }\n\n var td8 = document.createElement(\"td\");\n td8.textContent = Student.all[b].avg;\n data1.appendChild(td8);\n \n\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = Student.all[b].feedBack;\n\n\n\n }\n\n // STDtable.deleteRow(-1);\n\n\n //----------------------------------------------------------------------------------------- \n }\n}", "function updateClassStats() {\n\tvar len = studentListData.length;\n\tvar sum = 0;\n\tvar avg = 0;\n\n\t$.each(studentListData, function() {\n\t\tsum += this.classAverage;\n\t});\n\n\tavg = sum / len;\n\tavg = avg.toFixed(2);\n\t\n\n\tvar editData = { \n\t\taverage : avg,\n\t\tnumStudents : len\n\t};\n\n\t// updates class' classAverage\n\t$.ajax({\n\t\ttype: 'PUT',\n\t\turl: '/api/editclassstats',\n\t\tdata: editData,\n\t\tdataType: 'JSON'\n\t}).done(function(response) {\n\t\t\n\t\t// Check for success\n\t\tif (response.msg === '') {\n\n\t\t} else {\n\t\t\talert(response.msg);\n\t\t}\n\n\n\t});\n\n\n}", "UpdateData(){\n this.setState({ UserRUT: localStorage.getItem('UserRUT') }, () => {\n this.GetStudentsData();\n })\n this.setState({ UserLoggedIn: localStorage.getItem('UserLoggedIn') })\n this.setState({ UserName: localStorage.getItem('UserName') })\n this.setState({ UserNick: localStorage.getItem('UserNick') })\n this.setState({ UserContact: localStorage.getItem('UserContact') })\n this.setState({ UserAddress: localStorage.getItem('UserAddress') })\n this.setState({ UserRol: localStorage.getItem('UserRol') })\n }", "function modifyStudent(e) {\n e.preventDefault();\n const currentRow = e.target.parentElement.parentElement;\n const modifyingID = currentRow.firstChild.textContent;\n if (e.target.className === \"modify\") {\n $.ajax({\n type: \"post\",\n url: \"/admin/modify\",\n data: { modifying_id: modifyingID },\n 'content-type': 'application/json',\n success: function(response) {\n console.log(\"Success loading student modify page\");\n window.location.href = \"/modify-student\";\n },\n error: function(response) {\n alert(\"Error loading student modify page\");\n }\n });\n }\n}", "function showPage(list, page) {\n //Start Index = (page parameter * items per page) - items per page\n let startIndex = (page * itemsPerPage) - itemsPerPage;\n //End Index = page parameter * items per page\n let endIndex = page * itemsPerPage;\n //Select the UL element with a class of student-list and assign its value to a variable.\n let studentList = document.querySelector('.student-list');\n //Use the innerHTML property set the HTML content of the student-list variable you just created to an empty string. This will remove any students that might have previously been displayed.\n studentList.innerHTML = '';\n //Loop over the list parameter.\n for ( let i = 0; i < list.length; i++ ) {\n //Inside the loop:\n //Write a conditional statement that checks if the current index (i) is greater than or equal to the start index variable and less than the end index variable.\n if ( i >= startIndex && i < endIndex) {\n //Inside that conditional:\n //Create the DOM elements needed to display the information for each matching student as you iterate over the list parameter. Here is an example of what the the final version of these elements should look like:\n //Pro Tip: Because you will need to create multiple elements to display the information for each student, you might consider using a template literal for this\n //Insert the elements you have created to the student-list variable you created earlier. The insertAdjacentHTML method and beforeend option works well for this.\n let studentItem = list[i];\n \n studentList.insertAdjacentHTML( 'beforeend', `\n <li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${studentItem.picture.thumbnail} alt=\"Profile Picture\">\n <h3>${studentItem.name.first}</h3>\n <span class=\"email\">${studentItem.email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${studentItem.registered.date}</span>\n </div>\n </li>\n `)\n }\n }\n}", "function updateCurrentScoreTag(){\n var score = sessionStorage.getItem('nbCorrectAnswers');\n var examNumber = sessionStorage.getItem('examNumber');\n $('.currentScore').text('Note courante :' + score +' / ' + examNumber);\n }", "function displayList(students) {\n document.querySelector(\"#all-students\").innerHTML = \"\";\n if (hasBeenHacked === true) {\n randomizeBloodType();\n students.forEach(displayStudent);\n console.log(\"hacked\");\n } else {\n students.forEach(displayStudent);\n console.log(\"not hacked yet\");\n }\n\n // Display current data for allStudents array (and expelledStudents array)\n document.querySelector(\".students-gryffindor\").textContent = \"Students in Gryffindor: \" + allStudents.filter((student) => student.house === \"Gryffindor\").length;\n document.querySelector(\".students-hufflepuff\").textContent = \"Students in Hufflepuff: \" + allStudents.filter((student) => student.house === \"Hufflepuff\").length;\n document.querySelector(\".students-ravenclaw\").textContent = \"Students in Ravenclaw: \" + allStudents.filter((student) => student.house === \"Ravenclaw\").length;\n document.querySelector(\".students-slytherin\").textContent = \"Students in Slytherin: \" + allStudents.filter((student) => student.house === \"Slytherin\").length;\n\n document.querySelector(\".students-total\").textContent = \"Students in total: \" + allStudents.length;\n document.querySelector(\".students-expelled\").textContent = \"Students expelled: \" + expelledStudents.length;\n}", "function populateTable(callback) {\t\n\n var tableContent = '';\n var displayType = $('#selectDisplay').find(\":selected\").val();\n var sortOrder = $('#selectDisplay').find(\":selected\").attr('class');\n \n var id = $('#logout').attr('rel');\n\n $.getJSON('/api/students', function(data) {\n\n\t\t/*\tStick user data array into a userlist variable in the global object\n\t\t\tbad practice, do something else for large data like loading\n\t\t\tonly the data you really need at any given time */\n\t\tstudentListData = data;\n\n\t\tdata = data.sort(sortByProperty(displayType, sortOrder));\n\t\t\n\n\t\t// for each item in our JSON, add a table row and cells content string\n\t\t$.each(data, function() {\n\t\t\ttableContent += '<tr>';\n tableContent += '<td><a onclick=\"showStudentInfo(this)\" href=\"javascript:void(0);\" class=\"linkshowstudent\" title=\"Show Details\">' + this.studentName + '</a></td>';\n tableContent += '<td>' + this.classAverage + '</td>';\n tableContent += '<td><a onclick=\"editStudent(this)\" href=\"javascript:void(0);\" class=\"linkeditstudent\" rel=\"' + this.studentName + '\">edit</a> / ';\n tableContent += '<a onclick=\"deleteStudent(this)\" href=\"javascript:void(0);\" class=\"linkdeletestudent\" rel=\"' + this.studentName + '\">delete</a></td>';\n tableContent += '</tr>';\n\t\t});\n\n\t\t// Insert the content string into our existing HTML table\n\t\t$('#studentList table tbody').html(tableContent); // not good for large data sets (don't want to display so much)\n\t\t \n\t\tif (typeof callback === 'function') {\n \tcallback();\n }\n\t});\n\n\t\n}", "function access_student(target, name) {\n\n //Retrieve student data from 'data' attributes\n const student_username = target.slice(19, target.lastIndexOf('/'));\n const course_name = target.slice(target.lastIndexOf('/') + 1, target.length);\n\n //Create new elements\n const li = document.createElement('li');\n const avatar_img = document.createElement('img');\n const bio_name = document.createElement('a');\n const history_list = document.createElement('ul');\n\n bio_name.setAttribute('href', target);\n bio_name.setAttribute('target', '_blank');\n\n li.appendChild(avatar_img);\n li.appendChild(bio_name);\n li.appendChild(history_list);\n\n students_history.appendChild(li);\n\n //Retrieve user information\n fetch(`https://api.github.com/users/${student_username}`, {\n method: \"GET\", // *GET, POST, PUT, DELETE, etc.\n mode: \"cors\", // no-cors, cors, *same-origin\n credentials: \"same-origin\", // include, *same-origin, omit\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then(response => response.json())\n .then(response => {\n avatar_img.setAttribute('src', response.avatar_url);\n bio_name.innerText = name;\n })\n .catch(error => {\n if (error) throw new Error(error);\n })\n\n //Retrieve commit history\n fetch(`https://api.github.com/repos/${student_username}/${course_name}/commits`, {\n // fetch(`https://api.github.com/repos/milesmf/milesmf/commits`, {\n method: \"GET\", // *GET, POST, PUT, DELETE, etc.\n mode: \"cors\", // no-cors, cors, *same-origin\n credentials: \"same-origin\", // include, *same-origin, omit\n headers: {\n \"Content-Type\": \"application/json\",\n },\n })\n .then(response => response.json())\n .then(response => {\n if (response.message === 'Not Found') {\n const li = document.createElement('li');\n // const h5 = document.createElement('h5');\n const h3 = document.createElement('h3');\n\n // h5.innerText = x.commit.committer.date;\n h3.innerText = 'This student has no commit history :/';\n\n // li.appendChild(h5);\n li.appendChild(h3);\n\n history_list.appendChild(li);\n } else {\n\n response.map((x) => {\n console.log(x)\n\n const li = document.createElement('li');\n const h5 = document.createElement('h5');\n const a = document.createElement('a');\n\n h5.innerText = x.commit.committer.date;\n a.href = x.html_url;\n a.innerText = x.commit.message;\n\n li.appendChild(h5);\n li.appendChild(a);\n\n history_list.appendChild(li);\n });\n }\n })\n .catch(error => {\n if (error) throw new Error(error);\n })\n}", "function lookingForStudent() {\n\t//Creaton the input box and the submit button\n\t$(\"h4\").append(\"<form class='student-search'>\");\n\t$(\"form\").append(\"<input type='text' name='name' placeholder='Search for Students'>\");\t\n\t$(\"form\").append(\"<button class= 'search' type='submit' name='submit' value='submit'>Search</button>\");\n\n\tconst form = document.querySelector('form');\n\tconst input = form.querySelector(\"input[placeholder='Search for Students']\");\n\tlet text = input.value;\n\tlet submitCounter = 0;\n\n\t//Listening to the name that is written\n\tform.addEventListener('submit', (e) => {\n\t\t//Avoididng automatic refreshments\n\t\te.preventDefault();\n\t\t//Eliminating results of previous searchs\n\t\tif (submitCounter >0) {\n\t\t\t$('divLook').empty();\t\t\t\n\t\t};\n\t\tsubmitCounter +=1;\n\t\tlet counter = 0\n\n\t\tfor (let k=1; k<=studentsNumber; k+=1) {\t\n\n\t\t//Preparing to receive incomplete names\n\t\t\t//Separating name from family name\n\t\t\tlet nameSeparator = studentsData[k-1].name.indexOf(' ');\n\t\t\tlet nameSearchedSeparator = input.value.indexOf(' ');\n\t\t\t\n\t\t\tlet firstName = studentsData[k-1].name.substring(0,nameSeparator);\n\t\t\tlet firstNameSearched = input.value.substring(0,nameSearchedSeparator);\n\n\t\t\t//Family names can be introduced with name or without it\n\t\t\tlet familyName = studentsData[k-1].name.substring((nameSeparator+1), studentsData[k-1].name.length);\n\t\t\tlet familyNameSearched = input.value.substring((nameSearchedSeparator+1), input.value.length) \n\n\t\t\t//Correcting situations where only the name is typed\n\t\t\tif (nameSearchedSeparator < 0) {\n\t\t\t\tfirstNameSearched = familyNameSearched;\n\t\t\t}\n\n\t\t\t//Showing the positive results of the search (one or several)\n\t\t\tif (studentsData[k-1].name === input.value || firstName === firstNameSearched || familyName === familyNameSearched) {\n\t\t\t\tlet divLook = document.createElement('div');\n\t\t\t\t$(\"div.page-header.cf\").append(\"<divLook class='student-found'><p class='message'>\" + \n\t\t\t\tstudentsData[k-1].name + \n\t\t\t\t\" is the student number \" + studentsData[k-1].idnumber+\" who \" + \n\t\t\t\tstudentsData[k-1].enrollment + \"<br> His/Her contact address is: \"+ \n\t\t\t\tstudentsData[k-1].email+\"<br><img class='avatar' src=\"+ \n\t\t\t\tstudentsData[k-1].photo +\"></p></divLook>\");\n\t\t\t} else {\n\t\t\t\t//Showing the negative results of the search\n\t\t\t\tcounter +=1;\n\t\t\t\tif (counter === studentsNumber) { \n\t\t\t\t\t$(\"div.page-header.cf\").append(\"<divLook class='student-found'><p class='message'>\"+\n\t\t\t\t\t\"No student with this name is currently enrolled</p></divLook>\"); \n\t\t\t\t};\n\t\t\t};\t\t\n\t\t};\n\t\t//Cleaning the input box\n\t\tinput.value = '';\n\t});\n}", "function AddStudent2()\r\r\n{\r\r\n\tvar StudentName = document.form1.m_student2.value; // Student Name\r\r\n\tvar StudentClassID = \"\";\r\r\n\tvar StudentClassName = document.form1.m_class2.value; // Student Class Name\r\r\n\tvar StudentOutsidePraise = document.form1.m_outside_praise.value; // Student Outside Praise\r\r\n\tvar StudentInsidePraise = document.form1.m_inside_praise.value; // Student Inside Praise\r\r\n\r\r\n\tif( StudentName==\"\" || StudentClassName==\"\" )\r\r\n\t\treturn;\r\r\n\r\r\n\tif( Search_Student_Exist_In_Add_Ary( StudentName, StudentClassName, StudentOutsidePraise, StudentInsidePraise ) )\r\r\n\t\treturn;\r\r\n\r\r\n\tAdd_Student_To_Table(\"\", StudentName, \"\", StudentClassName, false, StudentOutsidePraise, StudentInsidePraise);\r\r\n}", "function setBody(data) {\n if (typeof data !== 'undefined') {\n let studentPage =\n `<div class=\"page-header cf\">\n <h2>Students</h2>\n </div>\n <ul class=\"student-list\">`;\n\n for (let i = 0; i < data.length - 1; i++) {\n studentPage +=\n `<li class=\"student-item cf\">\n <div class=\"student-details\">\n <img class=\"avatar\" src=${data[i].avatar}>\n <h3>${data[i].name}</h3>\n <span class=\"email\">${data[i].email}</span>\n </div>\n <div class=\"joined-details\">\n <span class=\"date\">${data[i].joined}</span>\n </div>\n </li>`\n }\n studentPage += `</ul></div>`;\n document.getElementsByClassName(\"page-header cf\")[0].innerHTML = studentPage;\n }\n}", "function changeMentor() {\n let studentName = document.getElementById('studentSelectForChange').value;\n let mentorName = document.getElementById('mentorSelectForChange').value;\n console.log(\"changing mentor for studentName:\" + studentName + \" to mentorName:\" + mentorName);\n\n let isStudentNeverAssigned = false;\n fetch(url+`/get-student/${studentName}`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n isStudentNeverAssigned = (data.result.mentorAssigned === 'false');\n let mentorStudentList = [];\n if(!isStudentNeverAssigned) updateStudentListOfOldMentor(studentName);\n\n fetch(url+`/get-mentor/${mentorName}`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n mentorStudentList = data.result.studentList;\n // Check to avoid assignment of same student to a mentor twice\n if(!mentorStudentList.includes(studentName)) mentorStudentList.push(studentName);\n // Assigning students to mentor in mongoDB\n assignStudentsToMentor(mentorName, mentorStudentList);\n // Removing student from mentor assignment select option\n removeStudentFromMentorAssignSelect(studentName);\n // Updating mongoDB student table with mentor name\n setMentor(studentName, mentorName);\n })\n })\n return false;\n}", "function courseInfo(course_id){\n\t\t$(\"#info_course\").load(\"../Tab_Course/course_info.php\", {\"ID\":course_id},function(){\n\t\t\tcourseDeleteConfirmation();\n\t\t\tloadEditingCourseForm();\n\t\t\tclickPrereqSearch();\n\t\t\thistoryReplaceID(id=course_id);\n\t\t\t$(\"#info_course\").collapse('show');\n\t\t});\n\t}", "function updateProfile()\r\n{\r\n // obtaining the data\r\n let name = document.getElementById(\"name\").value;\r\n let surname = document.getElementById(\"surname\").value;\r\n let dob = document.getElementById(\"dob\").value;\r\n let gender = document.getElementById(\"gender\").value;\r\n let city = document.getElementById(\"city\").value;\r\n let country = document.getElementById(\"country\").value;\r\n let educLevel = document.getElementById(\"educLevel\").value;\r\n let studyArea = document.getElementById(\"studyArea\").value;\r\n let science = document.getElementById(\"science\");\r\n let medicine = document.getElementById(\"medicine\");\r\n let travel = document.getElementById(\"travel\");\r\n let education = document.getElementById(\"education\");\r\n let sports = document.getElementById(\"sports\");\r\n let nutrition = document.getElementById(\"nutrition\");\r\n let economy = document.getElementById(\"economy\");\r\n let environment = document.getElementById(\"environment\");\r\n let interests = \"\";\r\n let password = document.getElementById(\"password\").value;\r\n\r\n // checking which interests did the user select\r\n if (science.checked == true)\r\n {\r\n interests += \"science||\";\r\n }\r\n if (medicine.checked == true)\r\n {\r\n interests += \"medicine||\";\r\n }\r\n if (travel.checked == true)\r\n {\r\n interests += \"travel||\";\r\n }\r\n if (education.checked == true)\r\n {\r\n interests += \"education||\";\r\n }\r\n if (sports.checked == true)\r\n {\r\n interests += \"sports||\";\r\n }\r\n if (nutrition.checked == true)\r\n {\r\n interests += \"nutrition||\";\r\n }\r\n if (economy.checked == true)\r\n {\r\n interests += \"economy||\";\r\n }\r\n if (environment.checked == true)\r\n {\r\n interests += \"environment||\";\r\n }\r\n\r\n // if user entered all the required data - update user to the database and update the view\r\n if ( name && surname && dob && gender && city && country && educLevel && password)\r\n {\r\n let userId = sessionStorage.getItem(\"userId\");\r\n\r\n // add user to the database\r\n // create object with user data to send to the server\r\n let editObject = {\r\n _id: userId,\r\n _name: name,\r\n _surname: surname,\r\n _dob: dob,\r\n _gender: gender,\r\n _city: city,\r\n _country: country,\r\n _studyLevel: educLevel,\r\n _studyArea: studyArea,\r\n _interests: interests,\r\n _password: password\r\n };\r\n\r\n // sending xml request\r\n let xml = new XMLHttpRequest;\r\n\r\n // function that is called when reply received from server\r\n xml.onreadystatechange = () =>\r\n {\r\n if ((xml.readyState == 4) && (xml.status == 200))\r\n {\r\n let updateResult = xml.responseText;\r\n\r\n // update the view\r\n messageOne.innerHTML = \"Successfully Updated \" + updateResult + \" User\";\r\n messageOne.style.display = \"block\";\r\n\r\n viewTitle.style.display = \"none\";\r\n textboxOne.style.display = \"none\";\r\n textboxTwo.style.display = \"none\";\r\n rightContainer.style.display = \"none\";\r\n mainContainer.style.display = \"none\";\r\n // updating the text on the button and its functionality\r\n buttonOne.innerText = \"Log Out\";\r\n buttonOne.onclick = logout; \r\n // updating the text on the link and its functionality\r\n linkOne.innerText = \"Edit My Profile\";\r\n linkOne.onclick = editProfile;\r\n\r\n //clearing the local storage\r\n localStorage.clear();\r\n }\r\n };\r\n\r\n //Send new user data to server\r\n xml.open(\"POST\", \"/amendUser\", true);\r\n xml.setRequestHeader(\"Content-type\", \"application/json\");\r\n xml.send(JSON.stringify(editObject)); \r\n }\r\n \r\n // if user did not fill in all the entries\r\n else\r\n {\r\n document.getElementById(\"editFormMsg\").innerHTML = \"Enter all fields.\";\r\n return;\r\n } \r\n}", "function setUpVariableInputs(){\n staff_id = getParameterByName(\"staff\");\n stu_id = getParameterByName(\"stu\");\n set_id = getParameterByName(\"set\");\n start_date = getParameterByName(\"start\");\n end_date = getParameterByName(\"end\");\n set_student = user[\"role\"] === \"STUDENT\" ? user[\"userId\"] : getParameterByName(\"student\");\n\n localStorage.setItem(\"initialRun\", true);\n disableGenerateReportButton();\n if (set_student) {\n student_report_view = true;\n setStudent(set_student);\n $(\"#staff_col\").css(\"display\", \"none\");\n } else {\n getStaff();\n }\n setDates();\n}", "function allStudentsLinkClick() {\n clearValues()\n hideAll();\n makeVisible(\"#allStudents\");\n \n getAllStudents('allStudentsInfoCallBack'); //get all students through an ajax call\n \n}" ]
[ "0.7215168", "0.7091297", "0.6969349", "0.69543827", "0.67484105", "0.67038155", "0.6700938", "0.6674522", "0.6628502", "0.6607442", "0.65169543", "0.64986193", "0.6491455", "0.64621973", "0.63995254", "0.6356958", "0.6336452", "0.6296728", "0.6288344", "0.6282596", "0.6163053", "0.61351895", "0.6096588", "0.6086782", "0.6080623", "0.60750574", "0.60638744", "0.6005593", "0.5999449", "0.59968084", "0.59935004", "0.598044", "0.5964309", "0.5958374", "0.5941693", "0.590994", "0.5906699", "0.59024906", "0.58884895", "0.5863822", "0.5857457", "0.5838794", "0.582751", "0.5819288", "0.58072644", "0.58039933", "0.5799396", "0.5797945", "0.5786341", "0.57679176", "0.5759984", "0.5748507", "0.5741511", "0.57412875", "0.57375836", "0.5722513", "0.57176495", "0.571235", "0.57099503", "0.5704393", "0.5694298", "0.56797105", "0.56763345", "0.56639713", "0.5663778", "0.5663647", "0.56514883", "0.56479", "0.5647688", "0.56380296", "0.563723", "0.56317306", "0.5631022", "0.5621429", "0.56090623", "0.56071943", "0.5603649", "0.55988723", "0.5589308", "0.5586929", "0.55834997", "0.5580683", "0.55793536", "0.5562954", "0.55562377", "0.5550103", "0.5538947", "0.5534581", "0.5526995", "0.5517768", "0.55161", "0.55113626", "0.5510064", "0.5508282", "0.5502922", "0.5498252", "0.54900897", "0.5486711", "0.548309", "0.54751277" ]
0.7036851
2
This function should add a headers row to the report card table
function addReportCardHeaders() { // update the code here reportCardTable.innerHTML += ` <div class='table-header'> <h4>Number</h4> <h4>Code</h4> <h4>Name</h4> <h4>Semester</h4> <h4>Credit</h4> <h4>Letter</h4> </div> ` }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addHeader(){\n\t\t\tself.$thead.find('tr').append('<th></th>');\n\t\t}", "function header() {\n let tableHeadingRow = document.createElement('tr');\n table.append(tableHeadingRow);\n let tableHeading = document.createElement('th');\n tableHeadingRow.append(tableHeading);\n\n for (let i = 0; i<hours.length; i++){\n tableHeading = document.createElement('th');\n tableHeadingRow.append(tableHeading);\n tableHeading.textContent = ' '+hours[i]+ ' ';\n }\n // last heading\n let tableHeading2 = document.createElement('th');\n tableHeadingRow.append(tableHeading2);\n tableHeading2.textContent = 'Daily Location Total';\n}", "appendReceiptSearchTableHeader () {\n var head_titles = ['ID', 'Name', 'Address', 'Phone No', 'Items', 'Retail', 'Cost', 'Profit', 'Date', 'Time'];\n var $head = `<thead><tr><th>${head_titles.join('</th><th>')}</th></tr></thead>`;\n $(\"#receipts-lists\").append($head);\n }", "function createHeader() {\r\n var head = document.querySelector('thead');\r\n newRow = addElement('tr', '', head);\r\n addElement('th', '', newRow);\r\n\r\n for (var i = 0; i < times.length; i++) {\r\n addElement('th', times[i], newRow);\r\n }\r\n\r\n addElement('th', 'Total', newRow);\r\n}", "function makeHeaderRow(){\n var trEl=document.createElement('tr');\n trEl.id='Header';\n newElement('th','Locations:',trEl);\n for(i=0;i<hours.length;i++){\n newElement('th',hours[i],trEl);\n }\n newElement('th','totals',trEl);\n profitTable.appendChild(trEl);\n}", "function tableHeader() {\n var headerTop = document.getElementById('SalesReport');\n var row = document.createElement('tr');\n headerTop.appendChild(row);\n var tableData = document.createElement('th');\n row.appendChild(tableData);\n for (var i = 0; i < hoursOfOperation.length; i++) {\n var hourHead = document.createElement('th');\n hourHead.innerText = hoursOfOperation[i];\n row.appendChild(hourHead);\n };\n var totalHead = document.createElement('th');\n totalHead.innerText = ('Daily Location Total');\n row.appendChild(totalHead);\n}", "appendInvoiceModalTableHeader () {\n var head_titles = ['Name', 'Quantity', 'Unit Cost', 'Total Retail', 'Date', 'Time'];\n var $head = `<thead><tr><th>${head_titles.join('</th><th>')}</th></tr></thead>`;\n $(\"#receipt-dt-modal .modal-body .table\").append($head);\n }", "function createHeader (){\n\n // Create the header raw\n // create raw\n var headRow = document.createElement('tr');\n table.appendChild(headRow);\n //create tds\n var firstTd;\n for (var i = 0; i < tableHeads.length ; i++){\n firstTd = document.createElement('td');\n firstTd.textContent= tableHeads[i];\n headRow.appendChild(firstTd);\n }\n}", "function generateHeader() {\n var tableRow = document.createElement('tr');\n var blank = document.createElement('th');\n tableRow.appendChild(blank);\n for (var i = 0; i < clock.length; i++) {\n var tableHead = document.createElement('th');\n tableHead.textContent = clock[i];\n tableRow.appendChild(tableHead);\n }\n var total = document.createElement('th');\n total.textContent = 'Daily Location Total';\n tableRow.appendChild(total);\n parentElement.appendChild(tableRow);\n}", "function renderHeader () {\n var trEl = document.createElement('tr');\n\n var headerTitles = ['', 'Daily Location Total'];\n for(var i = 0; i < headerTitles.length; i++) {\n //'for each pass, this code will run'\n var thEl = document.createElement('th');//create\n thEl.textContent = headerTitles[i];//add content\n trEl.appendChild(thEl);//append this table header element into a row\n }\n for(var i = 0; i < openHours.length; i++) {\n var thEl = document.createElement('th');\n thEl.textContent = openHours[i];\n trEl.appendChild(thEl);\n }\n cookiesTable.appendChild(trEl);\n}", "function addHeadingsToTable(){\n let newHeadingsRow = buildHeadingsRow();\n document.getElementsByTagName(\"thead\")[0].appendChild(newHeadingsRow);\n}", "function renderHeader() {\n\n var headerRow = document.createElement('tr');\ntable.appendChild(headerRow);\n\nvar emptyCell = document.createElement('td');\nheaderRow.appendChild(emptyCell);\n\n\nfor (let i = 0; i < hoursArray.length; i++) {\n var tableHeader = document.createElement('th')\n tableHeader.textContent = hoursArray[i];\n headerRow.appendChild(tableHeader);\n\n\n}\n\nvar totalHeader = document.createElement('th');\ntotalHeader.textContent = 'Daily Location Total';\nheaderRow.appendChild(totalHeader);\n\n \n \n}", "function makeHeaderRow() {\n var trEl = document.createElement('tr');\n\n var thEl = document.createElement('th');\n thEl.textContent = 'Store';\n trEl.appendChild(thEl);\n\n for (var i in hours) {\n thEl = document.createElement('th');\n thEl.textContent = hours[i];\n trEl.appendChild(thEl);\n }\n\n thEl = document.createElement('th');\n thEl.textContent = 'Daily Total';\n trEl.appendChild(thEl);\n\n storeTable.appendChild(trEl);\n}", "function headerTable() {\n\n\n\n let rawHeading = document.createElement('tr');\n table.appendChild(rawHeading);\n\n let th1 = document.createElement('th');\n rawHeading.appendChild(th1);\n th1.textContent = \" \";\n\n for (let i = 0; i < workingHours.length; i++) {\n let th = document.createElement('th');\n rawHeading.appendChild(th);\n th.textContent = workingHours[i];\n\n }\n\n\n let th2 = document.createElement('th');\n rawHeading.appendChild(th2);\n th2.textContent = \"Daily Location Total\";\n\n}", "function header(){\n var thE1 = document.createElement('th');\n var trE1 = document.createElement('tr');\n thE1.textContent = 'Store Locations';\n trE1.appendChild(thE1);\n\n for (var i = 0; i < hourList.length; i++){\n thE1 = document.createElement('th');\n thE1.textContent = hourList[i];\n trE1.appendChild(thE1);\n }\n thE1 = document.createElement('th');\n thE1.textContent ='Daily location Totals: ';\n trE1.appendChild(thE1);\n var salesTable = document.getElementById('tabl');\n salesTable.appendChild(trE1);\n}", "function addHeader() {\n DataRow = document.createElement('tr'); //create Row tag\n table.appendChild(DataRow);\n emptycol = document.createElement('th'); //create an empty col for empty cell in header and total in footer \n emptycol.textContent = ' ';\n DataRow.appendChild(emptycol);\n\n for (var out = 0; out < OpenHour.length; out++) {\n var ListItemLocation = document.createElement('th');\n ListItemLocation.textContent = OpenHour[out];\n DataRow.appendChild(ListItemLocation);\n }\n\n}", "function makeHeaderRow() {\n var trEl = document.createElement('tr');\n var thEl = document.createElement('th');\n thEl.textContent = 'Stores';\n trEl.appendChild(thEl);\n\n for (var i = 0; i < hours.length; i++) {\n thEl = document.createElement('th');\n thEl.textContent = (hours[i]);\n trEl.appendChild(thEl);\n }\n\n thEl = document.createElement('th');\n thEl.textContent = 'Daily Totals';\n trEl.appendChild(thEl);\n\n storeSalesTable.appendChild(trEl);\n}", "function makeHeaderRow () {\n var trEl = document.createElement('tr');\n var thEl = document.createElement('th');\n thEl.textContent = 'Location';\n trEl.appendChild(thEl);\n for(var i = 0; i < hours.length; i++){\n thEl = document.createElement('th');\n thEl.textContent = hours[i];\n trEl.appendChild(thEl);\n }\n thEl = document.createElement('td');\n thEl.textContent = 'Daily Location Totals';\n trEl.appendChild(thEl);\n storeTable.appendChild(trEl);\n}", "function renderHeader() {\n var tableHeader = document.createElement('tr')\n table.append(tableHeader)\n var cityLabel = document.createElement('th');\n cityLabel.textContent = 'Store Location';\n tableHeader.append(cityLabel);\n for (var i = 0; i < hours.length; i++) {\n var headerCellHour = document.createElement('th');\n headerCellHour.textContent = hours[i];\n tableHeader.append(headerCellHour);\n }\n var dailyTotalLabel = document.createElement('th');\n dailyTotalLabel.textContent = 'End of day Sales'\n tableHeader.append(dailyTotalLabel)\n}", "function create_thead() {\n var schema = _store.active_columns();\n var total = _store.active_rows()['total'];\n var html = [ '<tr>' ];\n\n // create header\n schema.forEach( function ( column ) {\n html.push( '<td class=\"', column['key'], ' ' );\n html.push( column['type'], '\">' );\n html.push( column['label'] );\n html.push( '</td>' );\n });\n\n html.push( '</tr>' );\n\n // create total row\n if( !!total ) {\n html.push( '<tr style=\"background-color: #3b3b3b\">' );\n\n schema.forEach( function ( column ) {\n html.push( '<td class=\"', column['key'], ' ' );\n html.push( column['type'], '\">' );\n html.push( total['data'][ column['key'] ] );\n html.push( '</td>' );\n });\n\n html.push( '</tr>' );\n }\n $('#data-table > thead').append( html.join('') );\n }", "function createHeader() {\n var tr = document.createElement('tr');\n table.appendChild(tr);\n\n for (i = 0; i < 17; i++) {\n var th = document.createElement('th');\n if (i == 0) {\n th.textContent = 'Store Name';\n } else if (i < 16) {\n th.textContent = hoursOpen[i - 1];\n } else {\n th.textContent = 'Daily Location Total';\n }\n tr.appendChild(th);\n }\n}", "function createHeader() {\n var table = gAppState.checkId(\"dbmsTableID\", \"fsTableID\");\n\n var header = table.createTHead(); // creates empty tHead\n var row = header.insertRow(0); // inserts row into tHead\n\n var cell0 = row.insertCell(0); // inserts new cell at position 0 in the row\n var cell1 = row.insertCell(1); // inserts new cell at position 1 in the row\n var cell2 = row.insertCell(2); // inserts new cell at position 2 in the row\n\n cell0.innerHTML = \"<b>Subject</b>\"; // adds bold text\n cell1.innerHTML = \"<b>Predicate</b>\";\n cell2.innerHTML = \"<b>Object</b>\";\n}", "function addTableHeader() {\n var table = document.getElementById('tableOfCookies');\n var trContainer = document.createElement('tr');\n\n for (var j = 0; j < storeHours.length; j++) {\n var thHours = document.createElement('th');\n thHours.textContent = storeHours[j];\n trContainer.appendChild(thHours);\n }\n table.appendChild(trContainer);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function createTableHeader(){\n var tr = document.createElement('tr');\n for (var i = 0; i < storeHours.length; i++) {\n var th = document.createElement('th');\n th.textContent = storeHours[i];\n tr.appendChild(th);\n }\n table.appendChild(tr);\n}", "function appendStatHeader(table, headerText) {\n\tvar thead = document.createElement('thead');\n\tvar row = thead.insertRow(0);\n\tvar cell = row.insertCell(0);\n\tcell.colSpan = '2';\n\tcell.className = 'stats-head';\n\tcell.appendChild(document.createTextNode(headerText));\n\ttable.appendChild(thead);\n}", "function headerRenderFunction() {\n\n //create header row\n let headerRow = document.createElement('tr');\n table.appendChild(headerRow);\n\n //create header cells\n for (let i = 0; i < headerContent.length; i++) {\n\n let headerCell = document.createElement('th');\n headerRow.appendChild(headerCell);\n headerCell.textContent = headerContent[i];\n }\n}", "function createHeader(){\r\n var createTR = document.createElement('tr');\r\n for(var i=0; i < headers.length; i++){\r\n var createTH = document.createElement('th');\r\n createTH.textContent = headers[i];\r\n createTR.appendChild(createTH);\r\n }\r\n coffeeData.appendChild(createTR);\r\n\r\n}", "function makeHeaderRow(){\n var trEl = document.createElement('tr');\n\n var thEl = document.createElement('th');\n thEl.textContent = 'Locations';\n trEl.appendChild(thEl);\n\n for (var i = 0; i < hours.length; i++){\n thEl = document.createElement('th');\n thEl.textContent = hours[i];\n trEl.appendChild(thEl);\n }\n\n thEl = document.createElement('th');\n thEl.textContent = 'Daily Total';\n trEl.appendChild(thEl);\n\n myTable.appendChild(trEl);\n}", "function ReportHeader(){}", "function makeTableHead() {\n var headParent = createElement('thead', 'id', 'table-head', 'Hours', tableEl);\n for (var iHead = 0; iHead < hoursOpen.length; iHead++) {\n createElement('th', 'class', 'time-indicator', hoursOpen[iHead], headParent);\n }\n createElement('th', 'id', 'totals', 'Total', headParent);\n}", "function createHdr(theTable) {\n // create table header here\n var hoursOpenArray = ['6:00 am', '7:00 am', '8:00 am', '9:00 am', '10:00 am', '11:00 am', '12:00 pm', '1:00 pm', '2:00 pm', '3:00 pm', '4:00 pm', '5:00 pm', '6:00 pm', '7:00 pm'];\n\n // var hoursOpenArray = [];\n // var hour = 0;\n // var hourText = '';\n // for (var h = 0; h < 14; h++) {\n // hour = h + 6;\n // if (hour > 12) {\n // hourText = (hour - 12) + ':00 pm';\n // } else if ( hour < 12) {\n // hourText = hour + ':00 am';\n // } else {\n // hourText = hour + ':00 pm';\n // };\n // hoursOpenArray[h] = hourText;\n // };\n\n var salesHeader = document.createElement('thead');\n var headerRow = document.createElement('tr');\n var blankHdr = document.createElement('th');\n // we need a blank column heading before adding the rest of the header data\n headerRow.appendChild(blankHdr);\n\n for (var i = 0; i < hoursOpenArray.length; i++) {\n var th = document.createElement('th');\n th.textContent = hoursOpenArray[i];\n headerRow.appendChild(th);\n }\n // we also need a final column for the total for the store\n // we will just re-use the blankHdr we have sitting around.\n var headerTotal = document.createElement('th');\n headerTotal.textContent = 'Total';\n headerRow.appendChild(headerTotal);\n\n salesHeader.appendChild(headerRow);\n theTable.appendChild(salesHeader);\n}", "renderSprintHeaderRow() {\n\n const template = markobj(`<table>\n <thead>\n <tr>\n <th class=\"left\">Member</th>\n <th>Role</th>\n <th>Time</th>\n <th>Hours</th>\n <!-- Inject Sprints -->\n </tr>\n </thead>\n <tbody>\n </tbody>\n </table>`);\n const container = document.querySelector('#team-data');\n container.innerHTML = \"\";\n container.appendChild(template);\n\n const header = container.querySelector('table thead tr');\n let sprintHeaders = '';\n this.sprintData.forEach( (sprint) => {\n sprintHeaders = markobj(`<th>${sprint.label}</th>`);\n header.appendChild(sprintHeaders);\n });\n sprintHeaders = markobj(`<th>Totals</th>`);\n header.appendChild(sprintHeaders);\n }", "function timeHeader(){\n var trEl = document.createElement('tr');\n var thLocation= document.createElement('th');\n thLocation.textContent='Location';\n trEl.appendChild(thLocation);\n for (var i=0; i<operatingHours.length; i++){\n var thEl=document.createElement('th');\n thEl.textContent = operatingHours[i];\n trEl.appendChild(thEl);\n }\n var totalEachLocation=document.createElement('th');\n totalEachLocation.textContent='Total';\n trEl.appendChild(totalEachLocation);\n report.appendChild(trEl);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 6;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\n var newRow = header.insertRow(-1);\n newRow.className = \"tablesorter-no-sort\";\n var cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Requests\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 3;\n cell.innerHTML = \"Executions\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 7;\n cell.innerHTML = \"Response Times (ms)\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 1;\n cell.innerHTML = \"Throughput\";\n newRow.appendChild(cell);\n\n cell = document.createElement('th');\n cell.setAttribute(\"data-sorter\", false);\n cell.colSpan = 2;\n cell.innerHTML = \"Network (KB/sec)\";\n newRow.appendChild(cell);\n}", "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 7;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "function summaryTableHeader(header) {\r\n var newRow = header.insertRow(-1);\r\n newRow.className = \"tablesorter-no-sort\";\r\n var cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Requests\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 3;\r\n cell.innerHTML = \"Executions\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 6;\r\n cell.innerHTML = \"Response Times (ms)\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 1;\r\n cell.innerHTML = \"Throughput\";\r\n newRow.appendChild(cell);\r\n\r\n cell = document.createElement('th');\r\n cell.setAttribute(\"data-sorter\", false);\r\n cell.colSpan = 2;\r\n cell.innerHTML = \"Network (KB/sec)\";\r\n newRow.appendChild(cell);\r\n}", "function _setHeaders() {\n // if no headers specified, we will use the fields as headers.\n _headers = (_headers == null || _headers.length < 1) ? _fields : _headers; \n var h = _buildRowColumns(_headers);\n if (_table.children('thead').length < 1) _table.prepend('<thead></thead>');\n _table.children('thead').html(h);\n }", "function financeHeaders() {\r\n document.querySelector(\"#financeTable\").innerHTML = \"\";\r\n const fTable = document.querySelector(\"#financeTable\");\r\n\r\n const financeHeaders = document.createElement(\"tr\");\r\n\r\n const fDate = document.createElement(\"th\");\r\n const fRevenue = document.createElement(\"th\");\r\n const fEarnings = document.createElement(\"th\");\r\n const fAssets = document.createElement(\"th\");\r\n const fLiability = document.createElement(\"th\");\r\n\r\n fDate.textContent = \"Date\";\r\n financeHeaders.appendChild(fDate);\r\n fRevenue.textContent = \"Revenue\";\r\n financeHeaders.appendChild(fRevenue);\r\n fEarnings.textContent = \"Earnings\";\r\n financeHeaders.appendChild(fEarnings);\r\n fAssets.textContent = \"Assets\";\r\n financeHeaders.appendChild(fAssets);\r\n fLiability.textContent = \"Liabilities\";\r\n financeHeaders.appendChild(fLiability);\r\n\r\n fTable.appendChild(financeHeaders);\r\n }", "function makeHeader() {\n //tr //th\n // Head\n let trow1 = document.createElement('tr');\n table1.appendChild(trow1);\n let tHead1 = document.createElement('th')\n trow1.appendChild(tHead1);\n tHead1.textContent='Name '\n \n // Working Hours\n for (let i = 0; i < workingHours.length; i++) {\n let tHead1 = document.createElement(\"th\")\n trow1.appendChild(tHead1);\n tHead1.textContent= workingHours[i];\n }\n \n let tHead2 = document.createElement(\"th\");\n trow1.appendChild(tHead2);\n tHead2.textContent= 'Daily Location Total' \n}", "function makingHeader(){\nlet tr=document.createElement('tr')\ntable.appendChild(tr)\n\nfor(let i=0; i< headerHoures.length;i++){\n let th=document.createElement('th')\n tr.appendChild(th)\n th.textContent=headerHoures[i]\n}\n}", "function createBulkImportHeader() {\n var caption = '<span class=\"table-caption\">Bulk&nbsp;Import' +\n '&nbsp;Status</span><br>';\n\n $('<caption/>', {\n html: caption\n }).appendTo('#masterBulkImportStatus');\n\n var items = [];\n\n var columns = ['Directory&nbsp;', 'Age&nbsp;', 'State&nbsp;'];\n\n var titles = ['', descriptions['Import Age'], descriptions['Import State']];\n\n /*\n * Adds the columns, add sortTable function on click,\n * if the column has a description, add title taken from the global.js\n */\n for (i = 0; i < columns.length; i++) {\n var first = i == 0 ? true : false;\n items.push(createHeaderCell(first, 'sortTable(1,' + i + ')',\n titles[i], columns[i]));\n }\n\n $('<tr/>', {\n html: items.join('')\n }).appendTo('#masterBulkImportStatus');\n}", "function _setHeaders() {\n // if no headers specified, we will use the fields as headers.\n _headers = (_headers == null || _headers.length < 1) ? _fields : _headers;\n var h = _buildRowColumns(_headers);\n if (_table.children('thead').length < 1) _table.prepend('<thead></thead>');\n _table.children('thead').html(h);\n }", "function headerRow(element){\n\theadRow=document.createElement(\"TR\");\n\tblueHead=document.createElement(\"TH\");\n\tblueHead.innerText=\"Blue\"\n\n\tredHead=document.createElement(\"TH\");\n\tredHead.innerText=\"Red\"\n\n\tgreyHead=document.createElement(\"TH\");\n\tgreyHead.innerText=\"Grey\"\n\n\theadRow.appendChild(blueHead);\n\theadRow.appendChild(redHead);\n\theadRow.appendChild(greyHead);\n\telement.appendChild(headRow);\n\t\n}", "buildTableHeader() {\r\n //Variables used\r\n var row, cell, head;\r\n var titles = [\"Name\", \"Link\", \"Image\", \"Date added\", \"Edit\", \"Delete\"];\r\n\r\n //Creates a new row, appends that row to the table\r\n head = document.createElement(\"thead\");\r\n row = document.createElement(\"tr\");\r\n document.getElementById(\"dataTable\").appendChild(head);\r\n head.appendChild(row);\r\n\r\n //Creates each column in the head\r\n titles.forEach((title) => {\r\n cell = document.createElement(\"th\");\r\n cell.appendChild(document.createTextNode(title));\r\n row.appendChild(cell);\r\n });\r\n }", "function makeHeaderRow(arrTime) {\n var trEl = document.createElement('tr');\n for (var i = 0; i <= arrTime.length; i++) {\n if (i === 0) {\n var thEl = document.createElement('th');\n thEl.textContent = '';\n trEl.appendChild(thEl);\n }\n else {\n var thEl = document.createElement('th');\n thEl.textContent = arrTime[i - 1];\n trEl.appendChild(thEl);\n }\n }\n var thTotalEl = document.createElement('th');\n thTotalEl.id = 'header-corner';\n thTotalEl.textContent = 'Daily Total';\n trEl.appendChild(thTotalEl);\n tableEl.appendChild(trEl);\n}", "function addAllColumnHeaders(data){\n /* Uses columnSet to create table headers */\n var headerTr$ = $('<tr/>');\n for (var i = 0 ; i < columnSet.length; i++){\n headerTr$.append($('<th/>').html(columnSet[i]));\n }\n $(params.table_name).append(headerTr$);\n }", "function createHeadName() {\n const thead =document.createElement(\"thead\");\n const tr = document.createElement(\"tr\");\n const div = document.querySelector(\"#details\");\n for (let i = 0; i <headerNames.length; i++) {\n\n const th1 = document.createElement(\"th\");\n // const th2 =document.createElement(\"th\");\n // const th3 = document.createElement(\"th\");\n // const th4 = document.createElement(\"th\");\n // const th5 = document.createElement(\"th\");\n th1.innerHTML=headerNames[i];\n // th2.innerHTML=headerNames[i+1];\n // th3.innerHTML=headerNames[i+2];\n // th4.innerHTML=headerNames[i+3];\n // th5.innerHTML=headerNames[i+4];\n tr.appendChild(th1);\n // tr.appendChild(th2);\n // tr.appendChild(th3);\n // tr.appendChild(th4);\n // tr.appendChild(th5);\n div.appendChild(tr);\n }\n\n }", "function renderHead(){\n var trEl = document.createElement('tr');\n \n var thElFirst = document.createElement('th')\n thElFirst.textContent = 'Location';\n trEl.appendChild(thElFirst);\n \n for (var i=0; i < hours.length; i++){\n var thEl = document.createElement('th');\n thEl.textContent = hours[i];\n trEl.appendChild(thEl);\n }\n\n var thElLast = document.createElement('th')\n thElLast.textContent = 'Location Total';\n trEl.appendChild(thElLast);\n \n cookTable.appendChild(trEl);\n}", "function createSalesTableHeader() {\n // Create the first header column\n var trEl = document.createElement('tr'); //create the row\n var thEl = document.createElement('th'); //create the first column cell\n thEl.textContent = 'Location';\n trEl.appendChild(thEl);\n\n // Create the header body\n for (var t = 0; t < storeHours.length; t++){\n var tdEl = document.createElement('th'); //create a cell for each column of time\n tdEl.textContent = storeHours[t];\n trEl.appendChild(tdEl);\n }\n\n // Create last header column\n thEl = document.createElement('th');\n thEl.textContent = 'Daily Total';\n trEl.appendChild(thEl);\n\n salesTable.appendChild(trEl);\n}", "function appendHeaders(data){\n var body = document.querySelector('.table-container')\n var table = document.createElement('div')\n var tr = document.createElement('ul')\n tr.classList.add('table-header')\n for (var key in data) {\n if (data.hasOwnProperty(key)) {\n if (key == 'symbol'){\n continue;\n }\n else{\n if(key.toString().indexOf('_usd') !== -1){\n key= key.replace('_usd', '')\n }\n if(key.toString().indexOf('percent_') !== -1){\n key= key.replace('percent_', '')\n }\n\n var th = document.createElement('li');\n\n th.setAttribute('key_value', key.toString());\n var text = key.toString().replace(/_/g, ' ');\n var span = document.createElement('span')\n span.innerText = text;\n th.append(span)\n tr.append(th);\n\n body.append(tr)\n }\n\n }\n }\n }", "static fillHeaders(table, headers, callback) {\n const tr = table.insertRow(0)\n headers.forEach((helem) => {\n let th = document.createElement('th')\n th.innerHTML = helem\n // register a event click for each created <th> element\n th.onclick = (e) => { callback(table, e.target.innerText) }\n tr.appendChild(th)\n })\n }", "function createHeaderRow(table, data){\r\n\tlet row = document.createElement(\"TR\");\r\n\trow.id = \"headerRow\";\r\n\ttable.append(row);\r\n\r\n\t// Create headerCell for each key in the data object. Pass in the object keys as arguments\r\n\tcreateCells(row, Object.keys(data));\r\n}", "function createHeader() {\n var timeArr = ['Store', '6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm', 'Daily Location Total'];\n var header_row = [];\n for (var i=0; i < timeArr.length; i++){\n header_row.push('<td>' + timeArr[i] + '</td>');\n }\n var full_row = header_row.join('');\n console.log(header_row);\n header_row = document.createElement('thead');\n header_row.innerHTML = full_row;\n document.body.appendChild(header_row);\n}", "function createTableHeader(){\n\tvar $table = $('#domainsTable');\n\t//var content = \"<tr> <th>Domain Name</th> <th> </th></tr>\";\n\tvar content = \"<tr><th>List of Available Domain Names.</th></tr>\";\n\t$table.append(content);\n}", "function makeTableHeader(){\n var table = document.getElementById('store-table');\n var theTableHeader = document.createElement('tr');\n var tableStoreHeading = document.createElement('th');\n tableStoreHeading.textContent = 'Store';\n theTableHeader.appendChild(tableStoreHeading);\n\n for (var i = 0; i < operatingHours.length; i++){\n var tableHourHeadings = document.createElement('th');\n tableHourHeadings.textContent = operatingHours[i];\n theTableHeader.appendChild(tableHourHeadings);\n }\n var tableDailyTotalHeading = document.createElement('th');\n tableDailyTotalHeading.textContent = 'Daily Location Total';\n theTableHeader.appendChild(tableDailyTotalHeading);\n\n table.appendChild(theTableHeader);\n}", "function appendToTHead(trHead, headerName){\n var th = $('<th class=\"mdl-data-table__cell--non-numeric\">').text(headerName);\n th.appendTo(trHead);\n \n return trHead\n}", "function createTableHead() {\n //let tableBody = document.getElementsByTagName('tbody');\n let thead = document.querySelector('thead');\n\n let headTR = document.createElement('tr');\n thead.appendChild(headTR);\n\n let tHeadName = document.createElement('th');\n tHeadName.innerText = 'Store Name: ';\n headTR.appendChild(tHeadName);\n\n for (let i = 0; i < operatingHours.length; i++) {\n //let tHeadHour = document.createElement('th');\n let hourTD = document.createElement('td');\n hourTD.innerText = operatingHours[i];\n headTR.appendChild(hourTD);\n\n }\n\n let tHeadTotal = document.createElement('td');\n tHeadTotal.innerText = 'Site Totals';\n headTR.appendChild(tHeadTotal);\n\n\n}", "function makeHeader(headerArr){\n var trEl = createPageElement('tr');\n\n //create empty header\n createTableItem('', trEl, 'th');\n\n //create hour headers\n for(var index = 0; index < headerArr.length; index++){\n createTableItem(headerArr[index], trEl, 'th');\n }\n\n //create total header\n createTableItem('Daily Location Total', trEl, 'th');\n\n return trEl;\n}", "function header(){\n\nlet tr = document.createElement('tr');\ntable.appendChild(tr)\n\n let hoursHead = [' ', '6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', 'Daily Location Total'];\n\n let thStore = document.createElement('th');\n tr.appendChild(thStore)\n thStore.textContent = \" \";\n \n for (let i = 0; i < workingHour.length; i++) {\n\n let th = document.createElement('th');\n tr.appendChild(th);\n th.textContent = workingHour[i]\n // tr.appendChild(th);\n\n\n }\n\n let thDailyT = document.createElement('th');\n tr.appendChild(thDailyT)\n thDailyT.textContent = \"Daily Location Total \";\n\n}", "function makeHeaderRow() {\n var trEl = document.createElement('tr');\n\n var thEl = document.createElement('th');\n thEl.textContent = 'Name';\n trEl.appendChild(thEl);\n\n\n thEl = document.createElement('th');\n thEl.textContent = '6:00am';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '7:00am';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '8:00am';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '9:00am';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '10:00am';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '11:00am';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '12:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '1:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '2:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '3:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '4:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '5:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '6:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = '7:00pm';\n trEl.appendChild(thEl);\n\n thEl = document.createElement('th');\n thEl.textContent = 'Daily Location Total';\n trEl.appendChild(thEl);\n\n salesProjectionsTable.appendChild(trEl);\n}", "function renderTableHead() {\n\tconst thead = document.querySelector('thead');\n\tconst tr = document.createElement('tr');\n\tcreateTdOrTh('', tr);\n\tcreateTdOrTh('', tr);\n\tcreateTdOrTh('Product', tr);\n\tcreateTdOrTh('Price', tr);\n\tcreateTdOrTh('Quantity', tr);\n\tcreateTdOrTh('Total', tr);\n\tthead.appendChild(tr);\n}", "function generateTableHead(table) {\n let tableHeadRow = $(\"#head-row\");\n\n tableHeadRow.append(\n `<th class=\"table-header\" id=\"athlete-header\" scope=\"col\">Athlete</th>`\n );\n\n for (let column of tableColumns) {\n tableHeadRow.append(`<th class=\"table-header\" id=\"${column}\" scope=\"col\">\n <span class=\"weekday-span\">${column}</span><br>\n <span class=\"${column}-date-span\"></span>\n </th>`);\n }\n\n tableHeadRow.append(\n `<th class=\"table-header\" id=\"total-miles-header\" scope=\"col\">Total Miles</th>`\n );\n}" ]
[ "0.7606329", "0.75395876", "0.7487819", "0.7471443", "0.7423536", "0.7405259", "0.7358278", "0.7349613", "0.73194534", "0.7310479", "0.7306039", "0.7292724", "0.72924787", "0.72870964", "0.72755975", "0.72714156", "0.7246142", "0.7214798", "0.7202979", "0.7186978", "0.71738064", "0.71690917", "0.7167226", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.71660876", "0.7144509", "0.7142253", "0.714102", "0.71338814", "0.71291125", "0.70920146", "0.7087375", "0.70745903", "0.7069995", "0.70659506", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.7064824", "0.70645577", "0.70645577", "0.70645577", "0.70645577", "0.70645577", "0.70645577", "0.70645577", "0.70645577", "0.70645577", "0.70618963", "0.70618963", "0.70618963", "0.70613784", "0.70410526", "0.70333815", "0.70224017", "0.70149416", "0.6990749", "0.6982894", "0.6959423", "0.69581264", "0.6933032", "0.6930046", "0.6896523", "0.68911296", "0.68883866", "0.68622476", "0.68486774", "0.6837916", "0.68252003", "0.6821706", "0.68110496", "0.68040234", "0.68000835", "0.6798014", "0.6796012", "0.6793635", "0.6776711", "0.67564034" ]
0.7874147
0
This is the primary function used to update the report card when the semester changes. It should call the other functions responsible for creating the necessary HTML
function updateReportCard() { updateDropdownLabel() reportCardTable.innerHTML = `` // add your code here addReportCardHeaders(); let i = 1; studentData[semester].forEach(element => { addCourseRowToReportCard(element,i); i++; }); // addCourseRowToReportCard(studentData[semester][0],1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSemester(clicked) {\n // code goes here\n semester = clicked.innerHTML\n}", "function renderReport(doc) {\n\n // ----------------------------------------------\n let br = document.createElement('br');\n let hr = document.createElement('hr');\n let page = document.createElement('span');\n\n let caption = document.createElement('h4'); //append caption\n let innerCaption = document.createElement('small');\n var t1 = document.createTextNode(\"PREVIOUS POSTS\");\n innerCaption.appendChild(t1);\n caption.appendChild(innerCaption)\n\n // append hr\n\n let title = document.createElement('h3'); //append title\n title.textContent = doc.data().studentUserName;\n\n let date = document.createElement('h5')//append date\n let icons = document.createElement('span')\n icons.classList.add('glyphicon');\n icons.classList.add('glyphicon-time');\n let time = document.createElement('span');\n time.textContent = doc.data().time;\n var t2 = document.createTextNode(' Posted on ');\n date.appendChild(icons);\n date.appendChild(t2);\n date.appendChild(time);\n\n\n let mainIcons = document.createElement('h5')//mainIcons\n let glyph1 = document.createElement('span');\n glyph1.classList.add('label');\n glyph1.classList.add('label-success');\n var t3 = document.createTextNode('created');\n var t5 = document.createTextNode(' ');\n glyph1.appendChild(t3);\n let glyph2 = document.createElement('span');\n glyph2.classList.add('label');\n glyph2.classList.add('label-primary');\n var t4 = document.createTextNode('read');\n glyph2.appendChild(t4);\n mainIcons.appendChild(glyph1);\n mainIcons.appendChild(t5);\n mainIcons.appendChild(glyph2);\n\n // append break (br)\n // append break (br)\n\n let comment = document.createElement('p')//append comment\n comment.textContent = doc.data().report;\n\n page.appendChild\n\n page.appendChild(caption);\n page.appendChild(hr);\n page.appendChild(title);\n page.appendChild(date);\n page.appendChild(mainIcons);\n page.appendChild(comment);\n page.appendChild(br);\n page.appendChild(br);\n page.appendChild(br);\n\n reportList.appendChild(page);\n\n}", "function updatePage() {\n\n // Summary Profile\n let nameElement = document.getElementById(\"comapnyName\");\n nameElement.innerText = \" \"+companyName;\n let marketCapElement = document.getElementById(\"marketCap\");\n marketCapElement.innerText = \" \"+marketCap;\n let industryElement = document.getElementById(\"industry\");\n industryElement.innerText = \" \"+industry;\n let sectorElement = document.getElementById(\"sector\");\n sectorElement.innerText = \" \"+sector;\n let websiteElement = document.getElementById(\"website\");\n websiteElement.innerText = \" \"+website;\n // Income Statement\n let totalRevenueElement = document.getElementById(\"totalRevenue\");\n totalRevenueElement.innerText = \" \"+totalRevenue;\n let totalEBITDAElement = document.getElementById(\"ebitda\");\n totalEBITDAElement.innerText = \" \"+totalEBITDA;\n let grossMarginElement = document.getElementById(\"grossMargin\");\n grossMarginElement.innerText = \" \"+grossMargin;\n // Balance Sheet Info\n let totalCashElement = document.getElementById(\"totalCash\");\n totalCashElement.innerText = \" \"+totalCash;\n let totalDebtElement = document.getElementById(\"totalDebt\");\n totalDebtElement.innerText = \" \"+totalDebt;\n let debtTwoEquityElement = document.getElementById(\"debtTwoEquity\");\n debtTwoEquityElement.innerText = \" \"+debtTwoEquity;\n\n}", "function setDataToScreen(){\n\t// Set data to page\n\tif(gAccount.accType == 'Y'){\n\t\tdocument.getElementById(\"dtlType\").innerHTML = CONST_STR.get('ACCOUNT_PERIOD_ONLINE');\n\t}else{\n\t\tdocument.getElementById(\"dtlType\").innerHTML = CONST_STR.get('ACCOUNT_PERIOD_COUNTER');\n\t}\n\t\n\tdocument.getElementById(\"dtlTypeMoney\").innerHTML = gAccount.accNumber;\n\tdocument.getElementById(\"dtlAmount\").innerHTML = gAccount.accAmount + ' VND';\n\tif(gAccount.accTenorDays != '0'){\n\t\tdocument.getElementById(\"dtlPeriod\").innerHTML = gAccount.accTenorDays + \" \";\n\t\tdocument.getElementById(\"dtlPeriodDay\").style.display = \"inline\";\n\t}else if(gAccount.accTenorMonths != '0'){\n\t\tdocument.getElementById(\"dtlPeriod\").innerHTML = gAccount.accTenorMonths + \" \";\n\t\tdocument.getElementById(\"dtlPeriodMonth\").style.display = \"inline\";\n\t}else if(gAccount.accTenorYears != '0'){\n\t\tdocument.getElementById(\"dtlPeriod\").innerHTML = gAccount.accTenorYears + \" \";\n\t\tdocument.getElementById(\"dtlPeriodYear\").style.display = \"inline\";\n\t}\n\tdocument.getElementById(\"dtlInterestRate\").innerHTML = gAccount.accInterestRate;\n\n\tif (gAccount.accProfitsInterim.trim() == '-') {\n\t\tdocument.getElementById(\"dtlProfitsInterim\").innerHTML = gAccount.accProfitsInterim;\n\t} else {\n\t\tdocument.getElementById(\"dtlProfitsInterim\").innerHTML = gAccount.accProfitsInterim + ' ' + gAccount.accTypeMoney;\n\t}\t\n\tdocument.getElementById(\"dtlDateStart\").innerHTML = gAccount.accDateStart;\n\tdocument.getElementById(\"dtlAmountBlock\").innerHTML = gAccount.accSoPhongToa + ' VND';\n\tdocument.getElementById(\"dtlDateEnd\").innerHTML = gAccount.accDateEnd;\n\tvar strEmptyReason = gAccount.accLyDoPhongToa.substring((gAccount.accLyDoPhongToa.length-3), gAccount.accLyDoPhongToa.length);\n\tif (strEmptyReason == ' , ') {\n\t\tstrEmptyReason = gAccount.accLyDoPhongToa.substring(0, (gAccount.accLyDoPhongToa.length-3));\n\t}else \n\t{\n\t\tstrEmptyReason = gAccount.accLyDoPhongToa;\n\t}\n\tdocument.getElementById(\"dtlReasonBlock\").innerHTML = strEmptyReason;\n}", "function twcheese_BattleReportEnhancer(gameDoc,report)\n\t{\n\t\tvar contentValueElement = gameDoc.getElementById('content_value');\t\t\n\t\t\n\t\tthis.includeReportTools = function()\n\t\t{\n\t\t\tvar toolTable = document.createElement('table');\n\t\t\ttoolTable.id = 'twcheese_BRE_tools';\n\t\t\ttoolTable.border = 3;\n\t\t\ttoolTable.insertRow(-1);\n\t\t\ttoolTable.rows[0].insertCell(-1); /* spot for raid calculator */\n\t\t\ttoolTable.rows[0].cells[0].vAlign = 'top';\n\t\t\ttoolTable.rows[0].insertCell(-1); /* spot for demolition information */\n\t\t\ttoolTable.rows[0].cells[1].vAlign = 'top';\n\t\t\ttoolTable.insertRow(-1);\n\t\t\ttoolTable.rows[1].insertCell(-1); /* spot for renamer */\n\t\t\ttoolTable.rows[1].cells[0].colSpan = 2;\n\t\t\tcontentValueElement.insertBefore(toolTable,contentValueElement.getElementsByTagName('h2')[0]);\n\t\t\t\n\t\t\t/*==== raider table ====*/\n\t\t\tif(report.espionageLevel >= 1)\n\t\t\t{\n\t\t\t\tvar raiderTable = document.createElement('table');\n\t\t\t\traiderTable.id = 'twcheese_raider_calculator';\n\t\t\t\traiderTable.insertRow(-1);\n\t\t\t\traiderTable.rows[0].insertCell(-1);\n\t\t\t\traiderTable.rows[0].cells[0].innerHTML = '<span align=\"center\"><h2>Raiders</h2></span>';\n\t\t\t\traiderTable.insertRow(-1);\n\t\t\t\traiderTable.rows[1].align = 'center';\n\t\t\t\traiderTable.rows[1].insertCell(-1);\n\t\t\t\tif(report.espionageLevel >= 2)\n\t\t\t\t\traiderTable.rows[1].cells[0].innerHTML = '<select id=\"twcheese_raider_selection\" onchange=\"twcheese_changeRaidMode(gameDoc.getElementById(\\'twcheese_raider_selection\\').value)\"><option value=\"scouted\">raid scouted resources</option><option value=\"predicted\">raid predicted resources</option><option value=\"periodic\">periodically raid resources</option></select>';\n\t\t\t\telse if(report.espionageLevel >= 1)\n\t\t\t\t\traiderTable.rows[1].cells[0].innerHTML = '<select id=\"twcheese_raider_selection\" onchange=\"twcheese_changeRaidMode(gameDoc.getElementById(\\'twcheese_raider_selection\\').value)\"><option value=\"scouted\">raid scouted resources</option></select>';\n\t\t\t\telse\n\t\t\t\t\traiderTable.rows[1].cells[0].innerHTML = '<select id=\"twcheese_raider_selection\" onchange=\"twcheese_changeRaidMode(gameDoc.getElementById(\\'twcheese_raider_selection\\').value)\"></select>';\n\t\t\t\t\n\t\t\t\traiderTable.rows[1].cells[0].innerHTML += ' <a href=\"'+ game_data.link_base_pure +'place&target='+ report.defenderVillage[2] +'\">&raquo; Send troops</a>';\n\t\t\t\traiderTable.rows[1].cells[0].innerHTML += '<button onclick=\"twcheese_BRESettings.period=gameDoc.getElementById(\\'twcheese_period\\').value;twcheese_BRESettings.raid=gameDoc.getElementById(\\'twcheese_raider_selection\\').value;twcheese_setBRESettings(twcheese_BRESettings);alert(\\'Settings Saved\\');\">Use current selection as default</button>';\n\t\t\t\traiderTable.rows[1].cells[0].innerHTML += '<div id=\"twcheese_periodic_options\">Period (hours):<input id=\"twcheese_period\" type=\"text\" size=3 maxlength=3 value=8 /><button onclick=\"' + 'twcheese_currentReport.raidPeriodic=twcheese_calculateRaidPeriodic(twcheese_currentReport.buildingLevels,parseInt(gameDoc.getElementById(\\'twcheese_period\\').value),twcheese_gameConfig.speed);' + 'twcheese_setRaiders(gameDoc.getElementById(\\'twcheese_raider_units\\'),twcheese_currentReport.raidPeriodic);\">Calculate</button></div>';\n\t\t\t\t\n\t\t\t\tvar raiderUnitsTable = document.createElement('table');\n\t\t\t\traiderUnitsTable.id = 'twcheese_raider_units';\n\t\t\t\traiderUnitsTable.border = 1;\n\t\t\t\traiderUnitsTable.cellspacing = 0;\n\t\t\t\traiderUnitsTable.insertRow(-1);\n\t\t\t\traiderUnitsTable.rows[0].className = 'center';\n\t\t\t\t\n\t\t\t\tvar unitLanguage = new Array('spear','sword','axe','archer','lcav','acav','hcav');\n\t\t\t\tfor(var i=0; i < 7; i++)\n\t\t\t\t{\n\t\t\t\t\traiderUnitsTable.rows[0].insertCell(-1);\n\t\t\t\t\traiderUnitsTable.rows[0].cells[i].width=\"35px\";\n\t\t\t\t\traiderUnitsTable.rows[0].cells[i].innerHTML = '<img src=\"'+imagePaths[unitLanguage[i]]+'\" alt=\"'+unitLanguage[i]+'\" />';\n\t\t\t\t}\n\n\t\t\t\traiderUnitsTable.insertRow(-1);\n\t\t\t\traiderUnitsTable.rows[1].className = 'center';\n\t\t\t\tfor(var i=0; i < 7; i++)\n\t\t\t\t\traiderUnitsTable.rows[1].insertCell(-1);\n\t\t\t\traiderTable.insertRow(-1);\n\t\t\t\traiderTable.rows[2].insertCell(-1);\n\t\t\t\traiderTable.rows[2].align = 'center';\n\t\t\t\traiderTable.rows[2].cells[0].appendChild(raiderUnitsTable);\n\t\t\t\t\n\t\t\t\ttoolTable.rows[0].cells[0].appendChild(raiderTable);\n\t\t\t}\n\t\t\t\n\t\t\t/*==== demolition table ====*/\n\t\t\tif(report.demolition)\n\t\t\t{\n\t\t\t\tvar demolitionTable = document.createElement('table');\n\t\t\t\tdemolitionTable.id = 'twcheese_demolition_calculator';\n\n\t\t\t\tdemolitionTable.insertRow(-1);\n\t\t\t\tdemolitionTable.rows[0].insertCell(-1);\n\t\t\t\tdemolitionTable.rows[0].cells[0].innerHTML = '<span align=\"center\"><h2>Demolition</h2></span>';\n\t\t\t\t\n\t\t\t\tvar demolitionUnitsTable = document.createElement('table');\n\t\t\t\tdemolitionUnitsTable.id = 'twcheese_demolition_units';\n\t\t\t\tdemolitionUnitsTable.border = 1;\n\t\t\t\tdemolitionUnitsTable.cellspacing = 0;\n\t\t\t\tdemolitionUnitsTable.insertRow(-1);\n\t\t\t\tdemolitionUnitsTable.rows[0].className = 'center'\n\t\t\t\tdemolitionUnitsTable.insertRow(-1);\n\t\t\t\tdemolitionUnitsTable.rows[1].className = 'center';\n\t\t\t\tdemolitionUnitsTable.insertRow(-1);\n\t\t\t\tdemolitionUnitsTable.rows[2].className = 'center';\n\t\t\t\tdemolitionUnitsTable.insertRow(-1);\n\t\t\t\tdemolitionUnitsTable.rows[3].className = 'center';\n\t\t\t\t\n\t\t\t\tdemolitionUnitsTable.rows[0].insertCell(-1);\n\t\t\t\tdemolitionUnitsTable.rows[0].insertCell(-1);\n\t\t\t\tdemolitionUnitsTable.rows[0].cells[0].colSpan = 17;\n\t\t\t\tdemolitionUnitsTable.rows[0].cells[0].innerHTML = '<img src=\"'+imagePaths['catapult']+'\" alt=\"catapults\" />';\n\t\t\t\tdemolitionUnitsTable.rows[0].cells[1].innerHTML = '<img src=\"'+imagePaths['ram']+'\" alt=\"rams\" />';\n\t\t\t\t\n\t\t\t\tvar buildingLanguage = new Array('hq','barracks','stable','workshop','church','church_f','academy','smithy','rally','statue','market','timber','clay','iron','farm','warehouse','hiding','wall');\n\t\t\t\tfor(var i=0; i < 18; i++)\n\t\t\t\t{\n\t\t\t\t\tdemolitionUnitsTable.rows[1].insertCell(-1);\n\t\t\t\t\tdemolitionUnitsTable.rows[1].cells[i].width=\"35px\";\n\t\t\t\t\tdemolitionUnitsTable.rows[1].cells[i].innerHTML = '<img src=\"'+imagePaths[buildingLanguage[i]]+'\" alt=\"'+buildingLanguage[i]+'\" />';\n\t\t\t\t\tdemolitionUnitsTable.rows[2].insertCell(-1);\n\t\t\t\t\tdemolitionUnitsTable.rows[2].cells[i].innerHTML = report.demolition[0][i];\n\t\t\t\t\tdemolitionUnitsTable.rows[3].insertCell(-1);\n\t\t\t\t\tdemolitionUnitsTable.rows[3].cells[i].innerHTML = report.demolition[1][i]; \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdemolitionTable.insertRow(-1);\n\t\t\t\tdemolitionTable.rows[1].insertCell(-1);\n\t\t\t\tdemolitionTable.rows[1].cells[0].appendChild(demolitionUnitsTable);\n\t\t\t\t\n\t\t\t\ttoolTable.rows[0].cells[1].appendChild(demolitionTable);\n\t\t\t}\n\t\t\t\n\t\t\t/*==== renamer table ====*/\n\t\t\tvar renamerTable = document.createElement('table');\n\t\t\trenamerTable.id = 'twcheese_renamer';\n\t\t\trenamerTable.align = 'center';\n\t\t\t\t\n\t\t\t\t/*==== renamer options ====*/\n\t\t\t\tvar renamerOptions = '<option>nothing</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:all\" >building levels: All</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:hq\" >building level: HQ</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:barracks\">building level: Barracks</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:stable\">building level: Stable</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:workshop\">building level: Workshop</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:church\">building level: Church</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:church_f\">building level: First Church</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:academy\">building level: Academy</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:smithy\">building level: Smithy</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:rally\">building level: Rally Point</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:statue\">building level: Statue</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:market\">building level: Market</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:timber\">building level: Timber Camp</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:clay\">building level: Clay Pit</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:iron\">building level: Iron Mine</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:farm\">building level: Farm</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:warehouse\">building level: Warehouse</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:hiding\">building level: Hiding Place</option>';\n\t\t\t\trenamerOptions += '<option value=\"buildings:wall\">building level: Wall</option>';\n\t\t\t\trenamerOptions += '<option value=\"troops:defSurvivors\">troops: Remaining Defense</option>';\n\t\t\t\trenamerOptions += '<option value=\"resources:all\">resources: Total Remaining</option>';\n\t\t\t\trenamerOptions += '<option value=\"time:launched\">time: Launched</option>';\n\t\t\t\trenamerOptions += '<option value=\"loyalty\">Loyalty</option>';\t\t\t\t\n\t\t\t\t\n\t\t\trenamerTable.insertRow(-1);\n\t\t\trenamerTable.rows[0].insertCell(-1);\n\t\t\trenamerTable.rows[0].cells[0].innerHTML = '<span align=\"center\"><h2>Renamer</h2></span>';\n\t\t\trenamerTable.rows[0].cells[0].colSpan = '6';\n\t\t\t\n\t\t\trenamerTable.insertRow(-1);\n\t\t\tfor(var i=0; i < 6; i++)\n\t\t\t{\n\t\t\t\trenamerTable.rows[1].insertCell(-1);\n\t\t\t\trenamerTable.rows[1].cells[i].innerHTML = '<select id=\"twcheese_renameOption'+i+'\" onchange=\"twcheese_previewNewName(twcheese_currentReport);\">'+renamerOptions+'</select>';\n\t\t\t}\n\t\t\t\n\t\t\trenamerTable.insertRow(-1);\n\t\t\trenamerTable.rows[2].insertCell(-1);\n\t\t\trenamerTable.rows[2].insertCell(-1);\n\t\t\trenamerTable.rows[2].cells[0].innerHTML = '<b>Preview:</b>'\n\t\t\trenamerTable.rows[2].cells[1].colSpan = 5;\n\t\t\trenamerTable.rows[2].cells[1].id = 'twcheese_rename_preview';\n\t\t\t\n\t\t\trenamerTable.insertRow(-1);\n\t\t\trenamerTable.rows[3].insertCell(-1);\n\t\t\trenamerTable.rows[3].cells[0].colSpan = 6;\n\t\t\trenamerTable.rows[3].cells[0].align = 'center';\n\t\t\trenamerTable.rows[3].cells[0].innerHTML = '<button onclick=\"pageMod.renameReport(gameDoc.getElementById(\\'twcheese_renameOption0\\').value,gameDoc.getElementById(\\'twcheese_renameOption1\\').value,gameDoc.getElementById(\\'twcheese_renameOption2\\').value,gameDoc.getElementById(\\'twcheese_renameOption3\\').value,gameDoc.getElementById(\\'twcheese_renameOption4\\').value,gameDoc.getElementById(\\'twcheese_renameOption5\\').value);\">Rename</button>';\n\t\t\trenamerTable.rows[3].cells[0].innerHTML += '<button onclick=\"pageMod.saveRenameSettings();alert(\\'saved renamer configuration\\');\">Use current selection as default</button>';\n\t\t\trenamerTable.rows[3].cells[0].innerHTML += ' <span title=\"Next time this script is ran: automatically rename reports, using the default renamer settings\">auto rename</span><input type=\"checkbox\" id=\"twcheese_auto_rename\" onclick=\"twcheese_BRESettings.autoRename = gameDoc.getElementById(\\'twcheese_auto_rename\\').checked; twcheese_setBRESettings(twcheese_BRESettings)\" />'\n\t\t\t\n\t\t\ttoolTable.rows[1].cells[0].appendChild(renamerTable);\n\t\t};\n\t\t\n\t\tthis.includeExtraInformation = function()\n\t\t{\n\t\t\tvar reportTable = gameDoc.getElementById('attack_luck').parentNode.parentNode.parentNode.parentNode;\n\t\t\t\n\t\t\t/*==== surviving defenders ====*/\n\t\t\tif(gameDoc.getElementById('attack_info_def_units'))\n\t\t\t{\n\t\t\t\tvar defenseUnitsTable = gameDoc.getElementById('attack_info_def_units');\n\t\t\t\tvar survivorsRow = defenseUnitsTable.insertRow(-1);\n\t\t\t\tsurvivorsRow.className = \"center\";\n\t\t\t\tsurvivorsRow.insertCell(-1);\n\t\t\t\tsurvivorsRow.cells[0].innerHTML = 'Survivors:';\n\t\t\t\tfor(var i=1; i < 13; i++)\n\t\t\t\t{\n\t\t\t\t\tsurvivorsRow.insertCell(-1);\n\t\t\t\t\tif(report.survivors[i-1] == 0)\n\t\t\t\t\t\tsurvivorsRow.cells[i].className=\"hidden\";\n\t\t\t\t\tsurvivorsRow.cells[i].innerHTML = report.survivors[i-1];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t/*==== population summary ====*/\n\t\t\tif(report.espionageLevel >= 2)\n\t\t\t{\n\t\t\t\tvar espionageTable = gameDoc.getElementById('attack_spy');\n\t\t\t\tvar populationRow = espionageTable.insertRow(-1);\n\t\t\t\tvar populationHeader = document.createElement('th');\n\t\t\t\tpopulationHeader.innerHTML = 'Population:';\n\t\t\t\tpopulationRow.appendChild(populationHeader);\n\t\t\t\tpopulationRow.insertCell(-1);\n\t\t\t\tpopulationRow.cells[1].innerHTML = 'Buildings <b>('+report.populationSummary[0]+')</b><br/>Military <b>('+report.populationSummary[1]+')</b><br/>';\n\t\t\t\tif(report.espionageLevel == 3)\n\t\t\t\t\tpopulationRow.cells[1].innerHTML += 'Idle';\n\t\t\t\telse\n\t\t\t\t\tpopulationRow.cells[1].innerHTML += 'Unknown';\n\t\t\t\tpopulationRow.cells[1].innerHTML += ' <b>('+report.populationSummary[2]+')</b>';\n\t\t\t}\n\t\t\t\n\t\t\t/*==== loyalty ====*/\n\t\t\tif(report.loyalty)\n\t\t\t{\n\t\t\t\tvar resultsHeaders = gameDoc.getElementById('attack_results').getElementsByTagName('th');\n\t\t\t\tvar loyaltyRow;\n\t\t\t\tfor(var i=0; i < resultsHeaders.length; i++)\n\t\t\t\t\tif(resultsHeaders[i].innerHTML == 'Loyalty:')\n\t\t\t\t\t\tloyaltyRow = resultsHeaders[i].parentNode;\n\t\t\t\t\t\t\n\t\t\t\tvar loyaltyHTML = loyaltyRow.cells[1].innerHTML;\n\t\t\t\tloyaltyRow.removeChild(loyaltyRow.cells[1]);\n\t\t\t\tloyaltyRow.insertCell(-1);\n\t\t\t\tloyaltyRow.cells[1].innerHTML = loyaltyHTML;\n\t\t\t\tloyaltyRow.cells[1].innerHTML += '<br/><span title=\"the current predicted loyalty, based on time passed since this report\">@Current Time: '+report.loyaltyExtra[0]+'</span>';\n\t\t\t\tloyaltyRow.cells[1].innerHTML += '<br/><span title=\"the predicted loyalty at time of arrival, should you send a nobleman from your current village right now\">@Arrival: '+report.loyaltyExtra[1]+'</span>';\n\t\t\t}\n\t\t\t\n\t\t\t/*==== opponents defeated ====*/\n\t\t\tvar oddRow = gameDoc.getElementById('attack_info_att').insertRow(-1);\n\t\t\tvar oddHeader = document.createElement('th');\n\t\t\toddHeader.innerHTML = 'ODD:';\n\t\t\toddRow.appendChild(oddHeader);\n\t\t\toddRow.insertCell(-1);\n\t\t\toddRow.cells[1].innerHTML = 'The defender defeated '+report.opponentsDefeatedSummary[1]+' opponents.';\n\t\t\t\t\t\t\n\t\t\tvar odaRow = gameDoc.getElementById('attack_info_def').insertRow(-1);\n\t\t\tvar odaHeader = document.createElement('th');\n\t\t\todaHeader.innerHTML = 'ODA:';\n\t\t\todaRow.appendChild(odaHeader);\n\t\t\todaRow.insertCell(-1);\n\t\t\todaRow.cells[1].innerHTML = 'The attacker defeated '+report.opponentsDefeatedSummary[0]+' opponents.';\n\t\t\t\n\t\t\t/*==== timing info ====*/\t\t\t\n\t\t\tvar launchRow = reportTable.insertRow(2);\n\t\t\tlaunchRow.insertCell(-1);\n\t\t\tlaunchRow.cells[0].innerHTML = '<span title=\"the time the attacker sent the attack\">Launched</span>';\n\t\t\tlaunchRow.insertCell(-1);\n\t\t\tlaunchRow.cells[1].innerHTML = twcheese_dateToString(report.timingInfo[0]);\n\t\t\t\n\t\t\t\t/*==== determine whether return time should be displayed. ====*/\n\t\t\t\tvar attackerSurvivors = twcheese_calculateSurvivors(report.attackerQuantity,report.attackerLosses);\n\t\t\t\tvar showReturnTime = false;\n\t\t\t\tfor(var i=0; i < attackerSurvivors.length; i++)\n\t\t\t\t\tif(attackerSurvivors[i] > 0)\n\t\t\t\t\t\tshowReturnTime = true;\n\t\t\t\n\t\t\tvar returnRow = reportTable.insertRow(3);\n\t\t\treturnRow.insertCell(-1);\t\t\t\n\t\t\tif(showReturnTime)\n\t\t\t{\t\t\t\t\n\t\t\t\treturnRow.cells[0].innerHTML = '<span title=\"the time the attacking troops return to the attacker\\'s village\">Returns</span>';\n\t\t\t\treturnRow.insertCell(-1);\n\t\t\t\treturnRow.cells[1].innerHTML = twcheese_dateToString(report.timingInfo[1]);\n\t\t\t}\n\t\t\t\n\t\t\t/*==== json representation ====*/\n\t\t\tvar jsonRow = reportTable.insertRow(5);\n\t\t\tjsonRow.insertCell(-1);\n\t\t\tjsonRow.cells[0].colSpan=2;\n\t\t\tjsonRow.cells[0].innerHTML = '<b>JSON</b><br/><textarea cols=50 readonly=true>' +JSON.stringify(report)+ '</textarea>';\n\t\t\t\n\t\t};\n\t\t\n\t\t/**\n\t\t *\trenames the report\n\t\t *\t@param op1\tfirst option to include in the report\n\t\t */\n\t\tthis.renameReport = function(op1,op2,op3,op4,op5,op6)\n\t\t{\n\t\t\tvar newName = 'twCheese: ' + report.attacker[1] + ' ('+report.attackerVillage[0]+'|'+report.attackerVillage[1]+','+report.attackerVillage[2]+') attacks '+report.defender[1]+' ('+report.defenderVillage[0]+'|'+report.defenderVillage[1]+','+report.defenderVillage[2]+')' + twcheese_renameText(op1,report) + twcheese_renameText(op2,report) + twcheese_renameText(op3,report) + twcheese_renameText(op4,report) + twcheese_renameText(op5,report) + twcheese_renameText(op6,report);\n\t\t\t\n\t\t\t/*==== retrieve key required for certain events ====*/\n\t\t\tvar text = String(gameDoc.getElementById('edit').getElementsByTagName('input')[1].onclick);\n\t\t\tvar hash = text.substring(text.indexOf('&h=')+3,text.indexOf('&report_id'));\n\t\t\n\t\t\t/*==== rename report ====*/\n\t\t\tgameDoc.getElementById('editInput').value = newName;\n\t\t\tvar submitLink = game_data.link_base_pure +'report&action=edit_subject&h='+hash+'&report_id='+report.reportID;\n\t\t\teditSubmit('label', 'labelText', 'edit', 'editInput', submitLink);\n\t\t};\n\t\t\n\t\tthis.saveRenameSettings = function()\n\t\t{\n\t\t\tfor(var i=0; i < 6; i++)\n\t\t\t\teval('twcheese_BRESettings.rename'+Number(i+1)+' = gameDoc.getElementById(\\'twcheese_renameOption'+i+'\\').value;');\n\t\t\ttwcheese_setBRESettings(twcheese_BRESettings)\t\t\t\t\t\t\n\t\t};\n\t}", "function displayCalendar_Spring2014_Summer2014(numberOfMonths) {\n\n from_semester_title.innerHTML = \"Spring 2014\";\n to_semester_title.innerHTML = \"Summer 2014\";\n\n $(\"#weekNumber\").html(\"1\");\n\n $(\"#dateoutput1\").html(\"13 Jan, Mon\");\n $(\"#dateoutput2\").html(\"5 May, Mon\");\n\n\n function highlightDays(date) {\n //month starts as 0\n var a = new Date(2014, 0, 13); // first day of FROM semester - September 9, 2013 - 2014, January 13\n var b = new Date(2014, 3, 11); // last day of FROM semester - December 6, 2013 - 2014, April 11\n\n if (a <= date && date <= b) {\n return [true, 'highlight'];\n }\n\n return [true, ''];\n\n }\n\n $(\"#datepicker_Spring2014_Summer2014\").datepicker({\n\n inline: true,\n showOtherMonths: true,\n defaultDate: '13-01-14', //09-09-13 dd-mm-yy\n numberOfMonths: numberOfMonths,\n dateFormat: \"dd-mm-yy\",\n\n beforeShowDay: highlightDays,\n\n onSelect: function (dateText, inst) {\n var date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, dateText, inst.settings);\n var dateText1 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n date.setDate(date.getDate() + 112); //old - 126\n var dateText2 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n\n var newDate = date.getDate();\n var newMonth = date.getMonth();\n\n /*\n console.log(\"-----------------------\");\n console.log(\"next semester full date: \" + date);\n console.log(\"next semester Date: \" + newDate);\n console.log(\"next semester Month: \" + newMonth);\n */\n\n //List starting week days of the new semester\n var weekNumber;\n var weekDays = 4;\n\n var wk1_start = 5;\n var wk1_end = wk1_start + weekDays;\n\n var wk2_start = 12;\n var wk2_end = wk2_start + weekDays;\n\n var wk3_start = 19;\n var wk3_end = wk3_start + weekDays;\n\n var wk4_start = 26;\n var wk4_end = wk4_start + weekDays;\n\n var wk5_start = 2;\n var wk5_end = wk5_start + weekDays;\n\n var wk6_start = 9;\n var wk6_end = wk6_start + weekDays;\n\n var wk7_start = 16;\n var wk7_end = wk7_start + weekDays;\n\n var wk8_start = 23;\n var wk8_end = wk8_start + weekDays;\n\n var wk9_start = 30;\n var wk9_end = 4;\n\n var wk10_start = 7;\n var wk10_end = wk10_start + weekDays;\n\n var wk11_start = 14;\n var wk11_end = wk11_start + weekDays;\n\n var wk12_start = 21;\n var wk12_end = wk12_start + weekDays;\n\n var wk13_start = 28;\n var wk13_end = 1;\n\n\n var Month4_2014 = 4;\n var Month5_2014 = 5;\n var Month6_2014 = 6;\n var Month7_2014 = 7;\n\n\n if ((newDate >= wk1_start && newDate <= wk1_end) && (newMonth == Month4_2014)) {\n weekNumber = 1;\n }\n\n else if ((newDate >= wk2_start && newDate <= wk2_end) && (newMonth == Month4_2014)) {\n weekNumber = 2;\n }\n\n else if ((newDate >= wk3_start && newDate <= wk3_end) && (newMonth == Month4_2014)) {\n weekNumber = 3;\n }\n\n else if ((newDate >= wk4_start && newDate <= wk4_end) && (newMonth == Month4_2014)) {\n weekNumber = 4;\n }\n\n else if ((newDate >= wk5_start && newDate <= wk5_end) && (newMonth == Month5_2014)) {\n weekNumber = 5;\n }\n\n else if ((newDate >= wk6_start && newDate <= wk6_end) && (newMonth == Month5_2014)) {\n weekNumber = 6;\n }\n\n else if ((newDate >= wk7_start && newDate <= wk7_end) && (newMonth == Month5_2014)) {\n weekNumber = 7;\n }\n\n else if ((newDate >= wk8_start && newDate <= wk8_end) && (newMonth == Month5_2014)) {\n weekNumber = 8;\n }\n\n else if ((newDate == wk9_start) && (newMonth == Month5_2014)) {\n weekNumber = 9;\n }\n\n else if ((newDate <= wk9_end) && (newMonth == Month6_2014)) {\n weekNumber = 9;\n }\n\n else if ((newDate >= wk10_start && newDate <= wk10_end) && (newMonth == Month6_2014)) {\n weekNumber = 10;\n }\n\n else if ((newDate >= wk11_start && newDate <= wk11_end) && (newMonth == Month6_2014)) {\n weekNumber = 11;\n }\n\n else if ((newDate >= wk12_start && newDate <= wk12_end) && (newMonth == Month6_2014)) {\n weekNumber = 12;\n }\n\n //adjusting criteria for weeks that have days in multiple months\n\n else if ((newDate >= wk13_start && newDate <= (wk13_start + 3)) && (newMonth == Month6_2014)) {\n weekNumber = 13;\n }\n\n else if (newDate == wk13_end && newMonth == Month7_2014) {\n weekNumber = 13;\n }\n\n\n else {\n weekNumber = 'N/A';\n }\n\n\n $(\"#weekNumber\").html(weekNumber);\n\n $(\"#dateoutput1\").html(dateText1);\n $(\"#dateoutput2\").html(dateText2);\n\n\n /*\n console.log(\" ~~~~~~~> wk9_start: \" + wk9_start);\n console.log(\" ~~~~~~~> wk9_end: \" + wk9_end);\n */\n\n }\n\n\n });\n\n}", "function displayAssessmentReport(result){\n var keys=Object.keys(result[0]);\n\n //tempArray is used to store one type of grade (hw,exam,or proj) at a time:\n var tempArray=[];\n\n //outter for is to loop on the keys that are available in each student object,\n //i.e gives one grade type at a time.\n for (var i=0; i<=keys.length-1; i++){\n\n //the inside foreach loops on all students.\n result.forEach(function(element){\n if (element[keys[i]] !== null){\n tempArray.push(element[keys[i]]);\n }\n });\n\n //if it is not an empty array then scale it and update the view.\n if(tempArray.length > 0){\n //scale one grade type at a time:\n scale(tempArray);\n\n //re empty the tempArray for the next iteration.\n tempArray=[];\n\n //Updating the View:\n var $tr=$(\"<tr class='assessment-report'>\"), $th=$(\"<th>\"), $tdT=$(\"<td>\"), $tdAB=$(\"<td>\"), $tdC=$(\"<td>\"), $tdDF=$(\"<td>\");\n\n //appending table data tags to a table row.\n $th.text(keys[i]);\n $tr.append($th);\n $tdT.text(assessmentScale.total);\n $tr.append($tdT);\n $tdAB.text(assessmentScale.satisfactory);\n $tr.append($tdAB);\n $tdC.text(assessmentScale.developing);\n $tr.append($tdC);\n $tdDF.text(assessmentScale.unsatisfactory);\n $tr.append($tdDF);\n\n //populating download obj and array with data, this data is sent to the server when generating pdf report.\n var assessmentObj={workType:\"\", totalNum:\"\", satisfactory:\"\", developing:\"\", unsatisfactory:\"\"};\n assessmentObj.workType= keys[i];\n assessmentObj.totalNum= assessmentScale.total;\n assessmentObj.satisfactory= assessmentScale.satisfactory;\n assessmentObj.developing= assessmentScale.developing;\n assessmentObj.unsatisfactory= assessmentScale.unsatisfactory;\n assessmentArray.push(assessmentObj);\n\n //appending the table row to the whole table.\n $(\".assessment-report-table\").append($tr);\n }//end if\n }//end of outter for.\n}//end of displayAssessmentReport function.", "function addReportCardHeaders() {\n // update the code here\n reportCardTable.innerHTML += `\n <div class='table-header'>\n <h4>Number</h4>\n <h4>Code</h4>\n <h4>Name</h4>\n <h4>Semester</h4>\n <h4>Credit</h4>\n <h4>Letter</h4>\n </div>\n `\n}", "function getSemReport(form_id){\n \n if(form_id == 1) {\n var form = document.getElementById('report_form'); \n }\n else if(form_id ==2) {\n var form = document.getElementById('graph_form');\n }\n\n //change the button status to loading - displays \"loading..\" text in the button \n $('#load1').button('loading');\n $('#load2').button('loading');\n\n //get sem-number from the form\n var sem_val = form.elements[0].value;\n \n //sem-number validation\n //if validation fails, return;\n if((typeof sem_val=='number') || sem_val%1!=0 || sem_val<1 || sem_val>8) {\n alert(\"Semester value should be an integer between 1 to 8\");\n $('#load1').button('reset');\n $('#load2').button('reset');\n return false;\n }\n\n \n //setting semester field in both form (in report-tab and graph-tab) to 'sem_val'\n //we're changing details in both tabs. So when user types something in one tab\n //and click button then the value in other tab should also be changed\n //UI thing - #clearity :D\n $('#graph_form input').val(sem_val);\n $('#report_form input').val(sem_val);\n \n //sending ajax request to /report with query 'sem=sem_val'\n var request = $.ajax({\n url: window.location.pathname + \"/report\",\n cache: false,\n type: \"GET\",\n data: {\"sem\": sem_val},\n dataType: 'json',\n });\n \n //when ajax request-response is successful\n request.done(function(response) {\n \n //using the compiled handlebars-template to generate the html output\n //put the html content in #report_table_body div\n var report_html = template(response);\n $('#report_table_body').html(report_html);\n \n //to enable jquery tooltip\n $(\"[data-toggle='tooltip']\").tooltip();\n \n //resetting buttons to actual text in the button\n $('#load1').button('reset'); \n $('#load2').button('reset'); \n \n //list of list variable - dataset for plotting graph\n var lol = [];\n\n //populating 'lol' from response json\n var i = 0;\n response.sub_record.forEach(function(doc, index) {\n lol[i] = [doc.sub_code, doc.cat1_mark, doc.cat2_mark, doc.cat3_mark];\n i++;\n });\n\n //generating graph, ploting graph in #graph_body div\n var chart = c3.generate({\n bindto: '#graph_body',\n data: {\n columns: lol,\n type: 'line'\n },\n axis: {\n x: {\n type: 'category',\n categories: ['CAT-1', 'CAT-2', 'CAT-3'],\n padding: {left: -0.4, right: 0.5},\n label: {text: 'Continuous Assessment Tests', position: 'outer-center'}\n },\n y: {\n label: {text: 'CAT Marks', position: 'outer-middle'}\n }\n }\n });\n \n //setting footers's content to empty\n //both footer divs are used to display errors \n $('#table_footer').text('');\n $('#graph_footer').text('');\n });\n \n //when ajax request-response fails\n request.fail(function(jqXHR, textStatus, errorText){\n \n //resetting buttons - displays actual text of the button\n $('#load1').button('reset'); \n $('#load2').button('reset'); \n \n //setting report_body and graph_body divs to empty\n $('#report_table_body').text(\"\");\n $('#graph_body').text(\"\");\n \n //displays error messages in footers\n $('#table_footer').text(\"Error - Couldn't able to fetch data\");\n $('#graph_footer').text(\"Error - Couldn't able to fetch data\");\n \n });\n \n return false;\n}", "function processGenerateReportButton() \n{ \n\t//console.log(\"Entereed generateReport\");\n\t//console.log(currentPage);\n\t\n\tif (currentPage == \"Campus\")\n\t{\n\t\tinitCampusReportGeneration();\n\t}\n\telse\n\t{ \n\t\tinitBuildingReportGeneration(currentPage);\n\t}\n\t\n}", "function doneMSAssesssment(){\r\n var transaction = getTransactionNo();\r\n var enrollmentNo = getEnrollmentNo();\r\n var studentNo = getStudentId();\r\n var name = $('#studentName').html();\r\n var department = $('input[name=radioDepartment]:checked').val();\r\n var age = $('#age').val();\r\n var schoolYear = $('#syEntered').val();\r\n var grade = $('#grade').val();\r\n var yrLevel = $('#yrLevel').val();\r\n var genAverage = $('#genAverage').val();\r\n \r\n var gy = \"\";\r\n $('#small-studNum').html(studentNo);\r\n $('#small-name').html(name);\r\n $('#small-department').html(department);\r\n $('#small-age').html(age);\r\n $('#small-schYear').html(schoolYear);\r\n if(department===\"Elementary Dept.\"){\r\n $('#for-grade').show();\r\n $('#small-grade').show();\r\n $('#for-yearLevel').hide();\r\n $('#small-yrLevel').hide();\r\n $('#small-grade').html(grade);\r\n gy = $('#small-grade').html();\r\n }else if(department===\"High School Dept.\"){\r\n $('#for-yearLevel').show();\r\n $('#small-yrLevel').show();\r\n $('#for-grade').hide();\r\n $('#small-grade').hide();\r\n $('#small-yrLevel').html(yrLevel);\r\n gy = $('#small-yrLevel').html();\r\n }\r\n $('#small-generalAve').html(genAverage);\r\n \r\n var obj = {\"transactionNo\": transaction,\"enrollmentNo\": enrollmentNo,\"studentNo\": studentNo,\"schoolYear\": schoolYear,\"gy\": gy, \"age\":age};\r\n if(studentNo === \"\" || studentNo === null || studentNo === NaN){\r\n }else{\r\n $('#dialog-confirm-done-MS-assessment').dialog({\r\n resizable: false,\r\n modal: true,\r\n buttons:{\r\n Yes:function(){\r\n $.ajax({\r\n type: 'POST',\r\n url: '../process/doneMSAssessment.php',\r\n data: obj,\r\n success: function(data){\r\n $('#div-alert-success').html(\"<i class='icon-check'></i>&nbsp;&nbsp;Assessment successfully created..\");\r\n $('#div-alert-success').show('blind',1000);\r\n clearFPTotalAmount();\r\n clearFPCPayment();\r\n clearMSTotalAmount();\r\n clearMSCPayment();\r\n $('#searchStudId').val(\"\");\r\n $('#studentId').html(\"\");\r\n $('#studentName').html(\"\");\r\n $('#age').val(\"\");\r\n $('#syEntered').val(\"\");\r\n $('#genAverage').val(\"\");\r\n $('#recentBal').val(\"\");\r\n $('input[name=radioPaymnt]').attr('disabled','disabled');\r\n $('#btn-sub-back').removeAttr('disabled');\r\n $('#btn-sub-next').removeAttr('disabled');\r\n $('#cashAmount').removeAttr('readonly');\r\n $('#cashAmount').val(\"\");\r\n $('#cashAmountF').removeAttr('readonly');\r\n $('#cashAmountF').val(\"\");\r\n setEnabledBT();\r\n hideSubjectsForm();\r\n hideMSPaymentFormTF();\r\n hideFullPaymentFormTF();\r\n setEnrollmentNo();\r\n setTransactionNo();\r\n\r\n $('input[name=radioPaymnt]').prop('checked', false);\r\n $('input[name=radioDepartment]').prop('checked', false);\r\n setProfilePic();\r\n },\r\n error: function(data){\r\n alert(\"error in processing assessment=>\"+data);\r\n }\r\n });\r\n $(this).dialog(\"close\");\r\n },\r\n No:function(){\r\n $('#btn-cancel-assmnt').removeAttr('disabled');\r\n $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n }\r\n\r\n}", "function displayPlan(myplan) {\r\n // Look at the plan of the html\r\n const coursePlan = document.getElementById(\"course-flex-table\");\r\n\r\n Object.entries(myplan.findYears()).forEach((year) => {\r\n const [yearName, terms] = year;\r\n\r\n let courseRowDiv = document.createElement(\"div\");\r\n courseRowDiv.classList.add(\"course-row\");\r\n coursePlan.appendChild(courseRowDiv);\r\n\r\n\r\n Object.entries(terms).forEach(term => {\r\n const [termName, courses] = term;\r\n\r\n // Adds the 4 rows for the years\r\n let courseRowItem = document.createElement(\"div\");\r\n courseRowItem.classList.add(\"course-row-item\");\r\n courseRowDiv.appendChild(courseRowItem);\r\n\r\n // Adds the semester to the boxes\r\n const semesterDiv = document.createElement(\"div\");\r\n semesterDiv.classList.add(\"semester\");\r\n courseRowItem.appendChild(semesterDiv);\r\n\r\n // Adds the header to the semesters\r\n const header = document.createElement(\"h3\");\r\n const modYear = parseInt(yearName) + (termName === \"Fall\" ? 0 : 1);\r\n header.textContent = `${termName} ${modYear}`;\r\n semesterDiv.appendChild(header);\r\n\r\n courses.forEach((course) => {\r\n const courseContent = document.createElement(\"p\");\r\n courseContent.textContent = `${course.courseDesignator} ${course.courseName}`;\r\n semesterDiv.appendChild(courseContent);\r\n });\r\n });\r\n });\r\n}", "function buildPage() {\n\tvar navOutput = '<select id=\"sprintSelector\" style=\"width:100px;\" onchange=\"changeCurrentSprint()\">';\n\tvar contentOutput = '<table cellspacing=\"0\" width=\"100%\" class=\"ms-rteTable-0\"><tbody><tr class=\"ms-rteTableEvenRow-0\">';\n\tvar sProgress;\n\t\n\t//Build navigation output.\n\tfor (var i = 0; i < sprintsData.sprints.length; i++) {\n\t\tvar sprintId = sprintsData.sprints[i].id;\n\t\tvar sprintNumber = sprintsData.sprints[i].data.sprint;\n\t\t\n\t\tif (currentSprintId === sprintId) {\n\t\t\tsProgress = sprintsData.sprints[i].data;\n\t\t\tnavOutput += '<option value=\"'+ sprintId +'\" selected>Sprint '+ sprintNumber +'</option>';\n\t\t\n\t\t} else {\n\t\t\tnavOutput += '<option value=\"'+ sprintId +'\">Sprint '+ sprintNumber +'</option>';\n\t\t}\n\t}\n\tnavOutput += '</select>&#160 &#160;' + \n\t\t\t\t\t'<a href=\"javascript:buildNewSprintTemplate();\">'+\n\t\t\t\t\t'<font size=\"2\">+ Add new sprint​</font>'+\n\t\t\t\t\t'</a> | '+\n\t\t\t\t\t'<a href=\"/regression/SitePages/Notes.aspx?s='+ currentSprintId +'\">'+\n\t\t\t\t\t'<font size=\"2\">View sprint notes​</font>'+\n\t\t\t\t\t'</a>​';\n\t\n\t//Build sprint progress output.\n\tfor (var i = 0; i < sProgress.tools.length; i++) {\n\t\t\tcontentOutput += '<td class=\"ms-rteTableEvenCol-0\" style=\"width: 14.2857%;\">' +\n\t\t\t\t\t\t\t\t'<h1>' + sProgress.tools[i].name + '</h1>' +\n\t\t\t\t\t\t\t\t'<ul>';\n \n\t\t\tfor (var j = 0; j < sProgress.tools[i].features.length; j++) {\n\t\t\t\tvar featureStatusHtml;\n\t\t\t\tvar urlVariables = '?s=' + currentSprintId + '&t=' + i + '&f=' + j;\n\t\t\t\tvar featureUrl = sProgress.tools[i].features[j].url + urlVariables;\n\t\t\t\t\n\t\t\t\tswitch(sProgress.tools[i].features[j].status) {\n\t\t\t\t\tcase 0:\n\t\t\t\t\t\tfeatureStatusHtml = ' - <font color=\"#C0C0C0\" size=\"1\"><b>?</b></font>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tfeatureStatusHtml = ' - <font color=\"#008000\" size=\"3\"><b>v</b></font>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tfeatureStatusHtml = ' - <font color=\"#ff0000\" size=\"3\"><b>x</b></font>';\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcontentOutput += '<li>'+\n\t\t\t\t\t\t\t\t\t'<a href=\"' + featureUrl + '\">'+\n\t\t\t\t\t\t\t\t\tsProgress.tools[i].features[j].name+\n\t\t\t\t\t\t\t\t\t'</a>' + featureStatusHtml+\n\t\t\t\t\t\t\t\t\t'</li>';\n\t\t\t}\n\t\t\t\n\t\t\tcontentOutput += '</ul>'+\n\t\t\t\t\t\t\t\t'<a href=\"javascript:openNewFeatureDialog(' + i + ');\">'+\n\t\t\t\t\t\t\t\t'<font size=\"1\">+ Add feature​</font>'+\n\t\t\t\t\t\t\t\t'</a></td>';\n\t\t\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\tcontentOutput += '</tr></tbody></table>';\t\n\t\n\t\n\tdocument.getElementById(\"SprintOptions\").innerHTML = navOutput;\n\tdocument.getElementById(\"innerContent\").innerHTML = contentOutput;\n\tdocument.getElementById(\"DeltaPlaceHolderPageTitleInTitleArea\").innerHTML = 'Regression - Sprint ' + sProgress.sprint;\n}", "function _makeReport() {\n document.getElementById(\"reportTable\").hidden = false;\n document.getElementById(\"chartContainer\").hidden = false;\n updateReportFromDB();\n}", "function updateReportDate(){\n\t\t//empty table if necessary\n\t\tif($(\"table.dataGrid tr\").length > 1){\n\t\t\t$(\"table.dataGrid tbody\").empty();\n\t\t}\n\t\t$('.container').hide();\n\t\t$.blockUI({ message: '<img src=\"images/busy.gif\" /> Saving New Report Date...' });\n\t\tvar reportDate = $(\"#reportDate\").val();\n\t\tvar ajaxParams = \"reportDate=\"+reportDate;\n\t\t$.ajax({\n\t\t\turl: \"/billing-circ/servlets/UpdateReportDate\",\n\t\t\tdataType: \"text\",\n\t\t\tdata: ajaxParams,\n\t\t\terror: function (xhr, desc, exceptionobj) {\n\t\t\t\t$.unblockUI();\n\t\t\t\t//add error message\n\t\t\t\t$.blockUI({ message: 'There was an error saving the report date. Please try again.' });\n\t\t\t\t setTimeout($.unblockUI, 2000);\n\t\t\t},\n\t\t\tsuccess: function(data){\n\t\t\t\t$.unblockUI();\n\t\t\t\t//add error message\n\t\t\t\t$.blockUI({ message: 'The report date was successfully saved.' });\n\t\t\t\t setTimeout($.unblockUI, 2000);\n\t\t\t}\n\t\t});\n\t}", "function updateCalendarStats(){\n if(new Date().getFullYear() == currentCalendar.lastYearViewed){\n currentStreakDiv.innerHTML = \"Current Streak: <span>\" + getCurrentStreak() + \"</span>\";\n }else{\n currentStreakDiv.innerHTML = \"\";\n }\n longestStreakSpan.innerHTML = getLongestStreak();\n totalLitSpan.innerHTML = getNumberCellsLit();\n percentLitSpan.innerHTML = getPercentCellsLit();\n }", "function build_academic_table(student, season, year) {\n $('#hdrImg').attr('src', 'https://icqt9q.dm.files.1drv.com/y4mypK3ZqfCqMeHAQ9-Gh-zOvoD6mINfspLLb-ISKs3gZBpv0lGf67HNFffxhy7z-0WHfCTcEgVubnFGirYqQREeS4rd9MhAo4Sgdj5JBU3dr4gOSSBWWALl-c3kHL_fjzats4IpkzlGCzLNChbP7mjNoxmVgbOrLQwavYNLQ6kYSWyW-ws_Bx9S6fJIVao4CFL5mmbohCy3BLz4LfdPfqUpQ?width=341&height=334&cropmode=none');\n /*\n * Create tham semestertab div\n */\n let academicPage = '\\\n <div class=\"athleticPics\">\\\n <img id=\"p1\" src=\"\" class=\"sportLeft\">\\\n <img id=\"p2\" src=\"\" class=\"sportRight\">\\\n </div>\\\n <div id=\"semestertab\">\\\n <table id=\"semTab\" class=\"semesterTable\" cellspacing=\"3\" cellpadding=\"3\" summary=\"List of classes, teachers and grades\">\\\n <caption id=\"capText\">\\\n <h3 id=\"seasonYear\"></h3>\\\n </caption>\\\n <tr id=\"academicHeaderList\">\\\n <th scope=\"col\" class=\"period\">Period</th>\\\n <th scope=\"col\" class=\"className\">Class</th>\\\n <th scope=\"col\" class=\"teacher\">Teacher</th>\\\n <th scope=\"col\" class=\"grade\">Grade</th>\\\n <th scope=\"col\" class=\"modify\"></th>\\\n </tr>\\\n </table>\\\n </div>';\n \n $(\"#main\").append(academicPage);\n let innerStr = student + \" \" + season + \" \" + year;\n $(\"#seasonYear\").html(innerStr);\n\n $('#p1').attr('src', randomPicture(student, 'Academic'));\n $('#p2').attr('src', randomPicture(student, 'Academic'));\n /*\n * Filter the transacriptList to retrieve the semester\n * record for the student, season, year provided.\n * Then build the table based on the returned records.\n */\n let transcriptList = database_data.getTranscripts();\n let semesterList = transcriptList.filter(function (obj) {\n return (obj.season===season && obj.year===year && obj.studentName===student);\n });\n\n if (semesterList.length !==0) {\n for (x in semesterList) {\n addAcademicRow(semesterList[x], \"semTab\");\n }\n\n /*\n * Build the GPA, Running GPA, and Ranking information\n */\n rankings = '\\\n <br>\\\n <pre id=\"sgpa\"></pre>\\\n <pre id=\"ogpa\"></pre>\\\n <br>\\\n <pre id=\"rank\"></pre>'\n $(\"#semestertab\").append(rankings);\n\n /*\n * We can use reduce on the semesterList to total the GPA\n * and WGPA values.\n */\n let semesterGPA = semesterList.reduce(function(acc, obj) {\n return acc + parseFloat(obj.GP);\n }, 0.000)/semesterList.length;\n let semesterWGPA = semesterList.reduce(function(acc, obj) {\n return acc + parseFloat(obj.WGP);\n }, 0.000)/semesterList.length;\n\n /*\n * Save the current semesters seasonId and then filter the\n * transcriptList for all student entries whose seasonID is\n * equal or less than the current seasonId. This builds the\n * running GPA and WGPA values.\n */ \n let localSeasonId = semesterList[0].seasonId;\n let runningGPAList = transcriptList.filter(function (obj) {\n return (obj.studentName === student && parseInt(obj.seasonId) <= localSeasonId);\n });\n let runningGPA = runningGPAList.reduce(function(acc,obj){\n return acc + parseFloat(obj.GP);\n }, 0.000)/runningGPAList.length;\n let runningWGPA = runningGPAList.reduce(function(acc,obj) {\n return acc + parseFloat(obj.WGP);\n }, 0.000)/runningGPAList.length;\n\n innerStr=\"\\t Semester GPA: \" + semesterGPA.toFixed(3) + \"\\tSemester Weighted GPA: \" + semesterWGPA.toFixed(3);\n $(\"#sgpa\").html(innerStr);\n\n innerStr=\"\\t Overall GPA: \" + runningGPA.toFixed(3) + \"\\tOverall Weighted GPA: \" + runningWGPA.toFixed(3);\n $(\"#ogpa\").html(innerStr);\n\n /*\n * Add the ranking information. May want to test for missing\n * ranking data from the database look up.\n */\n let rankingList = database_data.getRankings();\n let ranking = rankingList.filter(function (obj) {\n return (parseInt(obj.seasonId) == localSeasonId)\n });\n if (ranking.length !== 0) {\n innerStr =\"\\t Rank: \" + ranking[0].rank + \" Class Size: \" + ranking[0].totalStudents + \" Top \" + ranking[0].pct + \"%\";\n $(\"#rank\").html(innerStr);\n }\n }\n addHiddenInsertRow(\"semTab\");\n}", "function updatePageHtml(){\n\tfunction getClockData(timeData) {\n \t$.get(\"/api/\", timeData, function(data){\n \t\tconsole.log(data);\n \t\t//clear our previous enteries\n \t\tdocument.getElementById('clockInDate').innerHTML = \"\";\n \t\tdocument.getElementById('clockInTime').innerHTML = \"\";\n \t\tdocument.getElementById('clockOutTime').innerHTML = \"\";\n \t\tdocument.getElementById('totalTime').innerHTML = \"\";\n \t\t//Show our results on the company home page. \n \t\t//We will show the last 5 entries, but that can be adjusted.\n \t\tfor (var i = data.length - 1; i > data.length - 6; i--) {\n \t\t\t//always check for blank information before appending a new section.\n \t\t\tif(data[i].startDate == null){\n \t\t\t\t$('#clockInDate').append('<br>');\n \t\t\t}else{\n \t\t\t\t$('#clockInDate').append('<p class=\"light center\">' + data[i].startDate + '</p>');\n \t\t\t}\n \t\t\tif(data[i].startDate == null){\n \t\t\t\t$('#clockInTime').append('<br>');\n \t\t\t}else{\n \t\t\t\t$('#clockInTime').append('<p class=\"light center\">' + data[i].startTime + '</p>');\n \t\t\t}\n \t\t\tif(data[i].stopTime == null){\n \t\t\t\t$('#clockOutTime').append('<br>');\n \t\t\t}else{\n \t\t\t\t$('#clockOutTime').append('<p class=\"light center\">' + data[i].stopTime + '</p>');\n \t\t\t}\n \t\t\tif(data[i].startTime == null || data[i].stopTime == null){\n \t\t\t\t$('#totalTime').append('<p class=\"light center\">' + \"Error\" + '</p>');\n \t\t\t}else{\n \t\t\t\t\n \t\t\t\t$('#totalTime').append('<p class=\"light center\">' + Math.abs(data[i].stopTime - data[i].startTime) + '</p>');\n \t\t\t}\n\n \t\t}\n\n \t})\n \t.then();\n \t \n \t}\n\tgetClockData({\n\t\taction: 'timePunchInfo',\n\t\tUserId: sessionStorage.getItem('userId')\n\t});\n}", "function formatCourseTitle(currentState, currentInfo){\n //Only display custom course title card if there is enough information\n\n console.log(',', currentState);\n if(currentState >= 2){\n var courseTitleCardHTML =\n '<div id=\"cardTitle\">' +\n '<div class=\"courseAbbreviation\">' + currentInfo.courseAbbreviation + '</div>';\n if(currentState == 2)\n courseTitleCardHTML +=\n '<div class=\"courseName\">' + currentInfo.courseName + '</div>' +\n '<p class=\"message center\"></p>';\n if(currentState > 2){\n courseTitleCardHTML +=\n '<div class=\"courseProfessor\">' +\n (currentInfo.professorName.first? currentInfo.professorName.first[0] + '. ':'') +\n currentInfo.professorName.last +\n '</div>' +\n //Division Line\n //'<p class=\"message center\"></p>' +\n //Current Section Information\n '<div class=\"courseSection\">' +\n '<div class=\"sectionLetter\">' + currentInfo.sectionType + ' ' + currentInfo.sectionLetter + '</div>' +\n '<div class=\"changeSectionButton\" title=\"Change ' + currentInfo.sectionType + '\"><i class=\"fa fa-pencil-square-o\"></i></div>' +\n\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionDays\">' + currentInfo.sectionDays + '</div>' +\n\n '<div class=\"sectionTime\">' +\n currentInfo.sectionTimes.start.split(' ')[0] + '&nbsp; <i class=\"fa fa-long-arrow-right\"></i> &nbsp;' +\n currentInfo.sectionTimes.end +\n '</div>' +\n\n\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionLocation\">' + currentInfo.sectionLocation + '</div>' +\n\n '</div>';\n\n if(currentState == 3 && !currentInfo.finalSectionDate)\n courseTitleCardHTML += '<p class=\"message center\"></p>';\n }\n if(currentState > 3){\n courseTitleCardHTML +=\n '<div class=\"courseSection\">' +\n '<div class=\"sectionLetter\">' + currentInfo.subSectionType + ' ' + currentInfo.sectionLetter + currentInfo.sectionNumber + '</div>' +\n '<div class=\"changeSectionButton\" title=\"Change ' + currentInfo.subSectionType + '\"><i class=\"fa fa-pencil-square-o\"></i></div>' +\n\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionDays\">' + currentInfo.subSectionDays + '</div>' +\n\n '<div class=\"sectionTime\">' +\n currentInfo.subSectionTimes.start.split(' ')[0] + '&nbsp; <i class=\"fa fa-long-arrow-right\"></i> &nbsp;' +\n currentInfo.subSectionTimes.end +\n '</div>' +\n\n\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionLocation\">' + currentInfo.subSectionLocation + '</div>' +\n\n '</div>';\n }\n\n //If final information is already available\n if(currentInfo.finalSectionDate){\n courseTitleCardHTML +=\n '<div class=\"courseSection\">' +\n '<div class=\"sectionLetter\">' + currentInfo.finalSectionType + '</div>' +\n\n '<div class=\"sectionDate\">' + currentInfo.finalSectionDate + '</div>' +\n\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionDays\">' + currentInfo.finalSectionDay.substr(0,3) + '</div>' +\n\n '<div class=\"sectionTime\">' +\n currentInfo.finalSectionTimes.start.split(' ')[0] + '&nbsp; <i class=\"fa fa-long-arrow-right\"></i> &nbsp;' +\n currentInfo.finalSectionTimes.end +\n '</div>' +\n\n '<div style=\"clear:both;\"></div>' +\n\n '<div class=\"sectionLocation\">' + 'TBA' + '</div>' +\n\n '</div>';\n }\n\n courseTitleCardHTML += '</div>';\n\n jQuery('#currentlevel').after(courseTitleCardHTML);\n }\n}", "function addReport(){\r\n var text = \"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ac nisi eu elit rhoncus mattis dignissim vel sem. Donec bibendum augue velit, nec gravida turpis ornare eget. Mauris eu sapien bibendum, blandit risus at, pretium tellus. Donec volutpat non sem a efficitur. Curabitur turpis magna, elementum ac felis nec, congue finibus massa. Quisque laoreet tincidunt quam, sed mollis augue varius egestas. Curabitur quis sollicitudin diam, non tempus tortor. Nam condimentum arcu sed lacus rhoncus, id tincidunt lectus vehicula.\";\r\n var group = 1; //changeable\r\n \r\n //sample populator for report\r\n var ctr = 1;\r\n for(var i = 1; i < 10; i++,ctr++){\r\n if(ctr > 3){\r\n ctr = 1;\r\n }\r\n group = ctr;\r\n document.getElementById(\"report-container\").innerHTML +='<div data-toggle=\"modal\" data-target=\"#report-full\" class=\"card report-card mb-3 \" style=\"min-width:100%\"><div class=\"row no-gutters\"><div class=\"col\"><div class=\"card-body text-wrap\"><span class=\"badge badge-pill\" style=\"background-color:'+colors[group-1]+'\">Group '+ group+'</span><p class=\"text-truncate\">'+text+'</p></div></div></div></div>';\r\n }\r\n}", "function appendCalendarCard(summary, when, where, description) {\n document.getElementById(\"calandarCardTitle\").innerHTML = summary;\n formattedDate = formatDate(when);\n document.getElementById(\"calandarCardDate\").innerHTML = formattedDate;\n if (where != undefined) {\n document.getElementById(\"calandarCardLocation\").innerHTML = where;\n }\n if (description != undefined) {\n document.getElementById(\"calandarCarDescription\").innerHTML = description;\n }\n\n showPage();\n}", "function refreshStudentEvalResultView(){\n\t\t\n\t\tdocument.getElementById(\"student_side_list_pergrade\").innerHTML = \"\";\n\t}", "function enterReport(proj_name, proj_address, proj_city, proj_county, proj_state, proj_desc, bldg_size, proj_mgr, proj_sup, architect, civil_eng, mech_eng, elec_eng, plumb_eng, land_arch, int_design, sched_start, sched_compl, actual_start, actual_compl, sched_reason, init_budget, final_budget, budget_reason, sector, const_type, awards, proj_challenges, proj_strengths, UserId) {\n var UserId = currentUser.id;\n // function enterReport(pers_spir, pers_emot, pers_health, pers_pr_req) {\n $.post(\"/api/reportentry\", {\n proj_name: proj_name,\n proj_address: proj_address,\n proj_city: proj_city,\n proj_county: proj_county,\n proj_state: proj_state,\n proj_desc: proj_desc,\n bldg_size: bldg_size,\n proj_mgr: proj_mgr,\n proj_sup: proj_sup,\n architect: architect,\n civil_eng: civil_eng,\n mech_eng: mech_eng,\n elec_eng: elec_eng,\n plumb_eng: plumb_eng,\n land_arch: land_arch,\n int_design: int_design,\n sched_start: sched_start,\n sched_compl: sched_compl,\n actual_start: actual_start,\n actual_compl: actual_compl,\n sched_reason: sched_reason,\n init_budget: init_budget,\n final_budget: final_budget,\n budget_reason: budget_reason,\n sector: sector,\n const_type: const_type,\n awards: awards,\n proj_challenges: proj_challenges,\n proj_strengths: proj_strengths,\n UserId: UserId\n\n }).then(function (data) {\n console.log(\"abcde\")\n window.location.replace(data);\n // If there's an error, handle it by throwing up a bootstrap alert\n }).catch(handleLoginErr);\n }", "function showCourses()\n{\n var selected = this.departments.indexOf($(\"#department\").val());\n \n if ((0 <= selected) && (selected < this.pages.length))\n {\n // Creates a div containing the department page;\n // this makes it easier for jQuery to look through the page\n var page = this.pages[selected];\n var wrapper = document.createElement(\"div\");\n $(wrapper).html(page);\n \n // Clear the table body\n var tableBody = $(\"#course-list-table > tbody\");\n tableBody.html(\"\");\n \n $(\"tr\", wrapper).each(function()\n {\n columnIndex = 0;\n\t\t\tcrn = 0;\n\t\t\tname = \"\";\n\t\t\tsection = 0;\n title = \"\";\n credits = 0;\n instructor = \"\";\n seats = \"\";\n days = \"\";\n time = \"\";\n room = \"\";\n dates = \"\";\n columnCount = $(\"td\", $(this)).length;\n \n $(\"td\", $(this)).each(function()\n {\n// alert($(this).text());\n // Lectures -- Before Registration\n if (columnCount == 12)\n {\n switch (columnIndex)\n {\n case 1:\n crn = $(this).text();\n break;\n case 2:\n name = $(this).text();\n break;\n case 3:\n section = $(this).text();\n break;\n case 4:\n title = $(this).text();\n break;\n case 5:\n credits = $(this).text();\n break;\n case 6:\n instructor = $(this).text();\n break;\n case 7:\n seats = $(this).text();\n break;\n case 8:\n days = $(this).text();\n break;\n case 9:\n time = $(this).text();\n break;\n case 10:\n room = $(this).text();\n break;\n case 11:\n dates = $(this).text();\n break;\n }\n }\n // Labs -- Before Registration\n else if (columnCount == 11)\n {\n switch (columnIndex)\n {\n case 7:\n days = $(this).text();\n break;\n case 8:\n time = $(this).text();\n break;\n case 9:\n room = $(this).text();\n break;\n case 10:\n dates = $(this).text();\n break;\n }\n }\n \n // Lectures -- After Registration Begins\n if (columnCount == 14)\n {\n switch (columnIndex)\n {\n case 1:\n crn = $(this).text();\n break;\n case 2:\n name = $(this).text();\n break;\n case 3:\n section = $(this).text();\n break;\n case 4:\n title = $(this).text();\n break;\n case 5:\n credits = $(this).text();\n break;\n case 6:\n instructor = $(this).text();\n break;\n case 7:\n seats = $(this).text();\n break;\n case 10:\n days = $(this).text();\n break;\n case 11:\n time = $(this).text();\n break;\n case 12:\n room = $(this).text();\n break;\n case 13:\n dates = $(this).text();\n break;\n }\n }\n // Labs -- After Registration Begins\n else if (columnCount == 13)\n {\n switch (columnIndex)\n {\n case 9:\n days = $(this).text();\n break;\n case 10:\n time = $(this).text();\n break;\n case 11:\n room = $(this).text();\n break;\n case 12:\n dates = $(this).text();\n break;\n }\n }\n\n columnIndex++;\n });\n \n // Create a row in the table for this course\n var row = document.createElement(\"tr\");\n \n // Lectures\n if (crn != 0)\n {\n $(row).append(\"<td>\" + crn + \"</td>\");\n $(row).append(\"<td>\" + name + \"</td>\");\n $(row).append(\"<td>\" + section + \"</td>\");\n $(row).append(\"<td>\" + ((title.indexOf(\"Restriction:\") == -1) ?\n (title) :\n (title.substring(0, title.indexOf(\"Restriction\")) +\n \"<br />\" + title.substring(title.indexOf(\"Restriction\"))))+ \"</td>\");\n $(row).append(\"<td>\" + credits + \"</td>\");\n $(row).append(\"<td>\" + instructor + \"</td>\");\n $(row).append(\"<td>\" + seats + \"</td>\");\n $(row).append(\"<td>\" + days + \"</td>\");\n $(row).append(\"<td>\" + time + \"</td>\");\n $(row).append(\"<td>\" + room + \"</td>\");\n $(row).append(\"<td>\" + dates + \"</td>\");\n $(tableBody).append(row);\n }\n // Labs\n else if ((crn == 0) && (days.length > 0))\n {\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td></td>\");\n $(row).append(\"<td>\" + days + \"</td>\");\n $(row).append(\"<td>\" + time + \"</td>\");\n $(row).append(\"<td>\" + room + \"</td>\");\n $(row).append(\"<td>\" + dates + \"</td>\"); \n $(tableBody).append(row);\n }\n \n first = false;\n });\n }\n}", "function setFeesSubjects(){\r\n var schYear = $('#syEntered').val();\r\n var regexNoSpace = /^\\d{0,4}(\\-\\d{0,4})?$/;\r\n var schYearLength = schYear.length;\r\n var lastSchYearInput = schYear.substring(schYearLength-1,schYearLength);\r\n var gyl = $('#currentGYL').val();\r\n var dept = $('input[name=radioDepartment]:checked').val();\r\n var selectedGYL = \"\";\r\n if(dept === \"Elementary Dept.\"){\r\n selectedGYL = $('#grade').val();\r\n }else if(dept === \"High School Dept.\"){\r\n selectedGYL = $('#yrLevel').val();\r\n }else{\r\n selectedGYL = \"wa\";\r\n }\r\n \r\n if($('#studentId').html()===\"\" || $('#studentName').html()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Enter student ID on the search textbox!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else if($('#age').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter age!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#age').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if(!regexNoSpace.test(lastSchYearInput) || $('#syEntered').val()===\"\"){\r\n var resultSchYear = schYear.substring(0,schYearLength-1);\r\n $('#syEntered').val(resultSchYear);\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter school year correctly.\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#syEntered').css({border: '1px solid red'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if($('#genAverage').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter gen average!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#genAverage').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n\r\n }else if(selectedGYL === gyl){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;You are currently enrolled in \"+selectedGYL);\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else{\r\n $('#div-overlay-alert-msg').hide('blind',1000);\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n \r\n $('#radioFullPaymnt').removeAttr('disabled');\r\n $('#radioMonthlyPaymnt').removeAttr('disabled');\r\n $('#radioSemestralPaymnt').removeAttr('disabled');\r\n $('#age').attr('readonly','readonly');\r\n $('#syEntered').attr('readonly','readonly');\r\n $('#genAverage').attr('readonly','readonly');\r\n $('#yrLevel').attr('disabled','disabled');\r\n var category=\"\";\r\n if($('input[name=radioDepartment]:checked').val()===\"Elementary Dept.\"){\r\n category = $('#grade').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else if($('input[name=radioDepartment]:checked').val()===\"High School Dept.\"){\r\n category = $('#yrLevel').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else{\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please choose what department!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n disabledMode();\r\n $('#btn-sub-fees').removeAttr('disabled');\r\n }\r\n $('#category').html(category);\r\n }\r\n}", "function reporteeDevelopmentNeedListHTML(id, title, description, category, timeToCompleteBy, status){\n\tvar html = \" \\\n\t <div class='panel-group' id='dev-need-item-\"+id+\"'> \\\n\t <div class='panel panel-default' id='panel'> \\\n\t\t <input type='hidden' id='dev-need-status-\"+id+\"' value='\"+status+\"'> \\\n\t\t <input type='hidden' id='dev-need-category-id-\"+id+\"' value='\"+category+\"'> \\\n\t \t<div class='panel-heading'> \\\n\t \t<div class='row'> \\\n\t \t\t<div class='col-sm-6'> \\\n\t\t \t\t<div class='row'> \\\n\t\t\t \t\t<div class='col-sm-6' id='dev-need-no-\"+id+\"'><h6><b>#\"+id+\"</b></h6></div> \\\n\t\t\t \t\t<div class='col-sm-6' id='dev-need-date-\"+id+\"'><h6 class='pull-right'><b>\"+timeToCompleteBy+\"</b></h6></div> \\\n\t\t \t\t</div> \\\n\t\t \t\t<div class='row'> \\\n\t\t\t \t\t<div class='col-sm-12 wrap-text' id='dev-need-title-\"+id+\"'>\"+title+\"</div> \\\n\t\t \t\t</div> \\\n\t \t\t</div> \\\n\t \t\t<div class='col-sm-5 bs-wizard'> \\\n\t \t\t\t <div class='col-xs-4 bs-wizard-step complete' id='proposed-dev-need-dot-\"+id+\"'> \\\n\t\t\t\t\t\t <div class='text-center' id='test'><h6>Proposed</h6></div> \\\n\t\t\t\t\t\t <div class='bs-wizard-dot-start'></div> \\\n\t\t\t\t\t\t </div> \\\n\t\t\t\t\t\t <div class='col-xs-4 bs-wizard-step \"+ checkComplete(status, 1) +\"' id='started-dev-need-dot-\"+id+\"'> \\\n\t\t\t\t\t\t <div class='text-center'><h6>In-Progress</h6></div> \\\n\t\t\t\t\t\t <div class='progress'><div class='progress-bar'></div></div> \\\n\t\t\t\t\t\t <div class='bs-wizard-dot-start'></div> \\\n\t\t\t\t\t\t <div class='bs-wizard-dot-complete'></div> \\\n\t\t\t\t\t\t </div> \\\n\t\t\t\t\t\t <div class='col-xs-4 bs-wizard-step \"+ checkComplete(status, 2) +\"' id='complete-dev-need-dot-\"+id+\"'> \\\n\t\t\t\t\t\t <div class='text-center'><h6>Complete</h6></div> \\\n\t\t\t\t\t\t \t <div class='progress'><div class='progress-bar'></div></div> \\\n\t\t\t\t\t\t <div class='bs-wizard-dot-start'></div> \\\n\t\t\t\t\t\t <div class='bs-wizard-dot-complete'></div> \\\n\t\t\t\t\t\t </div> \\\n\t \t\t</div> \\\n\t \t\t<div class='col-sm-1 chev-height notUnderlined'> \\\n\t\t\t\t\t\t <a data-toggle='collapse' href='#collapse-dev-need-\"+id+\"' class='collapsed'></a> \\\n\t\t\t\t\t\t</div> \\\n\t \t</div> \\\n\t </div> \\\n\t <div id='collapse-dev-need-\"+id+\"' class='panel-collapse collapse'> \\\n\t <div class='panel-body'> \\\n\t <div class='row'> \\\n\t <div class='col-md-6'> \\\n\t <h5><b>Description</b></h5> \\\n\t </div> \\\n\t \t<div class='col-md-6' > \\\n\t \t<input type='hidden' id='dev-need-category-id-\"+id+\"' value='\" + category + \"'> \\\n\t\t <h6><b> Category: </b><span id='dev-need-category-\"+id+\"'>\" + categoryList[category] + \"</span></h6>\\\n\t\t </div> \\\n\t </div> \\\n\t <div class='row'> \\\n\t <div class='col-md-12 wrap-text'> \\\n\t <p id='dev-need-text-\"+id+\"'>\"+description+\"</p> \\\n\t </div> \\\n\t </div> \\\n\t </div> \\\n\t </div> \\\n\t \\\n\t </div> \\\n\t </div> \\\n\t \" \n return html;\n}", "function updateView(res){\n let user = res[0]\n const name = document.querySelector(\"#displayname\")\n const email = document.querySelector('#displayemail')\n const intro = document.querySelector('#displayintro')\n const table = document.querySelector('#coursetable')\n name.innerHTML = user.name + \" \" + \"<small>\" + \" \" + user.programs + \" \" + \"</small>\" + \"<small>\" + user.year + \" year student.\" +\"</small>\"\n email.innerText = user.email\n // program.innerText = user.programs\n // year.innerText = user.year\n intro.innerText = user.selfIntro\n addCourse(user, table)\n}", "function upLayout(){\n const monthHTML = document.querySelector('.month');\n const yearHTML = document.querySelector('.year');\n let monthString = '';\n if(month === 0){\n monthString = 'January';\n }else if(month === 1){\n monthString = 'February';\n }else if(month === 2){\n monthString = 'March';\n }else if(month === 3){\n monthString = 'April';\n }else if(month === 4){\n monthString = 'May';\n }else if(month === 5){\n monthString = 'June';\n }else if(month === 6){\n monthString = 'July';\n }else if(month === 7){\n monthString = 'August';\n }else if(month === 8){\n monthString = 'September';\n }else if(month === 9){\n monthString = 'October';\n }else if(month === 10){\n monthString = 'November';\n }else if(month === 11){\n monthString = 'December';\n }else{\n console.log('NOTWORKING');\n monthString = 'default';\n }\n monthHTML.innerHTML = monthString;\n yearHTML.innerHTML = year;\n }", "function makeGeneralPage(sprSheet,recentReleases,oldORPDetails) {\n var milestones=releaseList()\n var pendingInfo=oldORPDetails['pending'] //these are the items left to add to the new meeting agenda\n \n var genSheet=sprSheet.getSheetByName(\"General\") //get the right sheet\n genSheet.clear() //remove any content already there\n\n // generic header information\n var nRow=1\n nRow=addRows(genSheet,[{'cols' : ['Welcome to the CMSSW release meeting'], 'isBold':true, 'fontSize':18 }],nRow);\n nRow=addBlankRows(genSheet,{'nRows':2},nRow)\n nRow=addRows(genSheet,[{'cols' : ['General information'], 'isBold':true, 'fontSize':16 }],nRow);\n nRow=addRows(genSheet,[{'cols' : ['Viydo'], \n 'forms' : ['=HYPERLINK(\"http://vidyoportal.cern.ch/flex.html?roomdirect.html&key=uFVZiCsN6DIb\",\"(Vidyo: Weekly_Offline_Meetings room, Extension: 9226777)\")'],\n 'fontSize':14 }],nRow);\n nRow=addBlankRows(genSheet,{'nRows':2},nRow)\n\n nRow=addRows(genSheet,[{'cols' : ['General topics'], 'fontSize':14 }],nRow); \n\n //add in releases created since the last CMSSW release meeting - one per line\n //in case this is recreation of a meeting page, any descriptions are retained\n //via the existingReleases information from the old ORP (which is not old in this case) \n nRow=addRows(genSheet,[{'cols' : ['Recent releases'], 'fontSize':14 }],nRow);\n nRow=addRows(genSheet,[{'cols' : ['Release name','Date created','Primary purpose'], 'fontSize': 12}],nRow); \n var nRowReleaseStart=nRow //cache for where and how many releases there are - needed to create the existingReleases info next time\n var savedReleaseInfo=oldORPDetails['existingReleases']\n\n //See if there is some notes about the releases to save\n for ( var rel in recentReleases) {\n releaseComment=\"To fill in\"\n for ( var i in savedReleaseInfo) {\n if ( i == recentReleases[rel][0] ) {\n releaseComment=savedReleaseInfo[recentReleases[rel][0]]\n }\n }\n //add a link to the release notes\n nRow=addRows(genSheet,[{'cols' : ['',readableDate(extractDate(recentReleases[rel][1])),releaseComment],\n 'forms':['=HYPERLINK(\"https://github.com/cms-sw/cmssw/releases/'+recentReleases[rel][0]+'\",\"'+recentReleases[rel][0]+'\")' ]}],nRow);\n }\n nRow=addBlankRows(genSheet,{'nRows':1},nRow)\n\n //list of general items for discussion (or items that don't fit elsewhere\n nRow=addRows(genSheet,[{'cols' : ['General items for discussion'], 'fontSize':14 }],nRow);\n var genRowTop=nRow\n if ( (pendingInfo['general'] != null) && (pendingInfo['general'].length > 0 )){\n for ( var i in pendingInfo['general']) {\n if ( pendingInfo['general'][i][1].substr(0,1) == \"=\" ) { //watch for hyperlinks that need to be treated separately\n nRow=addRows(genSheet,[{'cols': [pendingInfo['general'][i][0],''],\n 'forms': ['',pendingInfo['general'][i][1]],\n 'isBold':false, 'fontSize':10}],nRow)\n }\n else{ //handle hyperlinks\n nRow=addRows(genSheet,[{'cols': pendingInfo['general'][i], 'isBold':false, 'fontSize':10}],nRow)\n }\n genSheet.getRange(nRow-1,2).setFontSize(8)\n }\n }\n \n \n var genRow=nRow //cache for later\n nRow=nRow+1 //not sure why I did this - it seems to be the same as adding a blank line\n \n nRow=addBlankRows(genSheet,{'nRows':1},nRow)\n \n var saveRows=[]\n // now loop over the active releases and add a stanza in the agenda for each one\n for ( var r in milestones) {\n var m=milestones[r]\n var savedRow=[m]\n nRow=addBlankRows(genSheet,{'nRows':1,'color':'blue'},nRow)\n nRow=addRows(genSheet,[{'cols' : [m], 'isBold':true, 'fontSize':16 }],nRow); //title row\n savedRow.push(nRow)\n nRow=addRows(genSheet,[{'cols' : ['Pending issues'], 'isBold':true, 'fontSize':12 }],nRow); //Pending issues\n \n //now add the pending issues - watch for hyperlinks and handle them separately\n if ( (pendingInfo[m] != null) && (pendingInfo[m].length > 0 )){\n for ( var i in pendingInfo[m]) {\n if ( pendingInfo[m][i][1].substr(0,1) == \"=\" ) {\n nRow=addRows(genSheet,[{'cols': [pendingInfo[m][i][0],''],\n 'forms': ['',pendingInfo[m][i][1]],\n 'isBold':false, 'fontSize':10}],nRow)\n }\n else{\n nRow=addRows(genSheet,[{'cols': pendingInfo[m][i], 'isBold':false, 'fontSize':10}],nRow)\n }\n genSheet.getRange(nRow-1,2).setFontSize(8)\n }\n }\n savedRow.push(nRow)\n\n // Stanza for new external package requests for discussion\n nRow=addRows(genSheet,[{'cols' : ['External package requests'], 'isBold':true, 'fontSize':12 }],nRow);\n savedRow.push(nRow)\n\n // Stanza for new CMSSW requests for discussion\n nRow=addRows(genSheet,[{'cols' : ['CMSSW requests'], 'isBold':true, 'fontSize':12 }],nRow);\n savedRow.push(nRow)\n nRow=nRow+1\n \n saveRows.push(savedRow)\n }\n nRow=addBlankRows(genSheet,{'nRows':1,'color':'blue'},nRow)\n\n //done with release-by-release section. Finish with AOB section\n nRow=addRows(genSheet,[{'cols' : ['AOB'], 'fontSize':14 }],nRow);\n var aobRow=nRow\n saveRows.push(['Misc info',aobRow,genRow,genRowTop,recentReleases.length+\" from \"+nRowReleaseStart])\n nRow=nRow+1//buildAOBMenu(genSheet,nRow)\n nRow=addBlankRows(genSheet,{'nRows':1},nRow)\n\n //Done - now format sheet\n var range=genSheet.getRange(nRow,1,saveRows.length,5)\n range.setValues(saveRows)\n genSheet.getRange(1,1,genSheet.getLastRow(),5).setWrap(true)\n \n genSheet.hideRows(nRow,saveRows.length)\n nRow=nRow+saveRows.length\n Logger.log('Total general rows'+nRow)\n\n //hardwired column widths \n var pixNums=[40,170,150,250,250]\n for ( var i=0; i<pixNums.length; i++) {\n genSheet.setColumnWidth(i+1,pixNums[i])\n }\n\n //trim off the extra rows and columns\n if ( genSheet.getMaxRows() > nRow) {\n genSheet.deleteRows(nRow,genSheet.getMaxRows()-(nRow-1))\n }\n if ( genSheet.getMaxColumns() > 5 ) {\n genSheet.deleteColumns(6,genSheet.getMaxColumns()-5)\n }\n \n //only \"I\" can edit this page\n var me = Session.getEffectiveUser();\n var protection = genSheet.protect().setDescription('Sample protected range');\n protection.addEditor(me);\n protection.removeEditors(protection.getEditors());\n if (protection.canDomainEdit()) {\n protection.setDomainEdit(false);\n }\n \n\n return genSheet \n}", "updateEvents() {\n\n // find all day squares\n var daySquares = C('day-square');\n\n // find all events happening this month in this.events\n var monthEvents = this.events[`${this.year}`][this.month];\n\n // find all of the keys in monthEvents (string values for all dates with events)\n var monthKeys = Object.keys(monthEvents);\n\n // hides all of the exclamation icons\n for (var i = 0; i < daySquares.length; i++) {\n daySquares[i].children[1].children[0].classList.add('hidden');\n }\n\n // loops through each key/date\n monthKeys.forEach( key => {\n\n // get all classes happening on this date\n var classes = Object.keys(monthEvents[`${key}`]);\n\n // parse the date into an int\n var date = parseInt(monthKeys);\n\n // opens the .day-assignment-content of the dateSquare for the day\n var dayContent = daySquares[this.monthInfo.firstDayOfWeek + date - 1].children[1];\n\n // declares a variable to hold HTML\n var contents = '';\n \n // shows the exclamation icon for the date\n dayContent.children[0].classList.remove('hidden');\n\n // loops through each event and appends relevant data to contents\n classes.forEach( cl => {\n \n contents += `<h4>${cl}</h4>`;\n\n var assignments = monthEvents[`${key}`][`${cl}`];\n\n var assignmentsList = '';\n\n assignments.forEach( a => {\n\n contents += `<li><p>${a[\"assignment-name\"]} Due ${new Date(a[\"due-date\"]).toLocaleString()}</p></li>`;\n\n });\n\n if (assignmentsList.length != 0)\n contents += `<ul>${assignmentsList}</ul>`;\n\n });\n\n // adds contents to the html of dayContent\n dayContent.children[1].innerHTML = contents;\n\n });\n \n }", "function updateReport(event) {\n \n cleanReport();\n \n // If the arrows where clicked, than update the arrows' timestamp\n updateTimeSpan(event);\n \n // extract report query from the DOM\n var reportQ = getReportQueryFromControlPanel();\n \n // write time span in human readable way\n var titleFrom = moment.unix(reportQ.start).format('YY MM DD HH:mm');\n var titleTo = moment.unix(reportQ.end).format('YY MM DD HH:mm');\n var verbalTimeSpanFormat = $(\"[name='radio-span']:checked\").data('verbal-format');\n var humanReadableTimespan = moment.unix(reportQ.end).format(verbalTimeSpanFormat);\n $('#report-title').html( /*titleFrom + '</br>' +*/ humanReadableTimespan /*+ '</br>' + titleTo*/ );\n\n // query data and update report\n getDataAndPopulateReport(reportQ);\n}", "function displayHTML(){\n\t\tdom.name.innerHTML = \"1. Name: \"+studentArray[position].name;\n\t\tdom.address.innerHTML = \"2. Address: \"+studentArray[position].street+\n\t\t\", \"+studentArray[position].city+\n\t\t\", \"+studentArray[position].state;\n\t\tdom.grades.innerHTML = \"3. Grades: \"+studentArray[position].grades;\n\t\tdom.date.innerHTML = \"4. Date: \"+studentArray[position].getDate();\n\t\tdom.gpaAvg.innerHTML = \"5. Average GPA: \"+studentArray[position].getAverage(studentArray[position].grades).toFixed(2);\n\t}//close displayHTML function", "function renderFinalPage() {\n console.log(\"final page\");\n $('.js-content').html(`\n <div class='col-12'>\n <div class='ans_box al_center qna_text'>\n ${getFinalReportHtml()}\n <div class='content'>\n <button class='js-restart'>Play Again</button>\n </div>\n </div>\n <div class='al_center content'>\n <img class='logo' src='http://cfile25.uf.tistory.com/original/197D2E244B84D8564AB57C'>\n </div>\n </div>`); \n}", "function mainSection() {\n\n var formattedCommencementDate = '';\n var formattedExpiryDate = '';\n var formattedUltimateExpiryDate = '';\n var formattedBusinessStartDate = '';\n\n dateListedForSale = format.format({\n value: dateListedForSale,\n type: format.Type.DATE\n });\n var dateListedForSaleArray = dateListedForSale.split('/');\n if (dateListedForSaleArray[1] < 10) {\n dateListedForSaleArray[1] = '0' + dateListedForSaleArray[1];\n }\n if (dateListedForSaleArray[0] < 10) {\n dateListedForSaleArray[0] = '0' + dateListedForSaleArray[0];\n }\n var formattedDateListedForSale = dateListedForSaleArray[2] + '-' +\n dateListedForSaleArray[1] +\n '-' + dateListedForSaleArray[0];\n\n if (!isNullorEmpty(commencementDate)) {\n commencementDate = format.format({\n value: commencementDate,\n type: format.Type.DATE\n });\n\n var commencementDateArray = commencementDate.split('/');\n if (commencementDateArray[1] < 10) {\n commencementDateArray[1] = '0' + commencementDateArray[1];\n }\n if (commencementDateArray[0] < 10) {\n commencementDateArray[0] = '0' + commencementDateArray[0];\n }\n var formattedCommencementDate = commencementDateArray[2] + '-' +\n commencementDateArray[1] +\n '-' + commencementDateArray[0];\n }\n\n if (!isNullorEmpty(expiryDate)) {\n expiryDate = format.format({\n value: expiryDate,\n type: format.Type.DATE\n });\n var expiryDateArray = expiryDate.split('/');\n if (expiryDateArray[1] < 10) {\n expiryDateArray[1] = '0' + expiryDateArray[1];\n }\n if (expiryDateArray[0] < 10) {\n expiryDateArray[0] = '0' + expiryDateArray[0];\n }\n var formattedExpiryDate = expiryDateArray[2] + '-' +\n expiryDateArray[1] +\n '-' + expiryDateArray[0];\n }\n\n if (!isNullorEmpty(ultimateExpiryDate)) {\n ultimateExpiryDate = format.format({\n value: ultimateExpiryDate,\n type: format.Type.DATE\n });\n var ultimateExpiryDateArray = ultimateExpiryDate.split('/');\n if (ultimateExpiryDateArray[1] < 10) {\n ultimateExpiryDateArray[1] = '0' + ultimateExpiryDateArray[1];\n }\n if (ultimateExpiryDateArray[0] < 10) {\n ultimateExpiryDateArray[0] = '0' + ultimateExpiryDateArray[0];\n }\n var formattedUltimateExpiryDate = ultimateExpiryDateArray[2] + '-' +\n ultimateExpiryDateArray[1] +\n '-' + ultimateExpiryDateArray[0];\n }\n if (!isNullorEmpty(businessStartDate)) {\n businessStartDate = format.format({\n value: businessStartDate,\n type: format.Type.DATE\n });\n var businessStartDateArray = businessStartDate.split('/');\n if (businessStartDateArray[1] < 10) {\n businessStartDateArray[1] = '0' + businessStartDateArray[1];\n }\n if (businessStartDateArray[0] < 10) {\n businessStartDateArray[0] = '0' + businessStartDateArray[0];\n }\n var formattedBusinessStartDate = businessStartDateArray[2] + '-' +\n businessStartDateArray[1] +\n '-' + businessStartDateArray[0];\n }\n\n\n var inlineHtml =\n '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-12 heading1\"><h4><span class=\"label label-default col-xs-12\" style=\"background-color: #103D39;\">MAIN DETAILS</span></h4></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">TRADING ENTITY <span class=\"mandatory\">*</span></span><input id=\"tradingEntity\" class=\"form-control tradingEntity\" value=\"' +\n tradingEntity + '\" readonly/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">MAIN CONTACT <span class=\"mandatory\">*</span></span><input id=\"mainContact\" class=\"form-control mainContact\" value=\"' +\n mainContact + '\" readonly/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">MOBILE NUMBER <span class=\"mandatory\">*</span></span><input id=\"contactNumber\" class=\"form-control contactNumber\" value=\"' +\n contactNumber + '\" readonly/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">EMAIL<span class=\"mandatory\">*</span></span><input id=\"email\" class=\"form-control email\" value=\"' +\n email + '\" readonly/></div></div>';\n\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">ABN <span class=\"mandatory\">*</span></span><input id=\"abn\" class=\"form-control abn\" value=\"' +\n abn + '\" readonly/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">DATE LISTED FOR SALE <span class=\"mandatory\">*</span></span><input id=\"dateListedForSale\" class=\"form-control dateListedForSale\" type=\"date\" value=\"' +\n formattedDateListedForSale + '\" readonly/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-12 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">ADDRESS<span class=\"mandatory\">*</span></span><textarea id=\"address\" class=\"form-control address\" style=\"height: 125px\" readonly/>' +\n address + '</textarea></div></div>';\n\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">COMMENCEMENT DATE <span class=\"mandatory\">*</span></span><input id=\"commencementDate\" class=\"form-control commencementDate\" type=\"date\" value=\"' +\n formattedCommencementDate + '\" readonly/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">EXPIRY DATE <span class=\"mandatory\">*</span></span><input id=\"expiryDate\" class=\"form-control expiryDate\" type=\"date\" value=\"' +\n formattedExpiryDate + '\" readonly/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">ULTIMATE EXPIRY DATE <span class=\"mandatory\">*</span></span><input id=\"ultimateExpiryDate\" class=\"form-control ultimateExpiryDate\" type=\"date\" value=\"' +\n formattedUltimateExpiryDate + '\" readonly/></div></div>';\n\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-3 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">UNLIMTED TERM OFFER<span class=\"mandatory\">*</span></span><select id=\"unlimitedTermOffer\" class=\"form-control unlimitedTermOffer\" readonly>';\n if (unlimitedTermOffer == 1) {\n inlineHtml += '<option value=\"1\" selected>Yes</option>';\n } else {\n inlineHtml += '<option value=\"2\">No</option>';\n }\n inlineHtml += '</select></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n\n\n if (!isNullorEmpty(deedOfVariation) || deedOfVariationUploaded == 1) {\n\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">UNLIMTED TERM OFFER<span class=\"mandatory\">*</span></span><select id=\"unlimitedTermOffer\" class=\"form-control unlimitedTermOffer\" readonly>';\n if (unlimitedTermOffer == 1) {\n inlineHtml += '<option value=\"1\" selected>Yes</option>';\n } else {\n inlineHtml += '<option value=\"2\">No</option>';\n }\n inlineHtml += '</select></div></div>';\n if (unlimitedTermOffer == 1) {\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">UNLIMITED TERM FEE ($) <span class=\"mandatory\">*</span></span><input id=\"unlimitedTermFee\" class=\"form-control unlimitedTermFee\" value=\"25000\" readonly/></div></div>';\n } else {\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">UNLIMITED TERM FEE ($) <span class=\"mandatory\">*</span></span><input id=\"unlimitedTermFee\" class=\"form-control unlimitedTermFee\" value=\"0\" readonly/></div></div>';\n }\n\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">RENEWAL TERMS (YEARS) <span class=\"mandatory\">*</span></span><input id=\"renewalTerms\" class=\"form-control renewalTerms\" value=\"' +\n renewalTerms + '\" readonly/></div></div>';\n\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n if (!isNullorEmpty(deedOfVariation)) {\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n var fileObj = file.load({\n id: deedOfVariation\n });\n var fullURL = baseURL + fileObj.url;\n inlineHtml +=\n '<div class=\"col-xs-2\"></div>';\n inlineHtml +=\n '<div class=\"col-xs-8\" style=\"text-align: center;\"><iframe id=\"viewer\" frameborder=\"0\" scrolling=\"no\" width=\"400\" height=\"600\" src=\"' +\n fullURL + '\"></iframe></div>';\n inlineHtml +=\n '<div class=\"col-xs-2\"></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n }\n\n inlineHtml +=\n '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-12 heading1\"><h4><span class=\"label label-default col-xs-12\" style=\"background-color: #103D39;\">PRESALES DETAILS</span></h4></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n if (unlimitedTermOffer == 1) {\n inlineHtml +=\n '<div class=\"col-xs-12 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">TERM ON FRANCHISEE IM <span class=\"mandatory\">*</span></span><input id=\"termOnIM\" class=\"form-control termOnIM\" value=\"Unlimited\" readonly/></div></div>';\n } else {\n inlineHtml +=\n '<div class=\"col-xs-12 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">TERM ON FRANCHISEE IM <span class=\"mandatory\">*</span></span><input id=\"termOnIM\" class=\"form-control termOnIM\" value=\"' +\n termOnIM + '\" /></div></div>';\n }\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">DATE BUSINESS STARTED <span class=\"mandatory\">*</span></span><input id=\"businessStartDate\" class=\"form-control businessStartDate\" type=\"date\" value=\"' +\n formattedBusinessStartDate + '\"/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">TOTAL DAILY RUN TIME <span class=\"mandatory\">*</span></span><input id=\"dailyRunTime\" class=\"form-control dailyRunTime\" value=\"' +\n dailyRunTime + '\"/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">LOW PRICE ($) <span class=\"mandatory\">*</span></span><input id=\"lowPrice\" class=\"form-control lowPrice\" value=\"' +\n lowPrice + '\"/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">HIGH PRICE ($) <span class=\"mandatory\">*</span></span><input id=\"highPrice\" class=\"form-control highPrice\" value=\"' +\n highPrice + '\"/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">SERVICE REVENUE ($) <span class=\"mandatory\">*</span></span><input id=\"serviceRevenue\" class=\"form-control serviceRevenue\" value=\"' +\n serviceRevenue + '\"/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">YEAR<span class=\"mandatory\">*</span></span><input id=\"serviceRevenueYear\" class=\"form-control serviceRevenueYear\" value=\"' +\n serviceRevenueYear + '\"/></div></div>';\n\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">MPEX COMMISSION ($) <span class=\"mandatory\">*</span></span><input id=\"mpexRevenue\" class=\"form-control mpexRevenue\" value=\"' +\n mpexRevenue + '\"/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">YEAR<span class=\"mandatory\">*</span></span><input id=\"mpexRevenueYear\" class=\"form-control mpexRevenueYear\" value=\"' +\n mpexRevenueYear + '\"/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">SENDLE COMMISSION ($) <span class=\"mandatory\">*</span></span><input id=\"sendleRevenue\" class=\"form-control sendleRevenue\" value=\"' +\n sendleRevenue + '\"/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-6 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">YEAR<span class=\"mandatory\">*</span></span><input id=\"sendleRevenueYear\" class=\"form-control sendleRevenueYear\" value=\"' +\n sendleRevenueYear + '\"/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">SALES COMMISSION (%) <span class=\"mandatory\">*</span></span><input id=\"salesCommission\" class=\"form-control salesCommission\" value=\"' +\n salesCommission + '\"/></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">NAB ACCREDITATION<span class=\"mandatory\">*</span></span><select id=\"nabAccreditation\" class=\"form-control nabAccreditation\">';\n if (isNullorEmpty(nabAccreditation) || nabAccreditation == 2) {\n inlineHtml +=\n '<option value=\"1\" >Yes</option><option value=\"2\" selected>No</option>';\n\n } else {\n inlineHtml +=\n '<option value=\"1\" selected>Yes</option><option value=\"2\">No</option>';\n\n }\n\n inlineHtml += '</select></div></div>';\n inlineHtml +=\n '<div class=\"col-xs-4 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">NAB ACCREDITATION FEE ($) <span class=\"mandatory\">*</span></span><input id=\"nabAccreditationFee\" class=\"form-control nabAccreditationFee\" value=\"' +\n nabAccreditationFee + '\"/></div></div>';\n\n inlineHtml += '</div></div>';\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n inlineHtml +=\n '<div class=\"col-xs-12 name_section\"><div class=\"input-group\"><span class=\"input-group-addon\">SALE PRICE<span class=\"mandatory\">*</span></span><input id=\"finalPurchasePrice\" class=\"form-control finalPurchasePrice\" value=\"' +\n finalPurchasePrice + '\"/></div></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n\n if (!isNullorEmpty(territoryMapDoc)) {\n inlineHtml += '<div class=\"form-group container\">';\n inlineHtml += '<div class=\"row\">';\n var fileObj2 = file.load({\n id: territoryMapDoc\n });\n var fullURL = baseURL + fileObj2.url;\n inlineHtml +=\n '<div class=\"col-xs-2\"></div>';\n inlineHtml +=\n '<div class=\"col-xs-8\" style=\"text-align: center;\"><iframe id=\"viewer\" frameborder=\"0\" scrolling=\"no\" width=\"400\" height=\"600\" src=\"' +\n fullURL + '\"></iframe></div>';\n inlineHtml +=\n '<div class=\"col-xs-2\"></div>';\n inlineHtml += '</div>';\n inlineHtml += '</div>';\n }\n }\n\n return inlineHtml\n\n }", "function updateStudentList() {\n for (var list = 0; list < student_array.length; list++) {\n $(\"#tableBody\").empty();\n }\n /**\n * addStudentToDom - take in a student object, create html elements from the values and then append the elements\n * into the .student_list tbody\n * @param studentObj\n */\n\n /**\n * reset - resets the application to initial state. Global variables reset, DOM get reset to initial load state\n */\n\n /**\n * set global variables to 0\n */\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 };\n reset();\n}", "function getStudentInfo () {\n\t//get the currentProblemIndex\n\tcurrentProblemIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].currentproblemindex;\n\tif (currentProblemIndex == undefined) {\n\t\tcurrentProblemIndex == 0;\n\t\tMeteor.call('updateStudentModel', 'currentproblemindex', 0);\n\t}\n\n\t//get the partialProblems\n\tpartialProblems = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproblems;\n\tif (partialProblems == undefined) {\n\t\tmakeProblems();\n\t\tMeteor.call('updateStudentModel', 'partialproblems', partialProblems);\n\t}\n\n\t//get the currentProblem\n\tcurrentProblem = partialProblems[currentProblemIndex];\n\n\t//get the partialproofcolor\n\tcolorIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproofcolor;\n\tif (colorIndex == undefined) {\n\t\tcolorIndex = 0;\n\t\tMeteor.call('updateStudentModel', 'partialproofcolor', 0);\n\t}\n\tdocument.getElementById('colorSelectPartial').selectedIndex = colorIndex;\n\tvar currentdragcolorname = colorSchemes[colorIndex].dragcolorname;\n\tvar currentdropcolorname = colorSchemes[colorIndex].dropcolorname;\n\tvar currentrulecolorname = colorSchemes[colorIndex].rulecolorname;\n\tchangeColors(colorSchemes[colorIndex]);\n\tvar currenthtml = $('#ruleInstructionsPartial').html();\n\tvar newhtml = currenthtml.replace(currentdragcolorname, colorSchemes[colorIndex].dragcolorname);\n\tnewhtml = newhtml.replace(currentdropcolorname, colorSchemes[colorIndex].dropcolorname);\n\tnewhtml = newhtml.replace(currentrulecolorname, colorSchemes[colorIndex].rulecolorname)\n\t$('#ruleInstructionsPartial').html(newhtml);\n}", "function renderGrades(){\n // Get subject from standardID.\n standardSubjectID = _.find(_.find(standards, function(standard){\n return standard.id === OC.editor.lwOptions['standardID'];\n }).subjects, function(subject) { return subject.title === OC.editor.lwOptions['subject']; }).id;\n\n // Find the subject title in the standards list.\n $.get('/resources/api/get-child-categories/' + standardSubjectID + '/',\n function(response){\n if (response.status == 'true'){\n var list = response.categories,\n i,\n gradeList = $('.lesson-wizard-grade-level-list');\n for (i = 0; i < list.length; i++){\n gradeList.append($('<li/>', {\n 'class': 'lesson-wizard-grade-level-list-item',\n 'id': list[i].id,\n 'text': list[i].title,\n }));\n }\n // Handle clicks for grade & topic.\n $('.lesson-wizard-grade-level-list-item').click(\n gradeTopicClickHandler);\n }\n else {\n OC.popup(response.message, response.title);\n }\n\n },\n 'json');\n }", "function updateOutcomes(outcomes, year) {\n // code for graphs\n\n// \n\n //code for cards\n d3.select('#outcome-row-card-header-percent').html\n (`<h4>${year}</h4>`);\n d3.select('#percent-ph-text').html(`<h1 class ='h1-card'> ${outcomes.percentPHyear}%</h1>\n <p>Of program enrollees had permanent housing upon program exit</p>`); \n \n d3.select('#outcome-row-card-header-avg').html\n (`<h4>${year}</h4>`);\n d3.select('#avg-ph-text').html(`<h1 class='h1-card'> ${outcomes.avgTimeToPH} days</h1>\n <p>Average time from initial shelter/transitional housing to permanent housing</p>`); \n}", "function DisplaySchedule()\n{\nHTMLCode = \"<table cellspacing=0 cellpadding=3 border=3 bgcolor=purple bordercolor=#000033>\";\nQueryDay = DefDateDay(QueryYear,QueryMonth,QueryDate);\nWeekRef = DefWeekNum(QueryDate);\nWeekOne = DefWeekNum(1);\nHTMLCode += \"<tr align=center><td colspan=8 class=Titre><b>\" + MonthsList[QueryMonth] + \" \" + QueryYear + \"</b></td></tr><tr align=center>\";\n\nfor (s=1; s<8; s++)\n{\nif (QueryDay == s) { HTMLCode += \"<td><b><font color=#ff0000>\" + DaysList[s] + \"</font></b></td>\"; }\nelse { HTMLCode += \"<td><b>\" + DaysList[s] + \"</b></td>\"; }\n}\n\nHTMLCode += \"<td><b><font color=#888888>Sem</font></b></td></tr>\";\na = 0;\n\nfor (i=(1-DefDateDay(QueryYear,QueryMonth,1)); i<MonthLength[QueryMonth]; i++)\n{\nHTMLCode += \"<tr align=center>\";\nfor (j=1; j<8; j++)\n{\nif ((i+j) <= 0) { HTMLCode += \"<td>&nbsp;</td>\"; }\nelse if ((i+j) == QueryDate) { HTMLCode += \"<td><b><font color=#ff0000>\" + (i+j) + \"</font></b></td>\"; }\nelse if ((i+j) > MonthLength[QueryMonth]) { HTMLCode += \"<td>&nbsp;</td>\"; }\nelse { HTMLCode += \"<td>\" + (i+j) + \"</td>\"; }\n}\n\nif ((WeekOne+a) == WeekRef) { HTMLCode += \"<td><b><font color=#00aa00>\" + WeekRef + \"</font></b></td>\"; }\nelse { HTMLCode += \"<td><font color=#888888>\" + (WeekOne+a) + \"</font></td>\"; }\nHTMLCode += \"</tr>\";\na++;\ni = i + 6;\n}\n\nCalendrier.innerHTML = HTMLCode + \"</table>\";\n}", "function doneAssessmentModeFP(){\r\n var status = \"enrolled\";\r\n var transaction = getTransactionNo();\r\n var enrollmentNo = getEnrollmentNo();\r\n var studentNo = getStudentId();\r\n var name = $('#studentName').html();\r\n var department = $('input[name=radioDepartment]:checked').val();\r\n var age = $('#age').val();\r\n var schoolYear = $('#syEntered').val();\r\n var grade = $('#grade').val();\r\n var yrLevel = $('#yrLevel').val();\r\n var genAverage = $('#genAverage').val();\r\n \r\n var gy = \"\";\r\n $('#small-studNum').html(studentNo);\r\n $('#small-name').html(name);\r\n $('#small-department').html(department);\r\n $('#small-age').html(age);\r\n $('#small-schYear').html(schoolYear);\r\n if(department===\"Elementary Dept.\"){\r\n $('#for-grade').show();\r\n $('#small-grade').show();\r\n $('#for-yearLevel').hide();\r\n $('#small-yrLevel').hide();\r\n $('#small-grade').html(grade);\r\n gy = $('#small-grade').html();\r\n }else if(department===\"High School Dept.\"){\r\n $('#for-yearLevel').show();\r\n $('#small-yrLevel').show();\r\n $('#for-grade').hide();\r\n $('#small-grade').hide();\r\n $('#small-yrLevel').html(yrLevel);\r\n gy = $('#small-yrLevel').html();\r\n }\r\n $('#small-generalAve').html(genAverage);\r\n \r\n \r\n\r\n var obj = {\"transactionNo\": transaction,\"enrollmentNo\": enrollmentNo,\"studentNum\": studentNo,\"schYear\": schoolYear,\"gy\": gy,\"status\": status, \"age\": age};\r\n\r\n $('#dialog-confirm-done-MS-assessment').dialog({\r\n resizable: false,\r\n modal: true,\r\n buttons:{\r\n Yes:function(){\r\n $.ajax({\r\n type: 'POST',\r\n url: '../process/doneAssessmentModeFP.php',\r\n data: obj,\r\n success: function(data){\r\n $('#div-alert-success').html(\"<i class='icon-check'></i>&nbsp;&nbsp;Assessment successfully created..\");\r\n $('#div-alert-success').show('blind',1000);\r\n clearFPTotalAmount();\r\n clearFPCPayment();\r\n clearMSTotalAmount();\r\n clearMSCPayment();\r\n $('#searchStudId').val(\"\");\r\n $('#studentId').html(\"\");\r\n $('#studentName').html(\"\");\r\n $('#age').val(\"\");\r\n $('#syEntered').val(\"\");\r\n $('#genAverage').val(\"\");\r\n $('#recentBal').val(\"\");\r\n $('input[name=radioPaymnt]').attr('disabled','disabled');\r\n $('#btn-sub-back').removeAttr('disabled');\r\n $('#btn-sub-next').removeAttr('disabled');\r\n $('#cashAmount').removeAttr('readonly');\r\n $('#cashAmount').val(\"\");\r\n $('#cashAmountF').removeAttr('readonly');\r\n $('#cashAmountF').val(\"\");\r\n setEnabledBT();\r\n hideSubjectsForm();\r\n hideMSPaymentFormTF();\r\n hideFullPaymentFormTF();\r\n setEnrollmentNo();\r\n setTransactionNo();\r\n\r\n $('input[name=radioPaymnt]').prop('checked', false);\r\n $('input[name=radioDepartment]').prop('checked', false);\r\n //renewAllData();\r\n },\r\n error: function(data){\r\n alert(\"error in processing assessment=>\"+data);\r\n }\r\n });\r\n $(this).dialog(\"close\");\r\n },\r\n No:function(){\r\n $('#btn-cancel-assmnt').removeAttr('disabled');\r\n $(this).dialog(\"close\");\r\n }\r\n }\r\n });\r\n \r\n}", "updated() {\n\t\tthis.wizard = this.shadowRoot.getElementById('wizard');\n\t\tthis.selectDataSet = this.shadowRoot.getElementById('select-data-set');\n\t\tthis.configureSchedule = this.shadowRoot.getElementById('configure-schedule');\n\t\tthis.deliveryMethod = this.shadowRoot.getElementById('delivery-method');\n\t}", "function htmlIntro() {\n \n document.writeln(\"<div class = title>Prescriber Portal</div>\");\n document.writeln(\"<div class = subtitle>Created By: GunaCode </div>\");\n /* game rules and examples */\n //button\n document.writeln(\"<button type=\\\"button\\\" class=\\\"collapsible\\\">\" + gameHeader[0] + \"</button>\")\n \n //content\n document.writeln(\"<div class=\\\"content\\\">\");\n htmlDescript(0);\n document.writeln(\"</div>\");\n \n /* header for game setup */\n //button\n document.writeln(\"<button type=\\\"button\\\" class=\\\"collapsible\\\">\" + gameHeader[1] + \"</button>\")\n // document.writeln(\"<canvas id=\\\"myChart\\\" style=\\\"width:100%;max-width:700px\\\"></canvas>\");\n // document.writeln(\"<p>\"+displayValue+\"</p>\");\n // makeChart();\n // document.writeln(\"<p>\"+displayValue+\"</p>\");\n // document.writeln(\"<p>\"+printValue+\"</p>\");\n \n \n \n //content\n document.writeln(\"<div class=\\\"content\\\">\");\n htmlDescript(1);\n document.writeln(\"</div>\");\n \n //header for game\n //htmlHeaders(2);\n collapsibleStyling();\n \n }", "async function updatePreview() {\r\n\t\tlet cards = ownerDocument.getElementById(\"cardbookPrintContent\").getAttribute(\"cards\");\r\n\t\tcardbookPrint.buildHTML(PrintEventHandler.printPreviewEl.querySelector(\"browser\").contentDocument,\r\n\t\t\t\t\t\t\t\t\t\t\t\tcards,\r\n\t\t\t\t\t\t\t\t\t\t\t\t{ headers: document.getElementById(\"displayHeadersCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfieldNames: document.getElementById(\"displayFieldNamesCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfn: document.getElementById(\"displayCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tpersonal: document.getElementById(\"personalCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\torg: document.getElementById(\"orgCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcustom: document.getElementById(\"customCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tcategories: document.getElementById(\"categoriesCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tadr: document.getElementById(\"adrCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\ttel: document.getElementById(\"telCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\temail: document.getElementById(\"emailCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\timpp: document.getElementById(\"imppCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\turl: document.getElementById(\"urlCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent: document.getElementById(\"eventCheckBox\").checked,\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tnote: document.getElementById(\"noteCheckBox\").checked } );\r\n\t\tPrintEventHandler._updatePrintPreview();\r\n\t}", "function createPage() {\r\n\r\n clearSection(setPoolSize);\r\n clearSection(setPlayerNames);\r\n clearSection(setRatings);\r\n clearSection(playerPool);\r\n clearSection(generator);\r\n clearSection(prepTeam);\r\n\r\n homeTeam.className = \"col card bg-light border-dark\";\r\n awayTeam.className = \"col card bg-light border-dark\";\r\n \r\n populateSection(homeTeam, \"H3\", \"Home Team\");\r\n home.forEach((home)=>populateSection(homeTeam, \"P\", home.getName() + \" / \" + home.getRating() ));\r\n populateSection(homeTeam, \"H4\", \"Rating: \" + homeScore)\r\n \r\n populateSection(awayTeam, \"H3\", \"Away Team\");\r\n away.forEach((away)=>populateSection(awayTeam, \"P\", away.getName() + \" / \" + away.getRating() ));\r\n populateSection(awayTeam, \"H4\", \"Rating: \" + awayScore);\r\n\r\n reset.focus();\r\n }", "setSemester(aSemester) {\n this.semester = aSemester;\n }", "function writeJuicerToDom() {\r\n refreshValues();\r\n document.getElementById(\"juicer-owned\").innerHTML = juicerOwned + \" clicker upgrades owned\";\r\n document.getElementById(\"juicer-upgrades-owned\").innerHTML = juicerUpgradeOwnded + \" upgrades owned\";\r\n}", "renderSemester(sem, index){\n if(sem.name !== \"\") {\n return (\n <Grid className='Semester' key = {index} centered padded>\n <Header as='h3' style={{marginTop: 0.5 + \"em\", marginBottom: 0}}>\n {sem.name}\n </Header>\n <Grid.Row>\n {sem.Lvas.map((lva, index) => (\n this.renderSingleLVA(lva, index)\n ))}\n </Grid.Row>\n </Grid>\n )\n }\n }", "function handleReportDOMUpdate(data){\n\n const updateDOMStructure = `\n <div class=\"report\" id =\"entryHolder\">\n <div class=\"left-side\">\n <h3>weather report</h3>\n <ul class=\"report-item\">\n <li>city: <span>${data.city}</span></li>\n <li>weather state: <span>${data.weatherState}</span></li>\n <li id=\"temp\">temperatrue: <span>${data.temp}&deg;C</span></li>\n <li id=\"content\">your feeling: <span>${data.userFeel}</span></li>\n </ul>\n </div>\n <div class=\"right-side\">\n <img src=\"http://openweathermap.org/img/w/${data.weatherIcon}.png\" alt=\"weather icon\">\n </div>\n <span id=\"date\">${data.currentTime}</span>\n</div>\n `\n document.getElementById('createArea').innerHTML = updateDOMStructure;\n}", "function doSummary() {\n if (userType == \"EXT\") {\n $(\"#merchAccts\").val($(\"#merchAccts\").val());\n }\n else {\n validateSummary4INT();\n $(\"#merchAccts\").val();\n }\n\n // cacheSearchValues();\n\n $.blockUI({\n message: PROCESSING,\n overlayCSS: {backgroundColor: '#E5F3FF'}\n });\n\n $(\"#reportForm\").attr(\"action\", \"summaryReport.htm\");\n $(\"#reportForm\").submit();\n}", "fillSemesters(){\n let semesters = this.state.plan.semesters;\n let semesterBoxes = [];\n for (let i = 0; i < semesters.length; i++) {\n semesterBoxes.push(<Semester key={i} callback={this.updateEditor} plan={this.state.plan} editMode={true}\n semesterIndex={i} semester={semesters[i]}\n scheduleConflict={semesters[i].schedule_conflict}\n courseList={this.state.courseList}/>)\n }\n\n return semesterBoxes;\n }", "function updateContent(transport) {\n var subtab = false;\n var sampleIdList = null;\n var sampleNameList = null;\n var skillModelsNotCachedList = null;\n var cachedFileStatusList = null;\n var samplesThatRequireCachingList = null;\n\n if (transport) {\n\n var json = transport.responseText.evalJSON(true);\n subtab = json.subtab;\n sampleIdList = json.lstSampleId;\n sampleNameList = json.lstSampleName;\n skillModelsNotCachedList = json.lstSkillModelsNotCached;\n cachedFileStatusList = json.lstCachedFileStatus;\n samplesThatRequireCachingList = json.lstSamplesThatRequireCaching;\n selectedSkillModelList = json.lstSelectedSkillModels;\n displaySampleCachedFileInfo(sampleIdList,\n sampleNameList,\n skillModelsNotCachedList,\n cachedFileStatusList,\n samplesThatRequireCachingList);\n }\n\n if (!subtab) {\n subtab = getSelectedSubtab();\n } else {\n selectSubtab(subtab);\n }\n if (subtab == \"byStudentStep\") {\n //theHelpWindow.updateContent($(\"help-export-step\"));\n $('cached_export_selection_div').show();\n $('stepExportNav').show();\n //Nudge here prevents all nav box margins from collapsing in IE8\n $('samples').setStyle({\n marginBottom: '0.5em'\n });\n if ($F('exportStepIncludeNoKCs') || $F('exportStepIncludeAllKCs')) {\n $('skills').hide();\n } else {\n $('skills').show();\n }\n\n $('kcModelNavHeader').hide();\n $('primary_kc_model_label').hide();\n\n studentStepSkillModelInit(selectedSkillModelList);\n $('students').show();\n $('problems').show();\n\n resetKCMHeader();\n if ($('contentSetName')) {\n $('contentSetName').show();\n }\n if ($('contentSetNameModified')) {\n $('contentSetNameModified').show();\n }\n\n requestByStudentStep();\n showExportFileStatus();\n updateExportFileStatus();\n\n }\n}", "updatePage() {\r\n\t\tvar htmlString = '';\r\n\r\n\t\tfor ( var key in this.data ) {\r\n\t\t\thtmlString = htmlString + '<li>' + this.data[key] + '</li>';\r\n\t\t}\r\n\r\n\t\tthis._dataEl.innerHTML = htmlString;\r\n\t}", "function fillCoverageView() {\n\n var $sequences = $(\"#sequences\");\n $($sequences).empty();\n\n $(\"#coverage-status-message\").empty();\n\n // only hsie syllabus supported\n var $selected = $(\"#teaching-group-select option:selected\").text();\n var $learning_area = \"\";\n if ($selected.indexOf(\"Geography\") != -1) {\n $learning_area = \"geography\";\n }\n if ($selected.indexOf(\"History\") != -1) {\n $learning_area = \"history\";\n }\n\n if (($learning_area != \"history\") && ($learning_area != \"geography\")) {\n $(\"#coverage-status-message\").append(\"<p>Syllabus coverage not available for this Learning Area</p>\");\n return\n }\n\n if (!$n3data.Syllabus) {\n $(\"#coverage-status-message\").append(\"<p>Syllabus coverage not available for this Learning Area</p>\");\n return \n }\n\n // if no lesson sequences have been created\n if (!$n3data.LessonSequence) {\n $(\"#coverage-status-message\").append(\"<p>No Lesson Sequences created for this Learning Area</p>\");\n return \n }\n\n // add column header\n $sequences.append($(\"<p><h6>Course Attendance</h6></p>\"));\n $.each($n3data.LessonSequence, function() {\n var $lessonBlock = $('<div>');\n $lessonBlock.append($(\"<p><h6>\" +\n this.thecourse +\n \" (\" + this.thedescription +\n \", taught by: \" + this.userId + \"), \" +\n \"</h6></p>\"));\n var $list = $('<ul>').addClass(\"collection\");\n $.each(this.lessonList, function() {\n var $listItem = $(\"<li>\").addClass(\"collection-item\");\n $listItem.append(makeCheckbox(this.summary));\n // $listItem.text(this.summary);\n $($list).append($listItem);\n });\n $lessonBlock.append($list);\n $sequences.append($lessonBlock)\n });\n\n}", "function build_academic_aside_nav(student) {\n /*\n * Get distinct season, year values\n * in order to build semester buttons.\n */\n let years = getStudentYears(student);\n\n /*\n * Build the selection_menu article\n */\n let semesterList = '\\\n <article id=\"select_menu\">\\\n <div id=\"topbar\">\\\n <div class=\"add-button-container\">\\\n <h2 class=\"highlight\">Semester</h2>\\\n <div id=\"awardsTooltip\" class=\"button-container tooltip\">\\\n <span class=\"tooltiptext\">Add a Semester</span>\\\n <button class=\"iBtn material-icons\">add</button>\\\n </div>\\\n </div>\\\n <div id=\"seasonDiv\" class=\"seasons\">\\\n <table id=\"seasonTab\" class=\"seasonTable\" cellspacing=\"3\" cellpadding=\"3\" summary=\"List of Semesters\">\\\n <tr id=\"seasonHeaderList\">\\\n <th scope=\"col\" class=\"summer\">SUMMER</th>\\\n <th scope=\"col\" class=\"fall\">FALL</th>\\\n <th scope=\"col\" class=\"spring\">SPRING</th>\\\n </tr>\\\n </table>\\\n </div>\\\n </div>\\\n </article>';\n $(\"#sidebar\").append(semesterList);\n\n /*\n * Loop through our distinct list of years, and build\n * a Summer, Fall, Spring Button for the given academic year.\n * Remember the Spring will always be year+1, since a school\n * year crosses the new year for the Spring grades.\n */\n let cnt=0;\n for (x in years) {\n let thisYear = parseInt(years[x].year);\n let nextYear = thisYear+1;\n if (cnt++ < 4) {\n $(\"#seasonTab\").append($('<tr>')\n .append($('<td>')\n .append($('<button>')\n .addClass('asideButton')\n .html(thisYear.toString())\n .click(function() {\n cleanMain();\n resetErrorMsgElement();\n build_academic_table(student, \"SUMMER\", thisYear.toString());\n })\n )\n )\n .append($('<td>')\n .append($('<button>')\n .addClass('asideButton')\n .html(thisYear.toString())\n .click(function() {\n cleanMain();\n resetErrorMsgElement();\n build_academic_table(student, \"FALL\", thisYear.toString());\n })\n )\n )\n .append($('<td>')\n .append($('<button>')\n .addClass('asideButton')\n .html(nextYear.toString())\n .click(function() {\n cleanMain();\n resetErrorMsgElement();\n build_academic_table(student, \"SPRING\", nextYear.toString());\n })\n )\n )\n )\n }\n }\n\n /*\n * Build the awards article\n */\n let awardsList = '\\\n <article id=\"awards\">\\\n <div id=\"awardsDiv\">\\\n <div class=\"add-button-container\">\\\n <h2>Awards</h2>\\\n <div id=\"awardsTooltip\" class=\"button-container tooltip\">\\\n <span class=\"tooltiptext\">Add an Award</span>\\\n <button class=\"iBtn material-icons\">add</button>\\\n </div>\\\n </div>\\\n </div>\\\n <ul id=\"awardsList\">\\\n </ul>\\\n </article>';\n $(\"#sidebar\").append(awardsList);\n\n /*\n * Add academic awards\n */\n let awardList = database_data.getAwards();\n let award = awardList.filter(function (obj) {\n return (obj.studentName === student && obj.catagory === \"Academic\");\n }).sort((a,b) => (a.year > b.year) ? 1 : ((b.year > a.year) ? -1 : 0));\n if (award.length !== 0) {\n for (x in award) {\n let innerStr = award[x].year + \" \" + award[x].title\n $(\"#awardsList\").append($(\"<li>\").html(innerStr));\n }\n }\n\n $(\".asideAddButton\").click(function(){\n error_not_implemented();\n });\n}", "function update_page() {\n // gets local json file\n /*global $*/\n /*global ODS_api*/\n \n // update Permit and Transit info\n update_permits();\n \n // update items info\n update_items();\n \n // update Open Data info\n update_od_police();\n \n // update Transit info\n update_transit();\n \n // update website info\n update_site_data();\n \n // display updated date\n var d = new Date();\n var offset = -300;\n var estDate = new Date(d.getTime() + offset*60*1000);\n var uDate = estDate.toUTCString().replace('GMT', '');\n $('#stamp').text('Updated: ' + uDate + ' - Prototype - Revision 1');\n}", "function singleClickWeeklyFinalReportRender(graphImage){\n\t\trunReportAnimation(100); //of Step 11 which completed the data processing\n\n\t\t//Get staff info.\n\t\tvar loggedInStaffInfo = window.localStorage.loggedInStaffData ? JSON.parse(window.localStorage.loggedInStaffData) : {};\n\t\t\n\t\tif(jQuery.isEmptyObject(loggedInStaffInfo)){\n\t\t\tloggedInStaffInfo.name = 'Staff';\n\t\t\tloggedInStaffInfo.code = '0000000000';\n\t\t}\t\n\n\n\t\tvar reportInfo_branch = window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '';\n\t\tvar temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\n\t\tif(reportInfo_branch == ''){\n\t\t\tshowToast('System Error: Branch name not found. Please contact Accelerate Support.', '#e74c3c');\n\t\t\treturn '';\n\t\t}\n\n\t\tvar temp_address_modified = (window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '') + ' - ' + (window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '');\n\t\tvar data_custom_footer_address = window.localStorage.bill_custom_footer_address ? window.localStorage.bill_custom_footer_address : '';\n\n\t\tvar reportInfo_admin = loggedInStaffInfo.name;\n\t\tvar reportInfo_time = moment().format('h:mm a, DD-MM-YYYY');\n\t\tvar reportInfo_address = data_custom_footer_address != '' ? data_custom_footer_address : temp_address_modified;\n\n\n\t\tif(graphImage && graphImage != ''){\n\t\t\twindow.localStorage.graphImageDataWeekly = graphImage;\n\t\t}\n\t\telse{\n\t\t\twindow.localStorage.graphImageDataWeekly = '';\n\t\t}\n\n\n\t\tvar graphRenderSectionContent = '';\n\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\tif(fromDate != toDate){\n\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t}\n\t else{ //Render graph only if report is for a day\n\n\t if(graphImage){\n\n\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t graphRenderSectionContent = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t '</div>'+\n\t '<div class=\"weeklyGraph\">'+\n\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/report_trend_images_repo/'+temp_image_name+'.png\" style=\"max-width: 90%\">'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\t }\n\n\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\n\t //Quick Summary Content\n\t var quickSummaryRendererContent = '';\n\n\t var a = 0;\n\t while(reportInfoExtras[a]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t a++;\n\t }\n\n\t //PENDING --> TOTAL CALCULATED ROUND OFFFFF\n\t console.log('PENDING API --> TOTAL CALCULATED ROUND OFFFFF')\n\n\t var b = 1; //first one contains total paid\n\t while(completeReportInfo[b]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t b++;\n\t }\n\n\n\t //Sales by Billing Modes Content\n\t var salesByBillingModeRenderContent = '';\n\t var c = 0;\n\t var billSharePercentage = 0;\n\t while(detailedListByBillingMode[c]){\n\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t c++;\n\t }\n\n\t var salesByBillingModeRenderContentFinal = '';\n\t if(salesByBillingModeRenderContent != ''){\n\t salesByBillingModeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByBillingModeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\t //Sales by Payment Types Content\n\t var salesByPaymentTypeRenderContent = '';\n\t var d = 0;\n\t var paymentSharePercentage = 0;\n\t while(detailedListByPaymentMode[d]){\n\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t d++;\n\t }\n\n\t var salesByPaymentTypeRenderContentFinal = '';\n\t if(salesByPaymentTypeRenderContent != ''){\n\t salesByPaymentTypeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByPaymentTypeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\n\n\n\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px 25px;text-align:center}.factsBox{margin-right: 5px; width:20%;display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:30%;display:inline-block;text-align:center;float:right;margin-top:30px}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:65%;display:inline-block}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t \n\n\t var finalReport_emailContent = '<html>'+cssData+\n\t\t '<body>'+\n\t\t '<div class=\"mainHeader\">'+\n\t\t '<div class=\"headerLeftBox\">'+\n\t\t '<div id=\"logo\">'+\n\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t '</div>'+\n\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t '</div>'+\n\t\t '<div class=\"headerRightBox\">'+\n\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '<div class=\"introFacts\">'+\n\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t '<div class=\"factsArea\">'+\n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t '</div>'+\n\t\t '</div>'+graphRenderSectionContent+\n\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t '<div class=\"summaryTableSection\">'+\n\t\t '<div class=\"tableQuickHeader\">'+\n\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t '</div>'+\n\t\t '<div class=\"tableQuick\">'+\n\t\t '<table style=\"width: 100%\">'+\n\t\t '<col style=\"width: 70%\">'+\n\t\t '<col style=\"width: 30%\">'+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Sales</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t quickSummaryRendererContent+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t '</table>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t salesByBillingModeRenderContentFinal+\n\t\t salesByPaymentTypeRenderContentFinal+\n\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t '<p class=\"footerNote\">www.accelerate.net.in | support@accelerate.net.in</p>'+\n\t\t '</div>'+\n\t\t '</body>'+\n\t\t '<html>';\n\t}", "function setupBookingReport(parmFromDate, parmToDate, includeBookings, sortBookings, showAgent, showInv, bookingArray, receiptArray, invoiceArray, topHeadtxt) {\n\t\n\tdocument.title = topHeadtxt;\n\tvar htmlCode = '';\n\n\tconsole.log(\"parmFromDate: \" + parmFromDate)\n\tconsole.log(\"showAgent: \" + showAgent)\n\tconsole.log(\"includeBookings: \" + includeBookings)\n\tconsole.log(\"receiptArray: \" + receiptArray)\n\tconsole.log(\"sortBookings: \" + sortBookings)\n\n\t// Prepair the dates\n\tvar fromDate = new Date(parmFromDate*1000);\n\tvar toDate = new Date(parmToDate*1000);\n\tvar reportHead = 'Period from <b>' + fromDate.format('d M Y') + '</b> to <b>' + toDate.format('d M Y') + '</b>';\n\tvar showChannel = true;\n\tvar showStatus = true;\n\tvar showUnit = true;\n\n\t// Set the headline and the status conditions\n\tswitch(includeBookings) {\n\t\tcase 'ACTIVE':\n\t\t\tvar txtInclude = 'Active Bookings'\n\t\t\tbreak;\n\t\tcase 'ALL':\n\t\t\tvar txtInclude = 'All Bookings'\n\t\t\tbreak;\n\t\tcase 'NOPAY':\n\t\t\tvar txtInclude = 'Unpaid Bookings'\n\t\t\tbreak;\n\t\tcase '0':\n\t\t\tvar txtInclude = 'New Bookings'\n\t\t\tbreak;\n\t\tcase '1':\n\t\t\tvar txtInclude = 'Pending'\n\t\t\tbreak;\n\t\tcase '2':\n\t\t\tvar txtInclude = 'Booked'\n\t\t\tbreak;\n\t\tcase '3':\n\t\t\tvar txtInclude = 'Check-in'\n\t\t\tbreak;\n\t\tcase '4':\n\t\t\tvar txtInclude = 'Check-out'\n\t\t\tbreak;\n\t\tcase '5':\n\t\t\tvar txtInclude = 'Done'\n\t\t\tbreak;\n\t\tcase '6':\n\t\t\tvar txtInclude = 'Cancelled'\n\t\t\tbreak;\n\t}\n\n\n\t\n\t// Sort bookingArray by different things\n\tswitch(sortBookings) {\n\t\tcase 'DATE':\n\t\t\tvar txtSort = 'Checkin Date'\n\t\t\tsortBy(bookingArray, (o) => o.checkin);\n\t\t\tbreak;\n\t\tcase 'CHANNEL':\n\t\t\tvar txtSort = 'Booking Channel'\n \t\t\tsortBy(bookingArray, (o) => [o.source, o.checkin]);\n\t\t\tbreak;\n\t\tcase 'PROPERTY':\n\t\t\tvar txtSort = 'Property'\n\t\t\tsortBy(bookingArray, (o) => [o.property, o.checkin]); \n\t\t\tbreak;\n\t\tcase 'STATUS':\n\t\t\tvar txtSort = 'Booking Status'\n \t\t\tsortBy(bookingArray, (o) => [o.status, o.checkin]);\n\t\t\tbreak;\n\t}\n\n\tsortBy(invoiceArray, (o) => o._id);\n\n\t// Put page title the same as report headline\n\tdocument.title = txtInclude + ' sort by ' + txtSort;\n\ttopHeadtxt = txtInclude + ' sort by ' + txtSort ; \n\t\n\t// Render the report \n\tvar fldSort = ''\n\tvar htmlCode = ''\n\thtmlCode = '';\n\thtmlCode += topHeadline(topHeadtxt);\n\thtmlCode += reportHeadline(reportHead)\t\n\t\n\n\t// DATE\n\tif (sortBookings=='DATE') {\n\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\n\t\t// Loop thru all bookings\n\t\tvar lines=0;\n\t\tfor (var i=0; i<bookingArray.length; i++) {\t\n\t\t\thtmlCode += renderBookings(i, includeBookings, sortBookings, showChannel, showStatus, showUnit, showAgent, showInv, bookingArray, receiptArray, invoiceArray);\n\n\t\t\t// Break every 28 lines \n\t\t\tlines += 1;\n\t\t\tif (lines>28) {\n\t\t\t\tlines = 0;\n\t\t\t\thtmlCode += '</table>';\n\t\t\t\thtmlCode += reportFooter();\t\t\t\n\t\t\t\thtmlCode += reportPageBreak();\n\t\t\t\thtmlCode += topHeadline(topHeadtxt);\n\t\t\t\thtmlCode += reportHeadline(txtSort)\t\n\t\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\t}\n\t\t}\n\n\t} else {\n\n\t\n\t\t// CHANNEL\n\t\tif (sortBookings=='CHANNEL') {\n\n\t\t\tshowChannel = false;\n\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\t\n\t\t\t// Loop thru all bookings\n\t\t\tvar lines = 0;\n\t\t\tfor (var i=0; i<bookingArray.length; i++) {\t\n\t\t\t\tif (fldSort != bookingArray[i].source || lines>26) {\n\t\t\t\t\tfldSort = bookingArray[i].source;\n\t\t\t\t\t// Break every 26 lines \n\t\t\t\t\tlines += 2;\n\t\t\t\t\tif (lines>26) {\n\t\t\t\t\t\tlines = 0;\n\t\t\t\t\t\thtmlCode += '</table>';\n\t\t\t\t\t\thtmlCode += reportFooter();\t\t\t\n\t\t\t\t\t\thtmlCode += reportPageBreak();\n\t\t\t\t\t\thtmlCode += topHeadline(topHeadtxt);\n\t\t\t\t\t\thtmlCode += reportHeadline(txtSort)\t\n\t\t\t\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\t\t\t}\n\t\t\t\t\tvar htmlHead = '<tr><th colspan=\"20\" style=\"background-color:#EEEEEE; color:#000000; border:1px solid #AAAAAA; text-align:left; height:38px; padding-left:6px; white-space: nowrap;\">#FIELD#</th></tr>'\n\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#999999; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">UNKNOWN</div>'\n\t\t\t\t\tswitch(fldSort) {\n\t\t\t\t\t\tcase '':\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#999999; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">UNKNOWN</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'T':\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#4CACCD; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">THAIHOME</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'B':\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#003580; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">BOOKING.COM</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'A':\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#FF8084; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">AIRBNB</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'E':\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#00355F; color:#FFCB00; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">EXPEDIA</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'G':\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#C59064; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">AGENTS</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\thtmlCode += htmlHead.replace('#FIELD#', txtStatus);\n\t\t\t\t}\n\t\t\t\tif (fldSort != '') {\n\t\t\t\t\thtmlCode += renderBookings(i, includeBookings, sortBookings, showChannel, showStatus, showUnit, showAgent, showInv, bookingArray, receiptArray, invoiceArray);\n\t\t\t\t\tlines += 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t}\n\n\n\t\t// PROPERTY\n\t\tif (sortBookings=='PROPERTY') {\n\n\t\t\t// Make the table header\n\t\t\tvar lines = 0;\n\t\t\tshowUnit = false;\n\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\t\n\t\t\t// Loop thru all bookings\n\t\t\tvar lines = 0;\n\t\t\tfor (var i=0; i<bookingArray.length; i++) {\t\n\n\t\t\t\tif (fldSort != bookingArray[i].property || lines>24) {\n\t\t\t\t\tfldSort = bookingArray[i].property;\n\t\t\t\t\t// Break every 25 lines \n\t\t\t\t\tlines += 2;\n\t\t\t\t\tif (lines>24) {\n\t\t\t\t\t\tlines = 0;\n\t\t\t\t\t\thtmlCode += '</table>';\n\t\t\t\t\t\thtmlCode += reportFooter();\t\t\t\n\t\t\t\t\t\thtmlCode += reportPageBreak();\n\t\t\t\t\t\thtmlCode += topHeadline(topHeadtxt);\n\t\t\t\t\t\thtmlCode += reportHeadline(txtSort)\t\n\t\t\t\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\t\t\t}\n\t\t\t\t\tvar htmlHead = '<tr><th colspan=\"20\" style=\"background-color:#EEEEEE; color:#000000; border:1px solid #AAAAAA; text-align:left; height:38px; padding-left:6px; white-space: nowrap;\">#FIELD#</th></tr>'\n\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:10px; background-color:#FFFFFF; color:#333333; width:250px; display: block; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">Property: &nbsp; ' + bookingArray[i].property + '</div>'\n\t\t\t\t\thtmlCode += htmlHead.replace('#FIELD#', txtStatus);\n\t\t\t\t}\n\t\t\t\tif (fldSort != '') {\n\t\t\t\t\thtmlCode += renderBookings(i, includeBookings, sortBookings, showChannel, showStatus, showUnit, showAgent, showInv, bookingArray, receiptArray, invoiceArray);\n\t\t\t\t\tlines += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// STATUS\n\t\tif (sortBookings=='STATUS') {\n\n\t\t\t// Make the table header\n\t\t\tvar lines = 0;\n\t\t\tshowStatus = false;\n\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\tfldSort = 99;\n\t\t\t\n\t\t\t// Loop thru all bookings\n\t\t\tvar lines = 0;\n\t\t\tfor (var i=0; i<bookingArray.length; i++) {\t\n\t\t\t\tif (fldSort != bookingArray[i].status || lines>24) {\n\t\t\t\t\tfldSort = bookingArray[i].status;\n\t\t\t\t\t// Break every 25 lines \n\t\t\t\t\tlines += 2;\n\t\t\t\t\tif (lines>24) {\n\t\t\t\t\t\tlines = 0;\n\t\t\t\t\t\thtmlCode += '</table>';\n\t\t\t\t\t\thtmlCode += reportFooter();\t\t\t\n\t\t\t\t\t\thtmlCode += reportPageBreak();\n\t\t\t\t\t\thtmlCode += topHeadline(topHeadtxt);\n\t\t\t\t\t\thtmlCode += reportHeadline(txtSort)\t\n\t\t\t\t\t\thtmlCode += renderBookingTableHeader(showChannel, showStatus, showUnit, showAgent, showInv);\n\t\t\t\t\t}\n\t\t\t\t\tvar htmlHead = '<tr><th colspan=\"20\" style=\"background-color:#EEEEEE; color:#000000; border:1px solid #AAAAAA; text-align:left; height:40px; padding-left:6px; white-space: nowrap;\">#FIELD#</th></tr>'\n\t\t\t\t\tvar txtStatus = '<div style=\"background-color:#999999; color:#FFFFFF; width:250px; display: block; text-align:center; font-weight:bold; font-size:18px; font-family:Roboto, Arial;\">UNKNOWN</div>'\n\t\t\t\t\tswitch(fldSort) {\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#FFE5E5;border: 1px solid #804040; color:#804040; width:200px; display: block;\">NEW BOOKINGS</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#FFE5E5;border: 1px solid #804040; color:#804040; width:200px; display: block;\">PENDING</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#DDFFDD;border: 1px solid #007000; color:#007000; width:200px; display: block;\">BOOKED</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#DDFFDD;border: 1px solid #007000; color:#007000; width:200px; display: block;\">CHECKIN</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#E0E0E0;border: 1px solid #808080; color:#404040; width:200px; display: block;\">CHECKOUT</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 5:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#E0E0E0;border: 1px solid #808080; color:#404040; width:200px; display: block;\">DONE</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 6:\n\t\t\t\t\t\t\tvar txtStatus = '<div style=\"padding-left:12px; font-family:Roboto, Arial; font-size:18px; background-color:#E0E0E0;border: 1px solid #808080; color:#404040; width:200px; display: block;\">CANCEL</div>'\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\thtmlCode += htmlHead.replace('#FIELD#', txtStatus);\n\t\t\t\t}\n\t\t\t\tif (fldSort != 99) {\n\t\t\t\t\thtmlCode += renderBookings(i, includeBookings, sortBookings, showChannel, showStatus, showUnit, showAgent, showInv, bookingArray, receiptArray, invoiceArray);\n\t\t\t\t\tlines += 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\t\n\n\t// Render footer\n\thtmlCode += '</table>';\n\thtmlCode += reportFooter();\t\t\t\n\t\n\treturn htmlCode;\n}", "function dataSubmittedPage() {\r\n app.getView().render('subscription/emarsys_datasubmitted');\r\n}", "function fnBindPayslipReport() {\n $('#divheadPaySlip').block({\n message: 'Retriveing data...',\n css: { border: '1px solid #ddd' }\n });\n if ($(\"#txtFromDate\").val() == \"\") {\n fnMsgAlert('info', 'PaySlip Report.', 'Select month and year');\n $(\"#divheadPaySlip\").unblock();\n return false;\n }\n var selectedMonth = fngetMonthNumber($('#txtFromDate').val().split('-')[0]);\n var selectedYear = $('#txtFromDate').val().split('-')[1];\n var reportView = \"1\";\n\n $.ajax({\n type: 'POST',\n url: '../HiDoctor_Reports/ReportsLevelThree/GetPayslipReport',\n data: 'month=' + selectedMonth + '&year=' + selectedYear + '&reportView=' + reportView + '&title=' + $(\"#divPageHeader\").html(),\n success: function (response) {\n if (response != \"\") {\n $('#dvGrid').html(response);\n $(\"#divPrint\").html(response);\n\n if (reportView == \"1\") {\n if (response == \"No data found.\") {\n $(\"#divprintArea\").hide();\n $(\"#divheadPaySlip\").unblock();\n }\n else {\n $(\"#divprintArea\").show();\n $(\"#divheadPaySlip\").unblock();\n }\n }\n else {\n $(\"#divprintArea\").hide();\n $(\"#divheadPaySlip\").unblock();\n\n }\n\n }\n else {\n $('#dvGrid').html();\n $(\"#divPrint\").html();\n $(\"#divprintArea\").hide();\n $(\"#divheadPaySlip\").unblock();\n }\n\n },\n error: function (e) {\n }\n });\n\n}", "function fetchSingleClickReport(){\n\n\n\t$( \"#summaryRenderArea\" ).children().css( \"display\", \"none\" );\n\tdocument.getElementById(\"singleClickReport_RenderArea\").style.display = \"block\";\n\n\t//Initialise animation contents\n\tdocument.getElementById(\"singleClickReport_RenderContent\").innerHTML = ''+\n '<center><div class=\"reportDemo\">'+\n '<svg class=\"progress\" width=\"120\"> <circle class=\"progress__meter\" cx=\"60\" cy=\"60\" r=\"54\" stroke-width=\"12\" /> <circle class=\"progress__value\" cx=\"60\" cy=\"60\" r=\"54\" stroke-width=\"12\" /> </svg>'+\n '<tag class=\"reportPercentage\" id=\"reportPercentageArea\"><span id=\"reportPercentageFigure\">0</span><span style=\"font-size: 60%\">%</span></tag>'+\n '<p class=\"generatingText\">Generating Report</p>'+\n '</div>'+\n '<div id=\"postReportActions\" style=\"display: none\">'+\n '<p style=\"font-size: 26px; color: #777; font-weight: 300; margin-top: -15px\">Your Report is Ready!</p>'+\n '<button data-hold=\"\" text-hold=\"\" id=\"reportActionButtonDownload\" onclick=\"reportActionDownload()\" style=\"margin-right: 5px\" class=\"btn btn-success btn-sm\"><i class=\"fa fa-download\"></i> Download</button>'+\n '<button data-hold=\"\" id=\"reportActionButtonPrint\" onclick=\"reportActionPrint()\" style=\"margin-right: 5px\" class=\"btn btn-success btn-sm\"><i class=\"fa fa-print\"></i> Print</button>'+\n '<button data-hold=\"\" text-hold=\"\" id=\"reportActionButtonEmail\" onclick=\"reportActionEmail()\" class=\"btn btn-success btn-sm\"><i class=\"fa fa-envelope\"></i> Email</button>'+\n '</div></center>';\t\n\n document.getElementById(\"singleClickReport_ErrorContent\").style.display = 'none';\n\n\n //Clear all graph data\n window.localStorage.graphImageDataWeeklyBW = '';\n window.localStorage.graphImageDataWeekly = '';\n window.localStorage.graphImageDataPayments = '';\n window.localStorage.graphImageDataBills = '';\n\n \n //Initialise animation\n\tvar progressValue = document.querySelector('.progress__value');\n\tvar RADIUS = 54;\n\tvar CIRCUMFERENCE = 2 * Math.PI * RADIUS;\n\n\tfunction runReportAnimation(value){\n\n\t\tif(value > 100){\n\t\t \tvalue = 100;\n\t\t}\n\n\t var progress = value / 100;\n\t var dashoffset = CIRCUMFERENCE * (1 - progress);\n\t progressValue.style.strokeDashoffset = dashoffset;\n\t document.getElementById(\"reportPercentageFigure\").innerHTML = value;\n\n\t //When it is 100%\n\t if(value == 100){\n\t \tsetTimeout(function(){\n\t \t\tdocument.getElementById(\"reportPercentageArea\").innerHTML = '<img src=\"images/common/report_ready.png\" class=\"staryDoneIcon\">';\n\t \t\t$('#reportPercentageArea').addClass('zoomIn');\n\t \t\t$('.progress__value').css(\"stroke\", \"#FFF\");\n\t \t\t$('.progress__meter').css(\"stroke\", \"#FFF\");\n\t \t\t$('.generatingText').css(\"display\", \"none\");\n\t \t\t$('#postReportActions').css(\"display\", \"block\");\n\n\t \t\tplayNotificationSound('DONE');\n\t \t}, 10);\n\t }\n\t\n\t\tprogressValue.style.strokeDasharray = CIRCUMFERENCE;\t\t\n\t}\n\n\tfunction stopReportAnimation(optionalSource){\t\t\n\t\tif(optionalSource == 'ERROR'){\n\t \t\tdocument.getElementById(\"reportPercentageArea\").innerHTML = '<img src=\"images/common/error_triangle.png\" class=\"staryDoneIcon\">';\n\t \t\t$('#reportPercentageArea').addClass('animateShake');\n\t \t\t$('.progress__value').css(\"stroke\", \"#FFF\");\n\t \t\t$('.progress__meter').css(\"stroke\", \"#FFF\");\n\t \t\t$('.generatingText').css(\"display\", \"none\");\n\t \t\t$('#postReportActions').css(\"display\", \"none\");\n\n\t \t\tplayNotificationSound('DISABLE');\n\t\t}\n\t\telse{\n\n\t\t}\n\t}\n\n\n\n\n\t//Note: Dates in YYYYMMDD format\n\tvar fromDate = document.getElementById(\"reportFromDate\").value;\n\tfromDate = fromDate && fromDate != '' ? fromDate : '01-01-2018'; //Since the launch of Vega POS\n\tfromDate = getSummaryStandardDate(fromDate);\n\n\tvar toDate = document.getElementById(\"reportToDate\").value;\n\ttoDate = toDate && toDate != '' ? toDate : getCurrentTime('DATE_STAMP');\n\ttoDate = getSummaryStandardDate(toDate);\n\n\tvar completeReportInfo = [];\n\tvar netSalesWorth = 0;\n\tvar netGuestsCount = '###';\n\tvar netRefundsProcessed = 0;\n\tvar reportInfoExtras = [];\n\tvar completeErrorList = []; //In case any API call causes Error\n\tvar detailedListByBillingMode = []; //Billing mode wise\n\tvar detailedListByPaymentMode = []; //Payment mode wise\n\tvar weeklyProgressThisWeek = []; //This Week sales\n\tvar weeklyProgressLastWeek = []; //Last Week sales\n\tvar paymentGraphData = []; //For payment graphs\n\tvar billsGraphData = []; //For bills graphs\n\n\n\t//Net Sales Worth = Total Paid - (All the other charges) - (Discounts & Refunds) + (Tips)\n\n\t//Starting point\n\trunReportAnimation(0);\n\tsetTimeout(singleClickTotalPaid, 1000);\n\n\n\t//Step 1: Total Paid Amount\n\tfunction singleClickTotalPaid(){\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_paidamount?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tvar temp_totalOrders = 0;\n\t\t\t\tvar temp_totalPaid = 0;\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\ttemp_totalOrders = data.rows[0].value.count;\n\t\t\t\t\ttemp_totalPaid = data.rows[0].value.sum;\n\t\t\t\t}\n\n\t\t\t\tcompleteReportInfo.push({\n\t\t\t\t\t\t\"name\": \"Total Paid Amount\",\n\t\t\t\t\t\t\"value\": temp_totalPaid,\n\t\t\t\t\t\t\"count\": temp_totalOrders,\n\t\t\t\t\t\t\"split\": []\n\t\t\t\t});\n\n\t\t\t\tnetSalesWorth = temp_totalPaid;\n\n\t\t\t\t//Step 1-2:\n\t\t\t\tsingleClickTotalGuests();\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 1,\n\t\t\t\t\t\"error\": \"Failed to load net sales figure. Report can not be generated.\"\n\t\t\t\t});\n\t\t\t\tstopReportAnimation('ERROR');\n\t\t\t\tsingleClickLoadErrors();\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \n\t}\t\n\n\n\t//Step 1-2: Total Number of Guests\n\tfunction singleClickTotalGuests(){\n\n\t\trunReportAnimation(3); //of Step 1 which takes 3 units\n\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/totalguests?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\tnetGuestsCount = data.rows[0].value.sum;\n\t\t\t\t}\n\n\t\t\t\t//Step 2:\n\t\t\t\tsingleClickExtraCharges();\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 1.2,\n\t\t\t\t\t\"error\": \"Failed to sum up the number of guests\"\n\t\t\t\t});\n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \n\t}\t\t\n\n\n\t//Step 2: \n\tfunction singleClickExtraCharges(){\n\n\t\trunReportAnimation(5); //of Step 1-2 which takes 2 units\n\n\t var requestData = {\n\t \"selector\" :{ \n\t \"identifierTag\": \"ACCELERATE_BILLING_PARAMETERS\" \n\t },\n\t \"fields\" : [\"identifierTag\", \"value\"]\n\t }\n\n\t $.ajax({\n\t type: 'POST',\n\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t data: JSON.stringify(requestData),\n\t contentType: \"application/json\",\n\t dataType: 'json',\n\t timeout: 10000,\n\t success: function(data) {\n\n\t if(data.docs.length > 0){\n\t if(data.docs[0].identifierTag == 'ACCELERATE_BILLING_PARAMETERS'){\n\n\t\t \tvar modes = data.docs[0].value;\n\t\t \tmodes.sort(); //alphabetical sorting \n\n\t\t \tif(modes.length == 0){\n\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t \"step\": 2,\n\t\t\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\t\t\treturn '';\n\t\t \t}\n\t\t \telse{\n\n\t\t \t //For a given BILLING PARAMETER, the total Sales in the given DATE RANGE\n\t\t\t\t\t $.ajax({\n\t\t\t\t\t type: 'GET',\n\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyextras?startkey=[\"'+modes[0].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t success: function(data) {\n\t\t\t\t\t \t\n\t\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t\t \t}\n\n\t\t\t\t\t \t\t//Now check in custom extras\n\t\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyextras_custom?startkey=[\"'+modes[0].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\tnetSalesWorth -= temp_sum;\n\n\t\t\t\t\t\t\t\t\t\treportInfoExtras.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\"name\": modes[0].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\"value\": temp_sum\n\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t \t//Check if next mode exists...\n\t\t\t\t\t\t\t\t \tif(modes[1]){\n\t\t\t\t\t\t\t\t \t\tsingleClickExtraChargesCallback(1, modes);\n\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t\t \t\t//Step 3: Total Discount offered\n\t\t\t\t\t\t\t\t \t\tsingleClickDiscountsOffered();\n\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t \"step\": 2,\n\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\t\t\t\t\t\t\treturn '';\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 },\n\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t \"step\": 2,\n\t\t\t\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\t\t\t\treturn '';\t \t\n\t\t\t\t\t }\n\t\t\t\t\t }); \n\t\t\t\t\t} //else - modes\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 2,\n\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t});\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\treturn '';\n\t }\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 2,\n\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t});\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\treturn '';\n\t }\n\t },\n\t error: function(data) {\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 2,\n\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t});\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\treturn '';\n\t }\n\n\t });\t\n\t}\n\n\n\t//Step 2 - Callback\n\tfunction singleClickExtraChargesCallback(index, modes){\n\n\t\t\t\t $.ajax({\n\t\t\t\t type: 'GET',\n\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyextras?startkey=[\"'+modes[index].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].name+'\",\"'+toDate+'\"]',\n\t\t\t\t timeout: 10000,\n\t\t\t\t success: function(data) {\n\n\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t \t}\n\t\t\t\t \t\n\n\t\t\t\t \t\t//Now check in custom extras\n\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyextras_custom?startkey=[\"'+modes[index].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tnetSalesWorth -= temp_sum;\n\n\n\t\t\t\t\t\t\t\t\treportInfoExtras.push({\n\t\t\t\t\t\t\t\t\t\t\"name\": modes[index].name,\n\t\t\t\t\t\t\t\t\t\t\"value\": temp_sum\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t \t//Check if next mode exists...\n\t\t\t\t\t\t\t \tif(modes[index+1]){\n\t\t\t\t\t\t\t \t\tsingleClickExtraChargesCallback(index+1, modes);\n\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t \t\t//Step 3: Total Discount offered\n\t\t\t\t\t\t\t \t\tsingleClickDiscountsOffered();\n\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t \"step\": 2,\n\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}); \n\t\t\t\t },\n\t\t\t\t error: function(data){\n\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t \"step\": 2,\n\t\t\t\t\t\t\t\"error\": \"Failed to read applied charges\"\n\t\t\t\t\t\t});\n\n\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\tsingleClickDiscountsOffered(); \n\t\t\t\t\t\treturn '';\n\t\t\t\t }\n\t\t\t\t }); \n\n\t}\t//End step 2 callback\n\n\n\t//Step 3: Discounts Offered\n\tfunction singleClickDiscountsOffered(){\n\n\t\trunReportAnimation(15); //of Step 2 which takes 10 units\n\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_discounts?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tvar temp_discountedOrdersCount = 0;\n\t\t\t\tvar temp_discountedOrdersSum = 0;\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\ttemp_discountedOrdersCount = data.rows[0].value.count;\n\t\t\t\t\ttemp_discountedOrdersSum = data.rows[0].value.sum;\n\t\t\t\t}\n\n\t\t\t\tnetSalesWorth += temp_discountedOrdersSum;\n\n\t\t\t\tcompleteReportInfo.push({\n\t\t\t\t\t\t\"name\": \"Discounts\",\n\t\t\t\t\t\t\"type\": \"NEGATIVE\",\n\t\t\t\t\t\t\"value\": temp_discountedOrdersSum,\n\t\t\t\t\t\t\"count\": temp_discountedOrdersCount\n\t\t\t\t});\t\n\n\t\t\t\t//Step 4: Total Round Off made\n\t\t\t\tsingleClickRoundOffsMade();\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 3,\n\t\t\t\t\t\"error\": \"Failed to read discounts offered\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickRoundOffsMade(); \n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \t\t\t\n\t}\n\n\n\n\t//Step 4: RoundOffs made\n\tfunction singleClickRoundOffsMade(){\n\n\t\trunReportAnimation(20); //of Step 3 which takes 5 units\n\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_roundoff?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tvar temp_roundOffCount = 0;\n\t\t\t\tvar temp_roundOffSum = 0;\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\ttemp_roundOffCount = data.rows[0].value.count;\n\t\t\t\t\ttemp_roundOffSum = data.rows[0].value.sum;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tnetSalesWorth += temp_roundOffSum;\n\n\t\t\t\tcompleteReportInfo.push({\n\t\t\t\t\t\t\"name\": \"Round Off\",\n\t\t\t\t\t\t\"type\": \"NEGATIVE\",\n\t\t\t\t\t\t\"value\": temp_roundOffSum,\n\t\t\t\t\t\t\"count\": temp_roundOffCount\n\t\t\t\t});\t\n\n\t\t\t\t//Step 5: Total Tips received\n\t\t\t\tsingleClickTipsReceived();\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 4,\n\t\t\t\t\t\"error\": \"Failed to read round-off amount\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickTipsReceived(); \n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \t\n\t}\n\n\n\n\t//Step 5: Total Tips Received\n\tfunction singleClickTipsReceived(){\n\n\t\trunReportAnimation(25); //of Step 4 which takes 5 units\n\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_tips?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tvar temp_tipsCount = 0;\n\t\t\t\tvar temp_tipsSum = 0;\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\ttemp_tipsCount = data.rows[0].value.count;\n\t\t\t\t\ttemp_tipsSum = data.rows[0].value.sum;\n\t\t\t\t}\n\n\t\t\t\tnetSalesWorth -= temp_tipsSum;\n\n\n\t\t\t\tcompleteReportInfo.push({\n\t\t\t\t\t\t\"name\": \"Tips\",\n\t\t\t\t\t\t\"type\": \"POSITIVE\",\n\t\t\t\t\t\t\"value\": temp_tipsSum,\n\t\t\t\t\t\t\"count\": temp_tipsCount\n\t\t\t\t});\t\n\n\t\t\t\t//Step 6: Refunds Issued\n\t\t\t\tsingleClickRefundsIssued();\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 5,\n\t\t\t\t\t\"error\": \"Failed to read tips received\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickRefundsIssued(); \n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \t\t\n\t}\n\n\n\t//Step 6: Total Refunds Issued\n\tfunction singleClickRefundsIssued(){\n\n\t\trunReportAnimation(30); //of Step 5 which takes 5 units\n\n\t\t//Refunded but NOT cancelled\n\t\t$.ajax({\n\t\t type: 'GET',\n\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/refund-summary/_view/allrefunds?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\ttimeout: 10000,\n\t\t\tsuccess: function(data) {\n\n\t\t\t\tvar temp_refundCount = 0;\n\t\t\t\tvar temp_refundSum = 0;\n\n\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\ttemp_refundCount = data.rows[0].value.count;\n\t\t\t\t\ttemp_refundSum = data.rows[0].value.sum;\n\t\t\t\t}\n\n\n\t\t\t\t//Cancelled and Refunded Orders\n\t\t\t\t$.ajax({\n\t\t\t\t type: 'GET',\n\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/accelerate_cancelled_invoices/_design/refund-summary/_view/allrefunds?startkey=[\"'+fromDate+'\"]&endkey=[\"'+toDate+'\"]',\n\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\tsuccess: function(seconddata) {\n\n\t\t\t\t\t\tif(seconddata.rows.length > 0){\n\t\t\t\t\t\t\ttemp_refundCount += seconddata.rows[0].value.count;\n\t\t\t\t\t\t\ttemp_refundSum += seconddata.rows[0].value.sum;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//netSalesWorth -= temp_refundSum;\n\t\t\t\t\t\tnetRefundsProcessed = temp_refundSum;\n\n\t\t\t\t\t\tcompleteReportInfo.push({\n\t\t\t\t\t\t\t\t\"name\": \"Refunds Issued\",\n\t\t\t\t\t\t\t\t\"type\": \"NEGATIVE\",\n\t\t\t\t\t\t\t\t\"value\": temp_refundSum,\n\t\t\t\t\t\t\t\t\"count\": temp_refundCount\n\t\t\t\t\t\t});\t\n\n\t\t\t\t\t\t//Step 7: Render everything \n\t\t\t\t\t\tsingleClickSummaryFinal();\n\n\t\t\t\t\t},\n\t\t\t\t\terror: function(data){\n\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t \"step\": 6,\n\t\t\t\t\t\t\t\"error\": \"Failed to read refunds issued\"\n\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\tsingleClickSummaryFinal(); \n\t\t\t\t\t\treturn '';\n\t\t\t\t\t}\n\t\t\t\t}); \n\n\n\t\t\t},\n\t\t\terror: function(data){\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 6,\n\t\t\t\t\t\"error\": \"Failed to read refunds issued\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickSummaryFinal(); \n\t\t\t\treturn '';\n\t\t\t}\n\t\t}); \t\t\n\t}\n\n\n\t//Step 7 : Render \n\tfunction singleClickSummaryFinal(){\n\n\t\t/*\n\t\t\tIntermediate validation pit-stop:\n\t\t\tEnsure if all the data so far is good to render the\n\t\t\tfinal report, in the final step.\n\n\t\t\tIf it fails at this step, terminate the process here\n\t\t\tand kill the progress status animation\n\t\t*/\n\n\t\t//Step 8: Detailed by Billing Modes\n\t\tsingleClickDetailedByModes();\n\t}\n\n\n\t//Step 8: Details by Billing Modes\n\tfunction singleClickDetailedByModes(){\n\n\t\trunReportAnimation(40); //of Step 6 which takes 10 units\n\n\t\tbillsGraphData = [];\n\n\t\t//Preload Billing Parameters\n\t var requestParamData = {\n\t \"selector\" :{ \n\t \"identifierTag\": \"ACCELERATE_BILLING_PARAMETERS\" \n\t },\n\t \"fields\" : [\"identifierTag\", \"value\"]\n\t }\n\n\t $.ajax({\n\t type: 'POST',\n\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t data: JSON.stringify(requestParamData),\n\t contentType: \"application/json\",\n\t dataType: 'json',\n\t timeout: 10000,\n\t success: function(data) {\n\n\t if(data.docs.length > 0){\n\t if(data.docs[0].identifierTag == 'ACCELERATE_BILLING_PARAMETERS'){\n\n\t\t \tvar billingExtras = data.docs[0].value;\n\n\t\t \tif(billingExtras.length == 0){\n\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\treturn '';\n\t\t \t}\n\t\t \telse{\n\n\n\t\t\t\t\t var requestData = {\n\t\t\t\t\t \"selector\" :{ \n\t\t\t\t\t \"identifierTag\": \"ACCELERATE_BILLING_MODES\" \n\t\t\t\t\t },\n\t\t\t\t\t \"fields\" : [\"identifierTag\", \"value\"]\n\t\t\t\t\t }\n\n\t\t\t\t\t $.ajax({\n\t\t\t\t\t type: 'POST',\n\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t\t\t\t\t data: JSON.stringify(requestData),\n\t\t\t\t\t contentType: \"application/json\",\n\t\t\t\t\t dataType: 'json',\n\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t success: function(data) {\n\t\t\t\t\t if(data.docs.length > 0){\n\t\t\t\t\t if(data.docs[0].identifierTag == 'ACCELERATE_BILLING_MODES'){\n\n\t\t\t\t\t \tvar modes = data.docs[0].value;\n\n\t\t\t\t\t\t \tif(modes.length == 0){\n\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \telse{\n\n\t\t\t\t\t\t\t \t//For a given BILLING MODE, the total Sales in the given DATE RANGE\n\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbybillingmode?startkey=[\"'+modes[0].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t\t\t\t\t success: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t \tvar preserved_sum = 0;\n\t\t\t\t\t\t\t\t\t\t \tvar preserved_count = 0;\n\t\t\t\t\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t \t\tpreserved_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t \t\tpreserved_count = data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t \t//Extras in this given Billing Mode\n\t\t\t\t\t\t\t\t\t\t \tvar splitExtrasInGivenMode = [];\n\n\t\t\t\t\t\t\t\t\t\t \tif(billingExtras[0]){\n\t\t\t\t\t\t\t\t\t\t \t\tpreProcessBillingSplits(0, billingExtras, splitExtrasInGivenMode)\n\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t \tfunction preProcessBillingSplits(splitIndex, paramsList, formedSplitList){\n\n\n\t\t\t\t\t\t\t\t\t\t \t//For a given Billing Mode, amount split by billing params\n\t\t\t\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t\t\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyrefundmodes_splitbyextras?startkey=[\"'+modes[0].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t\t\t\t\t\t\t\t success: function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t//Now check in custom extras also\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyrefundmodes_splitbycustomextras?startkey=[\"'+modes[0].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Finally, push it\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tsplitExtrasInGivenMode.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"name\": paramsList[splitIndex].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"value\": temp_sum,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"count\": temp_count\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t//Check if next exists in params list:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tif(paramsList[splitIndex + 1]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tpreProcessBillingSplits(splitIndex + 1, paramsList, splitExtrasInGivenMode);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\telse{ \t//Proceed to next BILLING MODE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tdetailedListByBillingMode.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"name\": modes[0].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"value\": preserved_sum,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"count\": preserved_count,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"split\": splitExtrasInGivenMode\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbillsGraphData.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": modes[0].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": preserved_sum \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t//Check if next exits in BILLING_MODES\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tif(modes[1]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tsingleClickDetailedByModesCallback(1, modes, paramsList);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tsingleClickRenderBillsGraph();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}); \n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}); \n\t\t\t\t\t\t\t\t\t\t \t} //end - pre process\n\n\n\n\n\n\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\t\t\treturn '';\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t}); \n\t\t\t\t\t\t\t\t\t} //else - mode\n\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t }\n\t\t\t\t\t });\n\n\n\t\t \t}\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 8,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\treturn '';\n\t }\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 8,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\treturn '';\n\t }\n\t \n\t },\n\t error: function(data) {\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 8,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\treturn '';\n\t }\n\n\t });\t\n\n\t}\n\n\n\t//Step 8 : Callback\n\tfunction singleClickDetailedByModesCallback(index, modes, paramsList){\n\n\t\t\t\t\t\t\t \t//For a given BILLING MODE, the total Sales in the given DATE RANGE\n\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbybillingmode?startkey=[\"'+modes[index].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t\t\t\t\t success: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t \tvar preserved_sum = 0;\n\t\t\t\t\t\t\t\t\t\t \tvar preserved_count = 0;\n\t\t\t\t\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t \t\tpreserved_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t \t\tpreserved_count = data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t \t//Extras in this given Billing Mode\n\t\t\t\t\t\t\t\t\t\t \tvar splitExtrasInGivenMode = [];\n\n\t\t\t\t\t\t\t\t\t\t \tif(paramsList[0]){\n\t\t\t\t\t\t\t\t\t\t \t\tpreProcessBillingSplits(0, paramsList, splitExtrasInGivenMode)\n\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t \tfunction preProcessBillingSplits(splitIndex, paramsList, formedSplitList){\n\n\t\t\t\t\t\t\t\t\t\t \t//For a given Billing Mode, amount split by billing params\n\t\t\t\t\t\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t\t\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyrefundmodes_splitbyextras?startkey=[\"'+modes[index].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t\t\t\t\t\t\t\t success: function(data) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t//Now check in custom extras also\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbyrefundmodes_splitbycustomextras?startkey=[\"'+modes[index].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].name+'\", \"'+paramsList[splitIndex].name+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Finally, push it\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tsplitExtrasInGivenMode.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"name\": paramsList[splitIndex].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"value\": temp_sum,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\"count\": temp_count\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t//Check if next exists in params list:\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tif(paramsList[splitIndex + 1]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\tpreProcessBillingSplits(splitIndex + 1, paramsList, splitExtrasInGivenMode);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\telse{ \t//Proceed to next BILLING MODE\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tdetailedListByBillingMode.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"name\": modes[index].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"value\": preserved_sum,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"count\": preserved_count,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\"split\": splitExtrasInGivenMode\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbillsGraphData.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"name\": modes[index].name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"value\": preserved_sum \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t//Check if next exits in BILLING_MODES\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \tif(modes[index+1]){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tsingleClickDetailedByModesCallback(index+1, modes, paramsList);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\tsingleClickRenderBillsGraph();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t\t}\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}); \n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}); \n\t\t\t\t\t\t\t\t\t\t \t} //end - pre process\n\n\n\t\t\t\t\t\t\t\t\t\t },\n\t\t\t\t\t\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t\t \"step\": 8,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different billing modes\"\n\t\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\t\t\t\t\t\t\t\t\treturn '';\t\t\t\t\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t\t}); \n\n\t}\n\n\n\n\t//Step 8-9: Render Graph (Bills)\n\tfunction singleClickRenderBillsGraph(){\n\n\t\t\twindow.localStorage.graphImageDataBills = '';\n\n\t\t\tif(billsGraphData.length == 0){\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickDetailedByPayment(); \n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tvar graph_labels = [];\n\t\t\tvar graph_data = [];\n\t\t\tvar graph_background = [];\n\t\t\tvar graph_border = [];\n\n\t\t\tvar m = 0;\n\t\t\tvar totalBaseSum = 0;\n\t\t\twhile(billsGraphData[m]){\n\t\t\t\ttotalBaseSum += billsGraphData[m].value;\n\t\t\t\tm++;\n\t\t\t} \n\n\t\t\tvar n = 0;\n\t\t\twhile(billsGraphData[n]){\n\t\t\t\tvar colorSet = random_rgba_color_set();\n\n\t\t\t\tgraph_labels.push(billsGraphData[n].name);\n\t\t\t\tgraph_data.push(parseFloat(((billsGraphData[n].value/totalBaseSum)*100)).toFixed(1))\n\t\t\t\tgraph_background.push(colorSet[0])\n\t\t\t\tgraph_border.push(colorSet[1])\n\n\t\t\t\tn++;\n\t\t\t}\n\n\n\t\t\tvar ctx = document.getElementById(\"reportGraphBills\").getContext('2d');\n\t\t\tvar myChart = new Chart(ctx, {\n\t\t\t type: 'pie',\n\t\t\t data: {\n\t\t\t labels: graph_labels,\n\t\t\t datasets: [{\n\t\t\t label: 'Billing Modes',\n\t\t\t data: graph_data,\n\t\t\t backgroundColor: graph_background,\n\t\t\t borderColor: graph_border,\n\t\t\t borderWidth: 1\n\t\t\t }]\n\t\t\t },\n\t\t\t options: { \t\n\t\t\t scales: {\n\t\t\t yAxes: [{\n\t\t\t \tdisplay:false,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: false\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:false\n\t\t \t}\n\t\t\t }]\n\t\t\t },\n\t\t\t animation: {\n\t\t onComplete: convertGraph\n\t\t }\n\t\t\t }\n\t\t\t});\t\n\n\t\t\tfunction convertGraph(){\n\t\t\t\tvar temp_graph = myChart.toBase64Image();\n\n\t\t\t\twindow.localStorage.graphImageDataBills = temp_graph;\n\n\t\t\t\t//Go to Step 9\n\t\t\t\tsingleClickDetailedByPayment();\n\t\t\t}\n\t}\n\n\n\t//Step 9: Details by Payment types\n\tfunction singleClickDetailedByPayment(){\n\n\t\trunReportAnimation(65); //of Step 8 which takes 25 units\n\n\t\tpaymentGraphData = [];\n\n\t var requestData = {\n\t \"selector\" :{ \n\t \"identifierTag\": \"ACCELERATE_PAYMENT_MODES\" \n\t },\n\t \"fields\" : [\"identifierTag\", \"value\"]\n\t }\n\n\t $.ajax({\n\t type: 'POST',\n\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t data: JSON.stringify(requestData),\n\t contentType: \"application/json\",\n\t dataType: 'json',\n\t timeout: 10000,\n\t success: function(data) {\n\n\t if(data.docs.length > 0){\n\t if(data.docs[0].identifierTag == 'ACCELERATE_PAYMENT_MODES'){\n\n\t \tvar modes = data.docs[0].value;\n\n\t \tif(modes.length == 0){\n\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\t\t\treturn '';\n\t\t \t}\n\t\t \telse{\n\t\t\t\t\t\t\n\t\t\t\t\t\t //For a given PAYMENT MODE, the total Sales in the given DATE RANGE\n\n\t\t\t\t\t\t $.ajax({\n\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbypaymentmode?startkey=[\"'+modes[0].code+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].code+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t success: function(data) {\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t\t//Now check in split payments\n\t\t\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbypaymentmode_multiple?startkey=[\"'+modes[0].code+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[0].code+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t \t\tif(temp_sum > 0){\n\t\t\t\t\t\t\t\t \t\t\tpaymentGraphData.push({\n\t\t\t\t\t\t\t\t\t\t \t\t\"name\": modes[0].name,\n\t\t\t\t\t\t\t\t\t\t \t\t\"value\": temp_sum\n\t\t\t\t\t\t\t\t\t\t \t})\n\t\t\t\t\t\t\t\t \t\t}\t\n\n\t\t\t\t\t\t\t\t \t\tdetailedListByPaymentMode.push({\n\t\t\t\t\t\t\t\t \t\t\t\"name\": modes[0].name,\n\t\t\t\t\t\t\t\t \t\t\t\"value\": temp_sum,\n\t\t\t\t\t\t\t\t \t\t\t\"count\": temp_count\n\t\t\t\t\t\t\t\t \t\t});\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\t\t \t//Check if next mode exists...\n\t\t\t\t\t\t\t\t\t \tif(modes[1]){\n\t\t\t\t\t\t\t\t\t \t\tsingleClickDetailedByPaymentCallback(1, modes, paymentGraphData);\n\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t\t\t \t\t//Step 10: Weekly Progress\n\t\t\t\t\t\t\t\t\t \t\tsingleClickWeeklyProgress();\n\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}); \n\n\n\t\t\t\t\t\t },\n\t\t\t\t\t\t error: function(data){\n\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t//Step 9-10: Render the Payment Graph \n\t\t\t\t\t\t\t\tsingleClickRenderPaymentsGraph(); \n\t\t\t\t\t\t\t\treturn '';\n\t\t\t\t\t\t }\n\t\t\t\t\t\t }); \n\t\t\t\t\t} \n\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 9,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t }\n\t }\n\t else{\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 9,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t }\n\t },\n\t error: function(data) {\n\t\t\t\tcompleteErrorList.push({\n\t\t\t\t \"step\": 9,\n\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t});\t\t\t\t\n\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t }\n\n\t });\n\t}\n\n\t//Step 9: Callback\n\tfunction singleClickDetailedByPaymentCallback(index, modes, paymentGraphData){\n\n\t\t\t\t\t\t //For a given PAYMENT MODE, the total Sales in the given DATE RANGE\n\n\t\t\t\t\t\t $.ajax({\n\t\t\t\t\t\t type: 'GET',\n\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbypaymentmode?startkey=[\"'+modes[index].code+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].code+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t success: function(data) {\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t \tvar temp_count = 0;\n\t\t\t\t\t\t \tvar temp_sum = 0;\n\n\t\t\t\t\t\t \tif(data.rows.length > 0){\n\t\t\t\t\t\t \t\ttemp_count = data.rows[0].value.count;\n\t\t\t\t\t\t \t\ttemp_sum = data.rows[0].value.sum;\n\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t \t\t//Now check in split payments\n\t\t\t\t\t\t\t \t$.ajax({\n\t\t\t\t\t\t\t\t\t\ttype: 'GET',\n\t\t\t\t\t\t\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/sumbypaymentmode_multiple?startkey=[\"'+modes[index].code+'\",\"'+fromDate+'\"]&endkey=[\"'+modes[index].code+'\",\"'+toDate+'\"]',\n\t\t\t\t\t\t\t\t\t\ttimeout: 10000,\n\t\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\t\t\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\t\t\t\t\t\t temp_count += data.rows[0].value.count;\n\t\t\t\t\t\t\t\t\t\t\t temp_sum += data.rows[0].value.sum;\n\t\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t \t\tif(temp_sum > 0){\n\t\t\t\t\t\t\t\t \t\t\tpaymentGraphData.push({\n\t\t\t\t\t\t\t\t\t\t \t\t\"name\": modes[index].name,\n\t\t\t\t\t\t\t\t\t\t \t\t\"value\": temp_sum\n\t\t\t\t\t\t\t\t\t\t \t})\n\t\t\t\t\t\t\t\t \t\t}\t\n\n\t\t\t\t\t\t\t\t \t\tdetailedListByPaymentMode.push({\n\t\t\t\t\t\t\t\t \t\t\t\"name\": modes[index].name,\n\t\t\t\t\t\t\t\t \t\t\t\"value\": temp_sum,\n\t\t\t\t\t\t\t\t \t\t\t\"count\": temp_count\n\t\t\t\t\t\t\t\t \t\t});\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\t\t \t//Check if next mode exists...\n\t\t\t\t\t\t\t\t\t \tif(modes[index+1]){\n\t\t\t\t\t\t\t\t\t \t\tsingleClickDetailedByPaymentCallback(index+1, modes, paymentGraphData);\n\t\t\t\t\t\t\t\t\t \t}\n\t\t\t\t\t\t\t\t\t \telse{\n\t\t\t\t\t\t\t\t\t \t\t//Step 9-10: Render the Payment Graph \n\t\t\t\t\t\t\t\t\t \t\tsingleClickRenderPaymentsGraph();\n\t\t\t\t\t\t\t\t\t \t}\n\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\terror: function(data){\n\t\t\t\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\t\t\t\t\t\t\t\treturn '';\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},\n\t\t\t\t\t \terror: function(data) {\n\t\t\t\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\t\t\t\t\treturn '';\t\t\t\t\t \t\n\t\t\t\t\t \t}\n\t\t\t\t\t });\n\t}\n\n\n\t//Step 9-10: Render Graph (Payments)\n\tfunction singleClickRenderPaymentsGraph(){\n\n\t\t\twindow.localStorage.graphImageDataPayments = '';\n\n\t\t\tif(paymentGraphData.length == 0){\n\t\t\t\t//Skip and go to next step\n\t\t\t\tsingleClickWeeklyProgress(); \n\t\t\t\treturn '';\n\t\t\t}\n\n\t\t\tvar graph_labels = [];\n\t\t\tvar graph_data = [];\n\t\t\tvar graph_background = [];\n\t\t\tvar graph_border = [];\n\n\t\t\tvar m = 0;\n\t\t\tvar totalBaseSum = 0;\n\t\t\twhile(paymentGraphData[m]){\n\t\t\t\ttotalBaseSum += paymentGraphData[m].value;\n\t\t\t\tm++;\n\t\t\t} \n\n\t\t\tvar n = 0;\n\t\t\twhile(paymentGraphData[n]){\n\t\t\t\tvar colorSet = random_rgba_color_set();\n\n\t\t\t\tgraph_labels.push(paymentGraphData[n].name);\n\t\t\t\tgraph_data.push(parseFloat(((paymentGraphData[n].value/totalBaseSum)*100)).toFixed(1))\n\t\t\t\tgraph_background.push(colorSet[0])\n\t\t\t\tgraph_border.push(colorSet[1])\n\n\t\t\t\tn++;\n\t\t\t}\n\n\n\t\t\tvar ctx = document.getElementById(\"reportGraphPayments\").getContext('2d');\n\t\t\tvar myChart = new Chart(ctx, {\n\t\t\t type: 'pie',\n\t\t\t data: {\n\t\t\t labels: graph_labels,\n\t\t\t datasets: [{\n\t\t\t label: 'Payment Types',\n\t\t\t data: graph_data,\n\t\t\t backgroundColor: graph_background,\n\t\t\t borderColor: graph_border,\n\t\t\t borderWidth: 1\n\t\t\t }]\n\t\t\t },\n\t\t\t options: {\t \t\n\t\t\t scales: {\n\t\t\t yAxes: [{\n\t\t\t \tdisplay:false,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: false\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:false\n\t\t \t}\n\t\t\t }]\n\t\t\t },\n\t\t\t animation: {\n\t\t onComplete: convertGraph\n\t\t }\n\t\t\t }\n\t\t\t});\t\n\t\t\tfunction convertGraph(){\n\t\t\t\tvar temp_graph = myChart.toBase64Image();\n\n\t\t\t\twindow.localStorage.graphImageDataPayments = temp_graph;\n\n\t\t\t\t//Go to Step 10\n\t\t\t\tsingleClickWeeklyProgress();\n\t\t\t}\n\t}\n\n\n\t//Step 10: Weekly Progress\n\tfunction singleClickWeeklyProgress(){\n\n\t\trunReportAnimation(75); //of Step 9 which takes 10 units\n\t\t\n\t\t/*\n\t\t\tNote: Rough figure only, refunds not included.\n\t\t*/\n\n\t\tvar lastWeek_start = moment(fromDate, 'YYYYMMDD').subtract(13, 'days').format('YYYYMMDD');\n\n\t\tvar currentIndex = 1;\n\n\t\tcalculateSalesByDate(currentIndex, lastWeek_start)\n\n\t\tfunction calculateSalesByDate(index, mydate){\n\n\t\t\trunReportAnimation(74 + index);\n\n\t\t\t$.ajax({\n\t\t\t type: 'GET',\n\t\t\t\turl: COMMON_LOCAL_SERVER_IP+'/'+SELECTED_INVOICE_SOURCE_DB+'/_design/invoice-summary/_view/grandtotal_paidamount?startkey=[\"'+mydate+'\"]&endkey=[\"'+mydate+'\"]',\n\t\t\t\ttimeout: 10000,\n\t\t\t\tsuccess: function(data) {\n\n\t\t\t\t\tvar temp_totalOrders = 0;\n\t\t\t\t\tvar temp_totalPaid = 0;\n\t\t\t\t\tvar fancyDay = moment(mydate, 'YYYYMMDD').format('ddd');\n\t\t\t\t\tvar fancyDate = moment(mydate, 'YYYYMMDD').format('MMM D');\n\n\t\t\t\t\tif(data.rows.length > 0){\n\t\t\t\t\t\ttemp_totalOrders = data.rows[0].value.count;\n\t\t\t\t\t\ttemp_totalPaid = data.rows[0].value.sum;\n\t\t\t\t\t}\n\n\t\t\t\t\tif(index <= 7){\n\t\t\t\t\t\tweeklyProgressLastWeek.push({\n\t\t\t\t\t\t\t\"name\": fancyDay+' ('+fancyDate+')',\n\t\t\t\t\t\t\t\"value\": temp_totalPaid\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\telse if(index <= 14){\n\t\t\t\t\t\tweeklyProgressThisWeek.push({\n\t\t\t\t\t\t\t\"name\": fancyDay+' ('+fancyDate+')',\n\t\t\t\t\t\t\t\"value\": temp_totalPaid\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\n\t\t\t\t\t//Next iterations\n\t\t\t\t\tif(index < 14){\n\t\t\t\t\t\tvar nextDate = moment(fromDate, 'YYYYMMDD').subtract((13 - index), 'days').format('YYYYMMDD');\n\t\t\t\t\t\tcalculateSalesByDate(index+1, nextDate);\n\t\t\t\t\t}\n\t\t\t\t\telse{\n\t\t\t\t\t\tsingleClickWeeklyWeeklyGraphRenderer();\n\t\t\t\t\t}\n\n\t\t\t\t},\n\t\t\t\terror: function(data){\n\t\t\t\t\tcompleteErrorList.push({\n\t\t\t\t\t \"step\": 9,\n\t\t\t\t\t\t\"error\": \"Failed to calculate sales by different payment modes\"\n\t\t\t\t\t});\t\t\t\t\n\n\t\t\t\t\t//Skip and go to next step\n\t\t\t\t\tsingleClickWeeklyWeeklyGraphRenderer(); \n\t\t\t\t\treturn '';\t\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}); \n\t\t}\n\n\t}\n\n\t//Step 11: Render Weekly Graph\n\tfunction singleClickWeeklyWeeklyGraphRenderer(){\n\n\t\trunReportAnimation(90); //of Step 10 which takes 14 units\n\n\t\tif(fromDate != toDate){\n\t\t\t//Skip and go to next step\n\t\t\tsingleClickGenerateAllReports();\n\t\t\treturn '';\n\t\t}\n\t\telse{\n\t\t\twindow.localStorage.graphImageDataWeekly = '';\n\t\t\twindow.localStorage.graphImageDataWeeklyBW = '';\n\t\t\tweeklyGraphBW();\n\t\t}\n\n\t\tfunction weeklyGraphBW(){\n\n\t\t\tvar graph_labels = [];\n\t\t\tvar graph_data = [];\n\n\t\t\tvar graph_border = [\"rgba(0, 0, 0, 1)\"];\n\t\t\tvar graph_border_last = [\"rgba(144, 144, 144, 1)\"];\n\n\t\t\t//This Weeks data\n\t\t\tvar n = 0;\n\t\t\twhile(weeklyProgressThisWeek[n]){\n\t\t\t\tgraph_labels.push(weeklyProgressThisWeek[n].name);\n\t\t\t\tgraph_data.push(parseInt(weeklyProgressThisWeek[n].value));\n\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\t//Last Weeks (exclude labels)\n\t\t\tvar graph_data_last = [];\n\t\t\tvar k = 0;\n\t\t\twhile(weeklyProgressLastWeek[k]){\n\t\t\t\tgraph_data_last.push(parseInt(weeklyProgressLastWeek[k].value));\n\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\n\n\t\t\tvar ctx = document.getElementById(\"weeklyTrendLineChartBW\").getContext('2d');\n\t\t\tvar myChart = new Chart(ctx, {\n\t\t\t type: 'line',\n\t\t\t data: {\n\t\t\t labels: graph_labels,\n\t\t\t datasets: [{\n\t\t\t label: 'This Week',\n\t\t\t data: graph_data,\n\t\t\t fill: false,\n\t\t\t borderColor: graph_border,\n\t\t\t borderWidth: 2\n\t\t\t \n\t\t\t },{\n\t\t\t label: 'Last Week',\n\t\t\t data: graph_data_last,\n\t\t\t fill: false,\n\t\t\t borderColor: graph_border_last,\n\t\t\t borderWidth: 2,\n\t\t\t borderDash: [10,5]\n\t\t\t }]\n\t\t\t },\n\t\t\t options: {\t \t\n\t\t\t scales: {\n\t\t\t yAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:true\n\t\t \t}\n\t\t\t }],\n\t\t\t xAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:false\n\t\t \t}\n\t\t\t }]\n\t\t\t },\n\t\t\t animation: {\n\t\t onComplete: convertGraph\n\t\t }\n\t\t\t }\n\t\t\t});\t\n\n\t\t\tfunction convertGraph(){\n\t\t\t\tvar temp_graph = myChart.toBase64Image();\n\t\t\t\twindow.localStorage.graphImageDataWeeklyBW = temp_graph;\n\n\t\t\t\tweeklyGraphColored();\t\t\t\n\t\t\t}\n\t\t}\n\n\n\n\t\tfunction weeklyGraphColored(){ //Colorfull Graph!\n\n\t\t\tvar graph_labels = [];\n\t\t\tvar graph_data = [];\n\n\t\t\tvar graph_background = [\"rgba(103, 210, 131, 0.2)\"];\n\t\t\tvar graph_background_last = [\"rgba(255, 177, 0, 0.2)\"];\n\n\t\t\tvar graph_border = [\"rgba(103, 210, 131, 1)\"];\n\t\t\tvar graph_border_last = [\"rgba(255, 177, 0, 1)\"];\n\n\t\t\t//This Weeks data\n\t\t\tvar n = 0;\n\t\t\twhile(weeklyProgressThisWeek[n]){\n\t\t\t\tgraph_labels.push(weeklyProgressThisWeek[n].name);\n\t\t\t\tgraph_data.push(parseInt(weeklyProgressThisWeek[n].value));\n\n\t\t\t\tn++;\n\t\t\t}\n\n\n\t\t\t//Last Weeks (exclude labels)\n\t\t\tvar graph_data_last = [];\n\t\t\tvar k = 0;\n\t\t\twhile(weeklyProgressLastWeek[k]){\n\t\t\t\tgraph_data_last.push(parseInt(weeklyProgressLastWeek[k].value));\n\t\t\t\t\n\t\t\t\tk++;\n\t\t\t}\n\n\t\t\tvar ctx = document.getElementById(\"weeklyTrendLineChart\").getContext('2d');\n\t\t\tvar myChart = new Chart(ctx, {\n\t\t\t type: 'line',\n\t\t\t data: {\n\t\t\t labels: graph_labels,\n\t\t\t datasets: [{\n\t\t\t label: 'This Week',\n\t\t\t data: graph_data,\n\t\t\t borderColor: graph_border,\n\t\t\t backgroundColor: graph_background,\n\t\t\t borderWidth: 2\n\t\t\t \n\t\t\t },{\n\t\t\t label: 'Last Week',\n\t\t\t data: graph_data_last,\n\t\t\t backgroundColor: graph_background_last,\n\t\t\t borderColor: graph_border_last,\n\t\t\t borderWidth: 2,\n\t\t\t borderDash: [10,5]\n\t\t\t }]\n\t\t\t },\n\t\t\t options: {\t \t\n\t\t\t scales: {\n\t\t\t yAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:true\n\t\t \t}\n\t\t\t }],\n\t\t\t xAxes: [{\n\t\t\t \tdisplay:true,\n\t\t\t ticks: {\n\t\t\t beginAtZero:true,\n\t\t\t display: true\n\t\t\t },\n\t\t\t gridLines: {\n\t\t \tdisplay:false\n\t\t \t}\n\t\t\t }]\n\t\t\t },\n\t\t\t animation: {\n\t\t onComplete: convertGraph\n\t\t }\n\t\t\t }\n\t\t\t});\t\n\n\t\t\tfunction convertGraph(){\n\t\t\t\tvar temp_graph = myChart.toBase64Image();\n\t\t\t\twindow.localStorage.graphImageDataWeekly = temp_graph;\n\n\t\t\t\tsingleClickGenerateAllReports();\n\t\t\t}\n\t\t}\n\t}\n\n\n\t//Step 12: Final Reports Render Stage\n\tfunction singleClickGenerateAllReports(){\n\n\n\t //PENDING --> TOTAL CALCULATED ROUND OFFFFF\n\t console.log('PENDING API --> TOTAL CALCULATED ROUND OFFFFF')\n\t \n\n\t\trunReportAnimation(95); //of Step 11 which completed the data processing\n\n\n\t\t//Get staff info.\n\t\tvar loggedInStaffInfo = window.localStorage.loggedInStaffData ? JSON.parse(window.localStorage.loggedInStaffData) : {};\n\t\t\n\t\tif(jQuery.isEmptyObject(loggedInStaffInfo)){\n\t\t\tloggedInStaffInfo.name = 'Staff';\n\t\t\tloggedInStaffInfo.code = '0000000000';\n\t\t}\t\n\n\n\t\tvar reportInfo_branch = window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '';\n\t\t\t\n\t\tif(reportInfo_branch == ''){\n\t\t\tshowToast('System Error: Branch name not found. Please contact Accelerate Support.', '#e74c3c');\n\t\t\treturn '';\n\t\t}\n\n\t\tvar temp_address_modified = (window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '') + ' - ' + (window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '');\n\t\tvar data_custom_footer_address = window.localStorage.bill_custom_footer_address ? window.localStorage.bill_custom_footer_address : '';\n\n\t\tvar reportInfo_admin = loggedInStaffInfo.name;\n\t\tvar reportInfo_time = moment().format('h:mm a, DD-MM-YYYY');\n\t\tvar reportInfo_address = data_custom_footer_address != '' ? data_custom_footer_address : temp_address_modified;\n\n\n\t\t//Reset Token Number and KOT Number (if preference set)\n\t\tresetBillingCounters();\n\n\t\tgenerateReportContentDownload();\n\n\t\tfunction generateReportContentDownload(){\n\n\t\t\t//To display weekly graph or not\n\t\t\tvar hasWeeklyGraphAttached = false;\n\t\t\tif(window.localStorage.graphImageDataWeekly && window.localStorage.graphImageDataWeekly != ''){\n\t\t\t\thasWeeklyGraphAttached = true;\n\t\t\t}\n\n\t\t\tvar graphRenderSectionContent = '';\n\t\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\t\tif(fromDate != toDate){\n\t\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t\t}\n\t\t else{ //Render graph only if report is for a day\n\n\t\t if(hasWeeklyGraphAttached){\n\n\t\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t\t graphRenderSectionContent = ''+\n\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t '<div class=\"summaryTableSection\">'+\n\t\t '<div class=\"tableQuickHeader\">'+\n\t\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t\t '</div>'+\n\t\t '<div class=\"weeklyGraph\">'+\n\t\t '<img src=\"'+window.localStorage.graphImageDataWeekly+'\" style=\"max-width: 90%\">'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '</div>';\n\t\t }\n\t\t }\n\n\t\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\t\t //Quick Summary Content\n\t\t var quickSummaryRendererContent = '';\n\n\t\t var a = 0;\n\t\t while(reportInfoExtras[a]){\n\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t\t a++;\n\t\t }\n\n\n\t\t var b = 1; //first one contains total paid\n\t\t while(completeReportInfo[b]){\n\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t\t b++;\n\t\t }\n\n\n\t\t //Sales by Billing Modes Content\n\t\t var salesByBillingModeRenderContent = '';\n\t\t var c = 0;\n\t\t var billSharePercentage = 0;\n\t\t while(detailedListByBillingMode[c]){\n\t\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t\t c++;\n\t\t }\n\n\t\t\t//To display bills graph or not\n\t\t\tvar hasBillsGraphAttached = false;\n\t\t\tif(window.localStorage.graphImageDataBills && window.localStorage.graphImageDataBills != '' && window.localStorage.graphImageDataBills != 'data:,'){\n\t\t\t\thasBillsGraphAttached = true;\n\t\t\t}\n\n\t\t var salesByBillingModeRenderContentFinal = '';\n\t\t if(salesByBillingModeRenderContent != ''){\n\n\t\t \tif(hasBillsGraphAttached){\n\t\t\t\t salesByBillingModeRenderContentFinal = ''+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t \t'<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t\t\t\t \t'</div>'+\n\t\t\t\t \t'<div class=\"tableGraphRow\">'+\n\t\t\t\t\t\t '<div class=\"tableGraph_Graph\"> <img src=\"'+window.localStorage.graphImageDataBills+'\" width=\"200px\"> </div>'+\n\t\t\t\t\t\t '<div class=\"tableGraph_Table\">'+\t\n\t\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t\t salesByBillingModeRenderContent+\n\t\t\t\t\t '</table>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '</div>'+\t\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>';\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t salesByBillingModeRenderContentFinal = ''+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t salesByBillingModeRenderContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>';\t\t\t\t\n\t\t\t\t}\n\t\t }\n\n\n\t\t //Sales by Payment Types Content\n\t\t var salesByPaymentTypeRenderContent = '';\n\t\t var d = 0;\n\t\t var paymentSharePercentage = 0;\n\t\t while(detailedListByPaymentMode[d]){\n\t\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t\t d++;\n\t\t }\n\n\t\t\t//To display payment graph or not\n\t\t\tvar hasPaymentsGraphAttached = false;\n\t\t\tif(window.localStorage.graphImageDataPayments && window.localStorage.graphImageDataPayments != '' && window.localStorage.graphImageDataPayments != 'data:,'){\n\t\t\t\thasPaymentsGraphAttached = true;\n\t\t\t}\n\n\t\t var salesByPaymentTypeRenderContentFinal = '';\n\t\t if(salesByPaymentTypeRenderContent != ''){\n\n\t\t \tif(hasPaymentsGraphAttached){\n\t\t\t salesByPaymentTypeRenderContentFinal = ''+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t \t'<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t\t\t \t'</div>'+\n\t\t\t \t'<div class=\"tableGraphRow\">'+\n\t\t\t\t\t '<div class=\"tableGraph_Graph\"> <img src=\"'+window.localStorage.graphImageDataPayments+'\" width=\"200px\"> </div>'+\n\t\t\t\t\t '<div class=\"tableGraph_Table\">'+\t\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t salesByPaymentTypeRenderContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>';\n\t\t\t }\n\t\t\t else{\n\t\t\t \tsalesByPaymentTypeRenderContentFinal = ''+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t salesByPaymentTypeRenderContent+\n\t\t\t '</table>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>';\n\t\t\t }\n\t\t }\n\n\t\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px;text-align:center}.factsBox{margin-right: 5px; width:18%; display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:35%;display:block;text-align:center;float:right;position:absolute;top:20px;left:62%}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:55%;display:block;min-height:250px;}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t\t \n\t\t var finalReport_downloadContent = cssData+\n\t\t\t '<body>'+\n\t\t\t '<div class=\"mainHeader\">'+\n\t\t\t '<div class=\"headerLeftBox\">'+\n\t\t\t '<div id=\"logo\">'+\n\t\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t\t '</div>'+\n\t\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"headerRightBox\">'+\n\t\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"introFacts\">'+\n\t\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t\t '<div class=\"factsArea\">'+\n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+graphRenderSectionContent+\n\t\t\t (hasWeeklyGraphAttached ? '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>' : '')+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Amount</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t\t quickSummaryRendererContent+\n\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t\t '</table>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>'+\n\t\t\t salesByBillingModeRenderContentFinal+\n\t\t\t salesByPaymentTypeRenderContentFinal+\n\t\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t\t '<p class=\"footerNote\">www.accelerate.net.in | support@accelerate.net.in</p>'+\n\t\t\t '</div>'+\n\t\t\t '</body>';\n\n\t\t\t\tvar finalContent_EncodedDownload = encodeURI(finalReport_downloadContent);\n\t\t\t\t$('#reportActionButtonDownload').attr('data-hold', finalContent_EncodedDownload);\n\n\t\t\t\tvar finalContent_EncodedText = encodeURI(fancy_report_title_name);\n\t\t\t\t$('#reportActionButtonDownload').attr('text-hold', finalContent_EncodedText);\n\n\t\t\t\tgenerateReportContentEmail();\n\n\t\t}\n\n\t\tfunction generateReportContentEmail(){\n\n\t\t\t\trunReportAnimation(97);\n\n\t\t\t\t//To display weekly graph or not\n\t\t\t\tvar hasWeeklyGraphAttached = false;\n\t\t\t\tif(window.localStorage.graphImageDataWeekly && window.localStorage.graphImageDataWeekly != ''){\n\t\t\t\t\thasWeeklyGraphAttached = true;\n\t\t\t\t}\n\n\t\t\t\tvar temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\n\t\t\t\tvar graphRenderSectionContent = '';\n\t\t\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\t\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\t\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\t\t\tif(fromDate != toDate){\n\t\t\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t\t\t}\n\t\t\t else{ //Render graph only if report is for a day\n\n\t\t\t if(hasWeeklyGraphAttached){\n\n\t\t\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t\t\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t\t\t graphRenderSectionContent = ''+\n\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"weeklyGraph\">'+\n\t\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/report_trend_images_repo/'+temp_image_name+'.png\" style=\"max-width: 90%\">'+\n\t\t\t '</div>'+\n\t\t\t '</div>'+\n\t\t\t '</div>';\n\t\t\t }\n\t\t\t }\n\n\t\t\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\t\t\t //Quick Summary Content\n\t\t\t var quickSummaryRendererContent = '';\n\n\t\t\t var a = 0;\n\t\t\t while(reportInfoExtras[a]){\n\t\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t\t\t a++;\n\t\t\t }\n\n\n\t\t\t var b = 1; //first one contains total paid\n\t\t\t while(completeReportInfo[b]){\n\t\t\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t\t\t b++;\n\t\t\t }\n\n\n\t\t\t //Sales by Billing Modes Content\n\t\t\t var salesByBillingModeRenderContent = '';\n\t\t\t var c = 0;\n\t\t\t var billSharePercentage = 0;\n\t\t\t while(detailedListByBillingMode[c]){\n\t\t\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t\t\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t\t\t c++;\n\t\t\t }\n\n\t\t\t\t//To display bills graph or not\n\t\t\t\tvar hasBillsGraphAttached = false;\n\t\t\t\tif(window.localStorage.graphImageDataBills && window.localStorage.graphImageDataBills != '' && window.localStorage.graphImageDataBills != 'data:,'){\n\t\t\t\t\thasBillsGraphAttached = true;\n\t\t\t\t}\n\n\t\t\t var salesByBillingModeRenderContentFinal = '';\n\t\t\t if(salesByBillingModeRenderContent != ''){\n\t\t\t\t\t salesByBillingModeRenderContentFinal = ''+\n\t\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t\t salesByBillingModeRenderContent+\n\t\t\t\t\t '</table>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '</div>'+\n\t\t\t\t\t '</div>';\n\t\t\t }\n\n\n\t\t\t //Sales by Payment Types Content\n\t\t\t var salesByPaymentTypeRenderContent = '';\n\t\t\t var d = 0;\n\t\t\t var paymentSharePercentage = 0;\n\t\t\t while(detailedListByPaymentMode[d]){\n\t\t\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t\t\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t\t\t d++;\n\t\t\t }\n\n\t\t\t var salesByPaymentTypeRenderContentFinal = '';\n\t\t\t if(salesByPaymentTypeRenderContent != ''){\n\t\t\t\t \tsalesByPaymentTypeRenderContentFinal = ''+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t salesByPaymentTypeRenderContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>';\n\t\t\t }\n\n\t\t\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t\t\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px;text-align:center}.factsBox{margin-right: 5px; width:18%; display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:35%;display:block;text-align:center;float:right;position:absolute;top:20px;left:62%}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:55%;display:block;min-height:250px;}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t\t\t \n\t\t\t var finalReport_emailContent = '<html>'+cssData+\n\t\t\t\t '<body>'+\n\t\t\t\t '<div class=\"mainHeader\">'+\n\t\t\t\t '<div class=\"headerLeftBox\">'+\n\t\t\t\t '<div id=\"logo\">'+\n\t\t\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"headerRightBox\">'+\n\t\t\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"introFacts\">'+\n\t\t\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t\t\t '<div class=\"factsArea\">'+\n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+graphRenderSectionContent+\n\t\t\t\t (hasWeeklyGraphAttached ? '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>' : '')+\n\t\t\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t\t\t '<div class=\"summaryTableSection\">'+\n\t\t\t\t '<div class=\"tableQuickHeader\">'+\n\t\t\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div class=\"tableQuick\">'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 70%\">'+\n\t\t\t\t '<col style=\"width: 30%\">'+\n\t\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Sales</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t\t\t quickSummaryRendererContent+\n\t\t\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '<div style=\"page-break-before: always; margin-top: 20px\"></div><div style=\"height: 30px; width: 100%; display: block\"></div>'+\n\t\t\t\t salesByBillingModeRenderContentFinal+\n\t\t\t\t salesByPaymentTypeRenderContentFinal+\n\t\t\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t\t\t '<p class=\"footerNote\">www.accelerate.net.in | support@accelerate.net.in</p>'+\n\t\t\t\t '</div>'+\n\t\t\t\t '</body>'+\n\t\t\t\t '<html>';\n\n\t\t\t\tvar finalContent_EncodedEmail = encodeURI(finalReport_emailContent);\n\t\t\t\t$('#reportActionButtonEmail').attr('data-hold', finalContent_EncodedEmail);\n\n\t\t\t\tvar myFinalCollectionText = {\n\t\t\t\t\t\"reportTitle\" : fancy_report_title_name,\n\t\t\t\t\t\"imageName\": reportInfo_branch+'_'+fromDate\n\t\t\t\t}\n\n\t\t\t\tvar finalContent_EncodedText = encodeURI(JSON.stringify(myFinalCollectionText));\n\t\t\t\t$('#reportActionButtonEmail').attr('text-hold', finalContent_EncodedText);\t\n\n\t\t\t\tgenerateReportContentPrint();\t\t\n\t\t}\n\n\t\tfunction generateReportContentPrint(){\n\n\t\t\trunReportAnimation(99);\n\n\t\t\tvar graphRenderSectionContent = '';\n\t\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\t\tif(fromDate != toDate){\n\t\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t\t}\n\n\n\t\t //Quick Summary Content\n\t\t var quickSummaryRendererContent = '';\n\n\t\t var a = 0;\n\t\t while(reportInfoExtras[a]){\n\t\t quickSummaryRendererContent += '<tr><td style=\"font-size: 11px\">'+reportInfoExtras[a].name+'</td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t\t a++;\n\t\t }\n\n\t\t var b = 1; //first one contains total paid\n\t\t while(completeReportInfo[b]){\n\t\t quickSummaryRendererContent += '<tr><td style=\"font-size: 11px\">'+completeReportInfo[b].name+'</td><td style=\"font-size: 11px; text-align: right\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span style=\"font-size: 60%\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t\t b++;\n\t\t }\n\n\t\t var printSummaryAll = ''+\n\t\t \t'<div class=\"KOTContent\">'+\n\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">OVERALL SUMMARY</h2>'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t '<tr><td style=\"font-size: 11px\"><b>Gross Sales</b></td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t\t quickSummaryRendererContent+\n\t\t\t '<tr><td style=\"font-size: 13px\"><b>Net Sales</b></td><td style=\"font-size: 13px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t\t '</table>'+\n\t\t\t '</div>';\n\n\t\t //Sales by Billing Modes Content\n\t\t var printSummaryBillsContent = '';\n\t\t var c = 0;\n\t\t var billSharePercentage = 0;\n\t\t while(detailedListByBillingMode[c]){\n\t\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t\t printSummaryBillsContent += '<tr><td style=\"font-size: 11px\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span style=\"font-style:italic; font-size: 60%; display: block;\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t\t c++;\n\t\t }\n\n\t\t var printSummaryBills = '';\n\t\t if(printSummaryBillsContent != ''){\n\t\t\t\tprintSummaryBills = ''+\n\t\t\t \t'<div class=\"KOTContent\">'+\n\t\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">BILLING MODES</h2>'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t\t printSummaryBillsContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>';\t\n\t\t }\n\n\n\t\t //Sales by Payment Types Content\n\t\t var printSummaryPaymentContent = '';\n\t\t var d = 0;\n\t\t var paymentSharePercentage = 0;\n\t\t while(detailedListByPaymentMode[d]){\n\t\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t\t printSummaryPaymentContent += '<tr><td style=\"font-size: 11px\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span style=\"font-style:italic; font-size: 60%; display: block;\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td style=\"font-size: 11px; text-align: right\"><span style=\"font-size: 60%\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>'; \n\t\t d++;\n\t\t }\n\n\t\t var printSummaryPayment = '';\n\t\t if(printSummaryPaymentContent != ''){\n\t\t\t printSummaryPayment = ''+\n\t\t\t \t'<div class=\"KOTContent\">'+\n\t\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">PAYMENT TYPES</h2>'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t\t printSummaryPaymentContent+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>';\t\n\t\t }\n\n\n\t\t var printSummaryCounts = ''+\n\t\t\t \t'<div class=\"KOTContent\">'+\n\t\t\t \t\t '<h2 style=\"text-align: center; margin: 5px 0 3px 0; font-weight: bold; border-bottom: 1px solid #444;\">OTHER DETAILS</h2>'+\n\t\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t\t '<col style=\"width: 85%\">'+\n\t\t\t\t '<col style=\"width: 15%\">'+ \n\t\t\t\t '<tr><td style=\"font-size: 10px\">Total Guests</td><td style=\"font-size: 13px\">'+netGuestsCount+'</td></tr>'+\n\t\t\t\t '<tr><td style=\"font-size: 10px\">Total Bills</td><td style=\"font-size: 13px\">'+completeReportInfo[0].count+'</td></tr>'+\n\t\t\t\t '</table>'+\n\t\t\t\t '</div>';\n\n\n\n\n\t\t var cssData = '<head> <style type=\"text/css\"> .KOTContent,.KOTHeader,.KOTNumberArea,.KOTSummary{width:100%;background-color:none}.subLabel,body{font-family:sans-serif}.KOTNumber,.invoiceNumber,.subLabel{letter-spacing:2px}#logo{min-height:60px;width:100%;border-bottom:2px solid #000}.KOTHeader,.KOTNumberArea{min-height:30px;padding:5px 0;border-bottom:1px solid #7b7b7b}.KOTContent{min-height:100px;font-size:11px;padding-top:6px;border-bottom:2px solid}.KOTSummary{font-size:11px;padding:5px 0;border-bottom:1px solid}.KOTContent td,.KOTContent table{border-collapse:collapse}.KOTContent td{border-bottom:1px dashed #444;padding:7px 0}.invoiceHeader,.invoiceNumberArea{padding:5px 0;border-bottom:1px solid #7b7b7b;width:100%;background-color:none}.KOTSpecialComments{min-height:20px;width:100%;background-color:none;padding:5px 0}.invoiceNumberArea{min-height:30px}.invoiceContent{min-height:100px;width:100%;background-color:none;font-size:11px;padding-top:6px;border-bottom:1px solid}.invoiceCharges{min-height:90px;font-size:11px;width:100%;background-color:none;padding:5px 0;border-bottom:2px solid}.invoiceCustomText,.invoicePaymentsLink{background-color:none;border-bottom:1px solid;width:100%}.invoicePaymentsLink{min-height:72px}.invoiceCustomText{padding:5px 0;font-size:12px;text-align:center}.subLabel{display:block;font-size:8px;font-weight:300;text-transform:uppercase;margin-bottom:5px}p{margin:0}.itemComments,.itemOldComments{font-style:italic;margin-left:10px}.serviceType{border:1px solid;padding:4px;font-size:12px;display:block;text-align:center;margin-bottom:8px}.tokenNumber{display:block;font-size:16px;font-weight:700}.billingAddress,.timeStamp{font-weight:300;display:block}.billingAddress{font-size:12px;line-height:1.2em}.mobileNumber{display:block;margin-top:8px;font-size:12px}.timeStamp{font-size:11px}.KOTNumber{font-size:15px;font-weight:700}.commentsSubText{font-size:12px;font-style:italic;font-weight:300;display:block}.invoiceNumber{font-size:15px;font-weight:700}.timeDisplay{font-size:75%;display:block}.rs{font-size:60%}.paymentSubText{font-size:10px;font-weight:300;display:block}.paymentSubHead{font-size:12px;font-weight:700;display:block}.qrCode{width:100%;max-width:120px;text-align:right}.addressContact,.addressText{color:gray;text-align:center}.addressText{font-size:10px;padding:5px 0}.addressContact{font-size:9px;padding:0 0 5px}.gstNumber{font-weight:700;font-size:10px}.attendantName,.itemQuantity{font-size:12px}#defaultScreen{position:fixed;left:0;top:0;z-index:100001;width:100%;height:100%;overflow:visible;background-image:url(../data/photos/brand/pattern.jpg);background-repeat:repeat;padding-top:100px}.attendantName{font-weight:300;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.itemComments,.itemQuantity{font-weight:700;display:block}.itemOldComments{display:block;text-decoration:line-through}.itemOldQuantity{font-size:12px;text-decoration:line-through;display:block} </style> </head>';\n\n\t\t var data_custom_header_image = window.localStorage.bill_custom_header_image ? window.localStorage.bill_custom_header_image : '';\n\n\t\t var data_custom_header_client_name = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '';\n\t\t\tif(data_custom_header_client_name == ''){\n\t\t\t data_custom_header_client_name = 'Report';\n\t\t\t}\n\n\t\t var finalReport_printContent = cssData +\n\t\t \t'<body>'+\n\t\t\t '<div id=\"logo\">'+\n\t\t\t (data_custom_header_image != '' ? '<center><img style=\"max-width: 90%\" src=\\''+data_custom_header_image+'\\'/></center>' : '<h1 style=\"text-align: center\">'+data_custom_header_client_name+'</h1>')+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"KOTHeader\" style=\"padding: 0; background: #444;\">'+\n\t\t\t \t'<p style=\"text-align: center; font-size: 16px; font-weight: bold; text-transform: uppercase; padding-top: 6px; color: #FFF;\">'+reportInfo_branch+'</p>'+\n\t\t\t '</div>'+\n\t\t\t '<div class=\"KOTNumberArea\">'+\n\t\t\t '<table style=\"width: 100%\">'+\n\t\t\t '<col style=\"width: 50%\">'+\n\t\t\t '<col style=\"width: 50%\">'+\n\t\t\t '<tr>'+\n\t\t\t '<td style=\"vertical-align: top\">'+\n\t\t\t '<p>'+\n\t\t\t '<tag class=\"subLabel\">Admin</tag>'+\n\t\t\t '<tag class=\"KOTNumber\" style=\"font-size: 13; font-weight: 300; letter-spacing: unset;\">'+reportInfo_admin+'</tag>'+\n\t\t\t '</p>'+\n\t\t\t '</td>'+\n\t\t\t '<td style=\"vertical-align: top\">'+\n\t\t\t '<p style=\" text-align: right; float: right\">'+\n\t\t\t '<tag class=\"subLabel\">TIME STAMP</tag>'+\n\t\t\t '<tag class=\"timeStamp\">'+reportInfo_time+'</tag>'+\n\t\t\t '</p>'+\n\t\t\t '</td>'+\n\t\t\t '</tr>'+\n\t\t\t '</table>'+\n\t\t\t '</div>'+\n\t\t\t '<h1 style=\"margin: 6px 3px; padding-bottom: 5px; font-weight: 400; text-align: center; font-size: 15px; border-bottom: 2px solid; }\">'+reportInfo_title+'</h1>'+\n\t\t\t \t printSummaryAll+printSummaryBills+printSummaryPayment+printSummaryCounts+\n\t\t\t \t'</body>';\n\n\t\t\t\tvar finalContent_EncodedPrint = encodeURI(finalReport_printContent);\n\t\t\t\t$('#reportActionButtonPrint').attr('data-hold', finalContent_EncodedPrint);\n\n\t\t\t\trunReportAnimation(100); //Done!\n\t\t}\n\t}\t\n\n\n\n\n\t//Step 12: Final Render Stage - EMAIL\n\tfunction singleClickWeeklyFinalReportRender(graphImage){\n\t\trunReportAnimation(100); //of Step 11 which completed the data processing\n\n\t\t//Get staff info.\n\t\tvar loggedInStaffInfo = window.localStorage.loggedInStaffData ? JSON.parse(window.localStorage.loggedInStaffData) : {};\n\t\t\n\t\tif(jQuery.isEmptyObject(loggedInStaffInfo)){\n\t\t\tloggedInStaffInfo.name = 'Staff';\n\t\t\tloggedInStaffInfo.code = '0000000000';\n\t\t}\t\n\n\n\t\tvar reportInfo_branch = window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '';\n\t\tvar temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\n\t\tif(reportInfo_branch == ''){\n\t\t\tshowToast('System Error: Branch name not found. Please contact Accelerate Support.', '#e74c3c');\n\t\t\treturn '';\n\t\t}\n\n\t\tvar temp_address_modified = (window.localStorage.accelerate_licence_branch_name ? window.localStorage.accelerate_licence_branch_name : '') + ' - ' + (window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name : '');\n\t\tvar data_custom_footer_address = window.localStorage.bill_custom_footer_address ? window.localStorage.bill_custom_footer_address : '';\n\n\t\tvar reportInfo_admin = loggedInStaffInfo.name;\n\t\tvar reportInfo_time = moment().format('h:mm a, DD-MM-YYYY');\n\t\tvar reportInfo_address = data_custom_footer_address != '' ? data_custom_footer_address : temp_address_modified;\n\n\n\t\tif(graphImage && graphImage != ''){\n\t\t\twindow.localStorage.graphImageDataWeekly = graphImage;\n\t\t}\n\t\telse{\n\t\t\twindow.localStorage.graphImageDataWeekly = '';\n\t\t}\n\n\n\t\tvar graphRenderSectionContent = '';\n\t\tvar fancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY - dddd');\n\n\t\tvar reportInfo_title = 'Sales Report of <b>'+fancy_from_date+'</b>';\n\t\tvar temp_report_title = 'Sales Report of '+fancy_from_date;\n\t\tif(fromDate != toDate){\n\t\t\tfancy_from_date = moment(fromDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\t\t\tvar fancy_to_date = moment(toDate, 'YYYYMMDD').format('Do MMMM YYYY');\n\n\t\t\treportInfo_title = 'Sales Report from <b>'+fancy_from_date+'</b> to <b>'+fancy_to_date+'</b>';\n\t\t\ttemp_report_title = 'Sales Report from '+fancy_from_date+' to '+fancy_to_date;\n\t\t}\n\t else{ //Render graph only if report is for a day\n\n\t if(graphImage){\n\n\t \tvar temp_image_name = reportInfo_branch+'_'+fromDate;\n\t \ttemp_image_name = temp_image_name.replace(/\\s/g,'');\n\n\t graphRenderSectionContent = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">WEEKLY SALES TREND</h1>'+\n\t '</div>'+\n\t '<div class=\"weeklyGraph\">'+\n\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/report_trend_images_repo/'+temp_image_name+'.png\" style=\"max-width: 90%\">'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\t }\n\n\t var fancy_report_title_name = reportInfo_branch+' - '+temp_report_title;\n\n\n\t //Quick Summary Content\n\t var quickSummaryRendererContent = '';\n\n\t var a = 0;\n\t while(reportInfoExtras[a]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+reportInfoExtras[a].name+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(reportInfoExtras[a].value).toFixed(2)+'</td></tr>';\n\t a++;\n\t }\n\n\t //PENDING --> TOTAL CALCULATED ROUND OFFFFF\n\t console.log('PENDING API --> TOTAL CALCULATED ROUND OFFFFF')\n\n\t var b = 1; //first one contains total paid\n\t while(completeReportInfo[b]){\n\t quickSummaryRendererContent += '<tr><td class=\"tableQuickBrief\">'+completeReportInfo[b].name+'</td><td class=\"tableQuickAmount\">'+(completeReportInfo[b].type == 'NEGATIVE' && completeReportInfo[b].value != 0 ? '- ' : '')+'<span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[b].value).toFixed(2)+'</td></tr>';\n\t b++;\n\t }\n\n\n\t //Sales by Billing Modes Content\n\t var salesByBillingModeRenderContent = '';\n\t var c = 0;\n\t var billSharePercentage = 0;\n\t while(detailedListByBillingMode[c]){\n\t billSharePercentage = parseFloat((100*detailedListByBillingMode[c].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByBillingModeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByBillingMode[c].name+' '+(billSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+billSharePercentage+'%)</span>' : '')+(detailedListByBillingMode[c].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByBillingMode[c].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByBillingMode[c].value).toFixed(0)+'</td></tr>';\n\t c++;\n\t }\n\n\t var salesByBillingModeRenderContentFinal = '';\n\t if(salesByBillingModeRenderContent != ''){\n\t salesByBillingModeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY BILLS</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByBillingModeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\t //Sales by Payment Types Content\n\t var salesByPaymentTypeRenderContent = '';\n\t var d = 0;\n\t var paymentSharePercentage = 0;\n\t while(detailedListByPaymentMode[d]){\n\t paymentSharePercentage = parseFloat((100*detailedListByPaymentMode[d].value)/completeReportInfo[0].value).toFixed(0);\n\t salesByPaymentTypeRenderContent += '<tr><td class=\"tableQuickBrief\">'+detailedListByPaymentMode[d].name+' '+(paymentSharePercentage > 0 ? '<span style=\"color: #5a5757\">('+paymentSharePercentage+'%)</span>' : '')+(detailedListByPaymentMode[d].count > 0 ? '<span class=\"smallOrderCount\">'+detailedListByPaymentMode[d].count+' orders</span>' : '')+'</td><td class=\"tableQuickAmount\"><span class=\"price\">Rs.</span>'+parseFloat(detailedListByPaymentMode[d].value).toFixed(0)+'</td></tr>';\n\t d++;\n\t }\n\n\t var salesByPaymentTypeRenderContentFinal = '';\n\t if(salesByPaymentTypeRenderContent != ''){\n\t salesByPaymentTypeRenderContentFinal = ''+\n\t '<div class=\"summaryTableSectionHolder\">'+\n\t '<div class=\"summaryTableSection\">'+\n\t '<div class=\"tableQuickHeader\">'+\n\t '<h1 class=\"tableQuickHeaderText\">SUMMARY BY PAYMENT</h1>'+\n\t '</div>'+\n\t '<div class=\"tableQuick\">'+\n\t '<table style=\"width: 100%\">'+\n\t '<col style=\"width: 70%\">'+\n\t '<col style=\"width: 30%\">'+\n\t salesByPaymentTypeRenderContent+\n\t '</table>'+\n\t '</div>'+\n\t '</div>'+\n\t '</div>';\n\t }\n\n\n\n\n\t var temp_licenced_client = window.localStorage.accelerate_licence_client_name ? window.localStorage.accelerate_licence_client_name.toLowerCase() : 'common';\n\t var cssData = '<head> <style type=\"text/css\"> body{font-family:sans-serif;margin:0}#logo{min-height:60px;width:100%}.mainHeader{background:url(https://accelerateengine.app/clients/'+temp_licenced_client+'/pattern.jpg) #c63931;width:100%;min-height:95px;padding:10px 0;border-bottom:2px solid #a8302b}.headerLeftBox{width:55%;display:inline-block;padding-left:25px}.headerRightBox{width:35%;float:right;display:inline-block;text-align:right;padding-right:25px}.headerAddress{margin:0 0 5px;font-size:14px;color:#e4a1a6}.headerBranch{margin:10px 0;font-weight:700;text-transform:uppercase;font-size:21px;padding:3px 8px;color:#c63931;display:inline-block;background:#FFF}.headerAdmin{margin:0 0 3px;font-size:16px;color:#FFF}.headerTimestamp{margin:0 0 5px;font-size:12px;color:#e4a1a6}.reportTitle{margin:15px 0;font-size:26px;font-weight:400;text-align:center;color:#3498db}.introFacts{background:0 0;width:100%;min-height:95px;padding:10px 0}.factsArea{display:block;padding:10px 25px;text-align:center}.factsBox{margin-right: 5px; width:20%;display:inline-block;text-align:left;padding:20px 15px;border:2px solid #a8302b;border-radius:5px;color:#FFF;height:65px;background:#c63931}.factsBoxFigure{margin:0 0 8px;font-weight:700;font-size:32px}.factsBoxFigure .factsPrice{font-weight:400;font-size:40%;color:#e4a1a6;margin-left:2px}.factsBoxBrief{margin:0;font-size:16px;color:#F1C40F;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.summaryTableSectionHolder{width:100%}.summaryTableSection{padding:0 25px;margin-top:30px}.summaryTableSection table{border-collapse:collapse}.summaryTableSection td{border-bottom:1px solid #fdebed}.tableQuick{padding:10px}.tableQuickHeader{min-height:40px;background:#c63931;border-bottom:3px solid #a8302b;border-top-right-radius:15px;color:#FFF}.tableQuickHeaderText{margin:0 0 0 25px;font-size:18px;letter-spacing:2px;text-transform:uppercase;padding-top:10px;font-weight:700}.smallOrderCount{font-size:80%;margin-left:15px;color:#aba9a9;font-style:italic;}.tableQuickBrief{padding:10px;font-size:16px;color:#a71a14}.tableQuickAmount{padding:10px;font-size:18px;text-align:right;color:#a71a14}.tableQuickAmount .price{font-size:70%;margin-right:2px}.tableGraphRow{position:relative}.tableGraph_Graph{width:30%;display:inline-block;text-align:center;float:right;margin-top:30px}.footerNote,.weeklyGraph{text-align:center;margin:0}.tableGraph_Table{padding:10px;width:65%;display:inline-block}.weeklyGraph{padding:25px;border:1px solid #f2f2f2;border-top:none}.footerNote{font-size:12px;color:#595959}@media screen and (max-width:1000px){.headerLeftBox{display:none!important}.headerRightBox{padding-right:5px!important;width:90%!important}.reportTitle{font-size:18px!important}.tableQuick{padding:0 0 5px!important}.factsArea{padding:5px!important}.factsBox{width:90%!important;margin:0 0 5px!important}.smallOrderCount{margin:0!important;display:block!important}.summaryTableSection{padding:0 5px!important}}</style> </head>';\n\t \n\n\t var finalReport_emailContent = '<html>'+cssData+\n\t\t '<body>'+\n\t\t '<div class=\"mainHeader\">'+\n\t\t '<div class=\"headerLeftBox\">'+\n\t\t '<div id=\"logo\">'+\n\t\t '<img src=\"https://accelerateengine.app/clients/'+temp_licenced_client+'/email_logo.png\">'+\n\t\t '</div>'+\n\t\t '<p class=\"headerAddress\">'+reportInfo_address+'</p>'+\n\t\t '</div>'+\n\t\t '<div class=\"headerRightBox\">'+\n\t\t '<h1 class=\"headerBranch\">'+reportInfo_branch+'</h1>'+\n\t\t '<p class=\"headerAdmin\">'+reportInfo_admin+'</p>'+\n\t\t '<p class=\"headerTimestamp\">'+reportInfo_time+'</p>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '<div class=\"introFacts\">'+\n\t\t '<h1 class=\"reportTitle\">'+reportInfo_title+'</h1>'+\n\t\t '<div class=\"factsArea\">'+\n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(0)+' <span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Net Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+parseFloat(netSalesWorth).toFixed(0)+'<span class=\"factsPrice\">INR</span></h1><p class=\"factsBoxBrief\">Gross Sales</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+netGuestsCount+'</h1><p class=\"factsBoxBrief\">Guests</p></div>'+ \n\t\t '<div class=\"factsBox\"><h1 class=\"factsBoxFigure\">'+completeReportInfo[0].count+'</h1><p class=\"factsBoxBrief\">Bills</p></div>'+\n\t\t '</div>'+\n\t\t '</div>'+graphRenderSectionContent+\n\t\t '<div class=\"summaryTableSectionHolder\">'+\n\t\t '<div class=\"summaryTableSection\">'+\n\t\t '<div class=\"tableQuickHeader\">'+\n\t\t '<h1 class=\"tableQuickHeaderText\">Quick Summary</h1>'+\n\t\t '</div>'+\n\t\t '<div class=\"tableQuick\">'+\n\t\t '<table style=\"width: 100%\">'+\n\t\t '<col style=\"width: 70%\">'+\n\t\t '<col style=\"width: 30%\">'+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"font-weight: bold;\">Gross Sales</td><td class=\"tableQuickAmount\" style=\"font-weight: bold;\"><span class=\"price\">Rs.</span>'+parseFloat(netSalesWorth).toFixed(2)+'</td></tr>'+\n\t\t quickSummaryRendererContent+\n\t\t '<tr><td class=\"tableQuickBrief\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\">Net Sales</td><td class=\"tableQuickAmount\" style=\"background: #f3eced; font-size: 120%; font-weight: bold; color: #292727; border-bottom: 2px solid #b03c3e\"><span class=\"price\">Rs.</span>'+parseFloat(completeReportInfo[0].value - netRefundsProcessed).toFixed(2)+'</td></tr>'+\n\t\t '</table>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t '</div>'+\n\t\t salesByBillingModeRenderContentFinal+\n\t\t salesByPaymentTypeRenderContentFinal+\n\t\t '<div style=\"border-top: 2px solid #989898; padding: 12px; background: #f2f2f2;\">'+\n\t\t '<p class=\"footerNote\">www.accelerate.net.in | support@accelerate.net.in</p>'+\n\t\t '</div>'+\n\t\t '</body>'+\n\t\t '<html>';\n\t}\t\n\n\tfunction singleClickLoadErrors(){\n\t\t//Display if any errors\n\t\tif(completeErrorList.length > 0){\n\t\t\tvar renderError = '<b style=\"color: #ff5050\">Report might contain Errors</b><br><i style=\"color: #ffb836; font-size: 80%\">The following errors occured while generating the Report and it might show incorrect figures. Try again.</i><br><br>';\n\t\t\tvar n = 0;\n\t\t\twhile(completeErrorList[n]){\n\t\t\t\trenderError += 'E'+completeErrorList[n].step+': '+completeErrorList[n].error+'<br>';\n\t\t\t\tn++;\n\t\t\t}\n\n\t\t\tdocument.getElementById(\"singleClickReport_ErrorContent\").style.display = 'block';\n\t\t\tdocument.getElementById(\"singleClickReport_ErrorContent\").innerHTML = renderError;\n\t\t}\n\t}\n\n\tfunction resetBillingCounters(){\n\t\tvar isEnabledVariabled = window.localStorage.appOtherPreferences_resetCountersAfterReport ? window.localStorage.appOtherPreferences_resetCountersAfterReport : '';\n\t\tif(isEnabledVariabled == 1){\n\t\t\tvar present_day_today = getCurrentTime('DATE_STAMP');\n\t\t\tif(fromDate == toDate && fromDate == present_day_today){\n\t\t\t\tresetBillingKOTIndex();\n\t\t\t}\n\t\t}\n\t}\n\n\tfunction resetBillingKOTIndex(){\n \n\t //Check for KOT index on Server\n\t var requestData = {\n\t \"selector\" :{ \n\t \"identifierTag\": \"ACCELERATE_KOT_INDEX\" \n\t },\n\t \"fields\" : [\"_rev\", \"identifierTag\", \"value\"]\n\t }\n\n\t $.ajax({\n\t type: 'POST',\n\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t data: JSON.stringify(requestData),\n\t contentType: \"application/json\",\n\t dataType: 'json',\n\t timeout: 10000,\n\t success: function(data) {\n\t if(data.docs.length > 0){\n\t if(data.docs[0].identifierTag == 'ACCELERATE_KOT_INDEX'){\n\n\t \t\tvar temp_value = parseInt(data.docs[0].value);\n\n\t \t\t//TWEAK\n\t \t\t/* to be safe with KOT number. 2 different KOTs with same KOTNumber should not exists at a time */\n\t \t\t/* assuming a max of 100 KOTs active at a time */\n\t \t\tif(temp_value < 100){\n\t \t\t\tresetBillingTokenIndex();\n\t \t\t\treturn '';\n\t \t\t}\n\n\t\t \tvar memory_revID = data.docs[0]._rev;\n\n\t \t //Update KOT number on server\n\t var updateData = {\n\t \"_rev\": memory_revID,\n\t \"identifierTag\": \"ACCELERATE_KOT_INDEX\",\n\t \"value\": 1\n\t }\n\n\t $.ajax({\n\t type: 'PUT',\n\t url: COMMON_LOCAL_SERVER_IP+'accelerate_settings/ACCELERATE_KOT_INDEX/',\n\t data: JSON.stringify(updateData),\n\t contentType: \"application/json\",\n\t dataType: 'json',\n\t timeout: 10000,\n\t success: function(data) {\n\t resetBillingTokenIndex();\n\t },\n\t error: function(data) {\n\t resetBillingTokenIndex();\n\t }\n\t });\n\t \n\t }\n\t else{\n\t resetBillingTokenIndex();\n\t }\n\t }\n\t else{\n\t resetBillingTokenIndex();\n\t }\n\n\t },\n\t error: function(data) {\n\t resetBillingTokenIndex();\n\t }\n\n\t });\t\t\n\t}\n\n\tfunction resetBillingTokenIndex(){\n\n\t\t\t\t\t\t var requestData = {\n\t\t\t\t\t\t \"selector\" :{ \n\t\t\t\t\t\t \"identifierTag\": \"ACCELERATE_TOKEN_INDEX\" \n\t\t\t\t\t\t },\n\t\t\t\t\t\t \"fields\" : [\"_rev\", \"identifierTag\", \"value\"]\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t $.ajax({\n\t\t\t\t\t\t type: 'POST',\n\t\t\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'/accelerate_settings/_find',\n\t\t\t\t\t\t data: JSON.stringify(requestData),\n\t\t\t\t\t\t contentType: \"application/json\",\n\t\t\t\t\t\t dataType: 'json',\n\t\t\t\t\t\t timeout: 10000,\n\t\t\t\t\t\t success: function(data) {\n\t\t\t\t\t\t if(data.docs.length > 0){\n\t\t\t\t\t\t if(data.docs[0].identifierTag == 'ACCELERATE_TOKEN_INDEX'){\n\n\t\t\t\t\t\t\t\t\t\twindow.localStorage.claimedTokenNumber = 1;\n\t\t\t\t\t\t\t\t\t\twindow.localStorage.claimedTokenNumberTimestamp = new Date();\n\n\t\t\t\t //Update token number on server\n\t\t\t\t var updateData = {\n\t\t\t\t \"_rev\": data.docs[0]._rev,\n\t\t\t\t \"identifierTag\": \"ACCELERATE_TOKEN_INDEX\",\n\t\t\t\t \"value\": 2\n\t\t\t\t }\n\n\t\t\t\t $.ajax({\n\t\t\t\t type: 'PUT',\n\t\t\t\t url: COMMON_LOCAL_SERVER_IP+'accelerate_settings/ACCELERATE_TOKEN_INDEX/',\n\t\t\t\t data: JSON.stringify(updateData),\n\t\t\t\t contentType: \"application/json\",\n\t\t\t\t dataType: 'json',\n\t\t\t\t timeout: 10000,\n\t\t\t\t success: function(data) {\n\t\t\t\t \tshowToast('KOT and Token Numbers are automatically reset. Change your preferences from System Options.', '#27ae60'); \n\t\t\t\t }\n\t\t\t\t }); \n\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t\t });\n\t}\n}", "function populateHTML(date, field) {//This is the function that will run when called with populateHTML\n var id = document.getElementById(field);//This grabs the second parameter passed through the function from the HTML document.\n id.innerHTML = date;//This line writes the new information to the HTML\n\n }", "function displayCalendar_Fall2014_Spring2015_5(numberOfMonths) {\n\n from_semester_title.innerHTML = \"Fall 2014\";\n to_semester_title.innerHTML = \"Spring 2015\";\n\n\n $(\"#weekNumber\").html(\"1\");\n\n $(\"#dateoutput1\").html(\"2 Sep, Tue\");\n $(\"#dateoutput2\").html(\"5 Jan, Mon\");\n\n function highlightDays(date) {\n var a = new Date(2014, 8, 2); // September 2, 2014\n var b = new Date(2014, 11, 8); // December 8, 2014\n\n if (a <= date && date <= b) {\n return [true, 'highlight'];\n }\n\n return [true, ''];\n\n }\n\n\n $(\"#datepicker_Fall2014_Spring2015_5\").datepicker({\n /*\n dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n */\n\n inline: true,\n showOtherMonths: true,\n defaultDate: '02-09-14',\n numberOfMonths: numberOfMonths,\n dateFormat: \"dd-mm-yy\",\n\n\n beforeShowDay: highlightDays,\n\n\n onSelect: function (dateText, inst) {\n var date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, dateText, inst.settings);\n var dateText1 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n date.setDate(date.getDate() + 125);\n var dateText2 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n\n var newDate = date.getDate();\n var newMonth = date.getMonth();\n\n /*\n console.log(\"date: \" + date);\n console.log(\"newDate: \" + newDate);\n console.log(\"newMonth: \" + newMonth);\n */\n\n var weekNumber;\n var weekDays = 4;\n var wk1_start = 5;\n var wk1_end = wk1_start + weekDays;\n\n var wk2_start = 12;\n var wk2_end = wk2_start + weekDays;\n\n var wk3_start = 19;\n var wk3_end = wk3_start + weekDays;\n\n var wk4_start = 26;\n var wk4_end = wk4_start + weekDays;\n\n var wk5_start = 2;\n var wk5_end = wk5_start + weekDays;\n\n var wk6_start = 16;\n var wk6_end = wk6_start + weekDays;\n\n var wk7_start = 23;\n var wk7_end = wk7_start + weekDays;\n\n var wk8_start = 2;\n var wk8_end = wk8_start + weekDays;\n\n var wk9_start = 9;\n var wk9_end = wk9_start + weekDays;\n\n var wk10_start = 16;\n var wk10_end = wk10_start + weekDays;\n\n var wk11_start = 23;\n var wk11_end = wk11_start + weekDays;\n\n var wk12_start = 30;\n var wk12_end = 3;\n\n var wk13_start = 6;\n var wk13_end = wk13_start + weekDays;\n\n\n var January = 0;\n var February = 1;\n var March = 2;\n var April = 3;\n\n /* console.log(\"newDate: \" + newDate); */\n\n if ((newDate >= wk1_start && newDate <= wk1_end) && (newMonth == January)) {\n weekNumber = 1;\n }\n\n else if ((newDate >= wk2_start && newDate <= wk2_end) && (newMonth == January)) {\n weekNumber = 2;\n }\n\n else if ((newDate >= wk3_start && newDate <= wk3_end) && (newMonth == January)) {\n weekNumber = 3;\n }\n\n else if ((newDate >= wk4_start && newDate <= wk4_end) && (newMonth == January)) {\n weekNumber = 4;\n }\n\n else if ((newDate >= wk5_start && newDate <= wk5_end) && (newMonth == February)) {\n weekNumber = 5;\n }\n\n else if ((newDate >= wk6_start && newDate <= wk6_end) && (newMonth == February)) {\n weekNumber = 6;\n }\n\n else if ((newDate >= wk7_start && newDate <= wk7_end) && (newMonth == February)) {\n weekNumber = 7;\n }\n\n\n else if ((newDate >= wk8_start && newDate <= wk8_end) && (newMonth == March)) {\n weekNumber = 8;\n }\n\n else if ((newDate >= wk9_start && newDate <= wk9_end) && (newMonth == March)) {\n weekNumber = 9;\n }\n\n else if ((newDate >= wk10_start && newDate <= wk10_end) && (newMonth == March)) {\n weekNumber = 10;\n }\n\n else if ((newDate >= wk11_start && newDate <= wk11_end) && (newMonth == March)) {\n weekNumber = 11;\n }\n\n else if (newDate >= wk12_start && newMonth == March) {\n weekNumber = 12;\n }\n\n else if (newDate <= wk12_end && newMonth == April) {\n weekNumber = 12;\n }\n\n\n else if ((newDate >= wk13_start && newDate <= wk13_end) && (newMonth == April)) {\n weekNumber = 13;\n }\n\n\n else {\n weekNumber = 'N/A';\n }\n\n\n $(\"#weekNumber\").html(weekNumber);\n\n $(\"#dateoutput1\").html(dateText1);\n $(\"#dateoutput2\").html(dateText2);\n\n\n }\n\n\n\n });\n\n\n}", "function displayPractice() {\n\tvar d = new Date();\n\tvar day = d.getDay();\n\tvar month = d.getMonth();\n\tvar date = d.getDate();\n // in case of pool closing set day = 8 practice canceled for repairs; day=9 practice canceled for meet -------------------------------------------------\n //if (month == 6 && date == lastPractice) {day = 7};\n if (RVCCclosed === true) {day = 8};\n\n\tif (month === 4 && date < firstPractice) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>BEGINS MAY \" + firstPractice + \"!\");\n\t} else if((month === lastmonthPractice && date > lastPractice) || (month > lastmonthPractice) ) {\n\t\t\t\t$(\"#todayschedule\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"Thank you for a Great Season!<br>See You next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n\t}else if ((month === 4 && date >= firstPractice) || (month === 5 && date < changeDate)) {\n\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n $(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule\").append(\"14 & Over: 7:10 - 8:20 PM\");\n $(\"#todayschedule2\").html(\"9 & Unders: 5:00 - 6:10 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"10 & Up: 6:05 - 7:15 PM<br />\");\n\t\t\t\t//$(\"#todayschedule2\").append(\"14 & Over: 7:10 - 8:20 PM\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"The RVCC Pool is CLOSED<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"The RVCC Pool is CLOSED<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n break;\n\n\t\t}\n } else if (month === lastmonthPractice && date == lastPractice) {\n switch (day) {\n default:\n $(\"#todayschedule\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n $(\"#todayschedule2\").html(\"All Ages: 6:00 - 7:15 PM<br />LAST PRATICE!!<br />See you next Summer <i style='color:#fd7d14' class='fas fa-smile-wink'></i>\");\n break;\n }\n\t} else if ( month === 5 && date >= changeDate || month === 6 || month === 7 && date <= lastPractice) {\n\t\t\tswitch (day) {\n\t\t\tdefault:\n\t\t\t\t$(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n\t\t\t\tbreak;\n\t\t\tcase 5:\n\t\t\t\t$(\"#todayschedule\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n $(\"#todayschedule2\").html(\"10 & Unders: 6:00 - 7:15 PM<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"11 & Overs: 6:45 - 8:00 PM\");\n break;\n case 7:\n $(\"#todayschedule\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n $(\"#todayschedule2\").html(\"Only Conference Qualifiers: 5:00 - 6:00 PM<br />\");\n break;\n case 8:\n $(\"#todayschedule\").html(\"RVCC Closed for Repairs<br />\");\n $(\"#todayschedule\").append(\"No Practice Today\");\n $(\"#todayschedule2\").html(\"RVCC Closed for Repairs<br />\");\n\t\t\t\t$(\"#todayschedule2\").append(\"No Practice Today\");\n break;\n case 9:\n $(\"#todayschedule\").html(\"Practice Canceled today<br />\");\n $(\"#todayschedule\").append(\"due to Swim Meet\");\n $(\"#todayschedule2\").html(\"Practice Canceled today<br />\");\n \t\t\t$(\"#todayschedule2\").append(\"due to Swim Meet\");\n\n\t\t}\n\t} else if (month >= 0 && month < 4) {\n\t\t$(\"#todayschedule\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n $(\"#todayschedule2\").html(\"Summer Team Practice<br>Begins in May, 2019<br/>Check back after April 15 for more details.<br/>Hope to see you there!\");\n\t} else {\n $(\"#todayschedule\").html(\"No Summer Team Practice Today!\");\n $(\"#todayschedule2\").html(\"No Summer Team Practice Today!\");\n }\n}", "function _callLineBoardReport()\r\n{\r\n\tvar htmlAreaObj = _getWorkAreaDefaultObj();\r\n\tvar objHTMLData = htmlAreaObj.getHTMLDataObj();\r\n var changeFields = objHTMLData.getChangeFields();\r\n var objAjax = htmlAreaObj.getHTMLAjax();\r\n bShowMsg = true;\r\n //when user doesn't enter anything and clicks on the report button for the\r\n //first time this check is done\r\n if(objHTMLData.hasUserModifiedData()==false)\r\n {\r\n var htmlErrors = objAjax.error();\r\n objAjax.error().addError(\"errorInfo\", 'Must enter values for: Season', true);\r\n messagingDiv(htmlErrors);\r\n return;\r\n }\r\n\tvar url = 'lineboardreport';// report action method name\r\n\t\r\n\tobjAjax.setActionMethod(url);\r\n\tobjAjax.setActionURL('lineboardreport.do');\r\n\tobjAjax.setProcessHandler(_loadLineBoardReport);\r\n\tobjHTMLData.performSaveChanges(_loadLineBoardReport, objAjax);\r\n}", "function updateSummarySectionUI(){\n\tvar registerUser = parseBoolean(localStorage.getItem(\"registerUser\"));\n\tupdateNewCreditsArea(); /* To update the new credit section whenever summary section updates.*/\n\tshowTotalPaymentAndDue();\n\tvar totalDueAmt = getFormatedNumber($(\"#amountDueTotal\").text(), false);\n\tvar totalPaymentAmt = getFormatedNumber($(\"#cashSummaryTotalAmount\").text(), false);\n\tif(!isRegisterSelected) {\n\t\tif (registerUser === false) {\n\t\t\tif (isGrtr === false) {\n\t\t\t\tif (totalPaymentAmt === totalDueAmt) {\n\t\t\t\t\tenableCheckoutAddSubmitButton();\n\t\t\t\t}\n\t\t\t\tregisterAdditionalInfoToValidate();\n\t\t\t} else {\n\t\t\t\tif (totalPaymentAmt > totalDueAmt) {\n\t\t\t\t\tdeActivateCheckoutPayButton();\n\t\t\t\t\tenableCreateAccCheckoutRegisterBtn();\n\t\t\t\t}\n\t\t\t\tregisterCreateProfileToValidate();\n\t\t\t}\n\t\t} else {\n\t\t\tactivateCheckoutPayButton();\n\t\t}\n\t}\n\t/* Checking if the CARD section is open then enable the PAY button and return */\n\tfor(var arrayIndex in cardOptionJsonTypes) {\n\t\tif ($(\"#panel\" + cardOptionJsonTypes[arrayIndex]).is(\":visible\") \n\t\t\t\t&& getSelectedDebitOrCreditCard(cardOptionJsonTypes[arrayIndex])) {\n\t\t\t/* Checking if cardInfoObject exists and contains the data */\n\t\t\tif(cardInfoObject && cardInfoObject.length > 0 ) {\n\t\t\t\tactivateCheckoutPayButton();\n\t\t\t\treturn;\n\t\t\t}\n\t\t} else if($(\"#panel\" + cardOptionJsonTypes[arrayIndex]).is(\":visible\")){\n\t\t\tdeActivateCheckoutPayButton();\n\t\t\treturn;\n\t\t}\t\n\t}\n\tvar cashSummaryTotalAmount = getFormatedNumber($('#cashSummaryTotalAmount').html(), false);\n\tvar mainPayAmountDueTotal = getFormatedNumber($('#amountDueTotal').text(), false);\n\tvar immediateOrScheduled = false;\n\tvar pendingTransactions = bp_get_pending_transaction_obj.pendingTransactions;\n\tfor (var index in pendingTransactions) {\n\t\t/*var scheduledSubmitdate1 = pendingTransactions[index].scheduledSubmitDate;*/\n\t\tif (pendingTransactions[index].submitType === 'IMMEDIATE') {\n\t\t\timmediateOrScheduled = true;\n\t\t}\n\t}\n\tif (registerUser) {\n\t\tif ((cashSummaryTotalAmount >= mainPayAmountDueTotal && cashSummaryTotalAmount) \n\t\t\t\t|| ((immediateOrScheduled && !mainPayAmountDueTotal)\n\t\t\t\t|| (( $('#listOfPaymentCardDEBIT').is(\":visible\") \n\t\t\t\t|| $('#listOfPaymentCardCREDIT').is(\":visible\"))))){\n\t\t\tactivateCheckoutPayButton();\n\t\t} else {\n\t\t\tdeActivateCheckoutPayButton();\n\t\t}\n\t}\n\tupdateSummarySectionFromCashClick();\n\tupdateNewCreditsArea();\n}", "function showAbsenceDetails_old() {\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == activeElement);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende']);\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: \" + formatDateDot(activeDataSet['adminMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\nanzeige += \"Meldung Lehrer am: \" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+'<br/>';\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: \" + formatDateDot(activeDataSet['elternMeldungDatum']);\t\n}\nif (activeDataSet['kommentar'] != \"0\") {\nanzeige += \"Kommentar: \" + formatDateDot(activeDataSet['kommentar']);\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function updatePrintingAndBadges() {\n $(\".ksp_printing_title\").remove();\n $(\".ksp_printing\").prepend('<div class=\"ksp_printing_title\">' + ksp_badge_title + '</div><p class=\"ksp_printing_subtitle\">' + ksp_badge_select + '</p>');\n $(\".ksp_printing_options\").before(\"<div class=\\\"ksp_printing_title printing_title_sub\\\">\" + ksp_printing_title + \" <a href=\\\"#\\\" onclick=\\\"shadowViewer.highlight({ 'elementToHighlight': '#ksp_printing_info' });return false;\\\" class=\\\"help_icon_viewer\\\">&nbsp;</a></div><p class=\\\"ksp_printing_subtitle\\\">\" + ksp_players_name + \"</p>\");\n $(\".ksp_printing_options > tbody > tr:eq(1)\").before(\"<tr><td colspan=\\\"2\\\"><p class=\\\"ksp_printing_subtitle\\\">\" + ksp_your_name + \"</p></td></tr>\");\n $(\".disclaimerlink\").remove();\n $(\".ksp_printing\").after($(\".ksp_printing > div:eq(5)\"));\n}", "function showAbsenceDetails(nr) {\nif (nr != undefined) {\nelementToCheck = nr;\t\n} else {\nelementToCheck = activeElement;\n}\ncontent = \"Abwesenheit\";\nactiveDataSet = studentList.find(dataset => dataset.absenceId == elementToCheck);\n//console.log(activeDataSet);\nif (activeDataSet['ende'] != activeDataSet['beginn']) {\ncontent += \" vom <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b> bis <b>\" +formatDateDot(activeDataSet['ende'])+'</b>';\t\n} else {\ncontent += \" am <b>\" + formatDateDot(activeDataSet['beginn']) + \"</b>\";\t\n}\nanzeige = \"\";\nif (activeDataSet['adminMeldung'] != 0) {\nanzeige = \"Eintrag Sekretariat am: <b>\" + formatDateDot(activeDataSet['adminMeldungDatum'])+'</b><br/>';\t\n}\nif (activeDataSet['lehrerMeldung'] != \"0\") {\n\tif (teacherUser ==1) {\n\taddInfo = activeDataSet['lehrerMeldung'] + \"<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t} else {\n\taddInfo = \"Eintrag Lehrkraft<b> (\" + formatDateDot(activeDataSet['lehrerMeldungDatum'])+')</b><br/>';\t\n\t}\n\tanzeige += addInfo;\t\n}\nif (activeDataSet['elternMeldung'] != \"0\") {\nanzeige += \"Eintrag Eltern am: <b>\" + formatDateDot(activeDataSet['elternMeldungDatum'])+'</b>';\t\n}\nif (activeDataSet['kommentar'] != \"\") {\nanzeige += \"<br/>Kommentar: <b>\" + activeDataSet['kommentar']+'</b>';\t\n}\nif (activeDataSet['entschuldigt'] != \"0000-00-00\") {\nanzeige += \"Entschuldigung am: <b>\" + formatDateDot(activeDataSet['entschuldigt'])+'</b>';\t\n}\ncontent += '<br/>' + anzeige;\n\nreturn content;\t\n}", "function setupRedesign() {\r\n // Populate package item card templates with fake data\r\n var parentDiv = $('#departureCard');\r\n var template = Handlebars.compile(document.getElementById('departureTemplate').innerHTML);\r\n var data = JSON.parse(localStorage.getItem('departure'));\r\n var html = template(setFlightData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#hotelCard');\r\n template = Handlebars.compile(document.getElementById('hotelTemplate').innerHTML);\r\n data = JSON.parse(localStorage.getItem('hotel'));\r\n html = template(setHotelData(data));\r\n parentDiv.append(html);\r\n\r\n parentDiv = $('#returnCard');\r\n template = Handlebars.compile(document.getElementById('returnTemplate').innerHTML);\r\n data = JSON.parse(localStorage.getItem('return'));\r\n html = template(setFlightData(data));\r\n parentDiv.append(html);\r\n\r\n // Calculate and display correct total, store it in localStorage\r\n document.getElementById('total').innerHTML = 'Total: $' + numberWithCommas(calcTotal());\r\n localStorage.setItem('total', document.getElementById('total').innerHTML);\r\n\r\n // Onclicks for viewing each package item\r\n document.getElementById('departure').onclick = function() {\r\n // Send click event to Google Analytics\r\n tracker = ga.getAll()[0];\r\n tracker.send('event', 'view', 'click');\r\n localStorage.setItem('link', 'details.html');\r\n localStorage.setItem('chosenDeparture', localStorage.getItem('departure'));\r\n };\r\n document.getElementById('hotel').onclick = function() {\r\n // Send click event to Google Analytics\r\n tracker = ga.getAll()[0];\r\n tracker.send('event', 'view', 'click');\r\n localStorage.setItem('link', 'details.html');\r\n localStorage.setItem('chosenHotel', localStorage.getItem('hotel'));\r\n localStorage.setItem('chosenHotNum', localStorage.getItem('hotNum'));\r\n };\r\n document.getElementById('return').onclick = function() {\r\n // Send click event to Google Analytics\r\n tracker = ga.getAll()[0];\r\n tracker.send('event', 'view', 'click');\r\n localStorage.setItem('link', 'details.html');\r\n localStorage.setItem('chosenReturn', localStorage.getItem('return'));\r\n };\r\n}", "function displaySubInformations(objectId, divTitle, fromToValue) \n{\n\n// ++ HAT1 ZUD: IR-604654-3DEXPERIENCER2019x ++\n\tvar selection = \"multiple\";\n\tif(fromToValue == \"From\")\n\t\ttraceabilityReportMethod = \"getDownDirectionSubRequirements\";\n\telse if(fromToValue == \"To\")\n\t\ttraceabilityReportMethod = \"getUpDirectionSubRequirements\";\n\telse\n\t\ttraceabilityReportMethod = \"getBothDirectionSubRequirements\";\n\t// -- HAT1 ZUD: IR-604654-3DEXPERIENCER2019x --\n\t\n\t//HAT1 ZUD: IR-438515-3DEXPERIENCER2019x: fix\n\tif(isIE)\n\tdivTitle = decode_utf8(divTitle);\n\t\n\tvar dialogId = \"\";\n\n\t//We need to load the jqueryui scripts in case it's not done already\n\t$.cachedScript(\"../requirements/scripts/plugins/jquery.ui-RMT.js\").done(function() {\n $.cachedScript(\"../requirements/scripts/plugins/jquery.dialogextend-RMT.js\").done(\n function() {\n \t var program;\n \t //START : IR-374998-3DEXPERIENCER2016x Requirement: When refining requirements, Change of relationship status of requirement \n \t //in drop down menu is not getting saved properly.\n \t var url = '../common/emxIndentedTable.jsp?toolbar=RMTSpecCoveredRefinedRemoveDelete&selection=multiple&hideRootSelection=true&expandLevel=1&sortColumnName=none&suiteKey=Requirements&editLink=true&freezePane=TargetReq&'+\n \t \t'program=emxTraceabilityReport:' + traceabilityReportMethod +\n \t '&table=RMTCoveredRefineReqTable&customize=false&objectId='+objectId; //hasChildren=false&editRootNode=false&\n \t /*var url = \"../common/emxIndentedTable.jsp?expandLevel=1&editLink=true&freezePane=TargetReq&objectId=\" + objectId +\n \t \"&customize=false&program=emxRequirement:getDerivedRequirements&reportRelationships=relationship_DerivedRequirement&reportDirection=\" +\n \t dir +\n \t \"&reportTypes=type_Requirement&table=RMTSpecCoveredRefinedRemoveDelete&header=emxRequirements.TraceabilityReport.Specification.Requirement.SubDerivedReqs.Header&HelpMarker=emxhelptraceabilityreqreqreport&suiteKey=Requirements&selectedType=Specification&baselineObject=\";*/\n \t ////END : IR-374998-3DEXPERIENCER2016x Requirement: When refining requirements, Change of relationship status of requirement \n \t //in drop down menu is not getting saved properly.\n \t var floatingDivId = \"float\" + objectId.split(\".\").join(\"_\");\n \t dialogId = floatingDivId;\n \t var floatingOptions = {\n \t resizable: [true, {\n \t animate: true\n \t }],\n \t height: 400,\n \t width: 1000,\n \t title: divTitle,\n \t close: function () {\n \t refreshMainPage();\n \t }\n \t };\n \t //maximize,minize buttons are options of dialogextend component\n \t var floatingExtentedOptions = {\n \t \t\t\"closable\": true,\n \t \"maximizable\": true,\n \t \"minimizable\": true,\n \t \"dblclick\": 'maximize'\t\t\n \t };\n \t \n \t var frameId = \"frame\" + objectId.split(\".\").join(\"_\");\n \t var div = $('#' + floatingDivId);\n \t var frame = $('#' + frameId);\n \t $('#' + floatingDivId).dialog(floatingOptions).dialogExtend(floatingExtentedOptions);\n \t frame.css({\n \t 'width': '100%',\n \t 'height': '100%'\n \t });\n \t frame.attr('src', url);\n\n })});\n}", "function renderTable() {\n // addstudent();\n // this is the table\n var STDtable = document.getElementById(\"studentinfo\");\n // this is student table data\n var data1 = document.createElement(\"tr\");\n STDtable.appendChild(data1);\n var td = document.createElement('td');\n data1.appendChild(td);\n td.textContent = STD.studentName;\n var td2 = document.createElement('td');\n data1.appendChild(td2);\n td2.textContent = STD.studentId;\n var td3 = document.createElement('td');\n data1.appendChild(td3);\n td3.textContent = STD.gender;\n var td4 = document.createElement('td');\n data1.appendChild(td4);\n td4.textContent = STD.parentId;\n var total = 0;\n //this is the for loop to get each mark in math subject\n for (var j = 0; j < mathMark.length; j++) {\n var td5 = document.createElement('td');\n data1.appendChild(td5);\n td5.textContent = STD.mathMark[j];\n mathTotal += parseInt(STD.mathMark[j]);\n total = total + parseInt(mathMark[j]);\n }\n mathTotal = parseInt(grade1) + parseInt(grade2) + parseInt(grade3);\n\n\n //this is the for loop to get each mark in english subject\n for (var d = 0; d < englishMark.length; d++) {\n var td6 = document.createElement('td');\n data1.appendChild(td6);\n total = total + parseInt(englishMark[d]);\n td6.textContent = STD.englishMark[d];\n }\n englishTotal = parseInt(gradeE1) + parseInt(gradeE2) + parseInt(gradeE3);\n\n\n //this is the for loop to get each mark in science subject\n for (var k = 0; k < scienceMark.length; k++) {\n var td7 = document.createElement('td');\n data1.appendChild(td7);\n td7.textContent = STD.scienceMark[k];\n total = total + parseInt(scienceMark[k]);\n }\n scienceTotal = parseInt(gradeS1) + parseInt(gradeS2) + parseInt(gradeS3);\n\n\n\n var td8 = document.createElement(\"td\");\n data1.appendChild(td8);\n avg = ((mathTotal + englishTotal + scienceTotal)/3);\n td8.textContent = avg;\n // STDtable.deleteRow(-1);\n var td9 = document.createElement(\"td\");\n data1.appendChild(td9);\n td9.setAttribute(\"border-collapse\", \" collapse\");\n td9.textContent = feedBack;\n addStudent.reset();\n // this is to count the number of female students\n if (gender === 'Male') {\n maleTotal++;\n }\n else if (gender === 'Female') {\n femaleTotal++;\n }\n}", "function schReportsTableFxn(res){\n let snum = 1;\n let pay_heads = '';\n\n res.fields.forEach(field => {\n pay_heads += `<th>${(field.field_name).toUpperCase()}</th>`;\n })\n let staffTable = ` \n <div class='row oxblood pt-2 pb-2 mb-2 text-white rounded'>\n <div class='col-12 pt-1 border-bottom border-light'>\n <h3 id='sch_name' class='text-center'>${res.school[0].school_name}</h3>\n <input type='hidden' id='school_id' value='${res.school[0].school_id}' >\n </div>\n <div class='col-12 col-md-4 py-1'> \n <h5>Date: ${(months[res.date.m])}, ${res.date.y}</h5> \n </div>\n </div>\n <table class='table table-bordered table-striped table-responsive table-sm mt-3' id='staffReportTable'>\n <thead class='oxblood text-white text-center'>\n <th>S/No.</th>\n <th>Name</th>\n <th>SALARY<br>(${naira})</th>\n ${pay_heads}\n <th>NET PAY<br>(${naira})</th>\n <th>View</th>\n <thead>\n <tbody>\n `;\n res.report.forEach(st => {\n let pay_fields = '', modalObj = {'Grade Salary':st.grade_salary};\n res.fields.forEach(field => {\n modalObj[field.field_name] = st[field.field_slug];\n pay_fields += `<td>${st[field.field_slug]}</td>`\n });\n modalObj['Net Pay'] = st.net_pay;\n staffTable += `\n <tr id='${st.StaffID}'>\n <td>${snum++}</td>\n <td class='nameCell'>${st.Lastname+' '+st.Firstname+' '+st.Other_names}</td> \n <td class='gradeSalary' data-pay='${st.grade_salary}'>\n ${(+st.grade_salary).toLocaleString('en-NG')}\n </td>\n ${pay_fields}\n <td class='netSalary'>${st.net_pay}</td>\n <td class='text-center'>\n <button class='btn oxline staffReportModal' data-record='${JSON.stringify(modalObj)}'>\n <i class='material-icons oxcon'>zoom_in</i>\n </button>\n </td>\n </tr>\n `\n });\n staffTable += `\n </tbody>\n </table>`\n\n return staffTable;\n}", "function refreshRenderContent() {\n\n if (checkHasHashChanged()) {\n $(\"#pen-save-status-content\").text(\"Remember to save!\");\n $(\"#save-pen\").addClass(\"save-indicator\");\n\n renderInIframe(\n returnRenderContentForiFrame(\n leftEditor.getValue(),\n centerEditor.getValue(),\n rightEditor.getValue(),\n externalsString,\n htmlClassValue,\n htmlHeadValue\n )\n );\n\n } else {\n $(\"#save-pen\").removeClass(\"save-indicator\");\n $(\"#pen-save-status-content\").text(\"\");\n }\n\n\n}", "function updateCard() {\n cardFactory.update(cardID, $scope.selectedCard, function (data) {\n if (data.status === 200) {\n Flash.create('success', \"Record updated successfully.\", 5000, {container: 'main'});\n $mdDialog.hide();\n $route.reload();\n }\n });\n }", "function SBR_show_all() {\n console.log(\"===== SBR_show_all ========\");\n\n // don't reset setting_dict.sel_depbase_pk\n\n setting_dict.sel_lvlbase_pk = null;\n setting_dict.sel_lvlbase_code = null;\n\n setting_dict.sel_sctbase_pk = null;\n setting_dict.sel_sctbase_code = null;\n\n setting_dict.sel_student_pk = null;\n setting_dict.sel_student_name = null;\n\n el_SBR_select_level.value = null;\n el_SBR_select_sector.value = null;\n\n t_MSSSS_display_in_sbr(\"student\", \"0\");\n\n// --- reset table\n tblHead_datatable.innerText = null;\n tblBody_datatable.innerText = null;\n\n// --- reset SBR_item_count\n el_SBR_item_count.innerText = null;\n\n// --- upload new setting and refresh page\n const datalist_request = {\n setting: {\n page: \"page_student\",\n sel_lvlbase_pk: null,\n sel_sctbase_pk: null,\n sel_student_pk: null\n },\n level_rows: {cur_dep_only: true},\n sector_rows: {cur_dep_only: true},\n\n // show deleted students only when SBR 'Show all' is clicked\n student_rows: {\"show_deleted\": true},\n };\n DatalistDownload(datalist_request);\n }", "updateCalendarBody() {\n this.updateCalendarHeader();\n this.updateCalendarDates();\n this.highlightCurrentDate();\n this.initNav();\n }", "function add_html() {\n\t\tdocument.getElementById(\"whole_month\").innerHTML=table_html;\n\t}", "function gameslotSubElementDrawer() {\n if (store.getState().currentPage == 'LOAD_SAVED') {\n if (savedData.slot1.isUsed == true) {\n loadSavedGameslot1Stars.innerHTML = store.getState().savedData.slot1.stars.toString() + '/77';\n loadSavedGameslot1Shields.innerHTML = store.getState().savedData.slot1.shields;\n loadSavedGameslot1Fists.innerHTML = store.getState().savedData.slot1.fists;\n }\n if (savedData.slot2.isUsed == true) {\n loadSavedGameslot2Stars.innerHTML = store.getState().savedData.slot2.stars.toString() + '/77';\n loadSavedGameslot2Shields.innerHTML = store.getState().savedData.slot2.shields;\n loadSavedGameslot2Fists.innerHTML = store.getState().savedData.slot2.fists;\n }\n if (savedData.slot3.isUsed == true) {\n loadSavedGameslot3Stars.innerHTML = store.getState().savedData.slot3.stars.toString() + '/77';\n loadSavedGameslot3Shields.innerHTML = store.getState().savedData.slot3.shields;\n loadSavedGameslot3Fists.innerHTML = store.getState().savedData.slot3.fists;\n }\n }\n }", "function viewReport( idCedulaNit, codigoCuenta, actualElement )\n{\n var childsT = actualElement.parentNode.parentNode.childNodes;\n \n var monthTD = childsT[ 1 ];\n \n var selectMonthSelect = monthTD.childNodes;\n \n var fechaExtracto = selectMonthSelect[ 0 ].options[ selectMonthSelect[ 0 ].selectedIndex ].value;\n \n //xhr = createXhr;\n \n document.getElementById('reportPlaceHolder').src = \"Extracto_Generar.jsp?codigoCuenta=\" + codigoCuenta + \"&idCedulaNit=\" + idCedulaNit + \"&fechaExtracto=\" + fechaExtracto;\n\n return false;\n} // end function viewReport", "function updateUI(id) {\n \n let newUrl = getUrl(id);\n let cardConfirmedToday = document.getElementById(\"card-confirmed-today\"),\n cardConfirmedAll = document.getElementById(\"card-confirmed-all\"),\n cardRecoveredToday = document.getElementById(\"card-recovered-today\"),\n cardRecoveredAll = document.getElementById(\"card-recovered-all\"),\n cardDeathsToday = document.getElementById(\"card-deaths-today\"),\n cardDeathsAll = document.getElementById(\"card-deaths-all\");\n\n fetch(newUrl)\n .then(function (response) {\n if (response.status !== 200) {\n console.warn(\n \"Looks like there was a problem. Status Code: \" + response.status\n );\n return;\n }\n response.json().then(function (data) {\n cardConfirmedToday.innerHTML =\n numeral(data.todayCases).format(\"0,0\") + \" New Cases\";\n cardConfirmedAll.innerHTML =\n numeral(data.cases).format(\"0,0\") + \" Total Cases\";\n cardRecoveredToday.innerHTML =\n numeral(data.todayRecovered).format(\"0,0\") + \" New Cases\";\n cardRecoveredAll.innerHTML =\n numeral(data.recovered).format(\"0,0\") + \" Total Cases\";\n cardDeathsToday.innerHTML =\n numeral(data.todayDeaths).format(\"0,0\") + \" New Cases\";\n cardDeathsAll.innerHTML =\n numeral(data.deaths).format(\"0,0\") + \" Total Cases\";\n createGraph(data)\n });\n })\n .catch(function (err) {\n console.error(\"Fetch Error -\", err);\n });\n }", "function updateDisplay() {\n if (view == 'assignments') {\n $('#graded-items').hide();\n\n $('#assignments').show();\n $('.assignment-progress-bar').show();\n updateAssignments((a) => {\n assignments = a;\n displayAssignments(assignments);\n });\n } else if (view == 'gradedItems') {\n $('#assignments').hide();\n $('.assignment-progress-bar').hide();\n\n $('#graded-items').show();\n updateGradedItems((g) => {\n gradedItems = g;\n displayGradedItems(gradedItems);\n });\n }\n }", "function updateQualification(ids)\r\n{\r\n addQualBut.style.display=\"none\";\r\n updQualButton.style.display=\"block\";\r\n canQualUpd.style.display=\"block\";\r\n\r\n\r\n typeUpd = document.getElementById(\"type0\");\r\n if(qualList[ids].qualification_type==\"Higher Ed\")\r\n {\r\n typeUpd.getElementsByTagName('option')[1].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"VET\")\r\n {\r\n typeUpd.getElementsByTagName('option')[2].selected='selected';\r\n }\r\n if(qualList[ids].qualification_type==\"TAFE\")\r\n {\r\n typeUpd.getElementsByTagName('option')[3].selected='selected';\r\n } \r\n degUpd=document.getElementById(\"degree0\");\r\n uniUpd=document.getElementById(\"uni0\");\r\n dateUpd=studyArr=document.getElementById(\"date0\");\r\n studyUpd =document.getElementById(\"study0\");\r\n if(qualList[ids].finished==0)\r\n {\r\n studyUpd.getElementsByTagName('option')[1].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"none\";\r\n }\r\n if(qualList[ids].finished==1)\r\n {\r\n //studyUpd.value = \"Completed\";\r\n studyUpd.getElementsByTagName('option')[2].selected='selected';\r\n document.getElementById(\"date0\").style.display=\"block\";\r\n dateUpd.value=qualList[ids].end_date;\r\n }\r\n\r\n degUpd.value=qualList[ids].qualification_name;\r\n uniUpd.value=qualList[ids].University_name;\r\n qualId=document.getElementById(\"edu\"+ids).value; \r\n}", "function displayStandings(standings, conference_names, last_updated){\n\n var conf_colors = document.getElementById('conf_colors');\n conf_colors.innerHTML = '';\n\n\n var i;\n var confs_len = conference_names.length;\n if (confs_len === 2) {\n var k = 1;\n }\n else {\n var k = 0;\n }\n for (var i = 0; i < confs_len; i++){\n\n conferences = document.getElementById('conferences');\n\n var conf_name = conference_names[i];\n\n var table = '<h2 id=\\'title_' + i +\n '\\' class=\\'conf_title\\'>' +\n conf_name + ' Conference</h2>';\n table += '<table id=\\'table_' + i + '\\'></table>';\n\n conferences.innerHTML += table;\n\n // Addition of table colors ----------------------------\n var title_color = '#title_' + i + ' {';\n title_color += 'background-color: ' + colors[k]['color'] +\n ';';\n title_color += '}';\n\n var table_colors = '#table_' + i + ', #table_' + i + ' th {';\n table_colors += 'background-color: ' + colors[k]['back'] +\n ';';\n table_colors += 'border: 3px solid ' + colors[k]['color'] +\n ';';\n table_colors += 'border-top: none;';\n table_colors += '}';\n k++;\n\n if (k >= colors.length) {\n k = 0;\n }\n\n conf_colors.innerHTML += title_color;\n conf_colors.innerHTML += table_colors;\n //~Addition of table colors ---------------------------\n\n conf_table = document.getElementById('table_' + i);\n\n team_span = '4';\n name_span = '2';\n\n var table_head = '<tr>';\n table_head += '<th colspan=\"' + team_span + '\">Team</th>';\n table_head += '<th>W</th>';\n table_head += '<th>L</th>';\n table_head += '<th>Win%</th>';\n table_head += '<th>GB</th>';\n table_head += '<th>L10</th>';\n table_head += '</tr>';\n\n conf_table.innerHTML = table_head;\n\n for (var j = 0; j < standings[i].length; j++) {\n\n var team = standings[i][j];\n\n if (j === parseInt(16/confs_len)){\n var table_row = '<tr class=\"top_border\">';\n }\n else {\n var table_row = '<tr>';\n }\n table_row += '<td>' + (j+1) + '</td>';\n table_row += '<td><img src=\"imgs/logos/' +\n team.team_id + '.png\"></td>';\n table_row += '<td colspan=\"' + name_span +\n '\" class=\"team_name\">' + team.name + '</td>';\n table_row += '<td>' + team.win + '</td>';\n table_row += '<td>' + team.loss + '</td>';\n table_row += '<td>' + team.win_percent.toFixed(4) + '</td>';\n table_row += '<td>' + team.games_behind + '</td>';\n table_row += '<td>' + team.last_ten_win + '-' +\n team.last_ten_loss + '</td>';\n table_row += '</tr>';\n \n conf_table.innerHTML += table_row;\n\n }\n\n }\n\n last_update = document.getElementById('last_updated');\n last_text = 'Last updated on ' + last_updated.date +\n ' at ' + last_updated.time;\n last_update.innerHTML = last_text\n\n return;\n}", "function update() {\n\t\tvar title = checkPage();\n\t\tif (!title)\n\t\t\treturn;\n\n\t\tvar button = getButton();\n\t\tif (!button)\n\t\t\treturn;\n\n\t\tvar filename = title.replace(/[-\\s]+/g, \"-\").toLowerCase(),\n\t\t calendar = icsWrite(getClasses(filename), title);\n\n\t\tbutton.setAttribute(\"href\", calendar);\n\t\tbutton.setAttribute(\"download\", filename + \".ics\");\n\t}", "showSavedData() {\n if (this.selectedCard && this.selectedCard.cardNumber) {\n this.dataLoaded = true;\n this.isEditable = false;\n this.addNewCard = false;\n this.isButtonDisabled = false;\n this.cardSelected.cardNumber = this.selectedCard.cardNumber\n ? this.selectedCard.cardNumber.match(/\\d+/)[0]\n : '';\n this.cardSelected.cardType = this.selectedCard.cardType.name;\n this.cardSelected.label = `<${this.selectedCard.cardType.name}> <${\n this.selectedCard.cardNumber\n }> <${this.selectedCard.expiryMonth}/${\n this.selectedCard.expiryYear\n }> <${this.selectedCard.accountHolderName}>`;\n this.cardSelected.paymentId = this.selectedCard.id;\n this.cardSelected.billingAddress = this.selectedCard.billingAddress;\n this.cardSelected.address = this.setAddress(this.selectedCard);\n this.cardSelected.accountHolderName = this.selectedCard.accountHolderName;\n this.$refs.cardDropdown.setDropdownLabel(this.cardSelected.label);\n this.$refs.cardRadioButton.setSelectedByValue(\n this.cardRadioButton[0].value,\n );\n checkoutEventBus.$emit('payment-method-added');\n } else {\n this.getPaymentDetails();\n }\n }", "function displayCalendar_Fall2014_Spring2015(numberOfMonths) {\n\n from_semester_title.innerHTML = \"Fall 2014\";\n to_semester_title.innerHTML = \"Spring 2015\";\n\n $(\"#weekNumber\").html(\"1\");\n\n $(\"#dateoutput1\").html(\"2 Sep, Tue\");\n $(\"#dateoutput2\").html(\"6 Jan, Tue\");\n\n function highlightDays(date) {\n var a = new Date(2014, 8, 2); // September 2, 2014\n var b = new Date(2014, 11, 8); // December 8, 2014\n\n if (a <= date && date <= b) {\n return [true, 'highlight'];\n }\n\n return [true, ''];\n\n }\n\n\n $(\"#datepicker_Fall2014_Spring2015\").datepicker({\n /*\n dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n */\n\n inline: true,\n showOtherMonths: true,\n defaultDate: '02-09-14',\n numberOfMonths: numberOfMonths,\n dateFormat: \"dd-mm-yy\",\n\n\n beforeShowDay: highlightDays,\n\n\n onSelect: function (dateText, inst) {\n var date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, dateText, inst.settings);\n var dateText1 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n date.setDate(date.getDate() + 126);\n var dateText2 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n\n var newDate = date.getDate();\n var newMonth = date.getMonth();\n\n /*\n console.log(\"date: \" + date);\n console.log(\"newDate: \" + newDate);\n console.log(\"newMonth: \" + newMonth);\n */\n\n var weekNumber;\n var weekDays = 6;\n var wk1_start = 6;\n var wk1_end = wk1_start + weekDays;\n\n var wk2_start = 13;\n var wk2_end = wk2_start + weekDays;\n\n var wk3_start = 20;\n var wk3_end = wk3_start + weekDays;\n\n var wk4_start = 27;\n var wk4_end = 2;\n\n var wk5_start = 3;\n var wk5_end = wk5_start + weekDays;\n\n var wk6_start = 17;\n var wk6_end = wk6_start + weekDays;\n\n var wk7_start = 24;\n var wk7_end = 2;\n\n var wk8_start = 3;\n var wk8_end = wk8_start + weekDays;\n\n var wk9_start = 10;\n var wk9_end = wk9_start + weekDays;\n\n var wk10_start = 17;\n var wk10_end = wk10_start + weekDays;\n\n var wk11_start = 24;\n var wk11_end = wk11_start + weekDays;\n\n var wk12_start = 31;\n var wk12_end = 6;\n\n var wk13_start = 7;\n var wk13_end = wk13_start + weekDays;\n\n\n var January = 0;\n var February = 1;\n var March = 2;\n var April = 3;\n\n /* console.log(\"newDate: \" + newDate); */\n\n if ((newDate >= wk1_start && newDate <= wk1_end) && (newMonth == January)) {\n weekNumber = 1;\n }\n\n else if ((newDate >= wk2_start && newDate <= wk2_end) && (newMonth == January)) {\n weekNumber = 2;\n }\n\n else if ((newDate >= wk3_start && newDate <= wk3_end) && (newMonth == January)) {\n weekNumber = 3;\n }\n\n else if ((newDate >= wk4_start) && (newMonth == January)) {\n weekNumber = 4;\n }\n else if ((newDate <= wk4_end) && (newMonth == February)) {\n weekNumber = 4;\n }\n\n else if ((newDate >= wk5_start && newDate <= wk5_end) && (newMonth == February)) {\n weekNumber = 5;\n }\n\n else if ((newDate >= wk6_start && newDate <= wk6_end) && (newMonth == February)) {\n weekNumber = 6;\n }\n\n else if ((newDate >= wk7_start) && (newMonth == February)) {\n weekNumber = 7;\n }\n\n else if ((newDate <= wk7_end) && (newMonth == March)) {\n weekNumber = 7;\n }\n\n\n else if ((newDate >= wk8_start && newDate <= wk8_end) && (newMonth == March)) {\n weekNumber = 8;\n }\n\n else if ((newDate >= wk9_start && newDate <= wk9_end) && (newMonth == March)) {\n weekNumber = 9;\n }\n\n else if ((newDate >= wk10_start && newDate <= wk10_end) && (newMonth == March)) {\n weekNumber = 10;\n }\n\n else if ((newDate >= wk11_start && newDate <= wk11_end) && (newMonth == March)) {\n weekNumber = 11;\n }\n\n else if (newDate == wk12_start && newMonth == March) {\n weekNumber = 12;\n }\n\n else if (newDate <= wk12_end && newMonth == April) {\n weekNumber = 12;\n }\n\n\n else if ((newDate >= wk13_start && newDate <= wk13_end) && (newMonth == April)) {\n weekNumber = 13;\n }\n\n\n else {\n weekNumber = 'N/A';\n }\n\n\n $(\"#weekNumber\").html(weekNumber);\n\n $(\"#dateoutput1\").html(dateText1);\n $(\"#dateoutput2\").html(dateText2);\n\n\n }\n\n\n\n });\n\n\n}", "function createReport() {\n let month = document.getElementById(\"reportMonth\").value;\n let thisMonthOper = JSON.parse(localStorage.getItem(\"operations\"));\n let reportObj = {};\n document.querySelector(\"tbody\").innerHTML = \"\";\n if (thisMonthOper === null) {\n thisMonthOper = [];\n }\n for (var i = 0; i < thisMonthOper.length; i++) {\n let operationsMonth = thisMonthOper[i].date[0]+thisMonthOper[i].date[1]+thisMonthOper[i].date[2]+thisMonthOper[i].date[3]+thisMonthOper[i].date[4]+thisMonthOper[i].date[5]+thisMonthOper[i].date[6];\n //create object from LS info\n if (operationsMonth === month) {\n if (reportObj.hasOwnProperty(thisMonthOper[i].item)) {\n reportObj[thisMonthOper[i].item] += thisMonthOper[i].sum;\n } else {\n reportObj[thisMonthOper[i].item] = thisMonthOper[i].sum;\n }\n }\n }\n //create report table\n let items = Object.keys(reportObj);\n let values = Object.values(reportObj);\n for (var i = 0; i < items.length; i++) {\n let newRow = tbody.insertRow();\n let rows = table.getElementsByTagName(\"tr\");\n let num = rows.length - 2;\n newRow.innerHTML = `\n <td>${num}</td>\n <td>${items[i]}</td>\n <td>${parseFloat(values[i] / 100 * 100).toFixed(2)}</td>\n <td>${months[month.slice(5,7)-1] + \"-\" + month.slice(0,4)}</td>\n `;\n }\n}", "function initialise(){\n\r\n\t/* Calculate the start month (current - 1)*/\r\n\tintMonthOffset = (12 - intMonth);\r\n\tvar intPreviousMonth = 99;\n\t\r\n\t/*Build the current date object*/\r\n\tdatCurrentDate.setDate(1);\r\n\tdatCurrentDate.setMonth(intMonth);\r\n\tdatCurrentDate.setFullYear(intYear);\r\n\t/* Build the end date one year on */\r\n\tendDate.setDate(1);\r\n\tendDate.setMonth(intMonth);\r\n\tendDate.setFullYear(datCurrentDate.getFullYear()+1);\r\n\tendDate.setDate(1);\r\n\tdocument.getElementById(\"yearDisplay\").innerHTML = \"\";\r\n\t/* Loop through the display 12 months and draw the plan */\r\n\twhile (datCurrentDate< endDate)\r\n\t\t{\n\t\t\r\n\t\t/*Test for new month */\r\n\t\tif (datCurrentDate.getMonth() != intPreviousMonth)\r\n\t\t\t{\r\n\t\t\t/* Clear all previous cell data */\r\n\t\t\tfor (var x = 1; x<=42; x++)\r\n\t\t\t\t{\r\n\t\t\t\tclrElid = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + x;\r\n\t\t\t\tdocument.getElementById(clrElid).innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById(clrElid).className = \"dateExtra\";\r\n\t\t\t\t}\r\n\t\t\t/* Create the month jump controls and its title */\r\n\t\t\telid = \"monthHeader\" + (( datCurrentDate.getMonth() + intMonthOffset) % 12);\r\n\t\t\tdocument.getElementById(elid).onclick = function(){\tjumpMonthHead(this);\t};\r\n\t\t\tdocument.getElementById(elid).innerHTML = myMonths[datCurrentDate.getMonth()] + \" \" +datCurrentDate.getFullYear();\r\n\t\t\tintPreviousMonth = datCurrentDate.getMonth();\r\n\t\t\tintDayOffset = datCurrentDate.getDay() + 6;\r\n\t\t\t//alert(intDayOffset);\r\n\t\t\t}\r\n\t\t/* Draw the weekdays for the first seven days */\r\n\t\tif (datCurrentDate.getDate() < 8)\r\n\t\t\t{\r\n\t\t\tstrDateId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"day\" + (( datCurrentDate.getDate() + intDayOffset) % 7);\r\n\t\t\tdocument.getElementById(strDateId).innerHTML = myShortDays[datCurrentDate.getDay()];\r\n\t\t\t//document.getElementById(strDateId).innerHTML = datCurrentDate.getDay();\r\n\t\t\t}\r\n\t\tstrDayId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + ( datCurrentDate.getDate() + (intDayOffset %7));\r\n\t\tdocument.getElementById(strDayId).innerHTML = datCurrentDate.getDate();\r\n\t\tdocument.getElementById(strDayId).title = \"\";\r\n\t\tdocument.getElementById(strDayId).className = \"dateShow\";\r\n\t\tdocument.getElementById(strDayId).onclick = function(){\tjumpMonth(this);\t};\r\n\t\tdatCurrentDate.setDate(datCurrentDate.getDate()+1);\r\n\t\t}\r\n\tif (intYear == endDate.getFullYear())\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear;\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + intYear -1;\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + intYear+1;\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear + \"/\" + endDate.getFullYear();\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + (intYear * 1 -1) + \"/\" + (endDate.getFullYear() *1 -1);\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + (intYear * 1 + 1) + \"/\" + (endDate.getFullYear() * 1 +1);\r\n\t\t}\r\n\t//listReminders();\r\n\t\r\n\t\r\n\t}", "updateDates() {\n if (document.getElementById(self.datePicker.id + 'currYear') !== null) {\n document.getElementById(self.datePicker.id + 'currYear').value = self.datePicker.current.getFullYear();\n document.getElementById(self.datePicker.id + 'currDate').value = self.pickerString();\n } else {\n if (document.getElementById(self.datePicker.id + 'currDate') !== null) {\n document.getElementById(self.datePicker.id + 'currDate').value = self.pickerString();\n }\n }\n document.getElementById(self.datePicker.id + 'calendar').replaceChild(self.buildCalendar(), document.getElementById(self.datePicker.id + 'calendar').childNodes[0]);\n }", "function renderCardCase(doc) {\n let li = document.createElement('li');\n let la = document.createElement('div');\n let edit = document.createElement('a');\n edit.href = '#updatemodal' + doc.id;\n edit.id = 'helo' + doc.id;\n\n edit.className = \"col s2 btn-small disabled edit modal-trigger\";\n edit.style.display = \"none\";\n edit.textContent = 'edit';\n li.className = 'loaded-data';\n li.setAttribute('data-id', doc.id);\n\n let hargaInput = doc.data().harga;\n let numHargaInput = Number(hargaInput);\n\n\n var free = new Object();\n free['Free'] = doc.data().free;\n free['Periode Promo'] = doc.data().periode;\n free['Garansi'] = doc.data().periode;\n free['Keterangan'] = doc.data().keterangan;\n free['Info Produk'] = doc.data().linkproduk;\n\n // Mengambil data sebagai objek untuk keperluan CASH\n var objek = new Object();\n objek['Produk'] = doc.data().nama;\n objek['Harga'] = Number(doc.data().harga);\n objek['Cashback'] = Number(doc.data().cashback);\n objek['Harga Spesial'] = world();\n objek['Free'] = doc.data().free;\n objek['Periode Promo'] = doc.data().periode;\n objek['Garansi'] = doc.data().garansi;\n objek['Keterangan'] = doc.data().keterangan;\n objek['Info Produk'] = doc.data().linkproduk;\n\n // Memunculkan Harga Spesial\n function world() {\n if (objek['Cashback'] !== 0) {\n return objek['Harga'] - objek['Cashback']\n } else if (objek['Cashback'] == 0) {\n return objek['Harga Spesial'] = '';\n } else {\n return 0 // Memunculkan 0 == Tidak ditampilkan karena sudah dirumuskan dibawah\n }\n }\n\n // MEMPERBAIKI HASIL DARI JIKA HARGA CASHBACK = 0 JADI TAMPILAN YANG DITAYANG CUKUP SATU YAITU Harga\n if (objek['Harga'] === objek['Harga Spesial']) {\n objek['Harga Spesial'] = 0\n }\n // MEMPERBAIKI HASIL DARI JIKA HARGA CASHBACK = 0 JADI TAMPILAN YANG DITAYANG CUKUP SATU YAITU Harga\n\n\n\n // MEMBERI TANDA KOMA UNTUK HASIL BILANGAN YANG DI PRINT KELUAR\n objek['Harga'] = objek['Harga'].toLocaleString(undefined, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n });\n objek['Harga Spesial'] = objek['Harga Spesial'].toLocaleString(undefined, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n });\n objek['Cashback'] = objek['Cashback'].toLocaleString(undefined, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n });\n // MEMBERI TANDA KOMA UNTUK HASIL BILANGAN YANG DI PRINT KELUAR\n\n let newSpesifikasi = doc.data().spesifikasi.split(\",\").join(\"<br>\");\n let newIsibox = doc.data().isibox.split(\",\").join(\"<br>\");\n\n\n // Mengambil data sebagai objek untuk merender Harga HCI (BUKAN UNTUK ANGSURAN)\n let hargaNormal = Number(doc.data().harga);\n let cashBack = Number(doc.data().cashback);\n let hargaHCI = hitung();\n \n function hitung() {\n if (cashBack !== 0 || cashBack !== '') {\n return hargaNormal - cashBack;\n } else {\n hargaHCI = hargaNormal;\n }\n }\n \n let hargaHCIST = hargaHCI.toLocaleString(undefined, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n });\n\n if(objek['Info Produk'] == '#' || objek['Info Produk'] == 'undefined' ||objek['Info Produk'] == null ||objek['Info Produk'] == '' ){\n li.innerHTML = `\n <div class=\"collapsible-header\">\n <span class=\"left col s12 red-text darken-3\">${doc.data().nama} - <span class=\"bold\">Rp ${hargaHCIST}</span></span>\n </div>\n <div class=\"center-align collapsible-body\">\n \n <div class=\"konten2${doc.id}\"></div> <!-- INFO HARGA CASH YANG BISA DI COPAS -->\n <br>\n <a id=\"copycash${doc.id}\"class=\"light-blue darken-4 waves-effect waves-light btn-small\">Copy Cash</a>\n <a class=\" btn-small disabled delete\" href=\"#\" >Delete</a>\n <br>\n <br>\n \n <a class=\"light-blue darken-4 waves-effect waves-light btn modal-trigger btn-small\" href=\"#modal1${doc.id}\">Spec</a>\n <a class=\"light-blue darken-4 waves-effect waves-light btn modal-trigger btn-small\" href=\"#modal2${doc.id}\">Isi Box</a>\n <!-- Modal Structure -->\n <div id=\"modal1${doc.id}\" class=\"modal\">\n <div class=\"modal-content\">\n <div class=\"spesifikasi${doc.id}\">${newSpesifikasi}</div>\n </div>\n <div class=\"modal-footer\">\n <a class=\"modal-close waves-effect waves-green btn-flat\" id=\"copyspesifikasi${doc.id}\">Copy</a>\n </div>\n </div>\n \n <!-- Modal Structure -->\n <div id=\"modal2${doc.id}\" class=\"modal\">\n <div class=\"modal-content\">\n <div class=\"isibox${doc.id}\">${newIsibox}</div>\n </div>\n <div class=\"modal-footer\">\n <a class=\"modal-close waves-effect waves-green btn-flat\" id=\"copyisibox${doc.id}\">Copy</a>\n </div>\n </div> \n `;\n }else{\n li.innerHTML = `\n <div class=\"collapsible-header\">\n <span class=\"left col s12\">\n ${doc.data().nama} - <span class=\"bold\">Rp ${hargaHCIST}</span>\n <a href=\"${doc.data().linkproduk}\" target=\"_blank\"><button>Link</button></a>\n </span>\n </div>\n <div class=\"center-align collapsible-body\">\n \n <div class=\"konten2${doc.id}\"></div> <!-- INFO HARGA CASH YANG BISA DI COPAS -->\n <br>\n <a id=\"copycash${doc.id}\"class=\"light-blue darken-4 waves-effect waves-light btn-small\">Copy Cash</a>\n <a class=\" btn-small disabled delete\" href=\"#\" >Delete</a>\n <br>\n <br>\n \n <a class=\"light-blue darken-4 waves-effect waves-light btn modal-trigger btn-small\" href=\"#modal1${doc.id}\">Spec</a>\n <a class=\"light-blue darken-4 waves-effect waves-light btn modal-trigger btn-small\" href=\"#modal2${doc.id}\">Isi Box</a>\n <!-- Modal Structure -->\n <div id=\"modal1${doc.id}\" class=\"modal\">\n <div class=\"modal-content\">\n <div class=\"spesifikasi${doc.id}\">${newSpesifikasi}</div>\n </div>\n <div class=\"modal-footer\">\n <a class=\"modal-close waves-effect waves-green btn-flat\" id=\"copyspesifikasi${doc.id}\">Copy</a>\n </div>\n </div>\n \n <!-- Modal Structure -->\n <div id=\"modal2${doc.id}\" class=\"modal\">\n <div class=\"modal-content\">\n <div class=\"isibox${doc.id}\">${newIsibox}</div>\n </div>\n <div class=\"modal-footer\">\n <a class=\"modal-close waves-effect waves-green btn-flat\" id=\"copyisibox${doc.id}\">Copy</a>\n </div>\n </div> \n `;\n }\n \n\n\n la.innerHTML = `\n <div class=\"modal\" id=\"updatemodal${doc.id}\">\n <form id=\"form${doc.id}\">\n <label for=\"update-nama-produk\">Nama Kamera</label>\n <input type=\"text\" placeholder=\"Nama Kamera\" id=\"update-nama-produk${doc.id}\" value=\"${doc.data().nama}\" required>\n <br>\n <label for=\"update-harga-produk\">Masukkan Harga</label>\n <input type=\"text\" placeholder=\"Masukkan Harga\" id=\"update-harga-produk${doc.id}\" value=\"${doc.data().harga}\" required>\n <br>\n <label for=\"update-cashback\">Cashback</label>\n <input type=\"text\" placeholder=\"Cashback\" id=\"update-cashback${doc.id}\" value=\"${doc.data().cashback}\" >\n <br>\n <label for=\"update-garansi\">Garansi</label>\n <input type=\"text\" placeholder=\"Garansi\" id=\"update-garansi${doc.id}\" value=\"${doc.data().garansi}\">\n <br>\n <label for=\"update-free-bonus\">Free</label>\n <input type=\"text\" placeholder=\"Free\" id=\"update-free-bonus${doc.id}\" value=\"${doc.data().free}\">\n <br>\n <label for=\"periode-promo\">Periode Promo</label>\n <input type=\"text\" placeholder=\"Periode Promo\" id=\"periode-promo${doc.id}\" value=\"${doc.data().periode}\">\n <br>\n <div class=\"input-field col s12\">\n <textarea id=\"keterangan${doc.id}\" class=\"materialize-textarea\" >${doc.data().keterangan}</textarea>\n <label for=\"keterangan\">Keterangan</label>\n </div>\n <br>\n <div class=\"input-field col s12\">\n <textarea id=\"linkproduk${doc.id}\" class=\"materialize-textarea\" >${doc.data().linkproduk}</textarea>\n <label for=\"linkproduk\">Link Produk</label>\n </div>\n <br>\n <div class=\"input-field col s12\">\n <textarea id=\"spesifikasi${doc.id}\" class=\"materialize-textarea\">${doc.data().spesifikasi}</textarea>\n <label for=\"spesifikasi\">Spesifikasi</label>\n </div>\n <div class=\"input-field col s12\">\n <textarea id=\"isibox${doc.id}\" class=\"materialize-textarea\" >${doc.data().isibox}</textarea>\n <label for=\"isibox\">Isi Box</label>\n </div>\n <button id=\"${doc.id}click\" class=\"right light-blue darken-4 btn waves-effect waves-light\" type=\"submit\" name=\"action\">Update\n <i class=\"material-icons right\">send</i>\n </button>\n </form>\n </div> \n `;\n\n elementul.appendChild(li);\n elementul.appendChild(edit);\n elementul.appendChild(la);\n\n // MODAL ISI BOX DAN SPESIFIKASI\n var elems = document.querySelectorAll('.modal');\n var el;\n for (el = 0; el < elems.length; el++) {\n var instances = M.Modal.init(elems[el]);\n }\n\n\n // MERENDER HARGA CASH YANG BISA DI COPY PASTE\n for (const property in objek) {\n if (`${objek[property]}` == 0) {\n continue;\n }\n // console.log(`${property}: ${objek[property]}`)\n let idbaru = document.querySelector('.konten2' + doc.id);\n if (typeof objek[property] == Number) {\n return objek[property].toLocaleString(undefined, {\n minimumFractionDigits: 0,\n maximumFractionDigits: 0\n });\n }\n idbaru.innerHTML += `${property} : ${objek[property]} <br>`\n }\n // MERENDER HARGA CASH YANG BISA DI COPY PASTE ENDING\n\n\n // MERENDER FREE BONUS TEPAT DIBAWAH ANGSURAN START\n // for (const property in free) {\n // if (`${free[property]}` == 0) {\n // continue;\n // }\n // // console.log(`${property}: ${free[property]}`)\n // let idbaru = document.querySelector('.konten4' + doc.id);\n // if (typeof free[property] == Number) {\n // return free[property].toLocaleString(undefined, {\n // minimumFractionDigits: 0,\n // maximumFractionDigits: 0\n // });\n // }\n // idbaru.innerHTML += `${property} ${objek[property]} <br>`\n // }\n // MERENDER FREE BONUS TEPAT DIBAWAH ANGSURAN ENDING\n\n\n\n\n // TOMBOL COPY CASH #1\n let copyCash = document.querySelector('#copycash' + doc.id);\n copyCash.addEventListener('click', function (e) {\n var text = document.querySelector(\".konten2\" + doc.id);\n var selection = window.getSelection();\n var range = document.createRange();\n range.selectNodeContents(text);\n selection.removeAllRanges();\n selection.addRange(range);\n //add to clipboard.\n document.execCommand('copy');\n });\n // TOMBOL COPY #1 ENDING\n\n // TOMBOL COPY SPESIFIKASI #1\n let copySpec = document.querySelector('#copyspesifikasi' + doc.id);\n copySpec.addEventListener('click', function (e) {\n var text = document.querySelector(\".spesifikasi\" + doc.id);\n var selection = window.getSelection();\n var range = document.createRange();\n range.selectNodeContents(text);\n selection.removeAllRanges();\n selection.addRange(range);\n //add to clipboard.\n document.execCommand('copy');\n });\n // TOMBOL SPESIFIKASI #1 ENDING\n\n // TOMBOL COPY SPESIFIKASI #1\n let copyBox = document.querySelector('#copyisibox' + doc.id);\n copyBox.addEventListener('click', function (e) {\n var text = document.querySelector(\".isibox\" + doc.id);\n var selection = window.getSelection();\n var range = document.createRange();\n range.selectNodeContents(text);\n selection.removeAllRanges();\n selection.addRange(range);\n //add to clipboard.\n document.execCommand('copy');\n });\n // TOMBOL SPESIFIKASI #1 ENDING\n\n\n\n // HAPUS PRODUK DARI DATABASE (BUKAN REAL TIME)\n let del = document.querySelectorAll('.delete');\n let x;\n for (x = 0; x < del.length; x++) {\n del[x].addEventListener('click', (e) => {\n e.stopPropagation();\n // Mendapatkan data target dari ID yang diklik\n let id = e.target.parentElement.parentElement.getAttribute('data-id');\n // UPDATE DIBAWAH INI \n db.collection('cardcase').doc(id).delete().then(function () {\n window.location.reload(true);\n });;\n });\n } // HAPUS PRODUK DARI DATABASE (BUKAN REAL TIME)\n\n\n // KLIK TO EDIT DI PRODUK SATUAN\n let editt = document.querySelectorAll('#helo' + doc.id);\n let t;\n for (t = 0; t < editt.length; t++) {\n editt[t].addEventListener('click', function (e) {\n e.preventDefault();\n let modal = document.querySelector('#updatemodal' + doc.id);\n var instance = M.Modal.init(modal)\n instance.open();\n });\n // KLIK TO EDIT DI PRODUK SATUAN ENDING\n\n\n let tombolKlik = document.querySelectorAll('#form' + doc.id);\n let tom;\n // UPDATE PRODUK HARGA AMBIL DATA DARI FORM MODAL TERBARU YANG POP UP\n for (tom = 0; tom < tombolKlik.length; tom++) {\n tombolKlik[tom].addEventListener('submit', function (e) {\n e.preventDefault()\n\n let nama = document.querySelector('#update-nama-produk' + doc.id).value;\n let harga = document.querySelector('#update-harga-produk' + doc.id).value;\n let cashback = document.querySelector('#update-cashback' + doc.id).value;\n let garansi = document.querySelector('#update-garansi' + doc.id).value;\n let free = document.querySelector('#update-free-bonus' + doc.id).value;\n let periode = document.querySelector('#periode-promo' + doc.id).value;\n let keterangan = document.querySelector('#keterangan' + doc.id).value;\n let linkproduk = document.querySelector('#linkproduk' + doc.id).value; \n let spesifikasi = document.querySelector('#spesifikasi' + doc.id).value;\n let isibox = document.querySelector('#isibox' + doc.id).value;\n console.log(nama);\n // UPDATE DIBAWAH INI \n db.collection('cardcase').doc(doc.id).update({\n nama: nama,\n harga: harga,\n cashback: cashback,\n garansi: garansi,\n free: free,\n periode: periode,\n keterangan: keterangan,\n linkproduk: linkproduk,\n spesifikasi: spesifikasi,\n isibox: isibox\n }).then(() => {\n // let modal = document.querySelector('#updatemodal' + doc.id);\n // var instance = M.Modal.init(modal);\n // instance.close();\n alert(`Update ${nama} Berhasil`);\n\n });\n });\n } // UPDATE PRODUK HARGA AMBIL DATA DARI FORM MODAL TERBARU YANG POP UP\n } // KLIK TO EDIT DI PRODUK SATUAN\n}", "function buildCourseContent(xml) {\n // variables used to fill different cards with related class info\n var accCSC = \"\";\n var accMATH = \"\";\n var accPHYS = \"\";\n var accENGL = \"\";\n var accScience = \"\";\n var accSoc = \"\";\n var accAH = \"\";\n var accSAH = \"\";\n var accFree = \"\";\n\n var xmlDoc = xml.responseXML;\n var x = xmlDoc.getElementsByTagName(\"courses\");\n\n var courseNameLen = getCourseLength(xml);\n var subLen = getSubnameLength(xml);\n var sub = getAllCourseSubnames(xml);\n var arrSubname = fillArray(subLen, xml, getCourseSubnameAt);\n var arrCourseNames = fillArray(courseNameLen, xml, getCourseNameAt);\n var id = [];\n var creditSum = 0;\n \n for (var i = 0; i <courseNameLen; i++) { \n var check;\n\n if(arrCourseNames[i].indexOf(' ') === -1){\n \tcheck = arrCourseNames[i];\n } else {\n \tcheck = arrCourseNames[i].split(\" \")[0];\n }\n\n id.push(check+i);\n // Check the course's subname and divide into separate cards\n creditSum += parseInt(getCourseCreditsAt(xml, i));\n\n\t switch(check) {\n\t case \"CSC\" : \n\t accCSC += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"MATH\" : \n\t accMATH += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"PHYS\" :\n\t accPHYS += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"ENGL\" : \n\t accENGL += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"Science\" : \n\t accScience += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i));\n\t break;\n\t case \"Social\" : \n\t accSoc += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t case \"Arts/Humanities\" : \n\t accAH += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t case \"SS/Arts/Hum\" : \n\t accSAH += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t case \"Free\" : \n\t accFree += addTableItem(arrCourseNames[i], id[i], getCourseCreditsAt(xml, i), getCourseGradeAt(xml, i)); \n\t break;\n\t default: \n\t console.log(check + \" is not recognized.\");\n\t break;\n\t }\n }\n // Create Basic cards with content filled in\n document.getElementById(\"cscCard\").innerHTML = createTableCard(\"Computer Science\", accCSC, \"CSC Footer\",\"CSC\");\n document.getElementById(\"mathCard\").innerHTML = createTableCard(\"Math\", accMATH, \"Math Footer\", \"MATH\");\n document.getElementById(\"physCard\").innerHTML = createTableCard(\"Physics\", accPHYS, \"Physics Footer\", \"PHYS\");\n document.getElementById(\"englCard\").innerHTML = createTableCard(\"English\", accENGL, \"English Footer\", \"ENGL\");\n document.getElementById(\"sciCard\").innerHTML = createTableCard(\"Science\", accScience, \"Science Footer\", \"Science\");\n document.getElementById(\"genedCard\").innerHTML = createTableCard(\"Gen-Ed.\", accSoc+accAH+accSAH, \"Gen-Ed Footer\", \"GENED\");\n document.getElementById(\"freeCard\").innerHTML = createTableCard(\"Electives\", accFree, \"Electives Footer\", \"ELECTIVES\");\n\n // Update grades to current status\n for(var j=0; j < courseNameLen; j++){\n \tupdateTableGrades(id[j], xml, j);\n }\n //setCourseGradeAt(xml, 10, \"D\");\n}", "function setPage ( data ) {\n document.title = data.title;\n $('#logo').html('<img src=\"images/' + data.logo + '\"/>');\n $('h3').css('color', data.mainColor);\n $('#sectOne').css('background-image', data.headerBkg);\n $('#headerText').html( data.header );\n setTwoColumn( data.about );\n $('#sectThree').css('background-image', data.subBkg);\n $('#heading2').html( data.subhead );\n $('#addInfo').html( data.subText );\n $('body').css('background', '#ffffff none');\n getMap( data.address, data.zip );\n currentSect = 5;\n nextForm();\n}", "function displayCalendar_Summer2014_Fall2014(numberOfMonths) {\n\n from_semester_title.innerHTML = \"Summer 2014\";\n to_semester_title.innerHTML = \"Fall 2014\";\n\n $(\"#weekNumber\").html(\"1\");\n\n $(\"#dateoutput1\").html(\"5 May, Mon\");\n $(\"#dateoutput2\").html(\"2 Sep, Tue\");\n\n function highlightDays(date) {\n var a = new Date(2014, 4, 5); // May 5, 2014\n var b = new Date(2014, 8, 2); // September 2, 2014\n\n if (a <= date && date <= b) {\n return [true, 'highlight'];\n }\n\n return [true, ''];\n\n }\n\n\n $(\"#datepicker_Summer2014_Fall2014\").datepicker({\n /*\n dayNamesMin: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'],\n */\n\n inline: true,\n showOtherMonths: true,\n defaultDate: '05-05-14',\n numberOfMonths: numberOfMonths,\n dateFormat: \"dd-mm-yy\",\n\n\n beforeShowDay: highlightDays,\n\n\n onSelect: function (dateText, inst) {\n var date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, dateText, inst.settings);\n var dateText1 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n date.setDate(date.getDate() + 120);\n var dateText2 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n\n var newDate = date.getDate();\n var newMonth = date.getMonth();\n\n /*\n console.log(\"date: \" + date);\n console.log(\"newDate: \" + newDate);\n console.log(\"newMonth: \" + newMonth);\n */\n\n var weekNumber;\n var weekDays = 6;\n var wk1_start = 2;\n var wk1_end = wk1_start + weekDays;\n\n var wk2_start = 9;\n var wk2_end = wk2_start + weekDays;\n\n var wk3_start = 16;\n var wk3_end = wk3_start + weekDays;\n\n var wk4_start = 23;\n var wk4_end = wk4_start + weekDays;\n\n var wk5_start = 30;\n var wk5_end = 6;\n\n var wk6_start = 7;\n var wk6_end = wk6_start + weekDays;\n\n var wk7_start = 14;\n var wk7_end = wk7_start + weekDays;\n\n var wk8_start = 21;\n var wk8_end = wk8_start + weekDays;\n\n var wk9_start = 28;\n var wk9_end = 3;\n\n var wk10_start = 4;\n var wk10_end = wk10_start + weekDays;\n\n var wk11_start = 11;\n var wk11_end = wk11_start + weekDays;\n\n var wk12_start = 18;\n var wk12_end = wk12_start + weekDays;\n\n var wk13_start = 25;\n var wk13_end = 1;\n\n\n var September = 8;\n var October = 9;\n var November = 10;\n var December = 11;\n\n /* console.log(\"newDate: \" + newDate); */\n\n if ((newDate >= wk1_start && newDate <= wk1_end) && (newMonth == September)) {\n weekNumber = 1;\n }\n\n else if ((newDate >= wk2_start && newDate <= wk2_end) && (newMonth == September)) {\n weekNumber = 2;\n }\n\n else if ((newDate >= wk3_start && newDate <= wk3_end) && (newMonth == September)) {\n weekNumber = 3;\n }\n\n else if ((newDate >= wk4_start && newDate <= wk4_end) && (newMonth == September)) {\n weekNumber = 4;\n }\n\n else if (((newDate == wk5_start) && (newMonth == September)) || ((newDate <= wk5_end) && (newMonth == October))) {\n weekNumber = 5;\n }\n\n else if ((newDate >= wk6_start && newDate <= wk6_end) && (newMonth == October)) {\n weekNumber = 6;\n }\n\n else if ((newDate >= wk7_start && newDate <= wk7_end) && (newMonth == October)) {\n weekNumber = 7;\n }\n\n else if ((newDate >= wk8_start && newDate <= wk8_end) && (newMonth == October)) {\n weekNumber = 8;\n }\n\n else if (((newDate >= wk9_start && newDate <= 31) && (newMonth == October)) || ((newDate <= wk9_end) && (newMonth == November))) {\n weekNumber = 9;\n }\n\n\n else if ((newDate >= wk10_start && newDate <= wk10_end) && (newMonth == November)) {\n weekNumber = 10;\n }\n\n else if ((newDate >= wk11_start && newDate <= wk11_end) && (newMonth == November)) {\n weekNumber = 11;\n }\n\n else if ((newDate >= wk12_start && newDate <= wk12_end) && (newMonth == November)) {\n weekNumber = 12;\n }\n\n\n else if (((newDate >= wk13_start && newDate <= 30) && (newMonth == November)) || ((newDate == 1) && (newMonth == December))) {\n weekNumber = 13;\n }\n\n\n else {\n weekNumber = 'N/A';\n }\n\n\n $(\"#weekNumber\").html(weekNumber);\n\n $(\"#dateoutput1\").html(dateText1);\n $(\"#dateoutput2\").html(dateText2);\n\n\n }\n\n\n\n });\n\n\n}", "function update() {\n //calendar object exposed on scope\n scope.calendar = elm.html('');\n var view = scope.calendar.fullCalendar('getView');\n if(view){\n view = view.name; //setting the default view to be whatever the current view is. This can be overwritten. \n }\n /* If the calendar has options added then render them */\n var expression,\n options = {\n defaultView : view,\n eventSources: sources\n };\n if (attrs.uiCalendar) {\n expression = scope.$eval(attrs.uiCalendar);\n } else {\n expression = {};\n }\n angular.extend(options, uiConfig.uiCalendar, expression);\n scope.calendar.fullCalendar(options);\n }", "function update() {\n //calendar object exposed on scope\n scope.calendar = elm.html('');\n var view = scope.calendar.fullCalendar('getView');\n if(view){\n view = view.name; //setting the default view to be whatever the current view is. This can be overwritten. \n }\n /* If the calendar has options added then render them */\n var expression,\n options = {\n defaultView : view,\n eventSources: sources\n };\n if (attrs.uiCalendar) {\n expression = scope.$eval(attrs.uiCalendar);\n } else {\n expression = {};\n }\n angular.extend(options, uiConfig.uiCalendar, expression);\n scope.calendar.fullCalendar(options);\n }", "function change_year(e){\n year=parseInt(e.target.id);\n initializing_description();\n document.getElementById('pileups').innerHTML=text;\n document.getElementById('YEAR').innerHTML=year.toString();\n document.getElementById('publications').innerHTML='# publications : '.concat(data_json['publications'][year.toString()].toString());\n document.getElementById('tanom_land').innerHTML='temperature anomaly land : '.concat(temp_anom_land['data'][year.toString()]);\n document.getElementById('tanom_ocean').innerHTML='temperature anomaly ocean : '.concat(temp_anom_ocean['data'][year.toString()]);\n document.getElementById('forest_coverage').innerHTML='forest coverage : '.concat((forest_coverage[year-min_year].toPrecision(3)).toString());\n for(var i=0;i<global_surface_ice.length;i++){\n\tif(global_surface_ice[i]['y']==year) document.getElementById('ice surface (million of km2)').innerHTML='ice surface : '.concat((global_surface_ice[i]['surface'].toPrecision(3)).toString(),' million of km2');\n }\n list_pileups_year();\n list_pairwize_year();\n change();\n}", "updateCalendarHeader() {\n this.uiComponents.calendarBody.innerHTML = this.templateText(\n this.calendarBodyTemplateText,\n {\n month: this.months()[this.dateObject.month].name,\n year: this.dateObject.year,\n },\n );\n }", "function UpdateClicked_Daily()\n{\n\tfncSaveChanges = \"\";\n\tshowWaitAlert(getSeaPhrase(\"UPDATING_DAILY_TE\",\"TE\"));\n\tUpdateTimeCard(\"Daily\");\n}", "function updatePageData(){\n // Update current step number\n $(\".kf-current-step\").each(function(index) {\n $(this).text(currentStep);\n });\n }", "function initPage(){\r\n\t\t//add head class\r\n\t\t$(\"#headGeneralInformationLi\").addClass(\"active\");\r\n\t\tgetSeries();\r\n\t\t$(\"#divLeft,#divHead,#divFoot\").addClass(\"notPrintable\");\r\n\t\t$(\"#startTime\").val(window.byd.DateUtil.lastWorkDate());\r\n\r\n\t\tajaxQueryReplacementCost(\"monthly\");\r\n \tajaxQueryReplacementCost(\"yearly\");\r\n \tajaxQueryCostDistribute();\r\n\t\tresetAll();\r\n\t}" ]
[ "0.61812705", "0.59588534", "0.5927778", "0.58503544", "0.58467627", "0.57469565", "0.57300836", "0.56618935", "0.56255484", "0.5616136", "0.5588741", "0.558832", "0.5569769", "0.55316454", "0.55129427", "0.5502673", "0.5480918", "0.54475623", "0.5426156", "0.54257214", "0.5425681", "0.54144365", "0.5401956", "0.53950906", "0.53808415", "0.53782165", "0.5377202", "0.53647226", "0.5359622", "0.53495514", "0.53366226", "0.5335456", "0.5317906", "0.53076106", "0.53042656", "0.5301296", "0.5297333", "0.5287606", "0.528354", "0.52759683", "0.5265935", "0.5255384", "0.52548003", "0.524984", "0.5246769", "0.5244378", "0.52309453", "0.52229273", "0.5220195", "0.52160966", "0.521038", "0.5208076", "0.5198712", "0.5194576", "0.5189145", "0.5185765", "0.51849073", "0.518484", "0.51819104", "0.51782924", "0.5173036", "0.51722574", "0.51711434", "0.5170179", "0.5165664", "0.5165131", "0.5162242", "0.51586264", "0.51527995", "0.5148738", "0.514818", "0.51427615", "0.5141367", "0.5133928", "0.5133161", "0.51323265", "0.5130902", "0.5129325", "0.51240766", "0.51237756", "0.5118117", "0.5117996", "0.5113892", "0.511269", "0.5104954", "0.51020586", "0.51010853", "0.51007235", "0.50910085", "0.508822", "0.50743896", "0.5071324", "0.50703424", "0.5067096", "0.5067096", "0.5062014", "0.5061069", "0.5060184", "0.50596935", "0.5058817" ]
0.7594558
0
This function should toggle the dropdown. If the dropdown classList contains the "closed" class, it should remove it. If the dropdown classList doesn't contain the "closed" class, it should add it.
function toggleDropdown() { // code goes here if (dropdown.classList.contains("closed")) { dropdown.classList.remove("closed") } else { dropdown.classList.add("closed") } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onToggleDropdown() {\n\t\tif(this.containerDropdownElement.className.indexOf(\"show\") == -1) {\n\t\t\tthis.containerDropdownElement.className += \" show\";\n\t\t} else {\n\t\t\tthis.containerDropdownElement.className = this.containerDropdownElement.className.replace(\" show\", \"\");\n\t\t}\n\t}", "function toggleDropdown(){\n\n dropdownItems.classList.toggle('dropdownShow');\n dropdownPijltje.classList.toggle('draaiPijl')\n}", "onToggleDropdown() {\n if (this.containerDropdownElement.className.indexOf('show') === -1) {\n this.containerDropdownElement.className += ' show';\n } else {\n const className = this.containerDropdownElement.className.replace(' show', '');\n\n this.containerDropdownElement.className = className;\n }\n }", "function toggleProjectList() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n console.log('hello')\n}", "function closeDropDowns( ){\n var i = 0, dropdown\n for(; i < openDropdowns.length; i++){\n dropdown = document.getElementById(openDropdowns[i])\n if(dropdown.classList.contains('show')){\n dropdown.classList.remove('show')\n }\n }\n }", "function dropdownToggle() {\n document.getElementById(\"ProjectDropdown\").classList.toggle(\"show\");\n}", "function toggleDropdown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function toggle() {\n console.log(\"toggle\");\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function closeTwopack() {\n var twopack_contains = document.getElementsByClassName(\"tp_drop_list\");\n for (var i = 0; i < twopack_contains.length; i++) {\n var openDropdown = twopack_contains[i];\n if (openDropdown.classList.contains('show')) {\n openDropdown.classList.remove('show');\n }\n }\n}", "function dropdownToggle() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function desplegable() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdownToggle($dropdown) {\n if ($dropdown.hasClass(\"open\")) {\n dropdownClose($dropdown);\n } else {\n dropdownOpen($dropdown);\n }\n }", "function drop() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "handleDropdownTrigger() {\n if (this.classList.contains('is-active')) {\n this.classList.remove('is-active');\n } else {\n this.classList.add('is-active');\n }\n }", "function dropit(){\n document.getElementById(\"dropOptions\").classList.toggle(\"show\");\n}", "function drop_toggle() {\n\tdocument.getElementById(\"peekaboo_nav_list\").classList.toggle(\"show\");\n}", "close() {\n const that = this;\n\n if (that.$dropDownContainer.hasClass('jqx-visibility-hidden')) {\n return;\n }\n\n const isClosingEventPrevented = that.$.fireEvent('closing').defaultPrevented;\n\n if (isClosingEventPrevented) {\n return;\n }\n\n that.$dropDownContainer.addClass('jqx-visibility-hidden');\n that.$.fireEvent('close');\n\n if (that.$.dropDownButton) {\n that.$.dropDownButton.removeAttribute('selected');\n }\n\n that.opened = false;\n that._preventDropDownClose = false;\n that._positionDetection.removeOverlay(true);\n\n if (that._edgeMacFF && !that.hasAnimation && that.$.dropDownContainer) {\n that.$.dropDownContainer.style.top = that.$.dropDownContainer.style.left = '';\n that.$dropDownContainer.addClass('not-in-view');\n }\n }", "function dropdown() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "close() {\n const that = this;\n\n if (that.$dropDownContainer.hasClass('jqx-visibility-hidden')) {\n return;\n }\n\n const isClosingEventPrevented = that.$.fireEvent('closing').defaultPrevented;\n\n if (isClosingEventPrevented) {\n return;\n }\n\n that.$dropDownContainer.addClass('jqx-visibility-hidden');\n that.$.fireEvent('close');\n\n if (that.$.dropDownButton) {\n that.$.dropDownButton.removeAttribute('selected');\n }\n\n that.opened = false;\n that._preventDropDownClose = false;\n that._positionDetection.removeOverlay(true);\n\n if (that._edgeMacFF && !that.hasAnimation) {\n that.$.dropDownContainer.style.top = that.$.dropDownContainer.style.left = '';\n that.$dropDownContainer.addClass('not-in-view');\n }\n }", "function dropdown(){\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropDown() {\n\tdocument.getElementById( \"dropdown\" ).classList.toggle( \"show\" );\n}", "function menuHider() {\n var dropdowns = document.getElementsByClassName(\"dropdown-content\");\n for (i = 0; i < dropdowns.length; i++) {\n var openDropdown = dropdowns[i];\n if (openDropdown.classList.contains('show')) {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }\n else if (!openDropdown.classList.contains('show')) {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }\n }\n}", "function toggleDropdown1() {\n console.log(\"klik\");\n const dropdown1 = document.querySelector(\".disabledDropdown1\");\n dropdown1.classList.toggle(\"active\");\n}", "function RUT() {\n document.getElementById(\"myDropdown\").classList.toggle(\"RUT_show\");\n}", "function myDropdown(){\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "_closeDropDown () {\n this._mainDropDownActive = false\n this._sizeDropDownActive = false\n this._containerHeader.querySelector('.dropdown-sub1-content').style.display = 'none'\n this._containerHeader.querySelector('.dropdown-content').style.display = 'none'\n }", "function dropDown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function editdropdown()\n{\n \n if($('.threadEdit-dropdown').hasClass(\"d-n\")){\n $('.threadEdit-dropdown').removeClass('d-n');\n }\n else{\n $('.threadEdit-dropdown').addClass('d-n');\n }\n \n}", "function toggleDropdown(dropdown) {\n document.getElementById(dropdown).classList.toggle(\"show\");\n}", "_closeDropDownButtonDropDown() {\n const that = this;\n\n if (that._dropDownButtonDropDownOpened) {\n that.$dropDownButtonDropDown.addClass('jqx-hidden');\n that._dropDownButtonDropDownOpened = false;\n }\n }", "function dropFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropdown() {\n document.getElementById(\"all-versions\").classList.toggle(\"show\");\n}", "function dropdownFunction() {\n $(\"#myDropdown\").toggleClass(\"hidden flexbox\");\n $(\".men-icon\").toggleClass(\"no-display\");\n}", "function dropdownFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function DropDown() {\n document.getElementById(\"dropdowmenu\").classList.toggle(\"show\");\n}", "function dropdownMenu() {\n\tdocument.getElementById(\"dropDownMenu\").classList.toggle(\"show\");\n}", "function toggleNav(){\n if($('#dropdown').hasClass('hide-dropdown')){\n $('#dropdown').removeClass('hide-dropdown');\n $('#dropdown').addClass('show-dropdown');\n }\n else{\n $('#dropdown').removeClass('show-dropdown');\n $('#dropdown').addClass('hide-dropdown');\n } \n}", "function dropdown() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function menuOptions() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function toggleDropdownButton() {\n if ($(this).is('.active')) {\n $(this).removeClass('active');\n } else {\n $(this).addClass('active');\n }\n}", "function dropFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function toggleDropdown() {\n if (document.querySelector(\".dropdown\") !== null) {\n let aDropdownButtonElements =\n document.querySelectorAll(\".dropdown__button\");\n /* let aDropdownListElements = document.querySelectorAll(\n \".dropdown-list-container\"\n ); */\n aDropdownButtonElements.forEach((eButton) => {\n eButton.addEventListener(\"click\", () => {\n //Reset all dialog boxes\n\n // aDropdownListElements.forEach((eList) => {\n // if (eButton.dataset.buttonid === eList.dataset.listid) {\n // eList.classList.toggle(\"dropdown-list-container--hidden\");\n // }\n // });\n\n //----------- REFACTORED VERSION ------------//\n document\n .querySelector(`[data-listid='${eButton.dataset.buttonid}']`)\n .classList.toggle(\"dropdown-list-container--hidden\");\n });\n });\n }\n}", "function dropdown() {\n glumacNameContainer.classList.toggle(\"show\");\n\n if (arrow.classList.contains('fa-arrow-down')) {\n arrow.classList.remove('fa-arrow-down');\n arrow.classList.add('fa-arrow-up');\n } else {\n arrow.classList.add('fa-arrow-down');\n }\n}", "function dropdownFunc() {\n document.getElementById(\"infoDrop\").classList.toggle(\"show\");\n }", "function toggleOpen() {\n this.classList.toggle(\"open\"); // removes if there, adds if not\n}", "function dropdown_menu_clicked() {\n if(document.getElementById('menu_dropdown_content').classList.contains('show'))\n \tdocument.getElementById('menu_dropdown_content').classList.remove('show');\n else\n \tdocument.getElementById('menu_dropdown_content').classList.add('show');\n}", "function openViewDropdown() {\n document.getElementById(\"viewDropdown\").classList.toggle(\"show\");\n}", "function dropdownTeam() {\n document.getElementById('myDropdown-team').classList.toggle('show');\n}", "function showDropdown() {\n document.getElementById(\"myDrop\").classList.toggle(\"show\");\n}", "function dropDown(){\n var _dropDown = $('.drop-down');\n if ( _dropDown.hasClass('hide') ) {\n _dropDown.removeClass('hide').addClass('show');\n } else {\n _dropDown.removeClass('show').addClass('hide');\n }\n}", "function dropDownParticipant() {\n document.getElementById(\"participantDropdown\").classList.toggle(\"show\");\n}", "function toggleDropdown() {\n document.getElementById(\"login-dropdown\").classList.toggle(\"is-active\");\n}", "function toggleDropdown() { \n document.querySelector(\"#my-dropdown\").classList.add(\"show\"); \n}", "function toggleDropdown(element) {\t\n\t\tif (hasClass(element,\"hidden\")) {\n\t\t\tshowOneDropdown(element);\n\t\t} else {\n\t\t\taddClass(element,\"hidden\");\n\t\t}\n\t}", "function menuShow() {\n if (ul.classList.contains('open')){\n ul.classList.remove('open');\n }\n\n else{\n ul.classList.add('open');\n }\n}", "function dropDown() {\n document.getElementById(\"playerDropdown\").classList.toggle(\"show\");\n}", "function dropDown() {\n if (dropdownMenu.className === \"dropdownMenu\") {\n dropdownMenu.className = \"dropdownMobile\";\n }\n else {\n dropdownMenu.className = \"dropdownMenu\";\n }\n}", "toggleForDropDown() {\n this.setState(prevState => ({\n dropdownOpen: !prevState.dropdownOpen\n }));\n }", "function menuDrop() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function dropmenu() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "close() {\n if(!this.$element.hasClass('is-open')){\n return false;\n }\n this.$element.removeClass('is-open')\n .attr({'aria-hidden': true});\n\n this.$anchor.removeClass('hover')\n .attr('aria-expanded', false);\n\n if(this.classChanged){\n var curPositionClass = this.getPositionClass();\n if(curPositionClass){\n this.$element.removeClass(curPositionClass);\n }\n this.$element.addClass(this.options.positionClass)\n /*.hide()*/.css({height: '', width: ''});\n this.classChanged = false;\n this.counter = 4;\n this.usedPositions.length = 0;\n }\n /**\n * Fires once the dropdown is no longer visible.\n * @event Dropdown#hide\n */\n this.$element.trigger('hide.zf.dropdown', [this.$element]);\n\n if (this.options.trapFocus) {\n Foundation.Keyboard.releaseFocus(this.$element);\n }\n }", "function CloseDropdown() {\n if ($(this).parent(\".n-search\").hasClass(\"open\")) {\n $(this).parent(\".n-search\").removeClass(\"open\");\n $(this).prev(\".dropdown-toggle\").attr(\"aria-expanded\", \"false\");\n }\n }", "function hide_dropdown(){\n $(document).find('.notification-dropdown').removeClass('dropdown-transition').addClass('dd')\n $(document).find('.notification-dropdown').find('.list-item').addClass('background-white')\n }", "function ToggleFilter(e) {\n for (let i = 0; i < dropDownList.length; i++)\n if (e.id !== dropDownList[i].id && dropDownList[i].children[0].classList.contains(\"toggled\")) {\n dropDownList[i].children[0].classList.remove(\"toggled\");\n } else if (e.id === dropDownList[i].id) {\n dropDownList[i].children[0].classList.toggle(\"toggled\");\n }\n}", "function myFunction() {\n \t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t\t}", "function myFunction() {\n\t\t\t\tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t\t\t\t}", "function dropdownCloseAll() {\n $dropdowns.removeClass(\"open\");\n }", "function ToggleDropdown(dropdown){\r\n\t\"use strict\";\r\n\t//$('li.has-dropdown').addClass('hover');\r\n\tif (hasClass(dropdown,'hover'))\r\n\t{\r\n\t\t$(dropdown).removeClass('hover');\r\n\t}\r\n\telse\r\n\t{\r\n\t\t$(dropdown).addClass('hover');\r\n\t}\r\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n \n}", "function myEditFunction() {\n document.getElementById(\"myEditDropdown\").classList.toggle(\"show\");\n}", "function openClosePunchList() {\n $containerCardLists.classList.toggle('container-card-lists-closed');\n}", "function openDropDown() {\n document.getElementById('submenu').classList.toggle('mostrar');\n}", "function tbDropDown(parentClass, dropdownClass, closeOtherDropdown) {\n\t\t$(document).on('click',parentClass,function(e){\n\t\t\tif ($(dropdownClass).hasClass('open')) {\n\t\t\t\t$(dropdownClass).removeClass('open').stop(false).slideUp(500, \"swing\");\n\t\t\t\t$(parentClass).removeClass('open');\n\t\t\t} else {\n\t\t\t\tif (closeOtherDropdown == true) {\n\t\t\t\t\tremoveDefaultDropdown();\n\t\t\t\t}\n\t\t\t\t$(dropdownClass).addClass('open').stop(false).slideDown(500, \"swing\");\n\t\t\t\t$(parentClass).addClass('open');\n\t\t\t}\n\t\t\te.stopPropagation();\n\t\t});\n\t}", "dropdownToggle(newValue){\n\t if (this._forceOpen){\n\t this.setState({ menuOpen: true });\n\t this._forceOpen = false;\n\t } else {\n\t this.setState({ menuOpen: newValue });\n\t }\n\t}", "dropdownToggle(newValue){\n\t if (this._forceOpen){\n\t this.setState({ menuOpen: true });\n\t this._forceOpen = false;\n\t } else {\n\t this.setState({ menuOpen: newValue });\n\t }\n\t}", "function myFunction() {\n \tdocument.getElementById(\"myDropdown\").classList.toggle(\"show\");\n\t}", "onToggleLanguagesDropdown() {\n $('#select-languages').on('click', function () {\n $(this).siblings('#dropdown-languages').toggleClass('show')\n });\n }", "function toggleDrop() {\n\n\tvar $choiceContainer = $('.js-choice-wrap');\n\tvar openClass = 'choice-opened';\n\n\tif ($choiceContainer.length) {\n\n\t\t$.each($choiceContainer, function () {\n\t\t\tvar $thisContainer = $(this);\n\n\t\t\tif ($thisContainer.attr('data-parent-position') !== undefined) {\n\t\t\t\t$thisContainer.parent().css({\n\t\t\t\t\t'position': 'relative',\n\t\t\t\t\t'padding-right': Math.round($thisContainer.outerWidth() + 10),\n\t\t\t\t\t'overflow': 'visible'\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\n\t\t$('.js-choice-open').on('click', function (e) {\n\t\t\te.preventDefault();\n\t\t\tvar $currentContainer = $(this).closest('.js-choice-wrap');\n\n\t\t\te.stopPropagation();\n\n\t\t\tif ($currentContainer.hasClass(openClass)) {\n\t\t\t\t$currentContainer.removeClass(openClass);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$choiceContainer.removeClass(openClass);\n\t\t\t$currentContainer.addClass(openClass);\n\n\t\t\t// close search form\n\t\t\tvar $searchFormContainer = $('.search-form-js');\n\t\t\tif($('html').hasClass('form-is-open')){\n\t\t\t\t$searchFormContainer.trigger('closeSearchForm');\n\t\t\t}\n\t\t});\n\n\t\t$(document).on('click', function () {\n\t\t\tcloseDrop();\n\t\t});\n\n\t\t$(document).keyup(function(e) {\n\t\t\tif ($choiceContainer.hasClass(openClass) && e.keyCode === 27) {\n\t\t\t\tcloseDrop();\n\t\t\t}\n\t\t});\n\n\t\t$choiceContainer.on('closeChoiceDrop', function () {\n\t\t\tcloseDrop();\n\t\t});\n\n\t\tfunction closeDrop() {\n\t\t\t$choiceContainer.removeClass(openClass);\n\t\t}\n\n\t\t$('.js-choice-drop').on('click', 'a', function (e) {\n\t\t\tvar $this = $(this);\n\n\t\t\t// if data-window-location is true, prevent default\n\t\t\tif ($this.closest($choiceContainer).attr('data-window-location') === 'true') {\n\t\t\t\te.preventDefault();\n\t\t\t}\n\n\t\t\t// if data-select is false, do not replace text\n\t\t\tif ($this.closest($choiceContainer).attr('data-select') === 'false') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$('a', '.js-choice-drop').removeClass('active');\n\n\t\t\t$this\n\t\t\t\t.addClass('active')\n\t\t\t\t.closest('.js-choice-wrap')\n\t\t\t\t.find('.js-choice-open span')\n\t\t\t\t.text($this.find('span').text());\n\t\t});\n\t}\n\n}", "function myFunction() {\n    document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n }", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function myFunction() {\r\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\r\n}", "function toggleDropdown() {\n links.forEach((link) => link.classList.toggle(\"toggleShow\"));\n menu.classList.toggle(\"navStyle\");\n bar.classList.toggle(\"change\");\n}", "function matrixDropdownToggle() {\n document.getElementById(\"matrix-dropdown\").classList.toggle(\"show\");\n}", "function CloseDropdown() {\n\t\t\tif ( $( this ).parent( \".n-search\" ).hasClass( \"open\" ) ) {\n\t\t\t\t$( this ).parent( \".n-search\" ).removeClass( \"open\" );\n\t\t\t\t$( this ).prev( \".dropdown-toggle\" ).attr( \"aria-expanded\", \"false\" );\n\t\t\t}\n\t\t}", "toggle() {\n this.setState({\n dropdownOpen: !this.state.dropdownOpen\n });\n }", "function deployDropdown() {\r\n var $parent = $(this).parent();\r\n var has_class = $parent.hasClass('active');\r\n $('.filter').each(function() {\r\n $(this).removeClass('active');\r\n });\r\n if (has_class) {\r\n $parent.removeClass('active');\r\n } else {\r\n $parent.addClass('active');\r\n document.addEventListener('click', clickOutsideDropdownMenuListener);\r\n }\r\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}", "function myFunction() {\n document.getElementById(\"myDropdown\").classList.toggle(\"show\");\n}" ]
[ "0.7360963", "0.71902317", "0.7141633", "0.6889421", "0.6874615", "0.6871357", "0.6867251", "0.6841624", "0.6817448", "0.6785155", "0.6721586", "0.66707164", "0.6576731", "0.6567761", "0.65598416", "0.6558041", "0.6556466", "0.6540552", "0.6536351", "0.6530308", "0.6529978", "0.6526571", "0.6517134", "0.6514142", "0.6500286", "0.6494315", "0.6493699", "0.6493643", "0.6486536", "0.6485553", "0.6469866", "0.64595175", "0.6457804", "0.64461243", "0.6441995", "0.6439748", "0.6431129", "0.643072", "0.6424701", "0.64204174", "0.64170146", "0.6415122", "0.6408405", "0.6405111", "0.64047796", "0.64044607", "0.6398516", "0.6396063", "0.63769317", "0.6360206", "0.6359746", "0.63532364", "0.6351566", "0.63513654", "0.63478863", "0.6339451", "0.63211083", "0.63112956", "0.6284039", "0.6281203", "0.6276225", "0.6275169", "0.62746596", "0.62688357", "0.62656474", "0.62554145", "0.62423503", "0.62197375", "0.6219675", "0.62173563", "0.6204792", "0.6204708", "0.6201828", "0.6201215", "0.6201215", "0.62007856", "0.61889964", "0.6179311", "0.6175308", "0.61733985", "0.61733985", "0.61733985", "0.6171461", "0.6164794", "0.6164794", "0.6164794", "0.6153837", "0.6152932", "0.61489594", "0.61394155", "0.61259866", "0.61215967", "0.61215967", "0.61215967", "0.61215967", "0.61215967", "0.61215967", "0.61215967", "0.61215967", "0.61215967" ]
0.81567013
0
This function should update the inner html of the dropdown label to be the current value stored in the `semester` variable.
function updateDropdownLabel() { // code goes here semesterDropLabel.innerHTML = semester }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateSemester(clicked) {\n // code goes here\n semester = clicked.innerHTML\n}", "function setDropdownContent(grade){\n\t\n\tvar na = \"<option value=\\\"NA\\\"> --- </option>\";\n var ip = \"<option value=\\\"inprog\\\"> In Progress </option>\";\n var a = \"<option value=\\\"A\\\"> A </option>\";\n var b = \"<option value=\\\"B\\\"> B </option>\";\n var c = \"<option value=\\\"C\\\"> C </option>\";\n var d = \"<option value=\\\"D\\\"> D </option>\";\n var f = \"<option value=\\\"F\\\"> F </option>\";\n var x = \"<option value=\\\"EX\\\"> EX </option>\";\n\tswitch(grade){\n\t\tcase \"inprogress\":\n\t\t\tip = \"<option value=\\\"inprog\\\" selected> In Progress </option>\";\n\t\t\tbreak;\n\t\tcase \"A\":\n\t\t\ta = \"<option value=\\\"A\\\" selected> A </option>\";\n\t\t\tbreak;\n\t\tcase \"B\":\n\t\t\tb = \"<option value=\\\"B\\\" selected> B </option>\";\n\t\t\tbreak;\n\t\tcase \"C\":\n\t\t\tc = \"<option value=\\\"C\\\" selected> C </option>\";\n\t\t\tbreak;\n\t\tcase \"D\":\n\t\t\td = \"<option value=\\\"D\\\" selected> D </option>\";\n\t\t\tbreak;\n\t\tcase \"F\":\n\t\t\tf = \"<option value=\\\"F\\\" selected> F </option>\";\n\t\t\tbreak;\n\t\tcase \"EX\":\n\t\t\tx = \"<option value=\\\"EX\\\" selected> EX </option>\";\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tna = \"<option value=\\\"NA\\\" selected> --- </option>\";\n\t\t\tbreak;\n\t}\n\n\treturn na + ip + a + b + c + d + f + x;\n}", "function showLanguageOption(item) {\n document.getElementById(\"dropdownLanguageOption\").innerHTML = item.innerHTML;\n}", "setSemester(aSemester) {\n this.semester = aSemester;\n }", "function setName () \n {\n $('#educationStatistic').html(name)\n }", "updateYear() {\n O('year-label').innerHTML = this.year;\n }", "function selectSem()\r\n{\r\n if(document.getElementById('sem-dropdown').value==\"yearly\")\r\n {\r\n document.getElementById('hidethis').style.display='none';\r\n }\r\n else \r\n {\r\n document.getElementById('hidethis').style.display='block'; \r\n } \r\n\r\n}", "function setValuesForDropdownMenu() \n{\n\n\tvar today = new Date();\n\tvar day = today.getDate();\n\tvar month = today.getMonth()+1;\n\tvar year = today.getFullYear();\n\n\tif(month<10) month = \"0\"+month;\n\tif(day<10) day = \"0\"+day;\n\n\tvar day_opt_value=year.toString()+month.toString()+day.toString();\n\tday_opt_value=Number(day_opt_value);\n\n\tvar month_opt_value=year.toString()+month.toString()+\"01\";\n\tmonth_opt_value=Number(month_opt_value);\n\n\tvar year_opt_value=year.toString()+\"0101\";\n\tyear_opt_value=Number(year_opt_value);\t\n\n\tdocument.getElementById('day-option').value=\"D\"+day_opt_value;\n\tdocument.getElementById('month-option').value=\"M\"+month_opt_value;\n\tdocument.getElementById('year-option').value=\"Y\"+year_opt_value;\n}", "function fillFormTitleSpc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"spc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_spc\").innerHTML = data;\n}", "function changeData(){\n\tcurYear = sel.value();\n\tmyTitle.html(curYear + \": \" + lev);\n}", "function birthMonthCh(event){\n $('input[name=\"month\"]').val(event.target.innerText);\n $('.month_dropdown-item')[0].innerHTML = event.target.innerText;\n}", "function setPhysicianGroupName()\n {\n \t\n \ttry {\n\t\t\tvar groupName = $(this).find(\"option:selected\").text();\n\t\t\tif (groupName == \"\") {\n\t\t\t\tgroupName = $(\"#groupName\").val();\n\t\t\t}\n\t\t\t//alert(groupName)\n\t\t\tif (groupName != null && groupName != undefined\n\t\t\t\t\t&& groupName != \"undefined\") {\n\t\t\t\tvar name = $(\"#physicianName\").val();\n\t\t\t\t$(\"#physicianNameWithGroupName\").val(name + \" - \" + groupName);\n\t\t\t}\n\t\t} catch (e) {\n\t\t}\n }", "function updateDropdowns(){\n name1.innerHTML = document.getElementById(\"dropdown1\").value;\n name2.innerHTML = document.getElementById(\"dropdown2\").value;\n name3.innerHTML = document.getElementById(\"dropdown3\").value;\n}", "function Schuljahre() {\n\tvar selectBox = document.getElementById(\"jahrKlasse\");\n\tvar thisYear = new Date().getFullYear() - 1;\n\tvar nextYear = (thisYear + 1).toString().substring(2, 4);\n\tvar opt, opt2;\n\topt = new Option(thisYear + \" / \" + nextYear + \" (2. Hj.)\");\n\tselectBox.appendChild(opt);\n\tthisYear = thisYear + 1;\n\tnextYear = (thisYear + 1).toString().substring(2, 4);\n\topt = new Option(thisYear + \" / \" + nextYear + \" (1. Hj.)\");\n\tselectBox.appendChild(opt);\n\topt = new Option(thisYear + \" / \" + nextYear + \" (2. Hj.)\");\n\tselectBox.appendChild(opt);\n}", "updateMonth() {\n O('month-label').innerHTML = MONTHS[this.month];\n }", "function updateDepartments()\n{\n var departments = $(\"#department\");\n departments.html(\"\");\n departments.append($(\"<option></option>\").text(\"Select a department\"));\n for (var i = 0; i < this.departments.length; i++)\n {\n departments.append($(\"<option></option>\").text(this.departments[i]));\n }\n}", "function combo(){\n alert(select);\n var label= __('amb1');\n var select= __('estEspecial').value;\n // alert(select);\n label.innerHTML= select;\n \n // alert(select.textContent);\n}", "_format_vernacular_selector(selected) {\n var url = '/admin/v1/all_species_vernacular';\n var json = this.dao.httpGet(url);\n console.log(json)\n var obj = JSON.parse(json);\n \n var resp = \"\";\n for (var i in obj) {\n var option = obj[i];\n if (selected == option.ott_id) {\n resp += `<option value=\"${option.ott_id}\" selected>${option.vernacular_name_english}</option>`\n } else {\n resp += `<option value=\"${option.ott_id}\">${option.vernacular_name_english}</option>`\n }\n }\n return `\n <label class=\"filter_label\" for=\"vernacular_selector\">Species (English name)</label>\n <select id=\"vernacular_selector\">\n ${resp}\n </select>`;\n }", "function fillFormTitleApspc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apspc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apspc\").innerHTML = data;\n}", "function initOptionYear() {\n for (let i = MIN_YEAR; i <= MAX_YEAR; i++) {\n years.append(`<option value='${i}'>${i}</option>`);\n }\n years.val(currentYear);\n}", "function SelectTag() {\n $('.select select').change(function () {\n var $this = $(this),\n $span = $this.parent('.select').find('span'),\n textchange = $this.find('option:selected').text();\n\n $span.text(textchange);\n })\n\n }", "function fillFormTitleApc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"apc\" value=\"${course.Id}\">${course.Title}</option>`;\n })\n document.getElementById(\"select_apc\").innerHTML = data;\n}", "function ChangeStudents(selectid, table) {\r\n let ind = document.getElementById(\"selectCourseUp\").selectedIndex + 1;\r\n let optable = document.getElementById(table);\r\n let select = document.getElementById(selectid);\r\n for (var i = 0; i < select.options.length; i++) {\r\n select.options[i].innerHTML = (i + 1) + \". \" + optable.rows[i].cells[2 * ind - 1].innerHTML + \" \" + optable.rows[i].cells[2 * ind].innerHTML;\r\n }\r\n}", "function setSelectedDesignation(code, description)\r\n{\r\n if( code != null && code != '')\r\n {\r\n objDesignationInvokerTextBox.value = code; \r\n if( objDesignationInvokerLabel != null) objDesignationInvokerLabel.innerHTML = description;\r\n }\r\n return;\r\n}", "function packageHint() {\nvar pack = this.options[this.selectedIndex].value;\nif (pack === 'monthly') {\n elPackageHint.innerHTML = 'Save $10 if you pay for 1 year!';\n} else {\n elPackageHint.innerHTML = 'Wise choice!';\n}\n}", "function onchange() {\n selectValue = regionSelect.property('value')\n sentence = selectValue + ' has a total undergraduate population of ' + formatComma(popObject[selectValue]) + '. '\n sentence += 'My favorite country, The United States of America, has a total undergrad population of ' + formatComma(total) + '. '\n sentence += 'Math tells us that ' + selectValue + ' makes up ' + formatDecimal(popObject[selectValue] / total * 100) + '% of \\'Merica\\'s undergrad population'\n \n d3.select('#explanation1')\n .text(sentence)\n \n //select the region which the dropdown selects\n console.log(d3.select('#'+selectValue))\n console.log(selectValue)\n \n\n d3.select('.selectedRegion').classed('selectedRegion', false);\n d3.select('#'+(selectValue).replace(/\\s/g, \"\")).classed('selectedRegion', true);\n \n \n }", "function fredCode() {\n\tvar nameTag = \"<option value='0'>Select</option>\";\n\tfor (let index = 0; index < currencyCh.length; index++) {\n\t\tconst name = currencyCh[index];\n\t\tnameTag += \"<option value='\" + name + \"'>\" + name + \"</option>\"\n\t}\n\tdocument.getElementById('currencyChange').innerHTML = nameTag;\n}", "function updateDropdownText(menuitem, text) {\n $(menuitem).parents(\".btn-group\").find(\".dropdown-toggle\").html(text +\n \" <span class=\\\"caret\\\"></span>\");\n }", "function update_farmer_groups(j){\n var options = '<option value=\"\">---------- </option>';\n for (var i = 0; i < j.length; i++) \n options += '<option value=\"' + parseInt(j[i].pk) + '\">' + j[i].fields['group_name'] + '</option>';\n $(\"#id_farmer_groups_targeted\").html(options);\n \n}", "function updateReportCard() {\n updateDropdownLabel()\n reportCardTable.innerHTML = ``\n\n // add your code here\n addReportCardHeaders();\n let i = 1;\n studentData[semester].forEach(element => {\n addCourseRowToReportCard(element,i);\n i++;\n });\n // addCourseRowToReportCard(studentData[semester][0],1);\n\n}", "function populateCourseDropdown(dropdown1)\n{\n addOption(dropdown1, \"--\");\n addOption(dropdown1, \"CIVE-2000\");\n addOption(dropdown1, \"CIVE-2200\");\n addOption(dropdown1, \"CIVE-3000\");\n addOption(dropdown1, \"CIVE-3100\");\n addOption(dropdown1, \"CIVE-3200\");\n addOption(dropdown1, \"CIVE-3300\");\n addOption(dropdown1, \"COMP-1000\");\n addOption(dropdown1, \"COMP-1100\");\n addOption(dropdown1, \"COMP-2000\");\n addOption(dropdown1, \"COMP-2500\");\n addOption(dropdown1, \"COMP-3071\");\n addOption(dropdown1, \"ELEC-2299\");\n addOption(dropdown1, \"ENGR-1800\");\n addOption(dropdown1, \"MECH-1000\");\n addOption(dropdown1, \"MECH-2250\");\n addOption(dropdown1, \"MECH-3100\");\n}", "function fillFormTitleTpc() {\n var data = \"\";\n courses.forEach(function (course) {\n data += `<option class=\"tpc\" value=\"${course.Id}\">${course.Title}</option>`;\n\n })\n document.getElementById(\"select_tpc\").innerHTML = data;\n}", "function dropDownSelection(event) {\n var selectDd = document.querySelector('#gradeLevel');\n document.getElementById(\"results\").innerHTML = selectDd.value;\n\n\n}", "function subjectSem()\r\n{\r\n for (var i = 1; i <=8; i++) \r\n document.getElementById('sub'+i).style.display = 'none';\r\n\r\n if(document.getElementById('year-dropdown').value==\"fe\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub1').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub2').style.display = 'block'; \r\n }\r\n\r\n if(document.getElementById('year-dropdown').value==\"se\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub3').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub4').style.display = 'block'; \r\n }\r\n\r\n if(document.getElementById('year-dropdown').value==\"te\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub5').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub6').style.display = 'block'; \r\n }\r\n\r\n if(document.getElementById('year-dropdown').value==\"be\")\r\n {\r\n \r\n if( document.getElementById('sem-dropdown').value==\"odd\")\r\n document.getElementById('sub7').style.display='block';\r\n else if(document.getElementById('sem-dropdown').value==\"even\")\r\n document.getElementById('sub8').style.display = 'block'; \r\n }\r\n}", "getSemester() {\n return this.semester;\n }", "function insertLang(display, value) {\n lang.insertAdjacentHTML(\n 'beforeend',\n '<option value=\"'+value+'\">'+display+'</option>'\n )\n}", "function displayInseamLength(inseamLength, idx) {\n\tvar inseamLengthId = (idx != undefined) ? \"inseamLength_\" + idx : \"inSeamLength\";\n\tvar selectInseamlength = $(\"\" + inseamLengthId);\n\tselectInseamlength.innerHTML = \"\";\n\tvar arrQuarter = new Array(4);\n\tarrQuarter[0] = \"\";\n\tarrQuarter[1] = \"1/4\";\n\tarrQuarter[2] = \"1/2\";\n\tarrQuarter[3] = \"3/4\";\n\tvar optionElement = createDOM('option', {'value':'default' , 'selected':'selected'});\n\toptionElement.appendChild(document.createTextNode('Select Inseam Length'));\n\tselectInseamlength.appendChild(optionElement);\n //BUG00234\n var selectedInseamLength = getValueFromElement('selectedInseamLength');\n\n var inseamLength_min = inseamLength.inseamLength_min;\n\tvar insemaLength_max = inseamLength.inseamLength_max;\n\tif (inseamLength_min > 0 && insemaLength_max > 0) {\n\t\tvar arrQuarter_length = arrQuarter.length;\n\t\tfor (i = inseamLength_min; i <= insemaLength_max; i++) {\n\t\t\tif (i == insemaLength_max) arrQuarter_length = 1;\n\t\t\tfor (j = 0; j < arrQuarter_length; j++) {\n\t\t\t\tif (j != 0) {\n\t\t\t\t\toptionElement = createDOM('option', {'value':'' + i + '-' + arrQuarter[j]});\n //BUG00234\n if (optionElement.value == selectedInseamLength){\n optionElement.selected = true;\n }\n var displayContent = i + ' - ' + arrQuarter[j];\n\t\t\t\t\toptionElement.appendChild(document.createTextNode(displayContent));\n\t\t\t\t}\n\n\t\t\t\t//selectInseamlength.innerHTML += \"<option value='\" + i + \"@\" + arrQuarter[j] + \"'>\" + i + \" - \" + arrQuarter[j] + \"</option>\";\n\t\t\t\telse {\n\t\t\t\t\toptionElement = createDOM('option', {'value':'' + i});\n //BUG00234\n if (optionElement.value == selectedInseamLength){\n optionElement.selected = true;\n }\n\t\t\t\t\toptionElement.appendChild(document.createTextNode(i));\n\t\t\t\t}\n\t\t\t\t//selectInseamlength.innerHTML += \"<option value='\" + i + \"'>\" + i + \"</option>\";\n\t\t\t\tselectInseamlength.appendChild(optionElement);\n\t\t\t}\n\t\t}\n\t\tselectInseamlength.disabled = false;\n\t}\n\tupdateCount += 1;\n //BUG00248\n YAHOO.ebauer.productUtils.toggleAddToButton();\n}", "function MUD_FillOptionsBankname() {\n console.log(\"===== MUD_FillOptionsBankname ===== \");\n const selected_value = null;\n let item_text = \"\"\n for (let i = 0, value; value = bankname_rows[i]; i++){\n item_text += \"<option value=\\\"\" + value + \"\\\"\";\n if (selected_value && value === selected_value) {item_text += \" selected\" };\n item_text += \">\" + value + \"</option>\";\n };\n\n el_MUD_select_bankname.innerHTML = item_text;\n\n } // MUD_FillOptionsBankname", "function t_yieldCountry() {\n\n var t_information = document.getElementById(\"t_information\");\n var picker = document.getElementById(\"t_countrypicker\");\n t_information.innerHTML = \"Delegate of \"+picker.options[picker.selectedIndex].value;\n\n}", "function createYearDropdown() {\n\n var selectYearDropDown = document.getElementsByClassName('select-year');\n\n for (var i = 0; i < selectYearDropDown.length; i++) {\n selectYearDropDown[i].onclick = function() {\n\n if (prerequisiteTable != null) {\n var text = this.innerHTML.split(/[ ,]+/);\n var year = stringToYear[text[0]] - 1;\n\n var date = new Date();\n\n if (date.getMonth() < 4 || date.getMonth() > 10) { // winter\n prerequisiteTable.selectTerm(year * 2 - 2);\n } else { // fall\n prerequisiteTable.selectTerm(year * 2 - 1);\n }\n\n // updateProgramTitle(this.innerHTML);\n document.getElementById('year-select-subtitle').innerHTML = this.innerHTML;\n }\n }\n }\n}", "function change_name(){\nif (selected_value == \"module\"){\ndocument.getElementById(\"module_name\").innerHTML += \"<h3 class=\\\"collap_header\\\">Course: \"+course_name+\"</h3>\";\n}\nelse if (selected_value == \"section\"){\ndocument.getElementById(\"module_name\").innerHTML += \"<h3 class=\\\"collap_header\\\">Module Name: \"+module_name+\"</h3>\";\n}\nelse{\ndocument.getElementById(\"module_name\").innerHTML += \"<h3 class=\\\"collap_header\\\">Section Name: \"+section_name+\"</h3>\";\n}\n}", "function yearList() {\n var list = '<option selected disabled value=\"0\">Year</option>';\n for (var i = new Date().getFullYear() - 17; i >= 1916; i--) {\n list += '<option value=\"' + i + '\">' + i + '</option>';\n }\n document.getElementById('numYear').innerHTML = list;\n\n}", "function assignmentsRender() {\n\tvar asgnSelect = document.getElementById('assignment_select');\n\tfor(i = asgnSelect.options.length - 1 ; i >= 0 ; i--) {\n\t\tasgnSelect.remove(i);\n\t}\n\t\n\tvar shown=0;\n\tfor (var i=0; i<assignments.length; i++) {\n\t\tvar option = document.createElement(\"option\");\n\t\toption.value = assignments[i].id;\n\t\toption.text = assignments[i].name;\n\t\tfor (var j=0; j<assignments[i].level; j++)\n\t\t\toption.text = \"__\" + option.text;\n\t\tif (assignments[i].visible == 0) option.style.display = \"none\";\n\t\telse shown++;\n\t\tasgnSelect.add(option);\n\t\tif (assignments[i].selected == 1) asgnSelect.value = assignments[i].id;\n\t}\n\tasgnSelect.size = shown;\n}", "function updateDropdownValues(){\n var dropdown = document.getElementById('radioStations');\n\n getStationsWithSavedOnes(\"stations\",(stations) => {\n\n if(stations.stations){\n dropdown.innerHTML=\"\";\n stations.stations.forEach(function (p1, p2, p3){\n var opt = document.createElement('option');\n opt.value = p1.url;\n opt.innerHTML = p1.name;\n dropdown.appendChild(opt);\n })\n\n }\n});\n}", "function fillStudentInSelectBox(){\n document.getElementById('studentSelectForChange').innerHTML = '';\n document.getElementById('studentsSelect').innerHTML = ''; \n document.getElementById('studentSelectForChange').appendChild(createDefaultOption(\"---Select Student---\"));\n document.getElementById('studentsSelect').appendChild(createDefaultOption(\"---Select Student---\"));\n\n fetch(url+`/get-students`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n console.log(data);\n data.result.forEach(student => {\n createStudentOption(student);\n console.log(\"inside fillStudentInSelectBox\")\n });\n })\n}", "function setSelectNames() { \n let date = new Date();\n monthsSelect.textContent = months[date.getMonth()];\n daysSelect.textContent = date.getDate();\n hoursSelect.textContent = checkZero(date.getHours()+1);\n minsSelect.textContent = '00';\n}", "function updateYear(year, date) {\n year.getElementsByTagName(\"option\")[date.getFullYear() - 1900].selected = \"selected\";\n}", "function getSelectedValue(e) {\n const value = $(this)\n .children(\"option:selected\")\n .val();\n\n if (e.target.id === \"season\") {\n season = value;\n } else {\n teamName = value.toLowerCase().replace(/\\s/g, \"-\");\n console.log(teamName);\n }\n\n getTeamStat(parseInt(season, 10), teamName);\n }", "function setSelectedExam(code, description)\r\n{\r\n if( code != null && code != '')\r\n {\r\n objExamInvokerTextBox.value = code; \r\n if( objExamInvokerLabel != null) objExamInvokerLabel.value = innerHTML;\r\n }\r\n return;\r\n}", "function load_subject_selector()\n{\n var data = get_data();\n var select = document.getElementById(\"angst-subjects\");\n \n default_option = document.createElement(\"option\");\n default_option.value = \"\";\n default_option.appendChild(document.createTextNode(\"-\"));\n select.appendChild(default_option);\n select.appendChild\n for (var i=0; i < data.length; i++)\n {\n var course = data[i];\n var optgroup = document.createElement(\"optgroup\");\n optgroup.label = course.course;\n for (var j = 0; j < course.disciplines.length; j++)\n {\n var discipline = course.disciplines[j];\n var option = document.createElement(\"option\");\n option.appendChild(document.createTextNode(discipline.name));\n option.value = discipline.expr;\n optgroup.appendChild(option);\n }\n select.appendChild(optgroup);\n }\n}", "function BindYearForUpdate(yeartype) {\n $('#ddlITNoticeYear option').remove();\n var selectBox = document.getElementById('ddlITNoticeYear');\n var date = new Date()\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n\n for (var i = year + 1; i >= year - 10; i--) {\n var option = document.createElement('option');\n var j = i;\n Fyear = (--j) + \"-\" + i\n option.value = Fyear;\n option.innerHTML = Fyear;\n selectBox.appendChild(option);\n }\n //}\n\n\n}", "function buildGradeSelectionMenu(currentValue) {\n let selectStr = '';\n let grades = [\"A+\",\"A\",\"A-\",\"B+\",\"B\",\"B-\",\"C+\",\"C\",\"C-\",\"D\",\"F\"];\n selectStr = buildSelectionOptions(grades, currentValue);\n return selectStr;\n}", "function country(selectedCountry) {\n // Select the country dropdown button and set text equal to selection\n country_button.text(selectedCountry)\n}", "function applyCurrentSyllable(){\n currentSyllableIndex = document.getElementById(\"syllable\").value;\n document.getElementById(\"input\").innerHTML = syllableDataChangeForm();\n}", "function setYears() {\n var end = 1975;\n var start = new Date().getFullYear();\n var options = \"\";\n for (var year = start; year >= end+1; year--) {\n options += \"<option name='\" + year + \"'>\" + year + \"</option>\";\n }\n document.getElementById(\"vg_year\").innerHTML = options;\n}", "function set_value_of_group_custom_dropdown(form_group, val) {\n var inputs = form_group.children('div:last');\n set_value_of_custom_dropdown(inputs, val);\n}", "function getDesc(selection) {\n //let txtSelected = selection.selectedIndex;\n let expName =\n \"Experiment Name: \" + selection.options[selection.selectedIndex].text;\n let description =\n \"Some description for \" +\n selection.options[selection.selectedIndex].text +\n \"...\";\n document.getElementById(\"expname\").innerHTML = expName;\n document.getElementById(\"description\").innerHTML = description;\n}", "function populateDropDown(selected) {\n var actualYear = new Date().getFullYear();\n for (i = actualYear; i >= actualYear - 100; i--) {\n $(\"select#Year\").append(\"<option \" + (i == selected ? \"selected\" : \"\") + \" value=\" + i + \">\" + i + \"</option>\");\n }\n}", "function update_list(){\r\n\tvar htmloutput = \"<option></option><option value='newrep'>New Response</option>\";\r\n\t\r\n\tfor(i=0; i<rep_text.length; i++){\r\n\t\tvar number = i+1;\r\n\t\thtmloutput += \"<option value='\" + number + \"'>\" + number + \"</option>\";\r\n\t}\r\n\tdocument.getElementById(\"curr_total\").innerHTML = htmloutput;\r\n}", "function populateYears() {\n\n\tfor(var i = 2008; i > 1921; i--){\n\t\tyrOptions += \"<option value= '\"+i+\"'>\"+i+\"</option>\";\n\t}\n\n\tselectYear.innerHTML = yrOptions;\n}", "function chooseDate(){\n\tvar a= getTempDate();\n\tvar m= a.getMonth();\n\tvar y= a.getFullYear();\n\tvar mName= fullMonthId[m];\n\tvar dropdiv= Util.div(\"dropdown\",\"\");\n\tvar niceDate = Util.span(mName, \"dropbtn\", \"niceDate\");\n\n\tvar dropdown= Util.div(\"dropdownMenu\", \"\");\n\tfor(var i=0; i<monthId.length; i++){\n\t\tvar opt= Util.a(\"javascript:void(0)\", monthId[i], \"changeMonth\", i);\n\t\topt.setAttribute(\"onclick\", \"changeMonth()\");\n\t\tdropdown.appendChild(opt);\n\t}\n\tniceDate.appendChild(dropdown);\n\tdropdiv.appendChild(niceDate);\n\n\tvar editYear=Util.span(' '+y, \"changeYear\", \"changeYear\");\n\teditYear.setAttribute(\"onclick\", \"changeYear()\");\n\n\tdocument.getElementById(\"up3\").appendChild(dropdiv);\n\tdocument.getElementById(\"up3\").appendChild(editYear);\n}", "function updateNumberOfDays(){\n $('#days').html('');\n month = $('#months').val();\n year = $('#years').val();\n days = daysInMonth(month, year);\n $('#days').append($('<option></option>').val('').html('---DAY---'));\n for(i=1; i < days+1 ; i++){\n $('#days').append($('<option></option>').val(i).html(i));\n }\n}", "setHbs() {\n const code = [];\n\n code.push('<JubileeSelect');\n code.push(' @items={{this.weekdays}}');\n code.push(' @selectedItem={{this.selectedWeekday}}');\n code.push(' @onChange={{fn (mut this.selectedWeekday)}} as |name|');\n code.push('>');\n code.push(' {{name}}');\n code.push('</JubileeSelect>');\n\n this.code = join(code);\n }", "function donate_percent_select(obj) \n { \n $('#charity_dropdownlist').show(); \n $('.donate_percent_store').val(obj); \t \n }", "function updateStatsOption() {\n var currText = 'Información';\n var currValue = (showStats ? 'ON': 'OFF');\n $('#optStats').attr('value', currText + ' (' + currValue + ')');\n}", "function toggleSelect(item) {\n switch (item.value) {\n case 'Just Java':\n document.getElementById('dynLbl').innerHTML = \" Endless Cup $2.00\";\n break;\n case 'Cafe au Lait':\n document.getElementById('dynLbl').innerHTML = \" Single $2.00 Double $3.00\";\n break;\n case 'Iced Cappucino':\n document.getElementById('dynLbl').innerHTML = \" Single $4.75 Double $5.75\";\n break;\n case 'Mocha Latte':\n document.getElementById('dynLbl').innerHTML = \" Double $3.00\";\n break;\n case 'Lite Latte':\n document.getElementById('dynLbl').innerHTML = \" Single $2.00\";\n break;\n }\n}", "function populateGroupDropdown(){\n $.each(grps, function(i,group){\n $('#group').append($('<option>').attr(\"value\",group.id).text(\"\\$\"+group.name+\"\\$\"))\n });\n MathJax.Hub.Queue([\"Typeset\",MathJax.Hub,\"group\"]);\n $('.selectpicker').selectpicker('refresh');\n}", "function buildGradeSelectionMenu(currentValue) {\n let selectStr = '';\n let grades = [\"A+\", \"A\", \"A-\", \"B+\", \"B\", \"B-\", \"C+\", \"C\", \"C-\", \"D\", \"F\"];\n selectStr = buildSelectionOptions(grades, currentValue);\n return selectStr;\n}", "constChange() {\n\t\tlet constant = this.m_constMenu.value;\n\t\tthis.m_constUnitMenu.innerHTML = \"\";\n\t\tCONFIG[constant].forEach(function(item) {\n\t\t\tGUI.m_constUnitMenu.innerHTML += \"<option value=\\\"\" + item[0] + \"\\\">\" + item[1] + \"</option>\";\n\t\t});\n\t}", "function changeTree(dropdown){\n var index = dropdown.selectedIndex;\n var treeName = dropdown[index].text;\n var startPoint = dropdown[index].value;\n\n if (treeName != \"Select navigation tree\"){\n document.getElementById(\"test\").innerHTML = treeName + \" \" + startPoint;\n selectedTree=treeName;\n initialiseTree_kmn();\n }\n}", "function populateMonths() {\n let template = $('#ddlViewBy').find('option:selected').val();\n\n // update dropdown\n $(\"#monthID\").empty();\n for (i in availableMonths[template]) {\n let month = availableMonths[template][i];\n if (months.indexOf(month) < 0) {\n $(\"#monthID\").append($('<option></option>').val(month).html(month));\n }\n }\n }", "function select(fc) {\r\n document.getElementById('dropdown').value = fc;\r\n change();\r\n}", "function downsLabel(){\n if (downs ===1){\n document.getElementById(\"down-unit\").innerHTML=\"ST\";\n }\n else if (downs === 2){\n document.getElementById(\"down-unit\").innerHTML=\"ND\";\n }\n else if (downs === 3){\n document.getElementById(\"down-unit\").innerHTML=\"RD\";\n }\n else{\n document.getElementById(\"down-unit\").innerHTML=\"TH\";\n }\n }", "function setupVenueLabel() {\n\n if ($('span[id*=selectedVenue]').text() != \"\") {\n $('span[id*=selectedVenue]').css('display', 'block');\n }\n}", "function populateBirthdayHandler() {\n success.innerHTML = \" \"\n error.innerHTML = \" \"\n var numOfMonth = 1\n for(var i = 1; i <= daysInMonth(month.value, year.value); i++) {\n day.innerHTML += '<option value=\"' + i + '\">' + i + '</option>' // populate days\n }\n months.forEach(m => {\n month.innerHTML += '<option value=\"' + numOfMonth++ + '\">' + m + '</option>' // populate months\n });\n\n for(var i = date.getFullYear() - 100; i <= date.getFullYear(); i++) {\n year.innerHTML += '<option value=\"' + i + '\">' + i + '</option>' // populate 100 years.\n }\n}", "function showStatesInDropDown() {\n\tlet html = states.map(curr => \"<option value=\" + curr.code + \">\" + curr.name + \"</option>\")\n\tlet inputState = document.querySelector('#inputStateForm');\n\tinputState.insertAdjacentHTML(\"afterbegin\", html);\n}", "function buildPeriodSelectionMenu(currentValue) {\n let selectStr = '';\n let periods = ['0','1','2','3','4','5','6','7'];\n selectStr = buildSelectionOptions(periods, currentValue);\n return selectStr;\n}", "function changeStandType_add(obj){\n\tif (obj.value==2){\n\t\t$(\"#standCode_add\").val(\"GB/T\");\t\t\n\t}else if (obj.value==4){\n\t\t$(\"#standCode_add\").val(\"DB62/T\");\n\t}\n\tcalculate_add();\n}", "function displayCalendar_Spring2014_Summer2014(numberOfMonths) {\n\n from_semester_title.innerHTML = \"Spring 2014\";\n to_semester_title.innerHTML = \"Summer 2014\";\n\n $(\"#weekNumber\").html(\"1\");\n\n $(\"#dateoutput1\").html(\"13 Jan, Mon\");\n $(\"#dateoutput2\").html(\"5 May, Mon\");\n\n\n function highlightDays(date) {\n //month starts as 0\n var a = new Date(2014, 0, 13); // first day of FROM semester - September 9, 2013 - 2014, January 13\n var b = new Date(2014, 3, 11); // last day of FROM semester - December 6, 2013 - 2014, April 11\n\n if (a <= date && date <= b) {\n return [true, 'highlight'];\n }\n\n return [true, ''];\n\n }\n\n $(\"#datepicker_Spring2014_Summer2014\").datepicker({\n\n inline: true,\n showOtherMonths: true,\n defaultDate: '13-01-14', //09-09-13 dd-mm-yy\n numberOfMonths: numberOfMonths,\n dateFormat: \"dd-mm-yy\",\n\n beforeShowDay: highlightDays,\n\n onSelect: function (dateText, inst) {\n var date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, dateText, inst.settings);\n var dateText1 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n date.setDate(date.getDate() + 112); //old - 126\n var dateText2 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n\n var newDate = date.getDate();\n var newMonth = date.getMonth();\n\n /*\n console.log(\"-----------------------\");\n console.log(\"next semester full date: \" + date);\n console.log(\"next semester Date: \" + newDate);\n console.log(\"next semester Month: \" + newMonth);\n */\n\n //List starting week days of the new semester\n var weekNumber;\n var weekDays = 4;\n\n var wk1_start = 5;\n var wk1_end = wk1_start + weekDays;\n\n var wk2_start = 12;\n var wk2_end = wk2_start + weekDays;\n\n var wk3_start = 19;\n var wk3_end = wk3_start + weekDays;\n\n var wk4_start = 26;\n var wk4_end = wk4_start + weekDays;\n\n var wk5_start = 2;\n var wk5_end = wk5_start + weekDays;\n\n var wk6_start = 9;\n var wk6_end = wk6_start + weekDays;\n\n var wk7_start = 16;\n var wk7_end = wk7_start + weekDays;\n\n var wk8_start = 23;\n var wk8_end = wk8_start + weekDays;\n\n var wk9_start = 30;\n var wk9_end = 4;\n\n var wk10_start = 7;\n var wk10_end = wk10_start + weekDays;\n\n var wk11_start = 14;\n var wk11_end = wk11_start + weekDays;\n\n var wk12_start = 21;\n var wk12_end = wk12_start + weekDays;\n\n var wk13_start = 28;\n var wk13_end = 1;\n\n\n var Month4_2014 = 4;\n var Month5_2014 = 5;\n var Month6_2014 = 6;\n var Month7_2014 = 7;\n\n\n if ((newDate >= wk1_start && newDate <= wk1_end) && (newMonth == Month4_2014)) {\n weekNumber = 1;\n }\n\n else if ((newDate >= wk2_start && newDate <= wk2_end) && (newMonth == Month4_2014)) {\n weekNumber = 2;\n }\n\n else if ((newDate >= wk3_start && newDate <= wk3_end) && (newMonth == Month4_2014)) {\n weekNumber = 3;\n }\n\n else if ((newDate >= wk4_start && newDate <= wk4_end) && (newMonth == Month4_2014)) {\n weekNumber = 4;\n }\n\n else if ((newDate >= wk5_start && newDate <= wk5_end) && (newMonth == Month5_2014)) {\n weekNumber = 5;\n }\n\n else if ((newDate >= wk6_start && newDate <= wk6_end) && (newMonth == Month5_2014)) {\n weekNumber = 6;\n }\n\n else if ((newDate >= wk7_start && newDate <= wk7_end) && (newMonth == Month5_2014)) {\n weekNumber = 7;\n }\n\n else if ((newDate >= wk8_start && newDate <= wk8_end) && (newMonth == Month5_2014)) {\n weekNumber = 8;\n }\n\n else if ((newDate == wk9_start) && (newMonth == Month5_2014)) {\n weekNumber = 9;\n }\n\n else if ((newDate <= wk9_end) && (newMonth == Month6_2014)) {\n weekNumber = 9;\n }\n\n else if ((newDate >= wk10_start && newDate <= wk10_end) && (newMonth == Month6_2014)) {\n weekNumber = 10;\n }\n\n else if ((newDate >= wk11_start && newDate <= wk11_end) && (newMonth == Month6_2014)) {\n weekNumber = 11;\n }\n\n else if ((newDate >= wk12_start && newDate <= wk12_end) && (newMonth == Month6_2014)) {\n weekNumber = 12;\n }\n\n //adjusting criteria for weeks that have days in multiple months\n\n else if ((newDate >= wk13_start && newDate <= (wk13_start + 3)) && (newMonth == Month6_2014)) {\n weekNumber = 13;\n }\n\n else if (newDate == wk13_end && newMonth == Month7_2014) {\n weekNumber = 13;\n }\n\n\n else {\n weekNumber = 'N/A';\n }\n\n\n $(\"#weekNumber\").html(weekNumber);\n\n $(\"#dateoutput1\").html(dateText1);\n $(\"#dateoutput2\").html(dateText2);\n\n\n /*\n console.log(\" ~~~~~~~> wk9_start: \" + wk9_start);\n console.log(\" ~~~~~~~> wk9_end: \" + wk9_end);\n */\n\n }\n\n\n });\n\n}", "function fillYears () {\n $.getJSON('https://www.fueleconomy.gov/ws/rest/vehicle/menu/year', function (data) {\n var mylen = data.menuItem.length;\n // $('#mnuYear').append($('<option>--Select Year--</option>'\n for(var i=0;i < mylen;i++) {\n $('#mnuYear').append($('<option>', { \n value: data.menuItem[i].value,\n text :data.menuItem[i].text\n }));\n }\n });\n }", "function ChangeAssignments(selectid, table) {\r\n let ind = document.getElementById(\"selectCourseUp\").selectedIndex + 1;\r\n let optable = document.getElementById(table);\r\n let select = document.getElementById(selectid);\r\n for (var i = 0; i < select.options.length; i++) {\r\n select.options[i].innerHTML = (i + 1) + \". \" + optable.rows[i].cells[2 * ind - 1].innerHTML + \": \" + optable.rows[i].cells[2 * ind].innerHTML;\r\n }\r\n}", "function changeProv()\n{\n var provSelect = this;\n var form = this.form;\n var census = form.Census.value;\n var censusYear = census.substring(2);\n var optIndex = provSelect.selectedIndex;\n if (optIndex == -1)\n return; // nothing to do\n var optVal = provSelect.options[optIndex].value;\n if (censusYear == '1851' || censusYear == '1861')\n form.Census.value = optVal + censusYear;\n loadDistsProv(optVal); // limit the districts selection\n var tdNode = document.getElementById('DivisionCell');\n tdNode.innerHTML = '';\n}", "function selectUpdateValue(e) {\n var target = e.target;\n var value = target.textContent;\n var thisSelectElement = target.parentNode.parentNode.parentNode.querySelector('select');\n var thisEntryPoint = target.parentNode.parentNode.previousElementSibling;\n thisSelectElement.value = value;\n thisEntryPoint.textContent = value;\n // close the list when you've selected an option\n selectOpenList(thisEntryPoint);\n softDismiss.style.zIndex = '';\n }", "function materialsubbase() {\n var tpbs = $(\"#materialsbs option:selected\").text();\n if (tpbs == $(\"#materialsbs option:first\").text()) {\n $(\"#subbasematerial\").text(\"Subbase\");\n } else {\n $(\"#subbasematerial\").text(\"Subbase \" + tpbs);\n };\n\n}", "function populateLevelSelectList() {\n $('select[name=\"current_level_select\"]').html(`\n <option selected disabled>Choose Chapter</option>\n `);\n let levelref = firebase\n .database()\n .ref(\"Test\")\n .child(_courseID)\n .child(\"Levels\");\n levelref.on(\"child_added\", data => {\n let level = data.val();\n $('select[name=\"current_level_select\"]').append(\n `<option value=\"${level.levelID}\">${level.levelname}</option>`\n );\n });\n}", "function populateLevelSelectList() {\n $('select[name=\"current_level_select\"]').html(`\n <option selected disabled>Choose Chapter</option>\n `);\n let levelref = firebase\n .database()\n .ref(\"Test\")\n .child(_courseID)\n .child(\"Levels\");\n levelref.on(\"child_added\", data => {\n let level = data.val();\n $('select[name=\"current_level_select\"]').append(\n `<option value=\"${level.levelID}\">${level.levelname}</option>`\n );\n });\n}", "function labelChange(value){\n\t$(\"#\" + selected ).removeClass(\"userSelect\");\n\t$(\"#\" + value + \"Select\").addClass(\"userSelect\");\n\tselected = value + \"Select\";\n}", "function updateMonth(month, date) {\n month.getElementsByTagName(\"option\")[date.getMonth()].selected = \"selected\";\n}", "function PopulateYearDropdown(minYear, maxYear) \n{ \n for (let curr = minYear; curr <= maxYear; curr++)\n {\n var option = document.createElement(\"option\");\n option.value = String(curr);\n option.text = String(curr);\n $(\"#expiryYear\").append(option);\n }\n}", "function getSemesterName( season, year ) {\n return season + \" \" + year;\n}", "#updateLabel() {\n this.container.querySelector('.label').innerHTML = this.label;\n }", "function changeMonthByYear(year_selector, month_selector) {\n var today = new Date();\n var months = \"<option selected disabled>Tháng</option>\";\n if (today.getFullYear() == year_selector.val()) {\n var today = new Date();\n for (var month = 1; month <= today.getMonth(); month++) {\n months += \"<option value='\" + month + \"'>\" + month + \"</option>/n\"\n }\n } else {\n for (var month = 1; month <= 12; month++) {\n months += \"<option value='\" + month + \"'>\" + month + \"</option>/n\"\n }\n }\n month_selector.html(months);\n}", "function selectCoursePrompt()\n{\n createDropdown(courseDropdown, \"Select a course: \", \"dropdown1\", selectResourcePrompt);\n populateCourseDropdown(dropdown1);\n}", "function displayHtml(html) {\n baseCurrency.innerHTML = html;\n toCurrency.innerHTML = html;\n baseCurrency.querySelector('[value=\"USD\"]').selected = true;\n toCurrency.querySelector('[value=\"NGN\"]').selected = true;\n}", "function renderTags2() {\r\n\r\n let strHtml = \"<option value=''>Escolher</option>\"\r\n for (let i = 0; i < tags.length; i++) {\r\n strHtml += `<option value='${tags[i]._id}'>${tags[i]._name}</option>`\r\n }\r\n let escolherTag = document.getElementById(\"inputSelTags\")\r\n escolherTag.innerHTML = strHtml\r\n\r\n}", "function updateSuperGroups(groupList)\n{\n var currentSettings = sgSearchCurrentSettings;\n\n $(\"#PB_GROUPXPB_GROUP_ID\").empty();\n if(groupList.length>1)\n {\n \t $(\"#PB_GROUPXPB_GROUP_ID\").append(\"<option value=''> --Please Select--</option>\");\n }\n \n // Re-populate the names of the States into the list\n for (var i in groupList)\n {\n var groupId = groupList[i].superGroupId;\n var groupName = groupList[i].name;\n var selectedFlg = (currentSettings != null) && (currentSettings.superGroupId == groupId);\n var selectedStr = \"\";\n if (selectedFlg == true)\n {\n selectedStr = \" selected='true'\";\n }\n\n var optionStr = \"<option value='\" + groupId + \"'\" + selectedStr + \">\" + groupName + \"</option>\";\n $(\"#PB_GROUPXPB_GROUP_ID\").append(optionStr);\n }\n}", "function buildPeriodSelectionMenu(currentValue) {\n let selectStr = '';\n let periods = ['0', '1', '2', '3', '4', '5', '6', '7'];\n selectStr = buildSelectionOptions(periods, currentValue);\n return selectStr;\n}", "function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}", "function BindYear(yeartype) {\n \n $('#ddlYear option').remove();\n var selectBox = document.getElementById('ddlYear');\n var date = new Date()\n var year = date.getFullYear();\n var month = date.getMonth() + 1;\n\n if (yeartype == \"Assesment_Year\") {\n if (month >= 4) {\n for (var i = year + 1; i > year; i--) {\n var option = document.createElement('option');\n var j = i;\n Fyear = (--j) + \"-\" + i\n option.value = Fyear;\n option.innerHTML = Fyear;\n selectBox.appendChild(option);\n }\n }\n else {\n for (var i = year; i > year - 1; i--) {\n var option = document.createElement('option');\n var j = i;\n Fyear = (--j) + \"-\" + i\n option.value = Fyear;\n option.innerHTML = Fyear;\n selectBox.appendChild(option);\n }\n }\n }\n else if (yeartype == \"Financial_Year\") {\n for (var i = year; i >= year - 10; i--) {\n var option = document.createElement('option');\n var j = i;\n Fyear = (--j) + \"-\" + i\n option.value = Fyear;\n option.innerHTML = Fyear;\n selectBox.appendChild(option);\n }\n }\n\n\n}", "function displayDeveloperIssuesCompletionChart(developers)\n{\n let items = \"\";\n Object.entries(developers).forEach(dev => {\n items += `<option value='${JSON.stringify(dev[1])}'>${dev[0]}</option>`;\n });\n\n let dropDown = document.getElementById(\"issuesCompletionDropDown\");\n dropDown.innerHTML = items;\n dropDown.setAttribute(\"onChange\", \"updateIssuesCompletionChart()\");\n\n document.getElementById(\"issuesCompletionChartSpinner\").style.display = \"none\";\n updateIssuesCompletionChart();\n}" ]
[ "0.67516583", "0.61929536", "0.59685767", "0.5928976", "0.59149027", "0.5909841", "0.5872012", "0.5815998", "0.5799512", "0.57136524", "0.5690627", "0.5636865", "0.56295305", "0.5615603", "0.5601714", "0.55992687", "0.5591593", "0.5589546", "0.55879563", "0.5584531", "0.5570768", "0.5548673", "0.5548323", "0.55292034", "0.55189854", "0.5509889", "0.5509595", "0.5495246", "0.5490609", "0.5471835", "0.54714113", "0.5465818", "0.54543716", "0.5444695", "0.5442149", "0.5387589", "0.53791404", "0.53738624", "0.5372846", "0.5363468", "0.53566545", "0.5352911", "0.5347141", "0.53405535", "0.53309005", "0.53209287", "0.5309763", "0.5304881", "0.5297986", "0.5290817", "0.5290078", "0.52883786", "0.52859133", "0.5276129", "0.52614325", "0.5255595", "0.525204", "0.5247898", "0.5241431", "0.5234855", "0.5234766", "0.5232325", "0.523036", "0.5218763", "0.5215987", "0.5209541", "0.5194775", "0.5192074", "0.51783085", "0.51675314", "0.5156875", "0.51552176", "0.5153738", "0.5152149", "0.5138618", "0.51379085", "0.5137617", "0.51341236", "0.5132423", "0.5130934", "0.51294", "0.5126356", "0.5124596", "0.5121456", "0.51204455", "0.51204455", "0.51174045", "0.5114115", "0.5112543", "0.51029617", "0.5100125", "0.5097873", "0.50973886", "0.5095109", "0.50943786", "0.50925297", "0.50857437", "0.5078227", "0.5077523", "0.50737774" ]
0.8385103
0
This function should updates the `semester` variable.
function updateSemester(clicked) { // code goes here semester = clicked.innerHTML }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setSemester(aSemester) {\n this.semester = aSemester;\n }", "getSemester() {\n return this.semester;\n }", "function Semester(newData) {\n\t\tnewData = newData || {};\n\t\t$super.call(this, newData, list, listName);\n\t\tthis.parent = $super.prototype;\n\n\t\t// Initialize the attributes of the new Semester object\n\t\tthis.initAttributes();\n\t}", "updateStudent() {\n\n\t}", "updateIndex(newIndex) {\n if (this._semester === undefined) {\n return this;\n }\n\n this._selectedSemestersIndex[this._semester] = newIndex;\n\n return this;\n }", "function updateReportCard() {\n updateDropdownLabel()\n reportCardTable.innerHTML = ``\n\n // add your code here\n addReportCardHeaders();\n let i = 1;\n studentData[semester].forEach(element => {\n addCourseRowToReportCard(element,i);\n i++;\n });\n // addCourseRowToReportCard(studentData[semester][0],1);\n\n}", "function onUpdateStudent() {\n\n if (classesSelectedIndex == -1 || classesSelectedIndex == 0) {\n updateTableOfStudents(true, true);\n } else {\n // retrieve key of currently selected class\n var keyClass = classes[classesSelectedIndex - 1].key;\n updateTableOfStudents(true, true, keyClass);\n }\n }", "function setGradeSheet() {\n dispatch(setGradeSheetId(student.grade_sheets[0].grade_sheet_id));\n }", "function displayCalendar_Spring2014_Summer2014(numberOfMonths) {\n\n from_semester_title.innerHTML = \"Spring 2014\";\n to_semester_title.innerHTML = \"Summer 2014\";\n\n $(\"#weekNumber\").html(\"1\");\n\n $(\"#dateoutput1\").html(\"13 Jan, Mon\");\n $(\"#dateoutput2\").html(\"5 May, Mon\");\n\n\n function highlightDays(date) {\n //month starts as 0\n var a = new Date(2014, 0, 13); // first day of FROM semester - September 9, 2013 - 2014, January 13\n var b = new Date(2014, 3, 11); // last day of FROM semester - December 6, 2013 - 2014, April 11\n\n if (a <= date && date <= b) {\n return [true, 'highlight'];\n }\n\n return [true, ''];\n\n }\n\n $(\"#datepicker_Spring2014_Summer2014\").datepicker({\n\n inline: true,\n showOtherMonths: true,\n defaultDate: '13-01-14', //09-09-13 dd-mm-yy\n numberOfMonths: numberOfMonths,\n dateFormat: \"dd-mm-yy\",\n\n beforeShowDay: highlightDays,\n\n onSelect: function (dateText, inst) {\n var date = $.datepicker.parseDate(inst.settings.dateFormat || $.datepicker._defaults.dateFormat, dateText, inst.settings);\n var dateText1 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n date.setDate(date.getDate() + 112); //old - 126\n var dateText2 = $.datepicker.formatDate(\"d M, D\", date, inst.settings);\n\n var newDate = date.getDate();\n var newMonth = date.getMonth();\n\n /*\n console.log(\"-----------------------\");\n console.log(\"next semester full date: \" + date);\n console.log(\"next semester Date: \" + newDate);\n console.log(\"next semester Month: \" + newMonth);\n */\n\n //List starting week days of the new semester\n var weekNumber;\n var weekDays = 4;\n\n var wk1_start = 5;\n var wk1_end = wk1_start + weekDays;\n\n var wk2_start = 12;\n var wk2_end = wk2_start + weekDays;\n\n var wk3_start = 19;\n var wk3_end = wk3_start + weekDays;\n\n var wk4_start = 26;\n var wk4_end = wk4_start + weekDays;\n\n var wk5_start = 2;\n var wk5_end = wk5_start + weekDays;\n\n var wk6_start = 9;\n var wk6_end = wk6_start + weekDays;\n\n var wk7_start = 16;\n var wk7_end = wk7_start + weekDays;\n\n var wk8_start = 23;\n var wk8_end = wk8_start + weekDays;\n\n var wk9_start = 30;\n var wk9_end = 4;\n\n var wk10_start = 7;\n var wk10_end = wk10_start + weekDays;\n\n var wk11_start = 14;\n var wk11_end = wk11_start + weekDays;\n\n var wk12_start = 21;\n var wk12_end = wk12_start + weekDays;\n\n var wk13_start = 28;\n var wk13_end = 1;\n\n\n var Month4_2014 = 4;\n var Month5_2014 = 5;\n var Month6_2014 = 6;\n var Month7_2014 = 7;\n\n\n if ((newDate >= wk1_start && newDate <= wk1_end) && (newMonth == Month4_2014)) {\n weekNumber = 1;\n }\n\n else if ((newDate >= wk2_start && newDate <= wk2_end) && (newMonth == Month4_2014)) {\n weekNumber = 2;\n }\n\n else if ((newDate >= wk3_start && newDate <= wk3_end) && (newMonth == Month4_2014)) {\n weekNumber = 3;\n }\n\n else if ((newDate >= wk4_start && newDate <= wk4_end) && (newMonth == Month4_2014)) {\n weekNumber = 4;\n }\n\n else if ((newDate >= wk5_start && newDate <= wk5_end) && (newMonth == Month5_2014)) {\n weekNumber = 5;\n }\n\n else if ((newDate >= wk6_start && newDate <= wk6_end) && (newMonth == Month5_2014)) {\n weekNumber = 6;\n }\n\n else if ((newDate >= wk7_start && newDate <= wk7_end) && (newMonth == Month5_2014)) {\n weekNumber = 7;\n }\n\n else if ((newDate >= wk8_start && newDate <= wk8_end) && (newMonth == Month5_2014)) {\n weekNumber = 8;\n }\n\n else if ((newDate == wk9_start) && (newMonth == Month5_2014)) {\n weekNumber = 9;\n }\n\n else if ((newDate <= wk9_end) && (newMonth == Month6_2014)) {\n weekNumber = 9;\n }\n\n else if ((newDate >= wk10_start && newDate <= wk10_end) && (newMonth == Month6_2014)) {\n weekNumber = 10;\n }\n\n else if ((newDate >= wk11_start && newDate <= wk11_end) && (newMonth == Month6_2014)) {\n weekNumber = 11;\n }\n\n else if ((newDate >= wk12_start && newDate <= wk12_end) && (newMonth == Month6_2014)) {\n weekNumber = 12;\n }\n\n //adjusting criteria for weeks that have days in multiple months\n\n else if ((newDate >= wk13_start && newDate <= (wk13_start + 3)) && (newMonth == Month6_2014)) {\n weekNumber = 13;\n }\n\n else if (newDate == wk13_end && newMonth == Month7_2014) {\n weekNumber = 13;\n }\n\n\n else {\n weekNumber = 'N/A';\n }\n\n\n $(\"#weekNumber\").html(weekNumber);\n\n $(\"#dateoutput1\").html(dateText1);\n $(\"#dateoutput2\").html(dateText2);\n\n\n /*\n console.log(\" ~~~~~~~> wk9_start: \" + wk9_start);\n console.log(\" ~~~~~~~> wk9_end: \" + wk9_end);\n */\n\n }\n\n\n });\n\n}", "function updateStudent() {\n var student = $scope.selectedStudent;\n if ($scope.includeSiblings === true) {\n updateSiblings(student);\n }\n var updatedStudent = StudentsModel.updateStudent(student);\n updateMarkerPosition(student.id);\n loadStudents();\n $scope.showEdit = false;\n $scope.includeSiblings = false;\n gotoTop();\n }", "async function determineCourses(programmeId){\n \n let Y1S1 = {}; // List of all courses for Year 1 Semester 1\n let Y1S2 = {}; // List of all courses for Year 1 Semester 2\n let Y2S1 = {}; // List of all courses for Year 2 Semester 1\n let Y2S2 = {}; // List of all courses for Year 2 Semester 2\n let Y3S1 = {}; // List of all courses for Year 3 Semester 1\n let Y3S2 = {}; // List of all courses for Year 3 Semester 2\n var programmeCourses = {}; // Dictionary to store all programme courses\n var semesterArr = []; // Array to store courses by semester\n var coreSemesterArr = []; // Array to store core courses by semester\n var today = new Date(); // Today's date\n var currentSem; // Value to store current semester\n\n var courses = await getProgrammeCourses(programmeId);\n\n \n for (var i=0; i<courses.length; i++) { // Initialise Courses for Degree using thier Level and Semester\n if (courses[i].level === \"I\") {\n if (courses[i].semester === \"1\") {\n Y1S1[courses[i].courseCode] = \"N\";\n }\n if (courses[i].semester === \"2\") {\n Y1S2[courses[i].courseCode] = \"N\";\n }\n }\n if (courses[i].level === \"II\") {\n if (courses[i].semester === \"1\") {\n Y2S1[courses[i].courseCode] = \"N\";\n }\n if (courses[i].semester === \"2\") {\n Y2S2[courses[i].courseCode] = \"N\";\n }\n }\n if (courses[i].level === \"III\") {\n if (courses[i].semester === \"1\") {\n Y3S1[courses[i].courseCode] = \"N\";\n }\n if (courses[i].semester === \"2\") {\n Y3S2[courses[i].courseCode] = \"N\";\n }\n }\n }\n\n programmeCourses = determineStudentCourses(courses); // Determine what courses a student failed, passed, didnt do or is in progress\n semesterArr = splitBySem(programmeCourses, courses); // Split courses by semester\n var coreCourses = getCoreCourses(courses); // Get core courses\n coreSemesterArr = splitBySem(programmeCourses, coreCourses); // Split core courses by semester\n\n var recCourses = [];\n var counter = 0;\n var year = 1;\n var sem = 1;\n var key;\n\n\n Y1S1 = semesterArr[0];\n Y1S2 = semesterArr[1];\n Y2S1 = semesterArr[2];\n Y2S2 = semesterArr[3];\n Y3S1 = semesterArr[4];\n Y3S2 = semesterArr[5];\n\n counter = 0;\n // If a student passed, failed or the course is in progress, assume that the student is in the next semester\n for (key in Y1S1) {\n if (Y1S1[key].grade === \"P\" || Y1S1[key].grade === \"F\" || Y1S1[key].grade === \"IP\") {\n counter+=1;\n }\n }\n if (counter > 1) {\n sem = 2;\n }\n counter = 0;\n if (year === 1 && sem === 2) {\n for (key in Y1S2) {\n if (Y1S2[key].grade === \"P\" || Y1S2[key].grade === \"F\" || Y1S2[key].grade === \"IP\") {\n counter+=1;\n }\n }\n if (counter > 1) {\n sem = 1;\n year = 2;\n }\n }\n counter = 0;\n if (year === 2 && sem === 1) {\n for (key in Y2S1) {\n if (Y2S1[key].grade === \"P\" || Y2S1[key].grade === \"F\" || Y2S1[key].grade === \"IP\") {\n counter+=1;\n }\n }\n if (counter > 1) {\n sem = 2;\n }\n }\n counter = 0;\n if (year === 2 && sem === 2) {\n for (key in Y2S2) {\n if (Y2S2[key].grade === \"P\" || Y2S2[key].grade === \"F\" || Y3S1[key].grade === \"IP\") {\n counter+=1;\n }\n }\n if (counter > 1) {\n sem = 1;\n year = 3;\n }\n }\n counter = 0;\n if (year === 3 && sem === 1) {\n for (key in Y3S1) {\n if (Y3S1[key].grade === \"P\" || Y3S1[key].grade === \"F\" || Y3S2[key].grade === \"IP\") {\n counter+=1;\n }\n }\n if (counter > 1) {\n sem = 2;\n }\n }\n\n if (today.getMonth() < 4) { // If the date is currently between January and April\n currentSem = 2;\n }\n // else if (today.getMonth() < 6) { // If the date is currently between May and July\n // currentSem = 1;\n // }\n else { // If the date is currently between August and December\n currentSem = 1;\n }\n\n // Recommended courses based on current year and semester if the student has not done the course yet\n if (year === 1 && currentSem === 1) {\n for (key in Y1S1) {\n if (Y1S1[key].grade === \"N\") {\n recCourses.push(Y1S1[key].courseCode)\n }\n }\n }\n if (year === 1 && currentSem === 2) {\n for (key in Y1S2) {\n if (Y1S2[key].grade === \"N\") {\n recCourses.push(Y1S2[key].courseCode)\n }\n }\n }\n if (year === 2 && currentSem === 1) {\n for (key in Y2S1) {\n if (Y2S1[key].grade === \"N\") {\n recCourses.push(Y2S1[key].courseCode)\n }\n }\n }\n if (year === 2 && currentSem === 2) {\n for (key in Y2S2) {\n if (Y2S2[key].grade === \"N\") {\n recCourses.push(Y2S2[key].courseCode)\n }\n }\n }\n if (year === 3 && currentSem === 1) {\n for (key in Y3S1) {\n if (Y3S1[key].grade === \"N\") {\n recCourses.push(Y3S1[key].courseCode)\n }\n }\n }\n if (year === 3 && currentSem === 2) {\n for (key in Y3S2) {\n if (Y3S2[key].grade === \"N\") {\n recCourses.push(Y3S2[key].courseCode)\n }\n }\n }\n \n recCourses = recommendCoreCourses(coreSemesterArr, year, currentSem, recCourses);\n removeCoursesNoPrereq(recCourses, courses, programmeCourses);\n props.setRecommended(recCourses);\n props.setLevel(year);\n if (props.recCourses !== null) {\n props.setLoad(false);\n }\n setProcessed(true);\n }", "setStudent(rol,course){\n\n this.rol=rol;\n this.course=course;\n }", "fillSemesters(){\n let semesters = this.state.plan.semesters;\n let semesterBoxes = [];\n for (let i = 0; i < semesters.length; i++) {\n semesterBoxes.push(<Semester key={i} callback={this.updateEditor} plan={this.state.plan} editMode={true}\n semesterIndex={i} semester={semesters[i]}\n scheduleConflict={semesters[i].schedule_conflict}\n courseList={this.state.courseList}/>)\n }\n\n return semesterBoxes;\n }", "function getSemesterName( season, year ) {\n return season + \" \" + year;\n}", "function splitBySem(coreRes, courses) {\n var semesterArr = [[]];\n\n // Iterate through programme courses\n for (var key in coreRes) {\n\n // Iterate through student courses\n for (var i=0; i<courses.length; i++) {\n if (key === courses[i].courseCode) { // If programme course is in courses array\n if ((courses[i].semester === \"1\" && courses[i].level === \"I\")) { // If Year 1, Semester 1 course\n if (!semesterArr[0]) { // Initialise 2D array\n semesterArr[0] = [];\n }\n semesterArr[0].push({ // Push course code and student grade into array\n courseCode: key,\n grade: coreRes[key]\n });\n break;\n }\n if ((courses[i].semester === \"2\" && courses[i].level === \"I\")) {\n if (!semesterArr[1]) {\n semesterArr[1] = [];\n }\n semesterArr[1].push({\n courseCode: key,\n grade: coreRes[key]\n });\n break;\n }\n if ((courses[i].semester === \"1\" && courses[i].level === \"II\")) {\n if (!semesterArr[2]) {\n semesterArr[2] = [];\n }\n semesterArr[2].push({\n courseCode: key,\n grade: coreRes[key]\n });\n break;\n }\n if ((courses[i].semester === \"2\" && courses[i].level === \"II\")) {\n if (!semesterArr[3]) {\n semesterArr[3] = [];\n }\n semesterArr[3].push({\n courseCode: key,\n grade: coreRes[key]\n });\n break;\n }\n if ((courses[i].semester === \"1\" && courses[i].level === \"III\")) {\n if (!semesterArr[4]) {\n semesterArr[4] = [];\n }\n semesterArr[4].push({\n courseCode: key,\n grade: coreRes[key]\n });\n break;\n }\n if ((courses[i].semester === \"2\" && courses[i].level === \"III\")) {\n if (!semesterArr[5]) {\n semesterArr[5] = [];\n }\n semesterArr[5].push({\n courseCode: key,\n grade: coreRes[key]\n });\n break;\n }\n }\n }\n }\n return semesterArr;\n }", "function listbysemester(req, res) {\r\n internalSchema.findOne({ semester: req.swagger.params.semester.value }, function (err, internalsemester) {\r\n if (err)\r\n res.send(err);\r\n res.json(internalsemester);\r\n });\r\n}", "function selectedSemester(radioGroup) {\n\n\t\t\t\tvar radioSem = document.getElementsByName(radioGroup);\n\t\t\t\t// var isSelected = false;\n\t\t\t\n\t\t\t\tfor ( var l = 0; l < radioSem.length; l++)\n\t\t\t\t\tif (radioSem.item(l).checked === true) \n\t\t\t\t\t\treturn true;\n\t\t\t\t\t\n\t\t\t\treturn false;\t\n\t\t\t\n\t\t}", "function editStudent() {\n\t// console.log('editing student!');\n\tgetMultipleValuesFromStorage(['CATEGORY', 'ADMISSION_DATE'])\n\t.then(function(keys) {\n\t\tvar cat = keys[0];\n\t\tvar date = keys[1];\n \n\t\tvar FT = getFieldTranslator();\n\n\t\t// student category\n\t\tif (cat !== \"\") {\n\t\t\tinsertValue( getDC( {\"CATEGORY\": cat}, FT, 'STUDENT_CATEGORY'), 'student_student_category_id' );\n\t\t}\n\n\t\t// admission date\n\t\tif (date !== \"\") {\n\t\t\tinsertValue( date, 'student\\\\[admission_date\\\\].calendar_field' );\t\n\t\t}\n\n\t\t// increment studentCount in firebase database:\n\t\tincrementStudentCount(1, 'FIXED');\n\n\t\t// submit form -> redirects back to student/profile/id\n\t\t$('input[name=\"commit\"]').click();\n\t})\n\t.catch(function(error) {\n\t\tThrowError({\n\t\t\tmessage: error,\n\t\t\terrMethods: ['mConsole', 'mAlert']\n\t\t});\n\t});\n}", "function semesterOptions(){\n var term = ['Spring', 'Summer', 'Fall'];\n var semesters = [];\n var date = new Date();\n var year = date.getFullYear();\n for (var i = year; i > year - 7; i--) {\n term.forEach(function(item, index){\n semesters.push(i+\" \"+item);\n });\n }\n return semesters;\n }", "async addSemester(event) {\n event.preventDefault();\n let payload = new FormData();\n payload.append(\"token\", Auth.getToken());\n payload.append(\"semester_name\", this.state.semester + ' ' + this.state.value);\n payload.append(\"identifier\", this.state.plan.plan_hash);\n const request = await fetch('https://tddd27-nikha864-backend.herokuapp.com/add_semester', {\n method: 'post',\n body: payload\n });\n\n let response = await request.json();\n\n if(response.success){\n // Re-render course plans to update the new one\n this.componentWillMount();\n this.setState({\n snackbarMessage: response.message,\n snackbarColor: 'white',\n loadingAddingPlan: false\n });\n }\n\n else{\n this.setState({\n snackbarMessage: response.message,\n snackbarColor: 'red',\n loadingAddingPlan: false\n });\n }\n this.handleOpenSnackbar();\n }", "function updateYear(year) {\n yearSelected = year;\n updateShotChart();\n updateSeasonRank();\n}", "function getSelectedSemester(radioGroup) {\n\n\t\t\t\tvar radioSem = document.getElementsByName(radioGroup);\n\t\t\t\t\n\t\t\t\tfor ( var i = 0; i < radioSem.length; i++) {\n\t\t\t\t\tif (radioSem.item(i).checked) \n\t\t\t\t\t\treturn radioSem.item(i).value;\n\t\t\t}\n\t\t}", "function semesterEnd() {\n var nowDate = new Date();\n if (nowDate.getMonth() <= 6) {\n return new Date(nowDate.getFullYear(), 6, 32).toUTCString(); // 31st of July, this year\n }\n else {\n return new Date(nowDate.getFullYear(), 11, 32).toUTCString(); // 31st of December, this year\n }\n}", "function updateData() {\n updateStudentList();\n gradeAverage();\n}", "function updateToMonthlySalary(){\n\n}", "function updateDropdownLabel() {\n // code goes here\n semesterDropLabel.innerHTML = semester\n}", "function enrollInSummerSchool(students) {\n var array = [];\n for(i=0; i<students.length; i++) {\n students[i].status = 'In Summer school';\n }\n return students;\n}", "function highlightDiv(semester){\n\tvar yearBeforeSemester = String((parseInt(semester.substring(0,4)) - 1)).concat(semester.substring(4,5));\n\n\tvar elements = document.querySelectorAll('*[data-name~=\"semesters\"]');\n\tfor (var i=0; i < elements.length; i++) {\n\t\tvar semesters = elements[i].childNodes;\n\t\tvar highlight = false;\n\t\tfor (var j=0; j < semesters.length; j++) {\n\t\t\tif(semesters[j].hasChildNodes() && semesters[j].getAttribute(\"data-name\") == \"semester\") {\n\t\t\t\tif(semesters[j].firstChild.nodeValue == semester) {\n\t\t\t\t\thighlight = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(highlight == false && semesters[j].firstChild.nodeValue == yearBeforeSemester) {\n\t\t\t\t\tsemesters[j].setAttribute(\"class\",\"probableLva\");\n\t\t\t\t} else {\n\t\t\t\t\tsemesters[j].setAttribute(\"class\",\"\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif(highlight) {\n\t\t\telements[i].parentNode.setAttribute(\"class\",\"currentlva\");\n\t\t} else {\n\t\t\telements[i].parentNode.setAttribute(\"class\",\"\");\n\t\t}\n\t}\n\n\tredrawFix();\n}", "function updateStudent(id) {\n let list = students[id - 1];\n console.log(list);\n setName(list.name)\n setRollNo(list.rollno)\n setStudentID(list.id)\n setFlag(false);\n }", "function setFeesSubjects(){\r\n var schYear = $('#syEntered').val();\r\n var regexNoSpace = /^\\d{0,4}(\\-\\d{0,4})?$/;\r\n var schYearLength = schYear.length;\r\n var lastSchYearInput = schYear.substring(schYearLength-1,schYearLength);\r\n var gyl = $('#currentGYL').val();\r\n var dept = $('input[name=radioDepartment]:checked').val();\r\n var selectedGYL = \"\";\r\n if(dept === \"Elementary Dept.\"){\r\n selectedGYL = $('#grade').val();\r\n }else if(dept === \"High School Dept.\"){\r\n selectedGYL = $('#yrLevel').val();\r\n }else{\r\n selectedGYL = \"wa\";\r\n }\r\n \r\n if($('#studentId').html()===\"\" || $('#studentName').html()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Enter student ID on the search textbox!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else if($('#age').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter age!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#age').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if(!regexNoSpace.test(lastSchYearInput) || $('#syEntered').val()===\"\"){\r\n var resultSchYear = schYear.substring(0,schYearLength-1);\r\n $('#syEntered').val(resultSchYear);\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter school year correctly.\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#syEntered').css({border: '1px solid red'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n }else if($('#genAverage').val()===\"\"){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please enter gen average!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n $('#genAverage').css({border: '1px solid red'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n\r\n }else if(selectedGYL === gyl){\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;You are currently enrolled in \"+selectedGYL);\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n }else{\r\n $('#div-overlay-alert-msg').hide('blind',1000);\r\n $('#genAverage').css({border: '1px solid #c0c0c0'});\r\n $('#syEntered').css({border: '1px solid #c0c0c0'});\r\n $('#age').css({border: '1px solid #c0c0c0'});\r\n \r\n $('#radioFullPaymnt').removeAttr('disabled');\r\n $('#radioMonthlyPaymnt').removeAttr('disabled');\r\n $('#radioSemestralPaymnt').removeAttr('disabled');\r\n $('#age').attr('readonly','readonly');\r\n $('#syEntered').attr('readonly','readonly');\r\n $('#genAverage').attr('readonly','readonly');\r\n $('#yrLevel').attr('disabled','disabled');\r\n var category=\"\";\r\n if($('input[name=radioDepartment]:checked').val()===\"Elementary Dept.\"){\r\n category = $('#grade').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else if($('input[name=radioDepartment]:checked').val()===\"High School Dept.\"){\r\n category = $('#yrLevel').val();\r\n enabledMode();\r\n $('#btn-sub-fees').attr('disabled','disabled');\r\n }else{\r\n $('#div-overlay-alert-msg').html(\"<i class='icon-exclamation-sign'></i>&nbsp;&nbsp;Please choose what department!\");\r\n $('#div-overlay-alert-msg').show('blind',1000);\r\n disabledMode();\r\n $('#btn-sub-fees').removeAttr('disabled');\r\n }\r\n $('#category').html(category);\r\n }\r\n}", "updateGrade(newGrade){\n this.averageGrade = newGrade;\n }", "function onModifyStudent() {\n 'use strict';\n if (lastCheckedStudent === -1) {\n window.alert(\"Warning: No student selected !\");\n return;\n }\n\n var student = FirebaseStudentsModule.getStudent(lastCheckedStudent);\n txtStudentFirstNameModified.value = student.firstname;\n txtStudentLastNameModified.value = student.lastname;\n txtStudentEMailModified.value = student.email;\n dialogModifyStudent.showModal();\n }", "renderSemester(sem, index){\n if(sem.name !== \"\") {\n return (\n <Grid className='Semester' key = {index} centered padded>\n <Header as='h3' style={{marginTop: 0.5 + \"em\", marginBottom: 0}}>\n {sem.name}\n </Header>\n <Grid.Row>\n {sem.Lvas.map((lva, index) => (\n this.renderSingleLVA(lva, index)\n ))}\n </Grid.Row>\n </Grid>\n )\n }\n }", "toggleWorkTerm(yearIndex, season){\n this.setState((prevState) => {\n\n let courseSequenceObjectCopy = JSON.parse(JSON.stringify(prevState.courseSequenceObject));\n\n // updated isWorkTerm property of semester in question\n let isWorkTerm = courseSequenceObjectCopy.yearList[yearIndex][season].isWorkTerm;\n courseSequenceObjectCopy.yearList[yearIndex][season].isWorkTerm = (isWorkTerm === \"true\") ? \"false\" : \"true\";\n\n // set new state based on changes\n return {\n \"courseSequenceObject\": courseSequenceObjectCopy\n };\n });\n }", "static updateGraduate(name) {\n Db.findStudent(name, (err, results) => {\n if(results[0].ability >= 100) {\n name = Db.cleanString(name);\n let sql = mysql.format(\"UPDATE shiftup SET graduate = 1 WHERE name = ?;\",[name]);\n connection.query(sql, function(err, result) {\n if (err) throw err;\n console.log(this.name + \" graduated\");\n });\n } else {\n console.log(\"You won't be able to graduate with that ability\");\n }\n \n })\n }", "function yearUp(){\r\n\tintYear++;\r\n\tlistReminders();\r\n\tinitialise();\n\r\n\t}", "function update(birthYear, occupation) { \n\tthis.birthYear = birthYear; \n\tthis.occupation = occupation;\n}", "function saveState() {\n if (selectedSemName != null &&\n selectedCourse != null &&\n selectedTab != null) {\n port.postMessage({\n note: \"state\",\n state: {\n semester: selectedSemName,\n course: selectedCourse.key,\n tab: selectedTab.getAttribute(\"attribute\")\n }\n });\n }\n}", "function adjust_season()\n{\n\tif (document.createitem.season1.selectedIndex == 0)\n\t{\n\t\tdocument.createitem.season2.value = \"\";\n\t}\n\telse\n\t{\n\t\tdocument.createitem.season2.value = Number(document.createitem.season1.value) + 1;\n\t}\n}", "function makeStudent() {\n currentStudent = studentsObject.sigmanauts[indexId];\n }", "function semesterChoice(choice) {\n document.cookie=\"semester=\" + choice + \"; expires=\" + semesterEnd();\n window.location.href = '/' + choice + 'semester.php';\n}", "function assignSelectedStudentsToMentor(){\n let multipleStudentSelect = document.getElementById('studentsSelect');\n let mentorName = document.getElementById('mentorSelect').value;\n let studentNameList = getSelectValues(multipleStudentSelect);\n console.log(`number of selected students is: ${studentNameList.length}`)\n\n fetch(url+`/get-mentor/${mentorName}`)\n .then((resp) => {\n return resp.json()\n })\n .then((data) => {\n console.log(\"result of old studenLIst of selected mentor is: \"+ data.result.studentList);\n for(let i=0; i<studentNameList.length; i++) setMentor(studentNameList[i], mentorName);\n let updatedStudentList = [];\n updatedStudentList = data.result.studentList.concat(studentNameList);\n console.log(\"result of updated studenLIst of selected mentor is: \"+ updatedStudentList);\n assignStudentsToMentor(mentorName, updatedStudentList);\n fillStudentInSelectBox();\n })\n return false;\n \n}", "function saveStudent(){\n student = true;\n }", "function updateGrade(){\n var user_points = initPointObjectCategories();\n var max_points = initPointObjectCategories();\n\n $(ASSIGNMENT_TABLE_CSS_PATH +' > tr').each(function(){\n var assignment = getAssignmentInfo($(this));\n user_points[assignment['category']] += assignment['user_score'];\n max_points[assignment['category']] += assignment['max_score'];\n });\n\n var number_grade = generateNumberGrade(user_points, max_points);\n var letter_grade = generateLetterGrade(number_grade);\n\n $(CATEGORIES_CSS_PATH).each(function(){\n updateCategoryScore($(this), user_points, max_points);\n })\n //$(category_element).find('td:nth-child(3)').text();\n\n $(CLASS_LETTER_GRADE_CSS_PATH).text((number_grade).toFixed(2) + \"%\");\n $(CLASS_NUMBER_GRADE_CSS_PATH).text(letter_grade);\n}", "function getCalendar(semester, year, callback) {\n var term_in = year;\n\n switch (semester) {\n case \"Winter\": {\n term_in = term_in.concat(\"10\");\n break;\n }\n case \"Summer\": {\n term_in = term_in.concat(\"20\");\n break;\n\n }\n case \"Fall\": {\n term_in = term_in.concat(\"30\");\n break;\n }\n }\n\n //Grab the HTML page of the calendar and pass it to the parseCalendarHTML\n request.post({ url: VIEW_CALENDAR_URL, form:{ 'term_in': term_in } }, function (err, resp) {\n parseCalendarHTML(resp.body, function(object) {\n callback(object);\n });\n });\n}", "setDegreeCourse(aDegreeCourse) {\n this.degree_course = aDegreeCourse;\n }", "updateStudentWorksheet() {\n\n }", "function SpringSemesterRate(springRate)\n{\n\tif( springRate >= 0 ){\n\t\treturn springRate / 4.5;\n\t} else {\n\t\treturn alert(\"Invalid Amount\");\n\t}\n}", "changeYear(minYear, maxYear){\n\t\tlet self = this;\n\t\tself.current = minYear;\n\t\tthis.maxYear = maxYear;\n\t\tself.update();\n\t}", "function students(d,curdate) {\n\tif (d.properties.students) {\n\t\tvar dateloc=d.properties.students.search(niceDate(curdate));\n\t\tif (dateloc > -1) {\n\t\t\treturn Number(d.properties.students.substr(dateloc+5,3));\n\t\t} else { return \"0\";}\n\t} else {return \"0\";}\n}", "function setEnrollmentNo(){\r\n var date = new Date();\r\n var currYear = date.getFullYear();\r\n var nextYear = currYear + 1;\r\n $.ajax({\r\n type: 'POST',\r\n url: '../process/setEnrollmentNo.php',\r\n success: function(data){\r\n var enrollmentNo = \"EN-\"+currYear+\"-\"+nextYear+\"-\"+data;\r\n $('#enrollmntId').val(enrollmentNo);\r\n },\r\n error: function(data){\r\n console.log('error setting enrollment no->'+data);\r\n }\r\n });\r\n}", "function setIndividualStudent(student) {\n\t\t\t\t\t\t\tvar data = filterDataByStudent(jsonData, student);\n\t\t\t\t\t\t\t$scope.individualStudent = ((data[0] !== null) && (data[0] !== undefined)) ? data[0]\n\t\t\t\t\t\t\t\t\t: null;\n\t\t\t\t\t\t}", "function updateCalendarStats(){\n if(new Date().getFullYear() == currentCalendar.lastYearViewed){\n currentStreakDiv.innerHTML = \"Current Streak: <span>\" + getCurrentStreak() + \"</span>\";\n }else{\n currentStreakDiv.innerHTML = \"\";\n }\n longestStreakSpan.innerHTML = getLongestStreak();\n totalLitSpan.innerHTML = getNumberCellsLit();\n percentLitSpan.innerHTML = getPercentCellsLit();\n }", "function createStudent(name, year) {\n return {\n name,\n year,\n courses: [],\n\n info() {\n console.log(`${this.name} is a ${this.year} year student`);\n },\n\n addCourse(course) {\n this.courses.push(course);\n },\n\n listCourses() {\n return this.courses;\n },\n\n addNote(code, note) {\n this.courses.forEach(course => {\n if (course.code === code) {\n if (!Object.prototype.hasOwnProperty.call(course, 'note')) {\n course['note'] = note;\n } else {\n course['note'] += `; ${note}`;\n }\n }\n });\n },\n\n updateNote(code, note) {\n this.courses.forEach(course => {\n if (course.code === code) {\n course['note'] = note;\n }\n });\n },\n\n updateGrade(code, grade) {\n this.courses.forEach(course => {\n if (course.code === code) {\n course['grade'] = grade;\n }\n });\n },\n\n getGrade(courseName) {\n let course = this.courses.find(course => course.name === courseName);\n return course.grade;\n },\n\n viewNotes() {\n this.courses.forEach(course => {\n if (Object.prototype.hasOwnProperty.call(course, 'note')) {\n console.log(`${course.name}: ${course.note}`);\n }\n });\n },\n\n viewGrades() {\n this.courses.forEach(course => {\n if (Object.prototype.hasOwnProperty.call(course, 'grade')) {\n console.log(`${course.name}: ${course.grade}`);\n } else {\n console.log(`${course.name}: In progess`);\n }\n });\n },\n };\n}", "function storeSuperbExplanations(){\n db.createCollection(community+'Cases', {w:1}, function(err, collection) {\n var caseCollection = db.collection(community+'Cases');\n //In \"caseCollection\", find the case with the Date \"Date\", then in that document\n //set the fields to the new values\n var SuperbExplanationsString = SuperbExplanations.join(\", \");\n var FirstSolversString = FirstSolvers.join(\", \");\n caseCollection.update({'Date':Date}, {$set:{'SuperbExplanations':SuperbExplanationsString, 'FirstSolvers':FirstSolversString, 'StudentExplanation':displayAnswerString}}, {w:1}, function(err, result){\n if (!err){\n res.render('success', {\n locals: {\n 'title': 'Grading Submitted',\n 'header': 'Grading Submitted',\n 'successMessage': 'Your grading has been recorded. Leaderboard is updated.',\n 'community':community,\n 'adminPanel': 'yes'\n }\n })\n }\n })\n })\n }", "function updatestdQualificationbycourse(executionContext) {\n try {\n var formContext = executionContext.getFormContext();\n var qualificationLable = formContext.getAttribute(\"new_studentqualification\").getText()\n if (qualificationLable == \"MCA\") {\n var coursevalue = formContext.getAttribute(\"new_studentcourse\").setValue(1);\n formContext.getControl(\"new_email\").setDisabled(false);\n formContext.getControl(\"new_stdmarks\").setDisabled(true);\n formContext.getAttribute(\"new_stdmarks\").setValue(null);\n }\n if (qualificationLable == \"Btech\") {\n var coursevalue = formContext.getAttribute(\"new_studentcourse\").setValue(2);\n formContext.getControl(\"new_stdmarks\").setDisabled(false);\n formContext.getControl(\"new_email\").setDisabled(true);\n formContext.getAttribute(\"new_email\").setValue(null);\n }\n }\n catch (e) {\n Xrm.Utility.alertDialog(e.message);\n }\n}", "function setDepartmentData(departments, department_pages)\n{\n this.departments = departments;\n this.pages = department_pages;\n// updateDepartments();\n}", "function setYears() {\n if (self.budgetMonths[0].month === 'January') {\n for (i = 0; i < self.budgetMonths.length; i++) {\n self.budgetMonths[i].year = self.startingYear;\n }\n } else {\n var newYear = false;\n for (i = 0; i < self.budgetMonths.length; i++) {\n if (newYear === false && self.budgetMonths[i].month != 'January') {\n newYear = false;\n self.budgetMonths[i].year = self.startingYear;\n } else if (newYear === false && self.budgetMonths[i].month === 'January') {\n newYear = true;\n self.budgetMonths[i].year = self.startingYear + 1;\n } else {\n self.budgetMonths[i].year = self.startingYear + 1;\n }\n }\n }\n } // end setYears", "function updateMonthlySalary(empMonthlySalary) {\n\n $('.person').last().data(\"monthlysalary\", {\n monthlysalary: empMonthlySalary\n });\n\n }", "function saveDegreePlan(req, res) {\n try {\n Plan.updateOne({\"studentID\": req.body.id}, {\n $set: req.body.newPlan\n }, { new: true })\n .then((plan) => {\n res.statusCode = 200;\n res.setHeader('Content-Type', 'application/json');\n res.json(plan);\n console.log(plan)\n console.log(\"PUT operation done\");\n })\n\n } catch (e) {\n console.log(e)\n res.send({ message: \"Error in Fetching semester information\" });\n }\n}", "set numberOfStudents(newNumberOfStudents){\n return Number.isInteger(newNumberOfStudents) ? this._numberOfStudents = newNumberOfStudents :\n 'Invalid input: numberOfStudents must be set to a Number.';\n }", "function saveEditSection()\n\t\t{\n\t\t\tresetStyleEdit();\n\t\t\t\n\t\t\tvar section={}; \n\t\t\t\n\t\t\tsection.Course = document.getElementById(\"editcName\").value;\n\t\t\tsection.CourseID= document.getElementById(\"courseID\").value; \n\t\t\tsection.UniqueID= document.getElementById(\"sectionID\").value; \n\t\t\tsection.Day1 = document.getElementById(\"editlDay1\").value.toUpperCase();\n\t\t\tsection.Day2 = document.getElementById(\"editlDay2\").value.toUpperCase();\n\t\t\tsection.StartTime = document.getElementById(\"editstartL\").value;\n\t\t\tsection.EndTime = document.getElementById(\"editendL\").value;\n\t\t\tsection.TutorialDay1 = document.getElementById(\"edittDay1\").value.toUpperCase();\n\t\t\tsection.TutorialDay2 = document.getElementById(\"edittDay2\").value.toUpperCase();\n\t\t\tsection.TutorialStartTime = document.getElementById(\"editstartT\").value;\n\t\t\tsection.TutorialEndTime = document.getElementById(\"editendT\").value;\n\t\t\tsection.LabDay = document.getElementById(\"editlabDay1\").value.toUpperCase();\n\t\t\tsection.LabStartTime = document.getElementById(\"editstartLab\").value;\n\t\t\tsection.LabEndTime = document.getElementById(\"editendLab\").value;\n\t\t\tsection.Availability = getSelectedSemester(\"editsemester\");\n\t\t\t\n\t\t\tif (!validateInputEdit()) \n\t\t\t{\n\t\t\t alert(\"Errors found. Please verify your input.\");\n\t\t\t return;\n\t\t\t}\n\t\t\telse\n\t\t {\n\t\t $.get(\"/Admin/UpdateExistingSection\", section, function (responseCode) {\n\t\t if (responseCode == 0) {\n\t\t alert(\"Section has been successfully edited\");\n\t\t location.reload();\n\t\t }\n\t\t }\n\t\t\t\t\t);\n\t\t }\n\t\t\t\n\t\t}", "function setOptionSelectedRoomsForAllCourse() {\n\t\t\tvar classCourseSemesters = {};\n\t\t\t$.each(classesCoursesJSON, function(value, object) {\n\t\t\t\tif(object.classSemesterId == urlParam(\"classSemesterId\"))\n\t\t\t\t\tclassCourseSemesters = object.classCourseSemesters;\n\t\t\t});\n\t\t\tfor(var i = 0; i < classCourseSemesters.length; i++) {\n\t\t\t\tif(classCourseSemesters[i].timetable != null\n\t\t\t\t\t\t&& classCourseSemesters[i].timetable.length > 0) {\n\t\t\t\t\tvar room = classCourseSemesters[i].timetable[0].room;\n\t\t\t\t\tvar check = false;\n\t\t\t\t\tif(room != null) {\n\t\t\t\t\t\tvar id = classCourseSemesters[i].classCourseSemesterId;\n\t\t\t\t\t\tfor(var x = 0; x < roomsJSON.length; x++) {\n\t\t\t\t\t\t\tif(roomsJSON[x].roomId == room.roomId) {\n\t\t\t\t\t\t\t\t$(\"#select-rooms-\" +id).find(\"option[value='\"+x+\"']\").attr(\"selected\", \"selected\");\n\t\t\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(!check) $(\"#select-rooms-\" +id +\" option:first\").attr(\"selected\", \"selected\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\tcheckCustomRooms();\n\t\t\t\n\t\t}", "updateMonth() {\n O('month-label').innerHTML = MONTHS[this.month];\n }", "function selectSeasoning() {\n\tseasoningCost = 1 - seasoningCost ;\n\tcalculateTotal();\n}", "set numberOfStudents(numStudents) {\n if(typeof numStudents === 'number'){\n this._numberOfStudents = numStudents;\n } else {\n console.log('Invalid input: numberOfStudents must be set to a Number.');\n }\n }", "function updateStudent() {\n studentString = JSON.stringify(Student.all);\n localStorage.setItem(\"studentinfo\", studentString);\n}", "getSchool() {\r\n return this.school;\r\n }", "constructor(props) {\n super(props);\n this.semesterList = props.semesterList;\n this.function = props.function;\n }", "function SummerSemesterRate(summerRate){\n\tif( summerRate >= 0 ){\n\t\treturn summerRate / 3;\n\t} else {\n\t\treturn alert(\"Invalid Amount\");\n\t}\n}", "function SetDateInputOnSeasons(season) {\n //Gets todays date.\n var todaysDate = new Date();\n var startDate;\n var endDate;\n //Determens the start- and endDate determent by what season is chosen.\n switch (season) {\n case 'Forår':\n startDate = new Date(2021, 3, 1);\n endDate = new Date(2021, 5, 30);\n break;\n case 'Sommer':\n startDate = new Date(2021, 3, 1);\n endDate = new Date(2021, 8, 30);\n break;\n case 'Efterår':\n startDate = new Date(2021, 7, 15);\n endDate = new Date(2021, 9, 31);\n break;\n case 'Vinter':\n startDate = new Date(2021, 9, 1);\n endDate = new Date(2021, 2, 31);\n break;\n }\n //Is that start date of the season has already passed then the date will pass to the next year.\n while (startDate < todaysDate) {\n startDate.setFullYear(startDate.getFullYear() + 1);\n endDate.setFullYear(endDate.getFullYear() + 1);\n }\n //Sets the inputs to the date determined by what season is chosen.\n document.getElementById('MainContent_startDate').value = ConvertDateFormat(startDate);\n document.getElementById('MainContent_endDate').value = ConvertDateFormat(endDate);\n}", "function incrementAbsences(course, student) {\n let numOfDaysMissed=0;\n course=new Map();\n for(let s of student){\n course.set(course,student)\n numOfDaysMissed++;\n }\nreturn numOfDaysMissed;\n}", "gradeAssignment(student) {\n let val1 = Math.floor(Math.random() * 100);\n let plusMin = \"\";\n let val2 = Math.floor(Math.random() * 100);\n val1 >= 50 ? (plusMin = \"plus\") : (plusMin = \"minus\");\n if (plusMin === \"plus\") {\n if (student.grade + val2 > 100) {\n student.grade = 100;\n } else {\n student.grade += val2;\n }\n } else if (plusMin === \"minus\") {\n if (student.grade - val2 < 0) {\n student.grade = 0;\n } else {\n student.grade -= val2;\n }\n }\n console.log(\n `${this.name} graded ${student.name}\\'s assignment. ${\n student.name\n } now has a grade of ${student.grade}!`\n );\n }", "function updateCurrentMonth() {\n updateDays();\n currentM.textContent = months[month];\n}", "function populateStudentInfo({ name, grade, advisor, major, graduationYear, imageUrl }) {\n updateStudentName(name)\n updateStudentGradeLevel(grade)\n updateStudentAdvisor(advisor)\n updateMajor(major)\n updateStudentGraduationYear(graduationYear)\n updateStudentImage(imageUrl)\n}", "function setTheYear() {\n if ( currentMonth >= 2 ) { // Check if it's past March\n console.log('Month - greater than or equal to 2');\n if ( currentMonth == 2 ) {\n console.log('Month - Equal to 2');\n if ( currentDay == 1 ) {\n console.log('The first!');\n start.setYear(currentYear - 1);\n end.setYear(currentYear);\n } else {\n console.log('After the first');\n start.setYear(currentYear);\n end.setYear(currentYear + 1);\n }\n } else {\n console.log('Month - greater than 2');\n start.setYear(currentYear);\n end.setYear(currentYear + 1);\n }\n } else {\n console.log('Month - less than 2');\n start.setYear(currentYear - 1);\n end.setYear(currentYear);\n }\n deferCheckDate.resolve();\n }", "function getAllSemesters() {\n return $http.get(\"/api/getAllSemester\")\n .then(function (response) {\n return response.data;\n });\n }", "function updateMonth(month) {\n $('h4.current-month').html('Aфиша ЦКЗ на ' + months[month]);\n }", "function build_academic_aside_nav(student) {\n /*\n * Get distinct season, year values\n * in order to build semester buttons.\n */\n let years = getStudentYears(student);\n\n /*\n * Build the selection_menu article\n */\n let semesterList = '\\\n <article id=\"select_menu\">\\\n <div id=\"topbar\">\\\n <div class=\"add-button-container\">\\\n <h2 class=\"highlight\">Semester</h2>\\\n <div id=\"awardsTooltip\" class=\"button-container tooltip\">\\\n <span class=\"tooltiptext\">Add a Semester</span>\\\n <button class=\"iBtn material-icons\">add</button>\\\n </div>\\\n </div>\\\n <div id=\"seasonDiv\" class=\"seasons\">\\\n <table id=\"seasonTab\" class=\"seasonTable\" cellspacing=\"3\" cellpadding=\"3\" summary=\"List of Semesters\">\\\n <tr id=\"seasonHeaderList\">\\\n <th scope=\"col\" class=\"summer\">SUMMER</th>\\\n <th scope=\"col\" class=\"fall\">FALL</th>\\\n <th scope=\"col\" class=\"spring\">SPRING</th>\\\n </tr>\\\n </table>\\\n </div>\\\n </div>\\\n </article>';\n $(\"#sidebar\").append(semesterList);\n\n /*\n * Loop through our distinct list of years, and build\n * a Summer, Fall, Spring Button for the given academic year.\n * Remember the Spring will always be year+1, since a school\n * year crosses the new year for the Spring grades.\n */\n let cnt=0;\n for (x in years) {\n let thisYear = parseInt(years[x].year);\n let nextYear = thisYear+1;\n if (cnt++ < 4) {\n $(\"#seasonTab\").append($('<tr>')\n .append($('<td>')\n .append($('<button>')\n .addClass('asideButton')\n .html(thisYear.toString())\n .click(function() {\n cleanMain();\n resetErrorMsgElement();\n build_academic_table(student, \"SUMMER\", thisYear.toString());\n })\n )\n )\n .append($('<td>')\n .append($('<button>')\n .addClass('asideButton')\n .html(thisYear.toString())\n .click(function() {\n cleanMain();\n resetErrorMsgElement();\n build_academic_table(student, \"FALL\", thisYear.toString());\n })\n )\n )\n .append($('<td>')\n .append($('<button>')\n .addClass('asideButton')\n .html(nextYear.toString())\n .click(function() {\n cleanMain();\n resetErrorMsgElement();\n build_academic_table(student, \"SPRING\", nextYear.toString());\n })\n )\n )\n )\n }\n }\n\n /*\n * Build the awards article\n */\n let awardsList = '\\\n <article id=\"awards\">\\\n <div id=\"awardsDiv\">\\\n <div class=\"add-button-container\">\\\n <h2>Awards</h2>\\\n <div id=\"awardsTooltip\" class=\"button-container tooltip\">\\\n <span class=\"tooltiptext\">Add an Award</span>\\\n <button class=\"iBtn material-icons\">add</button>\\\n </div>\\\n </div>\\\n </div>\\\n <ul id=\"awardsList\">\\\n </ul>\\\n </article>';\n $(\"#sidebar\").append(awardsList);\n\n /*\n * Add academic awards\n */\n let awardList = database_data.getAwards();\n let award = awardList.filter(function (obj) {\n return (obj.studentName === student && obj.catagory === \"Academic\");\n }).sort((a,b) => (a.year > b.year) ? 1 : ((b.year > a.year) ? -1 : 0));\n if (award.length !== 0) {\n for (x in award) {\n let innerStr = award[x].year + \" \" + award[x].title\n $(\"#awardsList\").append($(\"<li>\").html(innerStr));\n }\n }\n\n $(\".asideAddButton\").click(function(){\n error_not_implemented();\n });\n}", "function nextMonth(){\n if(data.calendar.month != 11 || data.calendar.year == 2018 || data.calendar.year == 2019){\n data.calendar.month++;\n }\n if(data.calendar.month >= 12){\n data.calendar.month = 0;\n data.calendar.year++;\n }\n sessionStorage.setItem(\"year\", data.calendar.year);\n sessionStorage.setItem(\"month\", data.calendar.month);\n fillInCalendar();\n}", "function getStudentInfo () {\n\t//get the currentProblemIndex\n\tcurrentProblemIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].currentproblemindex;\n\tif (currentProblemIndex == undefined) {\n\t\tcurrentProblemIndex == 0;\n\t\tMeteor.call('updateStudentModel', 'currentproblemindex', 0);\n\t}\n\n\t//get the partialProblems\n\tpartialProblems = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproblems;\n\tif (partialProblems == undefined) {\n\t\tmakeProblems();\n\t\tMeteor.call('updateStudentModel', 'partialproblems', partialProblems);\n\t}\n\n\t//get the currentProblem\n\tcurrentProblem = partialProblems[currentProblemIndex];\n\n\t//get the partialproofcolor\n\tcolorIndex = StudentModel.find({_id: Meteor.userId()}).fetch()[0].partialproofcolor;\n\tif (colorIndex == undefined) {\n\t\tcolorIndex = 0;\n\t\tMeteor.call('updateStudentModel', 'partialproofcolor', 0);\n\t}\n\tdocument.getElementById('colorSelectPartial').selectedIndex = colorIndex;\n\tvar currentdragcolorname = colorSchemes[colorIndex].dragcolorname;\n\tvar currentdropcolorname = colorSchemes[colorIndex].dropcolorname;\n\tvar currentrulecolorname = colorSchemes[colorIndex].rulecolorname;\n\tchangeColors(colorSchemes[colorIndex]);\n\tvar currenthtml = $('#ruleInstructionsPartial').html();\n\tvar newhtml = currenthtml.replace(currentdragcolorname, colorSchemes[colorIndex].dragcolorname);\n\tnewhtml = newhtml.replace(currentdropcolorname, colorSchemes[colorIndex].dropcolorname);\n\tnewhtml = newhtml.replace(currentrulecolorname, colorSchemes[colorIndex].rulecolorname)\n\t$('#ruleInstructionsPartial').html(newhtml);\n}", "function setInfo() {\n var name = document.querySelector(\"#name_form_student\");\n name.value = local_user.name;\n var account_number = document.querySelector(\"#no_cuenta_form_student\");\n account_number.value = local_user.num_account;\n var career = document.querySelector(\"#carrer_form_student\");\n career.value = local_user.career;\n var email = document.querySelector(\"#email_form_student\");\n email.value = local_user.email;\n var semester = document.querySelector(\"#semester_form_student\");\n semester.value = local_user.semester;\n\n}", "function nextStudent() {\n group.people.push(group.people.shift());\n selectGroup(true);\n saveNewOrder();\n}", "function calcGrade() {\r\n var midterm1 = document.getElementById(\"midterm1\").value;\r\n var midterm2 = document.getElementById(\"midterm2\").value;\r\n var assignment = document.getElementById(\"assignment\").value;\r\n var final = document.getElementById(\"final\").value;\r\n var attendance = document.getElementById(\"lectures\").checked;\r\n var presentation = document.getElementById(\"presentation\").checked;\r\n var assignment_date = new Date(document.getElementById(\"assignment_date\").value);\r\n var due_date = new Date(2020-07-01);\r\n\r\n if (attendance == true) {\r\n var point1 = 0.1;\r\n }\r\n else {\r\n var point1 = 0;\r\n }\r\n\r\n if (presentation == true) {\r\n var point2 = 0.2;\r\n }\r\n else {\r\n var point2 = 0;\r\n }\r\n\r\n if (assignment_date > due_date) {\r\n var hola = -0.1;\r\n }\r\n \r\n var grade = midterm1 * 0.2 + midterm2 * 0.2 + final * 0.3 + assignment * 0.3 + point1 + point2;\r\n\r\n if (grade > 5) {\r\n document.getElementById(\"grade\").innerHTML = \"The student's final grade is: \" + 5.0;\r\n }\r\n else if (grade < 0) {\r\n document.getElementById(\"grade\").innerHTML = \"The student's final grade is: \" + 0.0;\r\n }\r\n else {\r\n document.getElementById(\"grade\").innerHTML = \"The student's final grade is: \" + grade;\r\n }\r\n\r\n}", "function updateMonth(month, date) {\n month.getElementsByTagName(\"option\")[date.getMonth()].selected = \"selected\";\n}", "function setMajorMinor(tempMajor){\n majorMinor = tempMajor;\n GetNumProg();\n}", "updateDates() {\n if (document.getElementById(self.datePicker.id + 'currYear') !== null) {\n document.getElementById(self.datePicker.id + 'currYear').value = self.datePicker.current.getFullYear();\n document.getElementById(self.datePicker.id + 'currDate').value = self.pickerString();\n } else {\n if (document.getElementById(self.datePicker.id + 'currDate') !== null) {\n document.getElementById(self.datePicker.id + 'currDate').value = self.pickerString();\n }\n }\n document.getElementById(self.datePicker.id + 'calendar').replaceChild(self.buildCalendar(), document.getElementById(self.datePicker.id + 'calendar').childNodes[0]);\n }", "function School(school, degree, dates, location, majors){\n\tthis.school = school;\n\tthis.degree = degree;\n\tthis.dates = dates;\n\tthis.location = location;\n\n\tif(typeof majors === 'undefined'){\n\t\tconsole.log('majors undefined');\n\t\tmajors = [];\n\t}\n\n\tthis.majors = majors;\n}", "function switchSeasons() {\n\tcurrentSeasonSelected =event.target.value;\n\tprintToDom();\n}", "setStudyState(aStudyState) {\n this.study_state= aStudyState;\n }", "function FallSemesterRate(fallRate)\n{\n\tif( fallRate >= 0 ){\n\t\treturn fallRate / 4.5;\n\t} else {\n\t\treturn alert(\"Invalid Amount\");\n\t}\n}", "constructor(props){\n super(props);\n\n this.sem = {};\n for (var semester_id in this.props.sequence) {\n this.sem[semester_id] = createRef();\n }\n\n this.state = {\n sequence: this.props.sequence\n };\n\n this.actionAddSemester = this.actionAddSemester.bind(this);\n this.actionAddCourse = this.actionAddCourse.bind(this);\n this.actionRemoveCourse = this.actionRemoveCourse.bind(this);\n this.actionMoveCourse = this.actionMoveCourse.bind(this);\n this.convertYearAndSemesterToProgramSemesterId = this.convertYearAndSemesterToProgramSemesterId.bind(this);\n this.getCurrentAvailableYears = this.getCurrentAvailableYears.bind(this);\n }", "function grader (classId, assignmentId, studentId){\n let data = {grade: grade.value};\n if (isNaN(Number(data.grade)) || data.grade.length > 3) {\n return;\n }\n $.ajax({\n type: 'PUT',\n url: `/class/${classId}/${assignmentId}/${studentId}/grade`,\n data: JSON.stringify(data),\n dataType: \"json\",\n contentType: \"application/json\"\n });\n}", "function setCourseAssignmentStudents(courseAssignmentStudents) {\r\n localStorage.setItem(\"courseAssignmentStudents\", JSON.stringify(courseAssignmentStudents));\r\n}", "function listexternalsbysemester(req, res) {\r\n externalSchema.findOne({ semester: req.swagger.params.semester.value }, function (err, externalexam) {\r\n if (err)\r\n res.send(err);\r\n res.json(externalexam);\r\n });\r\n}", "function insertStudent(){\n fn = document.getElementById(\"fname\").value;\n ln = document.getElementById(\"lname\").value;\n //Parses a string into an integer.\n ps = parseInt(document.getElementById(\"passp\").value);\n ag = parseInt(document.getElementById(\"age\").value);\n ge = document.getElementById(\"gender\").value;\n gr = parseInt(document.getElementById(\"grade\").value);\n\n\n\n //Conditional statement - If there is an empty value then a message is displayed.\n if(fn == \"\" || ln == \"\" || ps == \"\" || ag == \"\"|| ge == \"\"|| gr == \"\" ){\n alert(\"Please fill all fields!\\nTo add a new student\");\n } else {\n //Save the input data into an object(global object).\n //Literal objecct\n objStudent = {firstName: fn, lastName: ln, passport: ps, age:ag, grade: gr};\n\n //Function with parameter - Query if the student already exist (by passport), returns a boolean\n var existStudent = ifExistStudent(objStudent);\n\n\n if (existStudent == true){\n alert(\"Sorry but this student already exist!\\nEnter another student\");\n }else{\n student.push(objStudent);\n\n //--REFRESH DATA--\n\n //Display list of original input.\n displayStudent();\n\n //create a copy the original array to sort from hights to lower grade.\n var copyStudent = student.slice(0);\n\n //save into a new array the sorted list by grade.\n var lastSortArray = sortByGradeHighest(copyStudent);\n\n //Display the last sorted list\n displaySortStudent(copyStudent);\n\n //BEST STUDENT//\n\n //this must have the highest grade object.\n var st = lastSortArray[0];\n //to get a value from an object, we write de obect.property\n var hGrade = st.grade;\n\n\n //display a list of student with the higher grade, it receive the order array + the best grade.\n findBestStudent(lastSortArray,hGrade);\n\n\n //WORST STUDENT//\n\n //create a copy the original array\n var copyStudent2 = student.slice(0);\n\n //save into a new array, sorted list by grade from lower to highest ;\n var sortArrayL = sortByGradeLowest(copyStudent2);\n\n //this must have the lower grade.\n var lg = sortArrayL[0];\n //to get a value from an object, we write de obect.property\n var lGrade = lg.grade;\n\n findWorstStudent(sortArrayL,lGrade);\n }\n }\n\n}", "updateYear() {\n O('year-label').innerHTML = this.year;\n }", "function updateAllCourses(data){\n for(var i in data){\n var table_row = data[i];\n if(table_row == undefined) return;\n if(table_row.grade[0] === \"F\"){\n loadCourseTableNextLevelPlus();\n return;\n }\n }\n loadCourseTableNextLevel();\n }", "function validateInputAdd()\n\t\t{\n\t\t\t\n\t\t\tvar courseName = document.getElementById(\"course_name\").value;\n\t\t\tvar courseL1 = document.getElementById(\"lDay1\").value.toUpperCase();\n\t\t\tvar courseL2 = document.getElementById(\"lDay2\").value.toUpperCase();\n\t\t\tvar startLec = document.getElementById(\"startL\").value;\n\t\t\tvar endLec = document.getElementById(\"endL\").value;\n\t\t\tvar courseT1 = document.getElementById(\"tDay1\").value.toUpperCase();\n\t\t\tvar courseT2 = document.getElementById(\"tDay2\").value.toUpperCase();\n\t\t\tvar startTut = document.getElementById(\"startT\").value;\n\t\t\tvar endTut = document.getElementById(\"endT\").value;\n\t\t\tvar courseLab1 = document.getElementById(\"labDay1\").value.toUpperCase();\n\t\t\tvar startLab = document.getElementById(\"startLab\").value;\n\t\t\tvar endLab = document.getElementById(\"endLab\").value;\n\t\t\tvar courseSemester = getSelectedSemester(\"semester\");\n\t\t\t\t\n\t\t\t\n\t\t\tvar validL1 = validDay(courseL1, \"lDay1\");\n\t\t\tvar validL2 = validDay(courseL2, \"lDay2\");\n\t\t\tvar validStartL = validTime(startLec, \"startL\");\n\t\t\tvar validEndL = validTime(endLec, \"endL\");\n\t\t\tvar validT1 = validDay(courseT1, \"tDay1\");\n\t\t\tvar validT2 = validDay(courseT2, \"tDay2\");\n\t\t\tvar validStartTut = validTime(startTut, \"startT\");\n\t\t\tvar validEndTut = validTime(endTut, \"endT\");\n\t\t\tvar validLab = validDay(courseLab1, \"labDay1\");\n\t\t\tvar validStartLab = validTime(startLab, \"startLab\");\n\t\t\tvar validEndLab = validTime(endLab, \"endLab\");\n\t\t\t\n\t\t\t\n\t\t\tvar isSemesterSelected = selectedSemester(\"semester\");\n\t\t\tvar lectureRequired = nonEmptyInput(courseL1, \"lDay1\");\n\t\t\tvar lectureStartRequired = nonEmptyInput(startLec, \"startL\");\n\t\t\tvar lectureEndRequired = nonEmptyInput(endLec, \"endL\");\n\t\t\tvar inputNonEmpty = lectureRequired && lectureStartRequired && lectureEndRequired;\n\t\t\t\n\t\t\tvar validInput = validL1 && validL2 && validStartL && validEndL && validT1 && validT2 && validStartTut && validEndTut && validLab && validStartLab && validEndLab && isSemesterSelected && inputNonEmpty;\n\t\t\t\n\t\t\treturn validInput;\n\t\t\t\n\t\t}", "getSchool() {\n return this.school;\n }" ]
[ "0.7819215", "0.70136034", "0.66827303", "0.6220493", "0.60968655", "0.58557254", "0.5674647", "0.56447023", "0.56235313", "0.5608952", "0.5540696", "0.5537522", "0.5533451", "0.55311793", "0.55180824", "0.55178875", "0.5502149", "0.549927", "0.5376453", "0.53597075", "0.5338498", "0.5295002", "0.5259904", "0.52587384", "0.525869", "0.5245652", "0.5228117", "0.5203842", "0.51920116", "0.5186437", "0.5175325", "0.51727057", "0.5148364", "0.5129477", "0.5128007", "0.50844264", "0.5066913", "0.5051485", "0.50469065", "0.5028249", "0.50170714", "0.49982527", "0.4990718", "0.49817815", "0.49741438", "0.49449208", "0.49423575", "0.49381962", "0.4922987", "0.49042758", "0.49019223", "0.48932028", "0.48599437", "0.48590901", "0.48552093", "0.48491094", "0.4845669", "0.4835356", "0.4822393", "0.4819828", "0.4819486", "0.4809853", "0.48041672", "0.48029605", "0.48013115", "0.48001218", "0.47992733", "0.47981325", "0.47906706", "0.4784989", "0.4782056", "0.4769268", "0.47657502", "0.47631645", "0.47611782", "0.47597253", "0.47527975", "0.475143", "0.47498572", "0.47459418", "0.47418126", "0.47354078", "0.47308138", "0.47297788", "0.47276324", "0.47240895", "0.4723249", "0.47163084", "0.47154248", "0.4712092", "0.47113636", "0.47066763", "0.47044092", "0.47042096", "0.4703526", "0.46939313", "0.4693004", "0.46869987", "0.46844727", "0.46841958" ]
0.6688955
2
a quick check to see if this origin can connect for now, we're taking 'em all!
function originIsBanned(origin) { //! TBD // we *may* want a black-list IP table for people who bomb us or otherwise mis-use... return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function originIsAllowed(origin) {\n\t//debido a que no se restringen clientes, no se realiza ningun tratamiento\n\treturn true;\n}", "function isConnect() {\n return !needWait;\n }", "function originIsAllowed(origin) {\n return true;\n if(origin === 'http://dbwebb.se' || origin === 'http://localhost') {\n return true; \n }\n return false;\n}", "function canConnect(source, target) {\n return rules.allowed('connection.create', {\n source: source,\n target: target\n });\n }", "function canConnect(source, target) {\n return rules.allowed('connection.create', {\n source: source,\n target: target\n });\n }", "function connected() {\n\t// return true;\n return navigator.connection.type != Connection.NONE;\n}", "function checkConnectionStatus() {\n if (!client.isConnected()) {\n connect();\n }\n}", "isConnected () {\n // TODO(ikajaste): It's possible this acutally returns true, make sure later\n return this.connection && this.connection.connected;\n }", "has_connections() {\n\t\t\treturn this.connected.length > 0\n\t\t}", "async _maybeConnect() {\n if (this._isConnectedOrConnecting) {\n return null;\n }\n\n this._isConnectedOrConnecting = true;\n await this.client.connect();\n }", "function thereAreConnections() {\n if (Object.keys(connections).length === 0) return false;\n return true;\n}", "function thereAreConnections() {\n if (Object.keys(connections).length === 0) return false;\n return true;\n}", "function checkConnection() {\n\t if (!window.tronWeb) {\n\t $('#connection-status').html('Not Connected to Tron');\n\t return false;\n\t }\n\t if (!window.tronWeb.defaultAddress.base58) {\n\t $('#connection-status').html('Not Connected to Tron');\n\t return false;\n\t }\n\t $('#connection-status').html('Connected to Tron');\n\t return true;\n\t}", "connected() {}", "function establish_peer_connection(tgtNode, proxyNode) { // tell proxyNode to introduce me tgtNode\n if (dc[tgtNode] && dc[tgtNode].readyState === \"open\") {\n return false; // conexion ya establecida\n }\n if (proxyNode === undefined)\n {\n proxyNode = handle_next(tgtNode, 0);\n if (proxyNode === id) {\n if (dc[successor] && (dc[successor].readyState === \"open\")) {\n proxyNode = successor;\n } else if (dc[boot] && (dc[boot].readyState === \"open\")) {\n proxyNode = boot;\n } else if (dc[successorNode] && (dc[successorNode].readyState === \"open\")) {\n proxyNode = successorNode;\n } else {\n return false; // sin candidato para proxyNode \n }\n }\n }\n console.info(\"ESTABLISH_PEER_CONNECTION: between me: \" + id + \"[\" + hash + \"]---> \" + proxyNode + \"[\" + Sha1.digest(proxyNode, bitwise) + \"] ---> \" + tgtNode + \"[\" + Sha1.digest(tgtNode, bitwise) + \"]\");\n console.log(\" \");\n\n if (tgtNode === proxyNode) { // localhost\n pc_loopback = new RTCPeerConnection(pc_config);\n setPcLoopback();\n setDcLoopback(dc_config, hash);\n pc_loopback.createOffer(gotLocalOffer, gotError, ms_config);\n } else {\n if (pc[tgtNode] === undefined) { // si tinc prioritat sempre podre crear un altre, per reconectar, en cas contrari si sh'ha perdut i no em busca donçs esta perdut \n pc[tgtNode] = new RTCPeerConnection(pc_config);\n setPcHandlers(tgtNode);\n setDcHandlers(tgtNode, Sha1.digest(tgtNode, bitwise), dc_config);\n pc[tgtNode].createOffer(gotLocalOffer, gotError, ms_config);\n } else {\n stillAlive(tgtNode);\n }\n }\n function gotLocalOffer(sdpOffer) {\n if (tgtNode === proxyNode) { // localhost\n pc_loopback.setLocalDescription(sdpOffer, gotSetOffer, gotError);\n } else {\n pc[tgtNode].setLocalDescription(sdpOffer, gotSetOffer, gotError);\n }\n }\n function gotSetOffer() { // wait answer \n\n var localOffer;\n var myVar = setInterval(function() {\n if (pc[tgtNode] && pc[tgtNode].remoteDescription !== undefined) {\n clearInterval(myVar); // connection already on progress en progress\n }\n console.info(\"TGT NODE : \" + tgtNode);\n console.log(pc[tgtNode]);\n\n if ((pc[tgtNode] && (navigator.mozGetUserMedia || pc[tgtNode].iceGatheringState === \"complete\")) || (tgtNode === id && (navigator.mozGetUserMedia || pc_loopback.iceGatheringState === \"complete\"))) {\n localOffer = (tgtNode === id) ? pc_loopback.localDescription : pc[tgtNode].localDescription;\n var tgtHash = Sha1.digest(tgtNode, bitwise);\n var msg = {\n type: \"lookup\", // aixo ja fa lo de buscar closest, buscara el node mateix en m hops \n rmi: \"establish\", // \n srcNode: id,\n srcHash: hash,\n tgtNode: tgtNode,\n tgtHash: tgtHash,\n msg: \"sdpOffer... I [\" + id + \"]:[\" + hash + \"] want to connect with [\" + tgtNode + \"]:[\" + tgtHash + \"]\",\n // default -> lookup & loopback utils\n proxyNode: proxyNode, // next step intermediary\n proxyStack: [id], // starting with self, afterward push... push\n path: [id], // stack of route taken\n hop: 0,\n // particular\n sdp: localOffer\n };\n\n // send localDescription to remoteNode & wait \n if (tgtNode === proxyNode) { // localhost // localhost // o try catch\n handle_peer_offerResponse(msg);\n } else {\n send(proxyNode, msg);\n }\n clearInterval(myVar);\n } else {\n console.log(\"waiting iceGatheringState to complete\");\n }\n }, 2000);\n }\n }", "function checkIsConnected() {\r\n if (_connectionState != Labs.ConnectionState.Connected) {\r\n throw \"API not initialized\";\r\n }\r\n }", "function hasGoodConnection() {\n\n var is_good = true;\n\n switch (navigator.connection.type) {\n\n case Connection.NONE:\n console.log('no internet connection');\n is_good = false;\n break;\n\n case Connection.UNKNOWN:\n console.log('unknown internet connection');\n is_good = false;\n break;\n\n //this would be great but Cell network info are not available on iOS\n //case Connection.CELL_2G:\n // console.log('2G connection too weak');\n // is_good = false;\n // break;\n //\n //case Connection.CELL:\n // console.log('Connection too weak');\n // is_good = false;\n // break;\n }\n //I assume the connection is good enough to load the map tiles\n return is_good;\n }", "function checkConnection(){\n viewModel.notOnline(!navigator.onLine);\n // requests next check in 500 ms\n setTimeout(checkConnection, 500);\n}", "get isConnected() {return false;}", "function connect() {\n window.ethereum\n .request({\n method: 'eth_requestAccounts'\n })\n .then(handleAccountsChanged)\n .catch((err) => {\n if (err.code === 4001) {\n // EIP-1193 userRejectedRequest error\n // If this happens, the user rejected the connection request.\n alert('Please connect to MetaMask.');\n } else {\n alert(err);\n }\n });\n }", "isConnected() {\n return this.connection && this.connection.isConnected;\n }", "_ensureConnected() {\n if (!this._instance) {\n throw new TypeError(\n 'You need to call `connect` method before calling any other methods'\n );\n }\n }", "function checkNetConnection() {\n\tvar status = window.navigator.onLine;\n\tif (status) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "connected() {\n // implement if needed\n }", "async function CheckInternetConnection() {\n result = await getRequest(\"http://pegelonline.wsv.de\");\n if (result == false) {\n drawError(translation.noInternetConnection);\n return false;\n }\n return true;\n}", "isConnected() { return this.accounts && this.accounts.length > 0; }", "function think()\n{\n\tif(!connected)\n\t\tconnect();\n}", "function isConnectionAvailable() {\n // Here we return true to make it convient for testing using web, and\n // also it will not impcat the function.\n var connection = navigator.connection;\n return !(connection && connection.type === Connection.NONE);\n }", "function checkConnection() {\n\t\n\t$('.no-connection').hide();\n\n\t//if no internet\n\tif(!window.connection) {\n\t\t/* ---------------------------------\n\t\t\tIF NO INTENET CONNECTION\t\n\t\t ---------------------------------*/\n\t\t//stop all loading stuff in the main page \n\t\tmainLoader('stop');\n\t\tvar detail \t= $('#message-detail').css('display');\n\t\tvar currentPage = $('.current-page').attr('id');\n\t\t\n\t\t//if no elemet in the field\n\t\tif(detail == 'none' && currentPage != 'compose') {\n\t\t\t$('.current-page').attr('id', 'list');\n\t\t\t//show no connection icon\t\n\t\t\t$('.no-connection').show();\n\t\t}\n\t\t\n\t\treturn false;\n\t}\n}", "function checkConnection(serviceName, socket, aCtr, ownSocket, messageProcessor) {\n\t\tfunction checkLoop(ctr) {\n\t\t\t// resolved socket is valid; send heart beat (containing own connection info) to client\n\t\t\t\n\t\t\tif (socket.isValid || (util.cordova && ownSocket.isValid)) {\n\t\t\t\t//console.log(\"connection stored with name: \" + serviceName);\n\n\t\t\t\t/* \n\t\t\t\t * Note for Cordova :\n\t\t\t\t * WebRTC is still an experimental technology. Setting up a socket can take some time.\n\t\t\t\t *\n \t\t\t\t * Optimization: Sockets are bidirectional hence we only need one.\n \t\t\t\t * Take the one that is the first to be connected with the remote actor.\n \t\t\t\t * If both are connected at the time of checking, choose the socket pointing to the actor with the smallest ip.\n \t\t\t\t * --> This \"protocol\" ensures both actors will choose the same socket in that particular case.\n\t\t\t\t */\n\n\t\t\t\tvar choosenSocket;\n\n\t\t\t\tif (util.cordova) {\n\n\t\t\t\t\tif (socket.isValid && ownSocket.isValid && typeof(connections[serviceName]) !== 'undefined')\n\t\t\t\t\t\tchoosenSocket = connections[serviceName]; // Both connections are still valid, stay with the same connection\n\t\t\t\t\telse if (socket.isValid && ownSocket.isValid)\n\t\t\t\t\t\tchoosenSocket = (isIpLesser(socket.hostName, ownSocket.hostName)) ? socket : ownSocket;\n\t\t\t\t\telse if (socket.isValid)\n\t\t\t\t\t\tchoosenSocket = socket;\n\t\t\t\t\telse if (ownSocket.isValid)\n\t\t\t\t\t\tchoosenSocket = ownSocket;\n\n\t\t\t\t\t/*\n\t\t\t\t\t * Close the other socket \n\t\t\t\t\t * --> could result in problems if the socket we are going to close is not yet valid (because the other peer won't see that it has been closed).\n\t\t\t\t\t */\n\t\t\t\t\t//if(choosenSocket === socket) ownSocket.close();\n\t\t\t\t\t//else socket.close();\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tchoosenSocket = socket;\n\n\t\t\t\tconnections[serviceName] = choosenSocket;\n\t\t\t\tvar objects = receptionist.getPublishedObjects();\n\t\t\t\t// notify newly added client all of all published objects\n\t\t\t\tfor (var typetag in objects){\n\t\t\t\t\tobjects[typetag].forEach(function (objectID) {\n\t\t\t\t\t\tvar nearReference = receptionist.getObjectReference(objectID).publicInterface;\n\t\t\t\t\t\tvar strategy = (nearReference.constructor == \"localFarReference\") ? \"by_reference\" : \"by_copy\";\n\t\t\t\t\t\tunicastObject(serviceName, strategy, objectID, typetag);\n\t\t\t\t\t});\n\t\t\t\t};\n\t\t\t\t// send messages from outbox of far reference to the client\n\t\t\t\tvar references = receptionist.getRemoteFarReferences(serviceName);\n\n\t\t\t\treferences.forEach(function (reference) {\n\t\t\t\t\treference.getOutbox().forEach(function(letter) {\n\t\t\t\t\t\tsendMessage(letter.message, letter.objectID, letter.futureID);\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\t// Send a heartbeat containing connection info to other client\n\t\t\t\tsendHeartbeat(serviceName);\n\t\t\t// client received a heartbeat from other client, resolve socket manually\n\t\t\t} else if (heartBeats[serviceName] && (ctr > 8)) {\n\t\t\t\t//console.log(\"using heartbeat info for: \" + serviceName);\n\t\t\t\tif (util.nodejs) {\n\t\t\t\t\tsocket = ambientModule.module.createTCPSocket();\n\t\t\t\t\tsocket.on('data', function(rawData) {\n\t\t\t\t\t\tmessageProcessor(message);\n\t\t\t\t\t});\n\t\t\t\t\tsocket.connect(heartBeats[serviceName], serviceName);\n\t\t\t\t\tsocket.isValid = true;\n\t\t\t\t} else {\n\t\t\t\t\tsocket = ambientModule.module.createTCPSocket({\n\t\t\t\t\t\thostName: serviceName,\n\t\t\t\t\t\tport: heartBeats[serviceName],\n\t\t\t\t\t\tmode: util.rw_mode\n\t\t\t\t\t});\n\t\t\t\t\tsocket.addEventListener('read', function(x) {\n\t\t\t\t\t\tmessageProcessor(message);\n\t\t\t\t\t});\n\t\t\t\t\tsocket.connect();\n\t\t\t\t}\n\t\t\t\tdelete heartBeats[serviceName];\n\t\t\t\tcheckLoop(0);\n\t\t\t}\n\t\t\t// keep waiting for valid socket connection for 30 seconds \n\t\t\telse if (ctr < 100) {\n\t\t\t\tsetTimeout(function(){checkLoop(ctr+1);}, 300);\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tif (aCtr)\n\t\t\tcheckLoop(aCtr);\n\t\telse\n\t\t\tcheckLoop(0);\n\t}", "is_connected() {\n return this.connected\n }", "function tryConnect() {\n // Get the selected ip and port\n var ipAddr = localStorage.getItem(\"ipAddress\");\n var port = localStorage.getItem(\"port\");\n \n if(ipAddr && port) {\n var WS_URL = 'ws://' + ipAddr + ':' + port;\n \n console.log(\"TRY CONNECT TO: \", WS_URL);\n \n var connection = new WebSocket(WS_URL);\n\n connection.onopen = function(evt) { onOpen(evt) };\n connection.onmessage = function(evt) { onMessage(evt) };\n connection.onerror = function(evt) { onError(evt) };\n connection.onclose = function(evt) { onClose(evt) };\n }\n else {\n console.error(\"IP OR PORT NOT SPECIFIED!\");\n chrome.browserAction.setIcon({path : {\n \"19\": \"icons/notConnected/notConnected19b.png\"\n }});\n }\n}", "hasOrigin() {\n return this.originJuggler != null;\n }", "hasOrigin() {\n return this.originJuggler != null;\n }", "canConnectTo(plug)\n\t{\n\t\tif (!this.canReplaceConnection(plug))\n\t\t\treturn false;\n\n\t\tif (this.node.tree.findConnections({inputPlug: plug}).length > 0)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "arePeersReady() {\n return this._readyState === true && this._remoteIsReady === true;\n }", "connect() {\n if (this.connected) {\n return;\n }\n this.connected = true;\n return this.emitEvent('connect', null);\n }", "function isConnected() {\r\n return _connectionState === Labs.ConnectionState.Connected;\r\n }", "function connect() {\n if (!started && localStream && channelReady) {\n createPeerConnection();\n started = true;\n peerConn.createOffer(setLocalAndSendMessage, createOfferFailed, mediaConstraints);\n } else {\n alert(\"Local stream not running yet - try again.\");\n }\n}", "_connectPeer () { \n // cb = cb || this._onConnection.bind(this)\n let onConnectionCb = this._onConnection.bind(this) // always need our onConnection callback to work properly\n\n if (this.closed) return false\n if (this.peers.length >= this._numPeers) return false\n let getPeerArray = [] // getPeerFuncs will be added here\n\n if (!process.browser) {\n // non-browser dns resolved connections: \n if (Array.isArray(this.dnsSeeds) && this.dnsSeeds.length > 0) {\n getPeerArray.push(this._connectDNSPeer.bind(this))\n }\n // non-browser static peers connections\n //if (this._tcpAddrs && this._freeAddrCount(this._tcpAddrs) > 0) {\n if (this.tcpAddrs && this.tcpAddrs.freeCount() > 0) {\n getPeerArray.push(this._connectStaticPeer.bind(this, onConnectionCb))\n }\n }\n /* pxp not supported:\n if (this._connectPxpWeb && !this.fConnectPlainWeb && this._exchange.peers.length > 0) {\n getPeerArray.push(this._exchange.getNewPeerCustom.bind(this._exchange))\n } */\n if (this.fConnectPlainWeb) {\n if (this.webAddrs && this.webAddrs.freeCount() > 0) {\n getPeerArray.push(this._getNewPlainWebPeer.bind(this))\n }\n }\n \n // user-defined function:\n if (this._params.getNewPeerCustom) {\n getPeerArray.push(this._params.getNewPeerCustom.bind(this._params))\n }\n \n if (getPeerArray.length === 0) { // could not find an addr to connect, let's retry in 8 sec\n this.connecting = false\n if (this.connectTimeout) {\n logdebug(`scheduling reconnection to peers in ${this.connectTimeout} ms`)\n setTimeout(() => {\n if (this.closed) return\n this.connecting = true\n logdebug(`resuming connecting to peers`)\n setImmediate(this.connect.bind(this))\n }, this.connectTimeout)\n }\n this._onConnection(Error(`No more methods available to get new peers for required ${this._numPeers} peers, current number ${this.peers.length}`))\n //logdebug(`No more methods available to get new peers for required ${this._numPeers} peers`);\n return false\n }\n let getPeerFunc = utils.getRandom(getPeerArray)\n logdebug(`_connectPeer: selected getPeerFunc is '${getPeerFunc.name}'`)\n getPeerFunc(onConnectionCb)\n return true\n }", "function isConnection() {\n return state.core.isConnection(state.nodes[_id].node);\n }", "function checkProxy(){\n var proxy = JonDoSwitcher.getProxy();\n if(proxy == \"JonDo\"){\n window.top.document.getElementById(\"enableJonDo\").style.display = \"none\";\n window.top.document.getElementById(\"jondo-switcher-message\").value = JonDoSwitcher.stringsBundle.GetStringFromName(\"connectedToJondo\") + \" \";\n // start socket connecting\n JonDoCommunicator.startSocketConnecting();\n }else if(proxy == \"Tor\"){\n window.top.document.getElementById(\"enableTor\").style.display = \"none\";\n window.top.document.getElementById(\"jondo-switcher-message\").value = JonDoSwitcher.stringsBundle.GetStringFromName(\"connectedToTor\") + \" \"; \n }else if(proxy == \"Direct\"){\n window.top.document.getElementById(\"disableAllProxies\").style.display = \"none\";\n window.top.document.getElementById(\"jondo-switcher-message\").value = JonDoSwitcher.stringsBundle.GetStringFromName(\"connectedDirectly\") + \" \"; \n }\n if(proxy != \"Unknown\"){\n clearInterval(checkProxyTimerObj);\n checkProxyTimerObj = null;\n // show survey info if not done already\n showSurveyInfo();\n }\n\tlet prefsBranch = prefsService.getBranch(\"extensions.jondoswitcher.\");\n if(prefsBranch){\n\t\tif(prefsBranch.getIntPref(\"switched_once\") == 0){\n\t\t\twindow.top.document.getElementById(\"alert_arrow\").hidden = false;\n\t\t}\n\t\t\n\t}\n}", "function customConnect() {\n resetZoom();\n if (!window.connect) {\n\n return;\n }\n\n if (!connectBtn.disabled) {\n connectBtn.disabled = true;\n } else {\n return false;\n }\n\n if (randomizeBackground) {\n randomBackground();\n }\n\n //Handle skin change options\n skinChange();\n //Need to reset this before trying to reconnect\n window.dead_mtm = - 1;\n if (selectedServer != '-1') {\n window.forcing = true;\n if (!window.bso) {\n window.bso = {};\n }\n }\n\n if (selectedServer == '-3') {\n //double check custom server entry\n manualServer = document.getElementById('server-manual-input').value;\n window.localStorage.setItem('server-manual', manualServer);\n var srv = manualServer.trim().split(':');\n if (validIP(srv[0])) {\n window.bso.ip = srv[0];\n window.bso.po = srv[1];\n } else {\n alert('The custom server you entered does not have a valid IP address format');\n document.getElementById('server-manual-input').focus();\n return false;\n }\n } else if (selectedServer == '-2') {\n var connectToServer = window.sos[Math.floor(Math.random() * window.sos.length)];\n window.bso.ip = connectToServer.ip;\n window.bso.po = connectToServer.po;\n selectedServer = connectToServer.ip + ':' + connectToServer.po;\n var selectSrv = document.getElementById('server-select').value = selectedServer;\n } else if (selectedServer != '-1') {\n var srv = selectedServer.trim().split(':');\n window.bso.ip = srv[0];\n window.bso.po = srv[1];\n }\n\n window.connect();\n setTimeout(connectionStatus, 1000);\n }", "function hasConnectionError() {\n\t\t\treturn settings.connectionError;\n\t\t}", "isOnline() {\n return new Promise((resolve, reject) => {\n send(this.ip, [0], (data, err) => {\n resolve(!!!err);\n })\n })\n }", "function isConnected() {\n var networkState = navigator.network.connection.type;\n\n //console.log(\"isConnected network state: \" + networkState);\n return (networkState !== Connection.NONE) && (networkState !== Connection.UNKNOWN);\n}", "static getConnection(origin) {\n const originString = origin.toString().toLowerCase();\n if (CoapClient.connections.has(originString)) {\n debug(`getConnection(${originString}) => found existing connection`);\n // return existing connection\n return Promise.resolve(CoapClient.connections.get(originString));\n }\n else if (CoapClient.pendingConnections.has(originString)) {\n debug(`getConnection(${originString}) => connection is pending`);\n // return the pending connection promise\n return CoapClient.pendingConnections.get(originString);\n }\n else {\n debug(`getConnection(${originString}) => establishing new connection`);\n // create a promise and start the connection queue\n const ret = DeferredPromise_1.createDeferredPromise();\n CoapClient.pendingConnections.set(originString, ret);\n setTimeout(CoapClient.workOffPendingConnections, 0);\n return ret;\n }\n }", "function connect() {\n ethereum\n .request({ method: 'eth_requestAccounts' })\n .then(handleAccountsChanged)\n .catch((err) => {\n if (err.code === 4001) {\n // EIP-1193 userRejectedRequest error\n // If this happens, the user rejected the connection request.\n console.log('Please connect to MetaMask.');\n } else {\n console.error(err);\n }\n });\n }", "validateConnection () {\n return !getReadOnly()\n }", "function checkAllowedOrigin(origin) {\n const allowedOrigins = process.env.ALLOWED_ORIGINS.split(\",\");\n return allowedOrigins.includes(origin);\n}", "function isConnected() {\n return user != null;\n }", "function ensureConnected(remote, callback) {\n\n if (isConnected(remote)) {\n callback(null, true);\n return;\n } else {\n attemptConnect(remote, callback);\n return;\n }\n\n}", "function tryConnect() {\n\tif (Connect.isConnect()) return;\n\tgetPage(\"http://mars2025.net/Advisor.aspx\",onStartMonitoringForCorrectUrl);\n\tgetPage(\"http://www.mars2025.net/Advisor.aspx\",onStartMonitoringForCorrectUrl);\n\tgetPage(\"http://www.mars2025.ru/Advisor.aspx\",onStartMonitoringForCorrectUrl);\n\tgetPage(\"http://mars2025.ru/Advisor.aspx\",onStartMonitoringForCorrectUrl);\n}", "attemptConnect() {\n ConnectionManager.connect();\n }", "function checkClientAlreadyConnected(request)\n { \n if (all_players_list[request.sessionID] != null)\n {\n request.session.player = all_players_list[request.sessionID];\n request.session.player['ref_count']++;\n console.log(\"This session (client \" + request.session.player.player_tag + \") is already connected. Increasing refcount to \" + request.session.player['ref_count']);\n return true;\n }\n return false;\n }", "beforeConnect(handshake, proceed) {\n console.log('Socket get connected');\n // `true` allows the socket to connect.\n // (`false` would reject the connection)\n return proceed(undefined, true);\n }", "function connect() {\n // supported by browser?\n if (!(\"WebSocket\" in window)) {\n log(\"WebSockets not supported by your Browser, this won't work\");\n return;\n }\n\n // ample orange\n document.getElementById('ample').classList.add('connecting');\n\n // disable btn\n document.getElementById('btn_connect').disabled = true;\n\n // get ip\n var ip = document.getElementById('ip').value;\n if(ip == \"\") ip = '127.0.0.1';\n\n // start connection\n socket = new WebSocket(\"ws://\"+ip+\":8080/smartphone\", \"v1.phonescoring.gr.ubisoft.com\");\n\n socket.onopen = function() {\n log('Step 0/3: connection open');\n noerror = true;\n\n // start\n getPhoneIdHandshake();\n };\n\n // wait for message - then continue\n socket.onmessage = function(e) {\n if(e.data != undefined) {\n parseMessage(e.data);\n //log(e.data);\n } else {\n log('unknown message type');\n }\n };\n\n socket.onerror = function() {\n noerror = false;\n log('error');\n retryConnection();\n };\n\n socket.onclose = function(e) {\n console.log(e);\n if(e.reason == 'CLOSE_MAX_PLAYERS_REACHED') {\n log('too many connections, try reloading the page');\n }else if(e.reason == 'CLOSE_PROTOCOL_ERROR') {\n log('closed by game, happens often - just wait it out');\n //retryConnection();\n } else if(e.code == 1006) {\n log('closed: is the game running on '+ip+'? firewall open?');\n //retryConnection();\n } else {\n log('closed with unexpected reason: '+e.reason);\n console.log(e);\n }\n };\n\n}", "function isConnected() {\n if (client === undefined) {\n return false;\n }\n return client.isConnected();\n }", "function isConnectEvent(event) {\n return event && event.type && (event.type === 'connected');\n}", "function authoriseNewConnection(mJSO, wsConnect) {\n\t\t// Parse URL and save which database the client requests to access.\n\t\t// Also save any query parameters. WARNING The query parameters are\n\t\t// stored in wsConnect.urlQuery WITHOUT BEING ESCAPED OR VALIDATED.\n\t\ttry {\n\t\t\tvar urlParams = parseURL(wsConnect.requestUrl);\n\t\t} catch (error) {\n\t\t\tsendMessage(wsConnect, mJSO.callbackID, false, 'The requested database is not readable');\n\t\t\tlog.info('parseURL failed, closing connection.', 'clientID:', wsConnect.connectionID, '; error:', error);\n\t\t\twsConnect.close();\n\t\t\treturn false;\n\t\t}\n\t\twsConnect.path2db = urlParams.path2db;\n\t\twsConnect.urlQuery = urlParams.query;\n\t\t// Extract last component of path2db - this is the db's name\n\t\twsConnect.dbName = urlParams.dbName;\n\n\n\t\t// load database-specific plugins\n\t\ttry {\n\t\t\tloadPluginConfiguration(wsConnect);\n\t\t} catch (error) {\n\t\t\t// It was not possible to load the configured plugin\n\t\t\tsendMessage(wsConnect, mJSO.callbackID, false, 'The requested database could not be loaded');\n\t\t\tlog.info('Plugin loader failed, closing connection.', 'clientID:', wsConnect.connectionID, '; Reason: ', error.message);\n\t\t\twsConnect.close();\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "function handleConnect(e) {\n if (e.kind === 'connect') {\n if (connectCallback) {\n connectCallback();\n }\n socket.emit('message', { id: id, kind: 'register' });\n return true;\n }\n\n return false;\n }", "checkConnectionStatus() {\n const connected = Meteor.status().connected;\n if (!connected) sAlert.error('Ingen tilkobling til server. Er du koblet til internett?');\n return connected;\n }", "async verifyConnection () {\n try {\n await this.client.checkConnect();\n this.connected = true;\n } \n catch (error) {\n console.log('Error connection to the Report Portal server');\n console.dir(error);\n this.connected = false;\n }\n }", "function doConnect() {\n\t\tif (typeof(name) == null) {\n\t\t\treturn;\n\t\t}\n\t\ttry {\n\t\t\tif (io !== undefined) {\n\t\t\t\tsocket = io.connect('ws://'+host+':'+port+'/');\n\t\t\t\tsynSocketID();\n\t\t\t\tsocket.on('connect', function (evt) { \n\t\t\t\t\tconsole.log(\"Connection opened\");\n\t\t\t\t\tonOpen(evt);\n\t\t\t\t\tsocket.on('disconnect', function (evt) { onDisconnect(evt) });\n\t\t\t\t\tsocket.on('message', function (evt) { onMessage(evt) });\n\t\t\t\t\tsocket.on('error', function (evt) { onError(evt) });\n\t\t\t\t});\n\t\t\t}\n\t\t} catch (e) {\n\t\t\t$('.connectionState').text(\"Not connected\");\n\t\t\t$('.connectionState').removeClass('connected');\n\t\t}\n\t}", "connectedCallback() {\n if (!this.isConnected) return;\n super.connectedCallback();\n \n }", "function connect(computerID) {\n conn = peer.connect(computerID);\n conn.on('open', function () {\n document.getElementById(\"sText\").innerHTML = \"Connecté\";\n document.getElementById(\"sIcon\").src = \"style/img/connected.svg\";\n imageInput.disabled=false;\n });\n\n conn.on('close', function () {\n document.getElementById(\"sText\").innerHTML = \"Déconnecté\";\n document.getElementById(\"sIcon\").src = \"style/img/disconnected.svg\";\n imageInput.disabled=true;\n });\n}", "socketsEmpty() {\n return this.playerMap.getActivePlayerCount() < 1;\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 }", "connect() {}", "function check_iconnection() {\n\n\n if (navigator.onLine) {\n\n\n } else {\n toaster(\"No Internet connection\");\n }\n}", "function check_iconnection() {\n\n\n if (navigator.onLine) {\n\n\n } else {\n toaster(\"No Internet connection\");\n }\n}", "function onSocketSecureConnect() {\n let data = _data.get(this);\n\n data.error = null;\n data.connected = true;\n\n _data.set(this, data);\n\n setImmediate(this.emit.bind(this, 'connected'));\n}", "function connect(receiverPeerId) {\r\n if (conn) {\r\n conn.close();\r\n alert('some connect is close')\r\n }\r\n conn = peer.connect(receiverPeerId, {\r\n reliable: true\r\n });\r\n state = `connected to remote peer ${receiverPeerId}`\r\n listen();\r\n\r\n}", "connect () {\n if (this.state == this.states.connected && this.socket.readyState == 'open')\n return\n\n if (!this.hasAuth())\n return this.fail('No auth parameters')\n\n this.state = this.states.connecting\n\n // To prevent duplicate messages\n this.clearSocketListeners()\n if (this.socket)\n this.socket.close()\n\n const url = this._buildUrl()\n this.socket = eio(url, this.options)\n this.socket.removeAllListeners('open')\n this.socket.removeAllListeners('error')\n this.socket.once('open', this.onOpen.bind(this))\n this.socket.once('error', (err) => {\n if (console && typeof(console.trace) == 'function') // eslint-disable-line\n console.trace(err) // eslint-disable-line\n\n if (err && err.type == 'TransportError') {\n this.fail(err)\n this._setupReconnect()\n }\n })\n }", "get isConnected() {\n return !!this.sender;\n }", "function manualConnection(){\n let path = document.getElementById(\"manualConnection\").value;\n\n if(path.length == 0 || path.indexOf(':') == -1){\n //TODO - make more apparent on the screen?\n console.log(\"Invalid path construction.\");\n return;\n }\n\n let i = path.indexOf(\"ws://\");\n if(i == -1){\n path = \"ws://\" + path;\n }\n else if( i != 0){\n //TODO - make more apparent on the screen?\n console.log(\"Invalid path, protocol cannot appear mid path.\")\n return;\n }\n\n console.log(\"Manual connection path ok with: \" + path)\n\n connect(path)\n}", "function connect() {\n \t\t\tvar deferred = _core.Deferred();\n \t\t\tconsole.log(\"Attempting to connect...\");\n \t\t\tvar c = null,\n \t\t\t\tix = -1,\n \t\t\t\thandshakeComplete = false,\n \t\t\t\t_\n\n \t\t\tfunction tryNext() {\n \t\t\t\tix+=1;\n \t\t\t\tif (ix < _preferredClients.length) {\n\n \t\t\t\t\tc = new _preferredClients[ix].class(_preferredClients[ix].name);\n \t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\tc.start(_uri, settings.hubs, {\n \t\t\t\t\t\tparseMessage : parseMessage,\n \t\t\t\t\t\tconnectionId : _connection ? _connection.getConnectionId() : null\n \t\t\t\t\t})\n \t\t\t\t\t\t.done(function(e) {\n\n \t\t\t\t\t\t\tconsole.warn(\"CONNECTION STABLISHED!\")\n\n \t\t\t\t\t\t\tc.onclose = function() {\n \t\t\t\t\t\t\t\tconsole.error(\"Connection was lost!!!! NOOOO!\");\n \t\t\t\t\t\t\t};\n\n \t\t\t\t\t\t\tif (_connection) {\n \t\t\t\t\t\t\t\tconsole.warn(\"[OOAOAAO] An existing connection exists! MÖÖÖRGE!\");\n \t\t\t\t\t\t\t}\n\n \t\t\t\t\t\t\t/// Connection successful.\n \t\t\t\t\t\t\t/// Hand over the connection lifecycle to a new OringConnection\n \t\t\t\t\t\t\t_connection = Object.create(OringConnection);\n \t\t\t\t\t\t\t_connection.onclose = function() {\n \t\t\t\t\t\t\t\tconsole.warn(\"_connection closed\");\n \t\t\t\t\t\t\t\tsetTimeout(connect, 50);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\t_connection.start(c, function(context) {\n \t\t\t\t\t\t\t\tconsole.warn(\"context\", context);\n \t\t\t\t\t\t\t\tdeferred.resolve(context);\n \t\t\t\t\t\t\t});\t\n\n \t\t\t\t\t\t\tif (e.message) {\n \t\t\t\t\t\t\t\t_connection.onmessage(e.message);\n \t\t\t\t\t\t\t}\n\n \t\t\t\t\t\t})\n \t\t\t\t\t\t.fail(function() {\n \t\t\t\t\t\t\tconsole.warn(\"Noo, \" + _preferredClients[ix].name + \" failed\");\n \t\t\t\t\t\t\ttryNext();\n \t\t\t\t\t\t});\n\n \t\t\t\t} else {\n \t\t\t\t\tconsole.log(\"All connection attempts failed. Will soon retry...\");\n \t\t\t\t\tdeferred.reject();\n \t\t\t\t}\n \t\t\t}\n\n \t\t\ttryNext();\n\n \t\t\treturn deferred.promise();\n \t}", "function connectionStatus() {\n if (!window.connecting || retry == 20) {\n window.forcing = false;\n retry = 0;\n connectBtn.disabled = false;\n return;\n }\n retry++;\n setTimeout(connectionStatus, 1000);\n }", "function corsControl(origin, callback) {\n if (origin && origin.includes(process.env.FRONTEND_URL_PATTERN)) {\n console.log(`${origin} is allowed`)\n callback(null, true)\n } else {\n console.error(`${origin} is not allowed`)\n callback(new Error('Not allowed by CORS'))\n }\n}", "_handleConnect(chainId) {\n if (!this._state.isConnected) {\n this._state.isConnected = true;\n this.emit('connect', { chainId });\n this._log.debug(messages_1.default.info.connected(chainId));\n }\n }", "function connect() {\n var target = $(\"#target-id\").val();\n conn = peer.connect(target);\n conn.on(\"open\", function () {\n updateConnectedTo(target);\n prepareMessaging();\n conn.on(\"data\", function (data) {\n displayMessage(data.message, data.timestamp, conn.peer);\n });\n console.log(conn);\n });\n}", "hasOrigin() {\n\t\treturn (this.origin.x < 0 && this.origin.x + this.width > 0)\n\t\t&& (this.origin.y < 0 && this.origin.y + this.height > 0);\n\t}", "isConnected() {\n return !this._connection._closed;\n }", "isConnected() {\n return !this._connection._closed;\n }", "isConnected() {\n return !this._connection._closed;\n }", "socketIsHost(socket) {\n return socket == this.hostSocket;\n }", "checkConnection() {\n var client = navigator;\n var container = this.component;\n\n if (!client.online) {\n\n container.show();\n\n container.html('<p>You are currently on any internet connection find a connection and try again</p>');\n\n } else{\n container.hide();\n }\n }", "function isOriginAllowed(requestOrigin) {\r\n var allowed = false;\r\n _.each(allowedOrigins, function (origin) {\r\n return !(allowed = origin.test(requestOrigin));\r\n });\r\n return allowed;\r\n}", "static tryToConnect(target) {\n return __awaiter(this, void 0, void 0, function* () {\n // parse/convert url\n if (typeof target === \"string\") {\n target = Origin_1.Origin.parse(target);\n }\n else if (!(target instanceof Origin_1.Origin)) { // is a URL\n target = Origin_1.Origin.fromUrl(target);\n }\n // retrieve or create the connection we're going to use\n try {\n yield CoapClient.getConnection(target);\n return true;\n }\n catch (e) {\n debug(`tryToConnect(${target}) => failed with error: ${e}`);\n if (\n // DTLSv1.2: invalid password\n /bad_record_mac/.test(e.message)\n // DTLSv1.3: invalid identity\n || /unknown_psk_identity/.test(e.message)) {\n return \"auth failed\";\n }\n else if (/(dtls handshake timed out|enotfound)/i.test(e.message)) {\n // The other party could not be reached or has no DTLS server running\n return \"timeout\";\n }\n else {\n return e;\n }\n }\n });\n }", "isproxy() {\n return this.state == PROXY;\n }", "function internet_is_reachable() {\n // TODO: this\n return true;\n}", "function isSameOriginEvent( event ) {\n\n\t\ttry {\n\t\t\treturn window.location.origin === event.source.location.origin;\n\t\t}\n\t\tcatch ( error ) {\n\t\t\treturn false;\n\t\t}\n\n\t}", "function handle_outbound_server_connect() {\n\tvar id;\n\n\tif (this.is_connected) {\n\t\tumode_notice(USERMODE_ROUTING,\"Routing\",\"Connected! Sending info...\");\n\t\tthis.send(format(\"PASS %s :TS\\r\\n\", this.cline.password));\n\t\tthis.send(\"CAPAB \" + SERVER_CAPAB + \"\\r\\n\");\n\t\tthis.send(\"SERVER \" + ServerName + \" 1 :\" + ServerDesc +\"\\r\\n\");\n\t\tid = Generate_ID();\n\t\tUnregistered[id] = new Unregistered_Client(id,this);\n\t\tUnregistered[id].server = true; /* Avoid recvq limitation */\n\t\tUnregistered[id].ircclass = this.cline.ircclass;\n\t\tUnregistered[id].cline = this.cline;\n\t\tthis.callback_id = this.on(\"read\", Socket_Recv);\n\t\treturn true;\n\t}\n\n\tif (YLines[this.cline.ircclass].connfreq > 0 && parseInt(this.cline.port) > 0) {\n\t\tumode_notice(USERMODE_ROUTING,\"Routing\",format(\n\t\t\t\"Failed to connect to %s (%s). Trying again in %d seconds.\",\n\t\t\tthis.cline.servername,\n\t\t\tthis.cline.host,\n\t\t\tYLines[this.cline.ircclass].connfreq\n\t\t));\n\t\tReset_Autoconnect(this.cline, YLines[this.cline.ircclass].connfreq * 1000);\n\t} else {\n\t\tumode_notice(USERMODE_ROUTING,\"Routing\",format(\n\t\t\t\"Failed to connect to %s (%s).\",\n\t\t\tthis.cline.servername,\n\t\t\tthis.cline.host\n\t\t));\n\t}\n\n\tthis.close();\n\n\treturn false;\n}", "function isNetworkAvailable(){\n var networkState = navigator.connection.type;\n alert(networkState);\n if(networkState == Connection.NONE){\n return false;\n }\n return true;\n}", "function checkPartnerX(callback) {\n origin.create(callback, { url: \"/doesntexist\" });\n }", "function acceptConnection(socket) {\n}", "function connection_online() {\n // Unblock.\n }", "function _metaConnect(message) {\n // console.log('_metaConnect');\n if ($.cometd.isDisconnected()) {\n // console.log('_metaConnect.cometd.isDisconnected()');\n _connected = false;\n _connectionClosed();\n return;\n }\n\n var wasConnected = _connected;\n _connected = message.successful === true;\n\n if (!wasConnected && _connected) {\n // console.log('_metaConnect.connectionSucceeded()');\n _connectionSucceeded();\n } else if (wasConnected && !_connected) {\n // console.log('_metaConnect.connectionBroken()');\n _connectionBroken();\n }\n }", "onConnect() {\n this.state = constants_1.SocksClientState.Connected;\n // Send initial handshake.\n if (this._options.proxy.type === 4) {\n this.sendSocks4InitialHandshake();\n }\n else {\n this.sendSocks5InitialHandshake();\n }\n this.state = constants_1.SocksClientState.SentInitialHandshake;\n }", "function connect(connectCallback){\n console.log(\"+++ in connect..\");\n\n mySolace.connect(connectCallback);\n\n }", "async function connect() {\n try {\n if (getWeb3()) {\n // function that periodically checks the chain state\n async function checkChain() {\n try {\n if (await verifyChainId(process.env.REACT_APP_CHAIN_ID)) {\n setChainState(CHAIN_STATE.CONNECTED);\n } else {\n setChainState(CHAIN_STATE.WRONG_CHAIN);\n }\n } catch (e) {\n console.error(e);\n // Stop the periodical chain check\n clearInterval(env.chainCheckIntervalId);\n setChainState(CHAIN_STATE.CHAIN_UNKNOWN);\n }\n }\n\n env.chainCheckIntervalId = setInterval(checkChain, 500);\n checkChain();\n } else {\n setChainState(CHAIN_STATE.DISCONNECTED);\n }\n } catch (error) {\n console.log(error);\n setChainState(CHAIN_STATE.DISCONNECTED);\n }\n }" ]
[ "0.7028714", "0.6715859", "0.6619467", "0.6592037", "0.6585695", "0.64976555", "0.648955", "0.63038194", "0.62987506", "0.6252887", "0.6227315", "0.6227315", "0.6170909", "0.6166181", "0.6154557", "0.61509705", "0.6117818", "0.6117778", "0.60295653", "0.60195005", "0.6016532", "0.6004241", "0.5981945", "0.5968781", "0.59352225", "0.5921864", "0.59193623", "0.5916354", "0.5915761", "0.5899231", "0.58743846", "0.5870748", "0.58691853", "0.58691853", "0.5868412", "0.58604825", "0.58536667", "0.5829112", "0.5828005", "0.5823574", "0.5817501", "0.5814473", "0.5805552", "0.5792009", "0.5768571", "0.5762613", "0.57607234", "0.574891", "0.5742421", "0.5720478", "0.57204056", "0.5707631", "0.569731", "0.5683297", "0.5679065", "0.56778497", "0.5666838", "0.56649464", "0.56616217", "0.5659121", "0.5654381", "0.5637964", "0.5625305", "0.56116825", "0.5608627", "0.55997574", "0.55989283", "0.5598369", "0.55982524", "0.55959165", "0.55959165", "0.5595645", "0.55868095", "0.55764854", "0.557046", "0.5561851", "0.5552571", "0.5551449", "0.5549265", "0.55268675", "0.55146396", "0.5511085", "0.5507207", "0.5507207", "0.5507207", "0.55062574", "0.5492309", "0.5487761", "0.5474258", "0.54730827", "0.5466898", "0.5465816", "0.5464314", "0.5453697", "0.54500544", "0.544789", "0.5445388", "0.54417187", "0.54393697", "0.54377306", "0.54230267" ]
0.0
-1
placeholder for session cleanup
function endSession(inSessionID) { console.log("ending session"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sessionCleanup() {\n\n\t}", "function onSessionEnded(sessionEndedRequest, session) {\r\n \r\n\r\n // Add any cleanup logic here\r\n}", "function destroy() {\n devlog.channel('iscSessionStorageHelper').debug( 'iscSessionStorageHelper.destroy');\n $window.sessionStorage.removeItem('loginResponse');\n $window.sessionStorage.removeItem('sessionTimeoutCounter');\n $window.sessionStorage.removeItem('showTimedOutAlert');\n $window.sessionStorage.removeItem('config');\n }", "function logout() {\n\n if ( checkProtocol('ws') || SERVERLESS ) return;\n\n if ( SESSION.id ) {\n\n // XHR\n send({ action: 'remove', data: SESSION.id }, function(){\n\n // beforeunload callback\n if ( QUEUE.length ) {\n\n delete SESSION.id;\n\n executeQueue( QUEUE );\n }\n });\n\n } else {\n\n executeQueue( QUEUE );\n }\n }", "function cleanup() {\n\t try {\n\t global.localStorage.removeItem(localStorageNamespace);\n\t } catch (_) {\n\t // nothing to do\n\t }\n\t}", "function finalize() {\n sys.puts(\"\");\n assert.equal(loadedPlaylistsCounter, session.playlists.length);\n session.logout(assert.ifError);\n }", "function userCleanup() {\n\n\t}", "end() {\n store.commit(SESSION_CLEAR);\n }", "logout() {\n return __awaiter(this, void 0, void 0, function* () {\n this.store = new SessionStore();\n });\n }", "clearSession() {\n this._clearSessionInStorage();\n\n this._session = {};\n }", "static logout() {\n AuthService.clearSession();\n clearTimeout(tokenRenewalTimeout);\n }", "function cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {\n // nothing to do\n }\n}", "function cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {\n // nothing to do\n }\n}", "function cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {\n // nothing to do\n }\n}", "function cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {\n // nothing to do\n }\n}", "function cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {\n // nothing to do\n }\n}", "function cleanup() {\n try {\n global.localStorage.removeItem(localStorageNamespace);\n } catch (_) {\n // nothing to do\n }\n}", "function cleanupPreviousSession(){\n\t\t\t\tlogger.debug(\"cleanupPreviousSession\", \"...\");\n\t\t\t\tlogger.debug(\"cleanupPreviousSession\", \"chatInstanceReady=\"+chatInstanceReady\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" collaborationInstanceReady=\"+collaborationInstanceReady\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" windowState = \" + windowState);\n\t\t\t\tif(windowState == windowStateType.DESTRUCTION){\n\t\t\t\t\tif(chatInstanceReady && collaborationInstanceReady){\n\t\t\t\t\t\tlogger.debug(\"cleanupPreviousSession start to clean previous session\", \"...\");\n\t\t\t\t\t\tif(collaborationApi)\n\t\t\t\t\t\t\tcollaborationApi.stopSession();\n\t\t\t\t\t\tif(chat)\n\t\t\t\t\t\t\tchat.disposeVisitor();\n\t\t\t\t\t\tchatOverHandler();\n\t\t\t\t\t\tdeleteAPI_instance();\n\t\t\t\t\t\tsessionMgr.stop();\n\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\tlogger.debug(\"cleanupPreviousSession complete cleaning previous session\", \"...\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlogger.debug(\"cleanupPreviousSession not ready to clean up previous session\", \"...\");\n\t\t\t\t}\n\t\t\t}", "function handleSessionExpiration() {\n const tick = 1000 * 60; // 1 min\n const timeout = 1000 * 600 // 10 min\n const sessionCleaner = createSessionCleaner({ timeout });\n setTimeout(\n sessionCleaner.cleanSession.bind(sessionCleaner), tick);\n}", "function _destroy() {\n token = undefined;\n authStore.destroy();\n }", "end() {\n this.session.close();\n }", "onUnload(callback) {\n try {\n this.log.info('Cleaned everything up...');\n clearInterval(this.timer);\n this.timer = null;\n clearTimeout(this.loginTimer);\n this.loginTimer = null;\n callback.bind(this)();\n }\n catch (e) {\n callback.bind(this)();\n }\n }", "function onSubscriptionEnded() {\n session = null;\n }", "_destroy() {}", "function cleanup() {\n\t\t\t\ttry {\n\t\t\t\t\t// do the cleanup\n\t\t\t\t\tKilauea.removeEvent(node, type, fn, capt);\n\t\t\t\t\t// cleanup the cleanup\n\t\t\t\t\tKilauea.removeEvent(window, 'unload', cleanup);\n\t\t\t\t\tnode = type = fn = null;\n\t\t\t\t} catch (e) {\n\t\t\t\t\t// tinyMCE: IE may produce access denied exception on unload\n\t\t\t\t}\n\t\t\t}", "sclear() {\n sessionStorage.clear()\n }", "function onSessionEnded(sessionEndedRequest, session) {\n // console.log(\"onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}\");\n // Add cleanup logic here\n}", "cleanup() {\n\n\t}", "unload() {}", "clearSession() {\n this.withMixpanel(() => {\n // Clears entire session\n // This should be called only on LOGOUT and not in mid-session.\n if (mixpanel.cookie && mixpanel.cookie.clear) {\n mixpanel.cookie.clear();\n this._sessionInitialized = false;\n }\n });\n }", "function _clear() {\n $window.sessionStorage.clear();\n }", "cleanup() {}", "cleanup() {}", "function deleteSession() {\n\tsessionStorage.clear();\n}", "logout() {\n // destroy the session\n localStorage.removeItem('session');\n }", "destroy() { /* There are no resources to clean up on MySQL server */ }", "function clearSession() {\n sessionStore.clear();\n }", "endSession() {\r\n this.endScript();\r\n this.cycler.endSession();\r\n }", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n\n}", "static clearSession() {\n localStorage.removeItem(KEY.ACCESS_TOKEN);\n localStorage.removeItem(KEY.ID_TOKEN);\n localStorage.removeItem(KEY.EXPIRES_AT);\n }", "internalCleanup() {\n\n }", "doLogout() {\n this.user = null;\n }", "sessionCLose() {\n localStorage.removeItem(\"user\");\n }", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId + \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId + \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId + \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function endSession(id) {\n\tdelete sessions[id];\n\tdelete remotes[id];\n\tclearTimeout(timers[id]);\n\tdelete timers[id];\n}", "reset() {\n console.log(\"session cleared\");\n localStorage.removeItem(this.getStorageKey());\n }", "cleanup() {\n\t\tclearTimeout(this._expirationTimer);\n\n\t\tif (this._stream) {\n\t\t\tthis._stream.abort();\n\t\t}\n\n\t\tthis._particle.deleteCurrentAccessToken({\n\t\t\tauth: this._accessToken\n\t\t});\n\t}", "function onSessionEnded(sessionEndedRequest, session) {\r\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\r\n \", sessionId=\" + session.sessionId);\r\n // Add cleanup logic here\r\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\r\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\r\n // Add cleanup logic here\r\n}", "logout() {\n this._userId = null\n this._userToken = null\n this._userUsername = null\n\n sessionStorage.clear()\n }", "remove () {\n // cleanup\n }", "destroy(){\n log.silly('Session.destroy:', `Session ${this.name}`);\n let deleted = 0;\n let ret = 1;\n\n for(let stage of this.get_stages()){\n // dump(stage, 1);\n\n if(stage.status === 'RETRYING'){\n log.silly('Session.end:', `${this.name}:`,\n `stage: ${stage.origin}:`,\n `Stage retrying, not removing`);\n ret = 0;\n continue;\n }\n\n // status is CONNECTED, DISCONNECTED, or END\n log.silly('Session.destroy:', `${this.name}:`,\n `Stage: \"${stage.origin}\"/${stage.status}:`,\n `Ending stage`);\n let stream = stage.stream;\n try{\n if(stage.on_disc){\n // // log.info('end:', stream.listenerCount(\"end\"));\n // stream.removeListener(\"end\", stage.on_disc[\"end\"]);\n // // log.info('end:', stream.listenerCount(\"end\"));\n\n // log.info('close:', stream.listenerCount(\"close\"));\n stream.removeListener(\"close\", stage.on_disc[\"close\"]);\n // log.info('close:', stream.listenerCount(\"close\"));\n\n // log.info('error:', stream.listenerCount(\"error\"));\n stream.removeListener(\"error\", stage.on_disc[\"error\"]);\n // log.info('error:', stream.listenerCount(\"error\"));\n }\n if(stage.status !== 'END' && stream){\n stream.end();\n // stream.destroy();\n deleted++;\n }\n } catch(err){\n log.info(`Session.destroy: ${this.name}: Could not terminate stage:`,\n `\"${stage.origin}\"/${stage.status}:`, dumper(err, 3));\n }\n\n stage.status = 'END';\n }\n\n log.verbose('Session.destroy:', `${this.name}:`,\n `deleted ${deleted} streams`);\n this.status = 'DESTROYED';\n\n this.events.push({ event: 'DESTROY',\n timestamp: new Date().toISOString(),\n message: \"Session destroyed\",\n content: ''});\n\n if(this.track){\n log.silly('Session.destroy:', `${this.name}:`,\n `Tracking session for ${this.track} seconds`);\n setTimeout(() => this.emit('destroy'), this.track * 1000);\n } else {\n this.emit('destroy');\n }\n\n // return OK if no stage is retrying\n return ret;\n }", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function logout() {\n tokenStore['igtoken'] = undefined;\n }", "function logout() {\n sessionStorage.clear(); \n}", "function deleteSession() {\n localStorage.clear();\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId+ \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "onDestroy() {}", "cleanup() {\n debug(\"cleanup\");\n this.subs.forEach((subDestroy) => subDestroy());\n this.subs.length = 0;\n this.decoder.destroy();\n }", "async init() {\n try {\n const url_params = Object.fromEntries(new URLSearchParams(document.location.search)); \n const session = await fetch(\n \"session\",\n {\n method: 'POST',\n headers: { 'content-type': 'application/json' },\n body: JSON.stringify(url_params),\n });\n this.session = await session.json();\n } catch(e) {\n throw new Error(\"Unable to fetch session\", e);\n }\n // splice session into metadata (overriding existing values)\n this.metadata = {\n ...this.metadata,\n ...this.session\n };\n\n // set up unload handler\n window.addEventListener('unload', () => {\n const status = this.session.status;\n if (status != \"submitted\" && status != \"assigned\") {\n this.updateStatus(\"abandoned\");\n }\n });\n\n \n }", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(`onSessionEnded requestId=${sessionEndedRequest.requestId}, sessionId=${session.sessionId}`);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add Cleanup logic here\n}", "function cleanupSessionStorage() {\n if (!window.name || window.name == \"null\") {\n window.name = makeid(32);\n }\n if (sessionStorage.getItem('windowName') != window.name) {\n let keys = Object.keys(sessionStorage);\n for (let i in keys) {\n let k = keys[i];\n if (!k.match(/^persist-/)) {\n sessionStorage.removeItem(k);\n }\n }\n }\n sessionStorage.setItem('windowName', window.name);\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId +\n \", sessionId=\" + session.sessionId);\n // Add cleanup logic here\n}", "unlisten() {\n this.session.removeListener('changed', this[cookieChangedHandler]);\n ipcMain.removeListener('open-web-url', this[openSessionWindowHandler]);\n ipcMain.removeHandler('cookies-session-get-all');\n ipcMain.removeHandler('cookies-session-get-domain');\n ipcMain.removeHandler('cookies-session-get-url');\n ipcMain.removeHandler('cookies-session-set-cookie');\n ipcMain.removeHandler('cookies-session-set-cookies');\n ipcMain.removeHandler('cookies-session-remove-cookie');\n ipcMain.removeHandler('cookies-session-remove-cookies');\n app.removeListener('certificate-error', this[handleCertIssue]);\n this[sessionValue] = null;\n }", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}", "function onSessionEnded(sessionEndedRequest, session) {\n console.log(\"onSessionEnded requestId=\" + sessionEndedRequest.requestId\n + \", sessionId=\" + session.sessionId);\n\n // Add any cleanup logic here\n}" ]
[ "0.87085104", "0.73043585", "0.7226283", "0.6695622", "0.6687954", "0.6638293", "0.6618317", "0.6607023", "0.65912706", "0.65897495", "0.65670425", "0.6545758", "0.6545758", "0.6545758", "0.6545758", "0.6545758", "0.6545758", "0.65450233", "0.65431976", "0.65061045", "0.6494422", "0.6489659", "0.6460926", "0.64584243", "0.6450286", "0.6440411", "0.64285356", "0.6425244", "0.64226806", "0.64122754", "0.6409717", "0.64001274", "0.64001274", "0.6395549", "0.6384808", "0.6369763", "0.63518214", "0.6347882", "0.633434", "0.6325574", "0.63253605", "0.6311492", "0.63101566", "0.62887585", "0.62887585", "0.62887585", "0.628802", "0.6277403", "0.6267141", "0.6248584", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.62459105", "0.624506", "0.62308747", "0.6227396", "0.6223229", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6221354", "0.6218069", "0.62097055", "0.6203847", "0.61917096", "0.61808234", "0.61782575", "0.617157", "0.6168678", "0.61663437", "0.6163777", "0.61530477", "0.61530477", "0.6151934", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417", "0.61385417" ]
0.0
-1
every 5 seconds remove demo user from
function getRandom(arr) { const idx = Math.floor(Math.random() * arr.length); return arr[idx] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clearUser(){\n this.dettachListeners(); \n this.user = null;\n }", "function deleteUser() {\n playersRef.child(thisIsPlayerNumberX).remove();\n // disableGamePlay();\n}", "static removeUser() {\n localStorage.removeItem('userInfo');\n }", "deleteUser() {\n this.deleteBox.seen = true\n }", "function toClearUser() {\r\n $('.people-slider-message').remove(); \r\n $('.user-name').remove(); \r\n $('.user-position').remove(); \r\n $('.user-photo').remove(); \r\n}", "function removeUser(socketid){\n for(let i = 0; i < users.length; i++){\n if(users[i].id === socketid ) {\n let uname = users[i].user_name;\n users.splice(i,1);\n io.emit(\"chat message\", socketid, createFullMessage(socketid,\"Server\",`${uname} has disconnected`),userColor);\n io.emit(\"updateUserList\", users);\n }\n }\n}", "async remove() {\n // this function is really just a wrapper around axios\n await axios({\n url: `${BASE_URL}/users/${this.username}`,\n method: \"DELETE\",\n data: {\n token: this.loginToken\n }\n });\n }", "function remove() {\n // REMOVE FROM DB\n let uid = $rootScope.account.authData.uid;\n $rootScope.db.users.child(uid).remove();\n }", "removeUser(username) {\n for (let i = this.chatUsersDB.length - 1; i >= 0; --i) {\n if (chatUsersDB[i].username === username) {\n chatUsersDB.splice(i, 1);\n }\n }\n }", "function timeToLiveCleanup(onlineUserList, i)\n{\n\n var toDelete = [];\n\n var now = Date.now();\n\n for (let r = 0; r < onlineUserList.length; r++) {\n const data = onlineUserList[r];\n\n if(now - ttlMilliseconds > data.lastCheck) toDelete.push(r);\n }\n\n //console.log(toDelete);\n\n var spliceOffset = 0;\n var aux = \"\";\n \n toDelete.forEach(index => {\n\n aux += onlineUserList[index].playerData.nick + \" - \";\n\n onlineUserList.splice(index + spliceOffset, 1);\n\n if(i >= index)\n spliceOffset--;\n });\n\n if(toDelete.length > 0) \n {\n console.log(\"CLEANUP :\" + aux);\n }\n\n return spliceOffset;\n}", "destroyUserLS() {\n localStorage.removeItem('logedUser');\n }", "function userDisconnet(socketId, userName) {\n\t//console.log(\"socketId(\" + socketId + \") disconnect user \" + userName);\n\tdelete arena.users[socketId];\n}", "function wipe(username) {\n Session.remove({ username: username}, (err) => {\n console.log(`[SESSION] something wrong with session for ${username}`);\n });\n}", "function removeUserFromSettings(uuid) {\n if (selectedUserUUID === uuid) { // targeted user with yellow overlay\n deselectUserOverlay(uuid);\n }\n if (activeTargetUUID === uuid) { // is listening to this user\n stopListening();\n }\n var settingsUsersListIndex = getIndexOfSettingsUser(uuid);\n if (settingsUsersListIndex !== -1) {\n if (settings.users[settingsUsersListIndex].overlayID) {\n deleteOverlay(uuid);\n }\n settings.users.splice(settingsUsersListIndex, 1);\n doUIUpdate();\n }\n }", "async function removeExpUser(name) {\n isCon = await init_connection();\n if(!isCon) return null;\n\n var id = await getIdUser(name);\n var sql = `DELETE FROM \\`experience\\` WHERE \\`user_id\\` = '${id}'`;\n const result = await query_db(sql);\n close_connection();\n return result;\n}", "function erase_users(options, completed, failed) {\n db.users.erase_db(function(removed_data){\n // console.log(removed_data);\n completed(removed_data);\n });\n}", "function removeUser(user_name) {\r\n var user_list = document.getElementById('user_list');\r\n var el_name = document.getElementById(user_name);\r\n\r\n user_list.removeChild(el_name);\r\n}", "function clearUser() {\n service.myself = null;\n service.amAdmin = null;\n LocalStorageService.removeToken();\n\n $rootScope.$broadcast('logout');\n }", "deleteUser(username){\n console.log(\"deleteUser called\");\n \n for (var i = 0; i < this.users.length; i++){\n if (this.users[1] === username){\n let tmp = this.users[i];\n this.users[i] = this.users[0];\n this.users[0] = tmp;\n this.users.shift();\n return;\n }\n }\n }", "function removeOnlineUsers(nickname) {\n $('#' + nickname + '').remove();\n }", "removeUser(req, res){\n \n }", "function timeOut() {\n for(var docName in documentDict) {\n for(var userName in documentDict[docName].users) {\n documentDict[docName].users[userName].timeout -= 5000;\n if (documentDict[docName].users[userName].timeout <= 0) {\n removeUser(docName, userName);\n console.log('user ' + userName + ' disconnected (timeout)');\n }\n }\n }\n}", "function userGone(details) {\n log_d(\"Got user left for user with details: \" + JSON.stringify(details));\n $('#userFeed' + details.userId).html('').remove();\n}", "async function destroy(username) {\r\n await request\r\n .del(reqURL(`${config.routes.user.delete}/${username}`))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`destroy:${username}`);\r\n}", "function removeUser() {\n UserModel.remove({ _id: '5ccc467de09f3f3b9de92446' }, function(err, user) {\n console.log('remove', err, user)\n })\n}", "remove (user, callback) {\n\t\tthrow new Error ('Not yet implemented');\n\t}", "function onUserOut(id) {\n\n for(var i=0; i<users.length; i++) {\n\n if (users[i].bodyId == id) {\n users[i].line.remove();\n users.splice(i, 1);\n break;\n }\n }\n}", "removeUser(user) {\n this.active_list = this.active_list.filter((a_user) => a_user.email !== user.email);\n this.setValue(this.active_list);\n }", "function remove(user_id) {\n MongoClient.connect(\"mongodb+srv://rankylau:18369012@cool-nfey6.mongodb.net/test?retryWrites=true\", function (err, client) {\n var db = client.db('Cool');\n db.collection('offences').remove({\"user_id\":user_id + \"\"});\n if (!err) {\n console.log(\"We are connected\");\n }\n client.close()\n });\n}", "function deleteActiveUser(delActiveUser) {\n alert(\"User \" + activeUser.nome + \" (\" + activeUser.numero + \") successfully logged out.\");\n localStorage.removeItem(\"ActiveUser\");\n resetVariables();\n}", "function removeUser(offline) {\n if($(\"#online_\" + offline.id).length) {\n $(\"#online_\" + offline.id).remove();\n }\n}", "function delete_user() {\n\tvar uri = \"http://localhost:8081/\" + user.accountType + \"s/\" + user.id;\n\tvar xhr = createRequest(\"DELETE\", uri);\n\txhr.onload = function() {\n\t\tif(xhr.status == 400) alert(\"Format Error\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong :/\");\n\t\telse {\n\t\t\tlocalStorage.removeItem(\"user\");\n\t\t\twindow.location.href = \"/\";\n\t\t}\n\t}\n\txhr.send();\n}", "function onceClearUser(err) {\n if (err) console.log(err);\n\n\n for (var i = 0; i < users_json.length; i++) {\n var json = users_json[i];\n var user = new models.User(json);\n\n user.save(function(err, user) {\n if (err) console.log(err);\n\n userIDs.push({\n \"id\": user._id,\n \"username\": user.username\n });\n\n users_to_save_count--;\n console.log(users_to_save_count + ' users left to save');\n checkCanClose();\n });\n }\n }", "function logoutPurge() {\n \n // purge of new User and current User values\n newUser.userId = 0; currentUser.userId = 0;\n newUser.firstName = ''; currentUser.firstName = '';\n newUser.lastName = ''; currentUser.lastName = '';\n newUser.email = ''; currentUser.email = '';\n newUser.password = ''; currentUser.password = '';\n \n // user list purge\n userList.userId = 0;\n userList.listId = 0;\n userList.listName = '';\n userList.items = [];\n \n // list item purge\n listItem.value = '';\n listItem.done = false;\n \n currentUser = newUser;\n todoUsersDB = [], todoListDB = [];\n userLists = [], currentListItems = [];\n listOfUserListsCaptions = [];\n \n // elemet's purge\n dashboardCaption = 'Dashboard';\n notesToLinks = '';\n notesCaption = '';\n notesItems = '';\n buttonClass = 'invisible';\n }", "function removeUser(){\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name == savedMem){\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tdelete currentProject.members[i].name;\n\t\t\t\tdelete currentProject.members[i].role[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"EditUser\").style.display = \"none\";\n\tpopTable();\n}", "async function remove(id){\r\n const deleteInfo = await fetch(\"https://611f26499771bf001785c736.mockapi.io/users/\"+ id ,\r\n {\r\n method:\"DELETE\"\r\n });\r\n \r\n const user = await deleteInfo.json();\r\n //console added to check error if anything goes wrong again\r\n //console.log(user)\r\n\r\n //empties our section in html before loading new data\r\n document.body.querySelector(\".container\").innerHTML=``;\r\n\r\n//refreshes and gives us new data\r\n getuser()\r\n}", "function logout() {\n localStorage.removeItem('token')\n observer.trigger(observer.events.logoutUser);\n}", "function removeUserInfo() {\n ssoClient.removeUserInfo();\n}", "function removeUserFromDom( userId ) {\n $(`.user-name-object[data-id=\"${userId}\"]`).remove();\n }", "function deleteUser(event) {\n var removeBtn = $(event.target);\n var removeIndex = removeBtn.attr(\"id\").split('-')[1];\n var removeUserId = users[removeIndex]._id;\n try {\n userService\n .deleteUser(removeUserId)\n .then(function () {\n users.splice(removeIndex, 1);\n renderUsers(users);\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "logOutUser() {\n this.__userAdmin__ = null\n this.__userToken__ = null\n this.removeStorage()\n window.location.reload()\n }", "function removecooldown(name, user){\r\n //removes the specified cooldown\r\n sql.run(`DELETE FROM usercooldowns WHERE user = \"${user}\" AND name = \"${name}\"`).catch(allerrors)\r\n}", "function removeUser(id) {\n\n var usersSpace = document.getElementById('space_for_users');\n var userToRemove = document.getElementById(id);\n\n usersSpace.removeChild(userToRemove);\n\n var count = getUsersCount();\n\n // Show message if no users\n if (count == 0) {\n document.getElementById('no-added-users').style.display = 'block';\n }\n\n return false;\n}", "deleteUserRequest() {\n SuperAgent\n .del('/users/' + this.props.user._id)\n .end((error, response) => {\n if (error) {\n console.log('UserCard - Error deleting user from request');\n } else {\n this.props.removeUser(this.props.index);\n }\n });\n }", "async function deleteUser () {\n // delete user if exists in the saved list. input will be sent to the request\n await handleSaveList(\"/githubSearch/delete\", \"delete\",\n document.getElementById(\"inputBox\").value.trim());\n }", "deleteUserApiToken() {\n this.__userApiToken__ = null\n sessionStorage.removeItem('freendies-user-token')\n }", "unsubscribe(email)\n {\n if (this.hasUser(email)) // Si esta suscripto\n {\n const indexToRemove = this.users.indexOf(email);\n this.users.splice(indexToRemove,1);\n }\n }", "function deleteUserToken() {\n setCookie('token', '', 0);\n}", "removeUser(user) {\n // User in Array suchen und \"rausschneiden\"\n for (var i=this.users.length; i >= 0; i--) {\n if (this.users[i] === user) {\n this.users.splice(i, 1);\n }\n }\n // geänderte Raumdetails wieder an alle senden\n var room = this;\n room.sendDetails();\n}", "function deleteUserData() {\r\n\tlocalStorage.clear();\r\n}", "removeFromWhitelist(username) {\n browser.storage.local.get('whitelist').then(({ whitelist }) => {\n if (!whitelist[username]) {\n console.warn(`\n (botcheck) Attempted to remove user from whitelist by clicking X\n on the popup, but user was not in whitelist.\n `);\n return;\n }\n delete whitelist[username];\n\n // Update UI\n this.whitelist = whitelist;\n\n browser.storage.local.set({ whitelist });\n });\n }", "logoutUser() {\n // Only call change user if the elevio library has been loaded.\n this._callIfElevioIsLoaded('logoutUser');\n }", "async function deleteUser(id) {\n const dbuser = await User.findById(id);\n if (dbuser) {\n if (dbuser.listenList.length > 0) {\n dbuser.listenList.map((item) => {\n deleteList(item);\n console.log(item);\n });\n }\n await User.deleteOne({ _id: id });\n return true;\n }\n return false;\n}", "function removeUser(id, io) {\n\tdelete users[id];\n\tdelete handles[id];\n io.sockets.emit('removeUser', { 'id' : id });\n\tconsole.log('Userid=' + id + ' has disconnected from chat.');\n}", "remove(condition) {\n // UserSchema.remove(condition, function(err){\n // if (err) {\n // message.setMessage(false, \"remove user error\", null, []);\n // callback(message);\n // }\n // else {\n // message.setMessage(true, \"remove user successfully\", null, []);\n // callback(message);\n // }\n // })\n }", "static deauthenticateUser() {\n localStorage.removeItem('token');\n localStorage.removeItem('role');\n localStorage.removeItem('username');\n Auth.onAuthenticationStatusChange(false);\n }", "delete(user) {\n return __awaiter(this, void 0, void 0, function* () {\n if (user == null) {\n throw new nullargumenterror_1.NullArgumentError('user');\n }\n let index = this.users.findIndex(u => u.id == user.id);\n if (index != -1) {\n this.users.splice(index, 1);\n }\n });\n }", "function removeWithId(){\n Users.removeUser(idSave);\n warning.style.display=\"none\";\n backgroundPicked.style.display = \"none\";\n printEmployees();\n}", "function elimina_account(){\r\n var users = JSON.parse(localStorage.getItem(\"users\") || \"[]\");\r\n var user=JSON.parse(sessionStorage.user);\r\n\r\n for(var i=0;i<users.length;i++){\r\n if(users[i].username == user.username){\r\n users.splice(i, 1);\r\n localStorage.setItem(\"users\", JSON.stringify(users));\r\n elimina_all_prenotazioni();\r\n }\r\n }\r\n}", "function userClear() {\n\tfor (let x = 0; x < 4; x++) {\n\t\t//disable button\n\t\tuser[x].classList.remove(COLOR_MAP[parseInt(user[x].id)]);\n\t\tuser[x].classList.add(\"disabled\");\n\t\t\n\t\tuser[x].removeEventListener(\"click\", correctClick);\n\t}\n}", "function removeUser(user) {\n\n // Get the user's ID.\n var id = user.id || user;\n\n var userName = $('#user-'+id).text();\n\n // Remove the corresponding element from the users list\n var userEl = $('#user-'+id).remove();\n\n // Re-append it to the body as a hidden element, so we can still\n // get the user's name if we need it for other messages.\n // A silly hack for a silly app.\n userEl.css('display', 'none');\n $('body').append(userEl);\n\n // Post a user status message if we're in a private convo\n if ($('#private-room-'+id).length) {\n postStatusMessage('private-messages-'+id, userName + ' has disconnected.');\n $('#private-message-'+id).remove();\n $('#private-button-'+id).remove();\n }\n\n}", "function removeUserArticle(user) {\n document.querySelector(`[data-id=\"${user.id}\"]`).remove();\n}", "remove() {\n const user = this.attrs.user;\n\n this.loading = true;\n m.redraw();\n\n app\n .request({\n method: 'DELETE',\n url: `${app.forum.attribute('apiUrl')}/users/${user.id()}/avatar`,\n })\n .then(this.success.bind(this), this.failure.bind(this));\n }", "function on_customer_remove(username) {\n console.debug(\"Removing: \" + username);\n var ret = afrimesh.customers.remove(username, function(error, result) {\n if (error) {\n return console.error(\"Could not remove customer: \" + customer + \" - \" + error);\n }\n console.debug(\"Removed: \" + ret);\n $(\"ul#menu ul#customers li#manage\").click();\n });\n }", "function unregister() {\n\t\t\tUserService\n\t\t\t\t.deleteUser(vm.userId)\n\t\t\t\t.then(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t// Take the user to login page on successful deletion\n\t\t\t\t\t\t$rootScope.currentUser = null;\n\t\t\t\t\t\t$location.url(\"/login\");\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\t// Display failure message\n\t\t\t\t\t\tvm.deleteError = \"Error! \";\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t}", "function doExecute(user) {\n logController.log(user.userID + ' has expired');\n user.contactList.forEach(function (contact) {\n logController.log('Sending message \"' + user.message + '\" to ' + contact);\n // twilio.sendSMS(contact, user.message);\n //console.log(contact);\n });\n User.collection.remove(user);\n}", "removeUser(db, callback) {\n this.collection = db.collection(\"USERS\");\n this.collection.remove({\"username\" : this.username}, function(err, results) {\n callback(results, null);\n });\n }", "delete(userlogin) {\n return __awaiter(this, void 0, void 0, function* () {\n if (userlogin == null) {\n throw new nullargumenterror_1.NullArgumentError('userLogin');\n }\n let index = this.logins.findIndex(l => l.user == userlogin.user);\n if (index != -1) {\n this.logins.splice(index, 1);\n }\n });\n }", "deletUser(user){\n users=users.filter(u=>{\n return u.name !=user.name\n })\n }", "logout() {\n localStorage.removeItem(\"user\");\n }", "function logout (){\n collectionOfUser.update(\n {\n id : loginUser.id,\n logIN : false,\n },\n function(){},\n error\n );\n clear();\n }", "sessionCLose() {\n localStorage.removeItem(\"user\");\n }", "function logout(){\n localStorage.removeItem('users');\n}", "logout() {\n localStorage.removeItem('user');\n }", "static removeUserSession(sessionId, callback) {\n MongoClient.connect(url,{\n poolSize: 100\n }, function (err, db) {\n if (err == null) {\n let collection = db.collection('users');\n let deleteEntity = {sessionId: sessionId};\n\n collection.findOneAndUpdate(deleteEntity, {$set: {\"sessionId\": \"\"}}, function (err, result) {\n console.log(\"removeSession-updated db\", result);\n callback(result);\n });\n /*collection.deleteOne(deleteEntity, function (err, result) {\n if (err === null) {\n callback(result);\n }\n callback(\"\");\n });*/\n }\n MongoApi.closeConnection(db);\n });\n callback(\"\");\n }", "function removeUserSite() {\n\t$(this).parent().remove();\n}", "unblockUser() {\r\n\r\n }", "async function DestroyDummyUser(user) {\n return user.destroy({ force: true });\n}", "async remove() {\n clearTimeout(this.timer);\n try {\n await this.message.clearReactions();\n } catch (e) {\n console.log(e);\n }\n jet.slideTabs.delete(this.userID);\n }", "forget(data, callback) {\n User.findOne({email: data.email},(err,res) => {\n if(err)\n callback(err);\n else if(!res)\n callback({message:\"User not found..\"});\n else{\n //it will generate the token\n var resetToken = util.token(res);\n User.updateOne({ email: res.email}, {token: resetToken}, (err, info) => {\n if(err)\n callback(err);\n else{\n util.nodeMailer(res, resetToken, callback);\n } \n })\n }\n });\n }", "function disassociateUserFromTaggr(access_token, callback) {\n\n// Open up the database\ndb.open(function(err, db) {\n // Grab the uid collection\n db.collection('uids', function(err, collection) {\n // Remove the entry with the access token provided\n collection.remove({'access_token':access_token}, function(err, cursor) {\n db.close();\n callback();\n });\n });\n });\n\n}", "function deleteUser(event){\n let id = event.currentTarget.id;\n fetch(`https://students-3d096.firebaseio.com/${id}.json`, {\n method: 'DELETE'\n })\n .then(res => res.json())\n .then(data => {\n users = users.filter(user => user.id != id);\n showUsersInfo(users);\n })\n}", "function deleteUserElement(req){\n deleteElement(dataTable_users,'#user_'+req.request.data);\n updateUserSelect();\n}", "function removeAnUser(username) {\n console.log (\"remove user: \" + username);\n delete users[username];\n\n //Delete the board if the user is a board's owner\n delete boards[board_owners[username]];\n delete board_owners[username];\n}", "async function userTask2(usersCollection) {\n try {\n const {result} = await usersCollection.deleteOne({department: 'a'});\n console.log(`UserTask #2: Removed ${result.n} user`);\n } catch (err) {\n console.error(err);\n }\n}", "function removeUser(res) {\n var name = res.match[2]\n , user = {name: name}\n , isCurrent = queue.isCurrent(user)\n , notifyNextUser = isCurrent && queue.length() > 1;\n\n if (name === 'me') {\n removeMe(res);\n return;\n }\n\n if (!queue.contains(user)) {\n res.send(name + ' isn\\'t in the queue :)');\n return;\n }\n\n queue.remove(user);\n res.send(name + ' has been removed from the queue. I hope that\\'s what you meant to do...');\n\n if (notifyNextUser) {\n notifyUser(queue.current());\n }\n }", "clearUser() {\n window.localStorage.clear(this.userKey)\n }", "static remove(user, cb) {\n let instance = userSchema.createUserInstance(user);\n\n instance.remove(cb);\n }", "static deauthenticateUser() {\n sessionStorage.removeItem('refreshToken');\n }", "function removeUser() {\n var user = $('#query-input-verwijder').val();\n var userid;\n\n databaseManager\n .query(\"SELECT ID_GEBRUIKER FROM gebruiker WHERE NAAM = (?)\", [user])\n .done(function (data) {\n\n if (data == \"\") {\n alert(\"Gebruiker is niet gevonden\");\n } else {\n userid = data[0].ID_GEBRUIKER;\n databaseManager\n .query(\"DELETE FROM gebruiker WHERE ID_GEBRUIKER = (?)\", [userid]);\n alert(\"Gebruiker is verwijderd\");\n }\n })\n }", "function deleteUserDataFromSessionStorage() {\n localStorage.removeItem('userData');\n}", "async function cleanDatabase() {\n console.log(\"Cleaning the database\")\n Friend.find({}, function(err, friends) {\n friends.forEach(async function (friend){\n const currTime = Date.now();\n let minuteDifference = Math.abs(currTime - friend.timestamp)\n minuteDifference = Math.round(minuteDifference / 60000)\n if (minuteDifference >= 4){\n // send notification\n sendNotification(friend, null, notificationTypes.STALE)\n await Friend.deleteOne({_id: friend._id}, function(err) {\n if (err) {\n console.log(err);\n } else {\n console.log(`successfully deleted stale user ${friend._id}`)\n }\n })\n }\n })\n })\n}", "function tagRemoved() {\n $('input[name=userId]').val('');\n $('html, body').animate({ scrollTop: $('#welcome').offset().top }, SPEED);\n clearRegistration();\n}", "function deleteAllAnimeFromUserList() {\n db.transaction((tx) => {\n tx.executeSql(\"delete from userlist\", [], () => {\n console.log(\"useDB: Deleted all anime from userlist in database!\");\n });\n });\n dispatch(clearUserData());\n }", "removeUser(id){\n var user = this.getUser(id);\n if(user){\n this.users = this.users.filter((user)=> user.id!==id); /* USER LIST WILL BE UPDATED */\n }\n\n return user;\n }", "function testRemove(){\n UserModel.remove({_id: '5c016964c01b2f04cc7e514d'}, function(err, result){\n console.log('remove', err, result)\n })\n}", "static removeUserFromBrowser() {\n localStorage.removeItem(AuthUtils.USER_KEY);\n }", "function removeUser(id){\r\n\tvar i;\r\n\tfor (i = 0; i < users.length; i++) { \r\n \tif(users[i].userID===id){\r\n \t\tusers.splice(i,1);\r\n \t\tconsole.log(\"index: \" + i);\r\n \t}\r\n\t}\r\n}", "function eliminarDatos(uid){\n //console.log('voy a eliminar'+uid);\n firebase.database().ref(\"usuarios/\"+uid).remove();\n}", "function logout() {\n localStorage.removeItem('user');\n}", "function deletarAgendamento() {\n\tfirebase.database().ref('users/' + uid).remove();\n\t$('#mdlVerAgendamento').modal('toggle');\n}" ]
[ "0.648261", "0.64512676", "0.641475", "0.6414479", "0.63990223", "0.6346476", "0.63454485", "0.6311817", "0.63083476", "0.63046426", "0.6293877", "0.6245016", "0.62371314", "0.6235561", "0.6197562", "0.6196626", "0.6191151", "0.6175656", "0.61708385", "0.6150998", "0.61486644", "0.6145124", "0.61356395", "0.61130846", "0.61106545", "0.61092675", "0.60982525", "0.6090896", "0.60905844", "0.6090504", "0.60745203", "0.6068705", "0.6065743", "0.60523427", "0.6039239", "0.6018788", "0.6014983", "0.60007685", "0.59998935", "0.5999452", "0.59949136", "0.5993968", "0.59915525", "0.59728473", "0.59719396", "0.59490937", "0.59389603", "0.5931641", "0.592382", "0.5908727", "0.5908096", "0.5899087", "0.5898955", "0.5896402", "0.58960646", "0.5894721", "0.5894492", "0.5892319", "0.58650637", "0.5862969", "0.5858558", "0.5858008", "0.5855064", "0.5852789", "0.5850864", "0.5848567", "0.58472776", "0.58463556", "0.58449566", "0.5840913", "0.5829422", "0.5827228", "0.58207464", "0.5817091", "0.5817068", "0.5808404", "0.580743", "0.58029467", "0.58023506", "0.57860875", "0.577657", "0.5772589", "0.57724494", "0.57714367", "0.5770926", "0.575944", "0.57539034", "0.5753613", "0.5743436", "0.57428586", "0.57409394", "0.57401836", "0.573649", "0.573529", "0.5733702", "0.57336104", "0.57324773", "0.572992", "0.5719421", "0.57152957", "0.5713372" ]
0.0
-1
if less < 5 people in q, add someone
function addToQueue() { if (people.length < 5) { people.enqueue(getRandom(randomPeople)) petsService.enqueue('dogs', getRandom(store.dogs)) petsService.enqueue('cats', getRandom(store.cats)) console.log(petsService.get()) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTopFive(users, user, limit){\n\n // ----------------------- Step 1 --------------------------//\n var counterArray = [];\n\n // for every user, and every possible forbidden id\n var i;\n var j;\n var flag = false;\n\n for(i = 0; i < users.length; i++) {\n\n if(user.googlename != users[i].googlename){\n counterArray.push([ i , 0, flag]);\n }\n\n /*\n var flag = true;\n\n for(j = 0; j < usedIDs.length; j++) {\n if(user[i].id == usedIDs[j]){\n flag = false;\n }\n }\n if(flag){\n // initialize 2d array: [ id , 0 (will be added to later)]\n counterArray.push([ i , 0 ]);\n }\n */\n }\n\n // ----------------------- Step 2 --------------------------//\n\n // data structure [id, counter ] counter is being added to\n\n if(user.politics){\n // add to all who also like politics\n for(i = 0; i < counterArray.length; i++){\n // check if the user also likes politics\n //console.log(users[counterArray[i][0]].politics)\n if(users[counterArray[i][0]].politics){\n // add one to the counter side of the 2d array\n counterArray[i][1]++;\n counterArray[i][2] = true;\n }\n }\n } else{\n for(i = 0; i < counterArray.length; i++){\n\n if(users[counterArray[i][0]].politics){\n\n counterArray[i][1] = counterArray[i][1] - 0.5;\n }\n }\n }\n\n if(user.food){\n // add to all who also like ...\n for(i = 0; i < counterArray.length; i++){\n // check if the user also likes ...\n if(users[counterArray[i][0]].food){\n // add one to the counter side of the 2d array\n counterArray[i][1]++;\n counterArray[i][2] = true;\n }\n }\n } else{\n for(i = 0; i < counterArray.length; i++){\n\n if(users[counterArray[i][0]].food){\n }\n }\n }\n\n if(user.movies){\n // add to all who also like ...\n for(i = 0; i < counterArray.length; i++){\n // check if the user also likes ...\n if(users[counterArray[i][0]].movies){\n // add one to the counter side of the 2d array\n counterArray[i][1]++;\n counterArray[i][2] = true;\n }\n }\n } else{\n for(i = 0; i < counterArray.length; i++){\n\n if(users[counterArray[i][0]].movies){\n\n counterArray[i][1] = counterArray[i][1] - 0.5;\n }\n }\n }\n\n if(user.sports){\n // add to all who also like ...\n for(i = 0; i < counterArray.length; i++){\n // check if the user also likes ...\n if(users[counterArray[i][0]].sports){\n // add one to the counter side of the 2d array\n counterArray[i][1]++;\n counterArray[i][2] = true;\n }\n }\n } else{\n for(i = 0; i < counterArray.length; i++){\n\n if(users[counterArray[i][0]].sports){\n\n counterArray[i][1] = counterArray[i][1] - 0.5;\n }\n }\n }\n\n if(user.travel){\n // add to all who also like ...\n for(i = 0; i < counterArray.length; i++){\n // check if the user also likes ...\n if(users[counterArray[i][0]].travel){\n // add one to the counter side of the 2d array\n counterArray[i][1]++;\n counterArray[i][2] = true;\n }\n }\n } else{\n for(i = 0; i < counterArray.length; i++){\n\n if(users[counterArray[i][0]].travel){\n\n counterArray[i][1] = counterArray[i][1] - 0.5;\n }\n }\n }\n\n if(user.diy){\n // add to all who also like ...\n for(i = 0; i < counterArray.length; i++){\n // check if the user also likes ...\n if(users[counterArray[i][0]].diy){\n // add one to the counter side of the 2d array\n counterArray[i][1]++;\n counterArray[i][2] = true;\n }\n }\n } else{\n for(i = 0; i < counterArray.length; i++){\n\n if(users[counterArray[i][0]].diy){\n\n counterArray[i][1] = counterArray[i][1] - 0.5;\n }\n }\n }\n for(i = 0; i < counterArray.length; i++){\n console.log(i + \": \" + counterArray[i][1] + counterArray[i][2])\n }\n\n\n// ----------------------- Step 3 --------------------------//\n\n var max;\n\n for(var startHere = 0; startHere < counterArray.length; startHere++){\n\n //set the max equal to the first term\n max = startHere;\n\n for(j = startHere; j < counterArray.length; j++){\n if( counterArray[max][1] < counterArray[j][1] ){\n max = j;\n }\n }\n\n //swap startHere and j\n var temp = counterArray[startHere];\n counterArray[startHere] = counterArray[max];\n counterArray[max] = temp;\n\n }\n\n\n// ----------------------- Step 4 --------------------------//\n\n var topFive = [];\n\n if(counterArray.length < limit){\n for(i = 0; i < counterArray.length; i++){\n\n\n if(counterArray[i][2] == true)\n topFive.push(counterArray[i][0]);\n\n /*if(counterArray[i][1] != 0){\n topFive.push(counterArray[i][0]);*/\n\n }\n }\n\n else{\n for(i = 0; i < limit; i++){\n if(counterArray[i][2] == true) {\n topFive.push(counterArray[i][0]);\n }\n }\n }\n\n return topFive;\n\n}", "function pushFive() {\n while (counter < 5 && tries > 0) {\n tries -= 1;\n var x = tags[Math.floor(Math.random() * tags.length)]/*.toLowerCase();*/\n if (fiveRand.indexOf(x) != -1) {\n pushFive();\n } else {\n counter += 1;\n fiveRand.push(x)\n }\n }\n }", "function addToUserNums() {\n let x = this.innerText;\n if (this.classList.contains('available')) {\n userNums.push(x);\n let i = userNums.length;\n document.getElementById(`pick${i}`).innerHTML = `<h3>${x}</h3>`;\n userNumsFull();\n }\n}", "function pushTopTen(songs, username) {\n pool.query(updateSongsQuery, [songs, username]).catch(function (error) {\n console.log(error);\n return false;\n });\n return true;\n}", "function filterUnderagedPeople(people, ageLimit) {\n \n}", "function attend_room(id){\n var room = room_arr[id];\n var totalnum = 0;\n if (room == undefined){\n alert(\"Please Add the Room !\");\n return;\n }\n for(var j = 0; j < room.cg_remain_num.length; j++){\n var num = parseInt(room.cg_remain_num[j]);\n totalnum += num;\n }\n // alert(totalnum);\n for(var i = 0; i < player_name_arr.length ; i++){\n var user = WhoAmI(player_name_arr[i]);\n if(i >= totalnum)\n return;\n if(i == 0)\n user.set_host(id);\n else\n user.set_player(id);\n user.main_pool = room.pool;\n }\n }", "function myAppendFunc() {\n var size = $(\"#appendform > input\").length;\n if(size >= 5)\n {\n alertify.alert(\"Can't be more than 5 questions\")\n }else\n {\n $(\"<label>possible answer \"+(size+1)+\") </label>\").appendTo(\"#appendform\");\n $(\"<input type='text' class='form-control' name='Possibleanswer[]' placeholder='5'>\").appendTo(\"#appendform\");\n } \n }", "function addNomination (idNominated){\n if(nominationState.nominations.length < 5){\n for(let i = 0; i < searchState.searchResults.length; i++){\n if(searchState.searchResults[i].id === idNominated){\n let newSearchState = searchState.searchResults;\n newSearchState[i].nominated = true;\n let newNomination = {id: newSearchState[i].id, title: newSearchState[i].title, year: newSearchState[i].year, poster: newSearchState[i].poster};\n let updateNominations = nominationState.nominations;\n updateNominations.push(newNomination); \n setSearchState({...searchState, searchResults: newSearchState});\n setNominationState({nominations: updateNominations});\n saveNominations();\n if(nominationState.nominations.length === 5){\n setCompleteState(true);\n }\n }\n }\n\n }\n else{\n setErrorState(true);\n }\n }", "addQueryToOtherUser(queryToOtherUser) {\n this.queriesToOtherUsers.push(queryToOtherUser);\n }", "function addPeople(newPerson, previousPeopleData, peopleOnHold, numberPeople) {\n //create copy of previousPeopleData into peopleData\n const peopleData = [];\n previousPeopleData.map(person => peopleData.push(person));\n\n while (numberPeople > 0) {\n numberPeople -= 1;\n const newID = peopleData.length + 1; //assign Id to new person\n\n //generate random string (same length for first and surname):\n const randomLength = (Math.ceil(Math.random() * 10)); //any length between 1 and 10\n const fName = generateRandomString(randomLength);\n const lName = generateRandomString(randomLength);\n \n const person = {\n Name: fName,\n Surname: lName\n }\n \n //add new person ID to MatchQueues of all previous persons:\n peopleData.map(person => {\n const matchQueueArray = person[3].split(\",\");\n matchQueueArray.push(newID);\n person[3] = matchQueueArray.toString();//reassign back to person object\n })\n \n // add new person to persons object (i.e. peopleData)\n const newMatchQueue = createUnmatchedIds(peopleData);\n \n const newPerson = [\n newID.toString(),\n person.Name,\n person.Surname,\n newMatchQueue.toString()\n ];\n peopleData.push(newPerson);\n }\n \n \n // write to csv file\n stringify(peopleData, { header: true, columns: PERSON_COLUMNS }, (err, output) => {\n if (err) throw err;\n fs.writeFile('read_write/new.csv', output, (err) => {\n if (err) throw err;\n console.log('added person to new.csv.');\n });\n });\n}", "function addUser(name, ineff, eff, isRange, high, low){\n\t\tvar w = new waterUser(name, ineff, eff, isRange, high, low);\n\t\twaterUses.push(w);\n\t}", "function addUser() {\n const newUser = getNewUser()\n const tableBody = getTablebody()\n const htmlNewUser = htmlRowUser(newUser)\n tableBody.innerHTML += htmlNewUser\n saveUsers(newUser)\n getUsersId()\n resetForm()\n //Si el género del nuevo usuario agregado es femenino encontrándose en ese momento en el filtro 'solo mujeres', se mostrará en dicho filtro \n if( filter()==newUser.gender){ \n filter() \n }else{\n printUsers()\n }\n}", "function calculaQuienPagaAQuien(){\n let min = getPeopleMin(people);\n while(min.amount != amountEach && min.amount < amountEach){\n let max = getPeopleMax(people);\n let amountToPay = (amountEach - min.amount).toFixed(2);\n \n people[min.indicePeople].payTo.push({\n index: max.indicePeople,\n name: people[max.indicePeople].name, \n amount: amountToPay\n });\n people[max.indicePeople].receiveFrom.push({\n index: min.indicePeople,\n name: people[min.indicePeople].name,\n amount: amountToPay\n });\n \n people[min.indicePeople].actAmount = amountEach;\n people[max.indicePeople].actAmount -= amountToPay;\n\n min = getPeopleMin(people); \n }\n}", "function showPeopleOver30() {\n\n}", "function huntAlone ( x ) {\n\tif ( x >= 5) {\n\t\tconsole.log (hunterName + \" is a vampire hunting pro, and can hunt on his own.\")\n\t}\n\telse {\n\t\tconsole.log (hunterName + \" is still new at vampire hunting and should go with a guide.\")\n\t}\n}", "function increaseSatisfactionByGreeting() {\n\n if(this.game.time.now > nextCheckGreetingStatus) \n {\n peopleCountGreeting = 0;\n\n // first get the new count of greeting people by selecting the standing people\n let standingPeople = people.filter(x => x.currentAnimation == \"stand\" && x.isInsidetheWorld == true && x.alive == true && x.sprite.x > 1 && x.sprite.x < game.world.bounds.width);\n\n // for each standing person, check if they're greeting based on angle and distance to boss\n for (var i = 0; i < standingPeople.length; i++)\n {\n var angleBetweenBossAndObject = standingPeople[i].game.physics.arcade.angleBetweenCenters(standingPeople[i].sprite, boss.sprite);\n var distanceBetweenBossAndObject = standingPeople[i].game.physics.arcade.distanceBetween(standingPeople[i].sprite, boss.sprite, false, true);\n\n // determine if the person is greeting the Boss\n if (distanceBetweenBossAndObject < gameConfig.distanceToGreetBossMax && gameConfig.angleToGreetBossMin < angleBetweenBossAndObject && angleBetweenBossAndObject < gameConfig.angleToGreetBossMax)\n {\n peopleCountGreeting++;\n }\n }\n\n // increase satisfaction based on the number of greeting people\n switch(true) {\n case (peopleCountGreeting >= 9): \n updateSatisfaction(\"add\", satisfactionPoints.peopleGreetingMin+4);\n analyticsFlags.bigCrowdCheering = true;\n break; \n case (peopleCountGreeting >= 7): \n updateSatisfaction(\"add\", satisfactionPoints.peopleGreetingMin+3);\n analyticsFlags.bigCrowdCheering = true;\n break;\n case (peopleCountGreeting >= 5): \n updateSatisfaction(\"add\", satisfactionPoints.peopleGreetingMin+2);\n analyticsFlags.bigCrowdCheering = true; \n break;\n case (peopleCountGreeting >= 3): \n updateSatisfaction(\"add\", satisfactionPoints.peopleGreetingMin+1);\n analyticsFlags.smallCrowdCheering = true; \n break;\n case (peopleCountGreeting == 2): \n updateSatisfaction(\"add\", satisfactionPoints.peopleGreetingMin);\n analyticsFlags.smallCrowdCheering = true;\n break;\n default:\n // code block\n }\n\n nextCheckGreetingStatus = this.game.time.now + checkGreetingStatusRate; \n }\n}", "function addToUser(i, appointment) {\n if(i<appointment.users.length) {\n User.findById(appointment.users[i]).exec(function(err,user){\n if(user.appointments.indexOf(appointment._id) === -1){//If a user on the Database doesn't contain this appointment add this appointment his/her to its appointment list.\n user.appointments.push(appointment._id);\n user.save();\n }\t \n addToUser(i+1,appointment);\n });\n } else {\n return;\n }\n}", "function botToViewerRatio() {\n // Checks for new users\n checkForUsers = setInterval(() => {\n console.log(\"Searching for new users and applying points to them.\");\n var currentUsersFiltered = [...new Set(currentUsers)];\n currentUsers = [];\n console.log(currentUsersFiltered);\n if (currentUsersFiltered.length == 0) {\n console.log(\"No users in chat. No points will be sent out.\")\n } else {\n currentUsersFiltered.forEach(function (value, index) {\n currentUsersFiltered[index] = { userName: value.toLowerCase() }\n })\n console.log(currentUsersFiltered)\n UserHandle.earnPointsWT(currentUsersFiltered);\n }\n }, 900000);\n}", "function onAddFiveClicked(){\n\t\tif (poker._bet < +50 && poker._cash >= +5){\n\t\t\tif(!cardsFliped)\n\t\t\t\tflipCards();\n\t\t\tresetHeld();\n\t\t\tpoker._bet += +5;\n\t\t\tpoker._cash -= +5;\n\t\t}\n\t\tbet.html(poker._bet);\n\t\tcash.html(poker._cash);\n\t}", "function add(name){\n\t\tsubs = subscribers_array.map(function(sub, pos){\n\t\t\treturn sub.name.toLowerCase()\n\t\t});\n\n\n\t\tpos = subs.indexOf(name.toLowerCase())\n\t\tif(pos != -1) {\n\t\t\talert(name + ' is already there in the database. Please enter a new username.')\n\t\t\treturn\n\t\t}\n\n\t\tsubscribers_array.push({'name' : name})\n\t\t_render()\n\t}", "function AddPlayer ( player :GameObject ) {\n\tvar minSize : float = 1000;\n\tvar minTeam : Team;\n\tfor (var t : Team in teams) {\n\t\tvar s = t.GetBalancedSize();\n\t\tif (s < minSize) {\n\t\t\tminSize = s;\n\t\t\tminTeam = t;\n\t\t} \n\t}\n\tminTeam.AddPlayer(player);\n}", "function showModelWhenToggelerIsAboveFive(toggeller) {\n let toggellerClass = $(toggeller).attr(\"class\");\n let parent = $(toggeller).parent().parent().parent();\n let cardBody = $(parent).children()[1]\n $(toggeller).attr(\"class\", $(parent).attr(\"id\"));\n // <-> \n if ($(toggeller).prop(\"checked\") && !checkIfToggellerApears(toggeller)) {\n favoriteCoinsToggelers.push(toggeller);\n parentsArray.push($(parent));\n\n saveFavoriteCoinsInLocalStorage(toggeller);\n\n } else {\n removeElementWhileToggellerNotChecked();\n removeFromLocalStorage(toggellerClass);\n }\n handleModalOpenance(toggeller);\n // -> clean array from empty index(s)\n favoriteCoinsToggelers = favoriteCoinsToggelers.filter(function (e) {\n return e\n });\n if (parentsArray.length == 6) {\n cloneElementIntoModal();\n }\n validateToggellers();\n}", "addPerson(person) {\n /* Check if the person is a patient */\n if (\"param\" in person) {\n this.patientsQueue.queue(person);\n /* Search for matches between patients first */\n const matchTwoPatients = this.searchPatientsMatch();\n if (matchTwoPatients)\n return matchTwoPatients;\n }\n else\n this.counselorsQueue.queue(person);\n /* Now, search for matches with counselors */\n const matchCounselorPatient = this.searchMatch();\n return matchCounselorPatient;\n }", "function fillProfQueue(){\r\n if(maxProfId != null){\r\n var c = Math.floor(Math.random() * maxProfId) + 1;\r\n profQ.push(c);\r\n }\r\n}", "function isOldEnoughWithName() {\n for (var i = 0; i < peopleWhoWantToSeeMadMaxFuryRoad.length; i++) {\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].gender == \"male\"){\n pronoun = \"He's\";\n }\n else if (peopleWhoWantToSeeMadMaxFuryRoad[i].gender == \"female\"){\n pronoun = \"She's\";\n };\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].age >= 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is old enough to see Mad Max.\" + \" \" + pronoun + \" allowed into the movies.\")\n }\n else if(peopleWhoWantToSeeMadMaxFuryRoad[i].age < 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is to young to see Mad Max.\" + \" \" + pronoun + \" NOT allowed into the movies.\")\n };\n }\n}", "function gryffindor() {\n gryffindorScore += 1;\n questionCount += 1;\n if (questionCount >= 3) {\n updateResult();\n }\n}", "function megaFriend(friends = [ \"a ,b , c , d\"]) {\r\n var largeName = friends[0];\r\n for(i = 0; i < friends.length; i++) {\r\n if (friends[i].length > largeName.length){\r\n largeName = friends[i]; \r\n }\r\n }\r\n return largeName\r\n}", "function mentorWithMoreSkills(mentors) {\n mentors.sort((mentor1, mentor2) => mentor1.skills.length > mentor2.skills.length)\n mentors.forEach(mentor => console.log(mentor.firstName, mentor.skills.length))\n}", "function trustInMoraThan5CapitalDistrict(){ \n var nMin = 1;\n schoolModel.aggregate([ // finding trust with all their information\n {\n $group:{\n _id:\"$data.name-of-trust-society-managing-committee\", \n Numberofschools:{$sum:1}, \n cities: {$addToSet: \"$data.district\"},\n schools:{$addToSet:\"$data.name-of-institution\"},\n states:{$addToSet:\"$data.state\"}\n }\n },\n {\n $project: { // project these values in output \n _id: 0, \n \"trustname\":\"$_id\",\n \"states\":\"$states\",\n \"cities\":\"$cities\", \n }\n } \n ], function (err, detailsOfTrust) {\n finalTrust=[]; // array of trust which are in 5 or more capital district \n if (!err){\n detailsOfTrust.forEach( function(Element){ \n counter=0;\n if(Element.trustname != \"\"){\n var cities=Element['cities']; // only cities from element in cities \n var capitals = [];\n cities.forEach(function (cityElement){ // capitalelement is single value of capitaldistrict array\n eIndex=capitalDistrict.indexOf(cityElement) // checking value match in cityelement \n if(eIndex!=-1){ // if match \n counter+=1; // increase counter with 1\n capitals.push(cityElement); \n }\n });\n Element.capitals = capitals;\n if(counter >= nMin ){\n //if its mathches 5 times then push the element in array\n finalTrust.push(Element);\n // push the element in array if it have trust in 5 or more \n }\n }\n }); \n }\n else{\n return console.log(err);\n } \n console.log(finalTrust.length); // final result\n }) \n}", "async getRandomPersons(number = 6, mattMode = false) {\n if (this.peopleCache.length < 1) await this.refreshPeopleCache();\n\n const peopleArray = await this.doMattMode(mattMode);\n\n const personCount = peopleArray.length;\n\n if (personCount <= number)\n throw new Error(\n \"PeopleManager: There are fewer (or equal) number of people in the cache than what was requested! Either hire more people or request a lower amount.\"\n );\n let result = [];\n while (result.length < number) {\n // generate random numbers, and push people into our array until we have enough\n // this could get really inefficient if we were always getting close to the number of total people in the DB\n const index = Math.floor(Math.random() * personCount);\n\n const someone = peopleArray[index];\n if (!result.includes(someone)) {\n result.push(someone);\n }\n }\n return result;\n }", "function addPerson(start, click) {\n people.push(new Person(start));\n\n if (click) {\n var add = 1 + total_perclick;\n\n if (isEventRunning(\"illegals_entering\")) {\n add = 1;\n addSendIllegalClick();\n }\n\n deported += add;\n total++;\n }\n\n document.getElementById(\"count\").innerHTML = deported.toFixed(0);\n updateObscuredItems();\n\n if (faces.length < settings.max_faces) {\n faces.push(new FallingFace());\n }\n}", "addInfected(num){\n this.infected += num;\n\n if(this.infected > this.population)\n this.infected = this.population;\n }", "function addHint(){\n if(vm.hints.length < vm.maxHintCount){\n vm.hintNumber = vm.hints.length + 1;\n vm.hints.push({'count':+ vm.hintNumber});\n vm.addHintTranslate = $translate.instant(\"preview-ANOTHER_HINT\");\n }\n }", "function oldEnoughName(){\n for (var i = 0; i < peopleWhoWantToSeeMadMaxFuryRoad.length; i++){\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].age >= 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is of age to see Mad Max.\")\n }\n else if(peopleWhoWantToSeeMadMaxFuryRoad[i].age < 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is NOT of age to see Mad Max\")\n }\n }\n}", "function tickets(peopleInLine) {\n console.log(peopleInLine)\n if (peopleInLine[0] !== 25) return 'NO'\n if (peopleInLine[1] > peopleInLine[0]) return 'NO'\n let register = peopleInLine[0];\n for (let i = 1; i < peopleInLine.length; i += 1) {\n if (register < peopleInLine[i]) return 'NO'\n register += peopleInLine[i]\n\n }\n return 'YES'\n}", "function over30(action) {\r\n let obj;\r\n action === \"FollowsMost\" ? obj = pplUserFollows : obj = pplThatFollowUser;\r\n let max = 0;\r\n let most = [];\r\n for (let user in obj) {\r\n let count = 0;\r\n for (i = 0; i < obj[user].length; i++) {\r\n let curr = obj[user][i];\r\n if (data[curr].age > 30) {\r\n count++;\r\n }\r\n }\r\n if (count > max) {\r\n max = count;\r\n most = [user];\r\n }\r\n else if (count === max) {\r\n most.push(user);\r\n }\r\n }\r\n let listOfUsers = most.join(\" \");\r\n action === \"FollowsMost\" ? console.log(listOfUsers + \" follows the most people over 30:\", max) :\r\n console.log(listOfUsers + \" is followed by the most people over 30:\", max);\r\n}", "addRating(input) {\n // to make sure input is a number between 1 and 5 including\n if (typeof (input) == 'number' && input > 0 && input < 6) {\n this.ratings.push(input);\n } else {\n console.log('Error! Pick a number from 1 to 5.')\n }\n }", "function addToItinerary(index){\n\tif(!inItinerary(index)){\n\t\tif(itinerary.length<10){\n\t\t\titinerary.push(index);\n\t\t}else{\n\t\t\talert('Max waypoints (8) exceeded.');\n\t\t}\n\t}else{\n\t\talert('This is place is already in your itinerary.');\n\t}\n}", "function showTopFivePlayers(topFivePlayers, topFivePlayersDiv) {\n while (topFivePlayersDiv.children.length > 0) {\n topFivePlayersDiv.removeChild(topFivePlayersDiv.firstChild);\n }\n topFivePlayers.forEach(user => {\n\n const paragraph1 = document.createElement('p');\n paragraph1.setAttribute('class', `${user.username}`);\n const paragraph2 = document.createElement('p');\n paragraph2.setAttribute('class', `${user.username}`);\n const paragraph3 = document.createElement('p');\n paragraph3.setAttribute('class', `${user.username}`);\n\n paragraph2.style.color = '#e40046';\n paragraph2.style.fontWeight = 'bold';\n paragraph3.style.color = '#e40046';\n paragraph3.style.fontWeight = 'bold';\n\n const username = document.createTextNode(user.username);\n const title = document.createTextNode(user.title);\n const score = document.createTextNode(user.score);\n\n paragraph1.appendChild(username);\n paragraph2.appendChild(title);\n paragraph3.appendChild(score);\n\n const userContainer = document.createElement('div');\n userContainer.appendChild(paragraph1);\n userContainer.appendChild(paragraph2);\n userContainer.appendChild(paragraph3);\n topFivePlayersDiv.appendChild(userContainer);\n });\n return;\n}", "function tickets(peopleInLine){\n let a25 = 0;\n let a50 = 0;\n for(var i = 0;i<peopleInLine.length;i++){\n if(peopleInLine[i] == 25){\n a25 += 1;\n }\n if(peopleInLine[i] == 50){\n a25 -= 1; a50 += 1;\n }\n if(peopleInLine[i] == 100){\n if(a50 == 0 && a25 >= 3){\n a25 -= 3;\n }else{\n a25 -= 1; a50 -= 1;\n }\n }\n if(a25 < 0 || a50 < 0){\n return 'NO';\n }\n }\n return 'YES';\n }", "function collectEggs() {\n if (gameData.eggs + gameData.eggcollectorNum <= gameData.storage) {\n gameData.eggs += (gameData.eggcollectorNum);\n duckUpdate();\n } else if (gameData.eggs + gameData.eggcollectorNum > gameData.storage) {\n gameData.eggs = gameData.storage;\n duckUpdate();\n }\n if (gameData.eggs + (gameData.roboteggcollectorNum * 5) <= gameData.storage) {\n gameData.eggs += (gameData.roboteggcollectorNum * 5);\n duckUpdate();\n } else if (gameData.eggs + (gameData.roboteggcollectorNum * 5) > gameData.storage) {\n gameData.eggs = gameData.storage;\n duckUpdate();\n }\n\n}", "function allocateSeat() {\n let votesTotal = parties.reduce((total, party) => total + party.votes, 0);\n parties = parties.sort((a, b) => b.votesCalculated - a.votesCalculated);\n if (parties[0].votes / votesTotal < threshold) {\n parties[0].votesCalculated = 0;\n allocateSeat();\n }\n parties[0].mpsGranted++;\n parties[0].votesCalculated = parties[0].votes / (parties[0].mpsGranted+1);\n}", "findHireableUsers(numberOfRepo, numberOfFollower, hireableUsersFound) {\n const pageURL = `https://api.github.com/search/users?q=repos%3A>${numberOfRepo}+followers%3A>${numberOfFollower}`;\n\n this.fetchPopularUsers(pageURL, (popularUsers) => {\n const hireableUsers = [];\n\n // throttle to avoid overloading API\n let numberOfUserDetailsToFetch = popularUsers.length;\n const throttle = new Throttle({\n active: true, // set false to pause queue\n rate: 500, // how many requests can be sent every `ratePer`\n ratePer: 1000, // number of ms in which `rate` requests may be sent\n concurrent: 10, // how many requests can be sent concurrently\n });\n\n\n popularUsers.forEach((user) => {\n this.fetchUser(user, throttle, (userDetails) => {\n numberOfUserDetailsToFetch -= 1;\n\n if (userDetails.body.hireable) {\n hireableUsers.push(userDetails.body);\n }\n\n if (numberOfUserDetailsToFetch === 0) {\n hireableUsersFound(hireableUsers);\n }\n });\n });\n });\n }", "checkPassengers(){\n if(this.passengers > 4){\n console.log(\"There are too many passengers\");\n }\n }", "function athena() {\n athenaScore = athenaScore + 1;\n questionCount = questionCount + 1;\n\n if (questionCount >= 5) {\n updateResult();\n }\n}", "if (!this._skillsToMentors.has(skill)) {\n this._skillsToMentors.set(skill, [userId]);\n this._skillsToMentorsQueue.set(skill, [userId]);\n }", "function countN14Users(u) {\n\tvar c = 0;\n\tfor (var k in u) {\n\t\tif (users[k].beruf >= 1 && users[k].beruf <= 4) {\n\t\t\tc++;\n\t\t}\n\t}\n\treturn c;\n}", "function addToPool (userId, friendEmail) {\n return cq.query(qb.userByEmail(friendEmail))\n .then(transformer.user)\n .then(friend => {\n if (!friend.name) {\n // no user with that email\n return {};\n }\n\n return cq.query(qb.addToPool(userId, friend.id))\n // return the added friend\n .then(() => friend);\n });\n}", "addSong(selectedSong){\r\n let newItem = this.userBand + \" - \" + selectedSong;\r\n //prevents adding of duplicate songs\r\n this.userSetlist.indexOf(newItem) === -1 ? this.userSetlist.push(newItem) : console.log(\"This song is already in the list\");\r\n }", "function findPartner() {\n // Get users list from local storage\n var users = JSON.parse(localStorage.getItem(\"usersTable\"));\n var values = Object.values(users);\n var minVal = Math.min(...values);\n var keys = Object.keys(users);\n // finalized lunch group\n var group = [];\n \n // increment value for every time colleague joins user for lunch\n for(let key in users) {\n if(users[key] === minVal && group.length < 5) {\n group.push(key)\n users[key]++;\n }\n }\n \n // Similar to Circular Linked List\n if(group.length < 3) {\n group.push(keys[0]);\n group.push(keys[1]);\n users[keys[0]]++;\n users[keys[1]]++;\n }\n\n document.querySelector('.modal-text').textContent = `Go to Lunch with ${group}`;\n // Set the local storage with updated users table\n localStorage.setItem('usersTable', JSON.stringify(users));\n }", "addFriend(newFriend){\n var i;\n for (i = 0; i < this._friends.length; i++) {\n if (this._friends[i] === newFriend){\n console.log(newFriend + \" is already in list\");\n return;\n }\n }\n this._friends.push(newFriend);\n }", "function addFriendSuggestions(array, occurences, friends) {\n let template = document.querySelector(\"#friends-suggestion\").content;\n let parent = document.querySelector(\".friends_suggestion-parent\");\n for (let i = 0; i < occurences; i++) {\n let clone = template.cloneNode(true);\n clone.querySelector(\".paragraph\").textContent = array[i].username;\n clone.querySelector(\".button\").dataset.uuid = array[i]._id;\n clone.querySelector(\".button\").addEventListener(\"click\", addFriend);\n parent.appendChild(clone);\n }\n}", "function perfectFriend(friends) {\n\n if (typeof friend == \"object\") {\n\n let largestName = friends[0];\n for (let i = 0; i < friends.length; i++) {\n if (largestName.length < 5) {\n largestName = friends[i];\n }\n }\n return largestName;\n }\n\n else {\n let error = \"please input a valid number. negetive number or text is not supported\"\n return error;\n }\n}", "function appendUsers() {\n queryRequest(uniqueProjectUsers);\n usersWithNumberOfIssues.length = 0;\n uniqueProjectUsers.forEach(function (user) {\n var numberOfIssues = 0;\n issuesOfProject.forEach(function (issue) {\n if (issue.assignee == user) {\n numberOfIssues++;\n }\n })\n if (user == 'Unassigned') {\n usersWithNumberOfIssues.push({\n user: user,\n numberOfIssues: numberOfIssues,\n color: 'color: #1678CC'\n })\n } else {\n usersWithNumberOfIssues.push({\n user: user,\n numberOfIssues: numberOfIssues\n })\n }\n })\n buildPieChart();\n}", "function pushNotif(person, notif){\n\n //push the new notification into the queue\n person.notifsHistory.push(notif);\n\n //trim the notifications\n if(person.notifsHistory.length > 5){\n \tperson.notifsHistory.shift();\n }\n}", "function catchPokemon(wildPokemon) {\n // make sure the player can only have a max of 6 pokemon\n if (playerPokemon.length < 6) {\n // add wild pokemon to array of player\"s pokemon\n playerPokemon.push(wildPokemon);\n console.log(\"You caught a \" + wildPokemon.name + \"!\");\n } else {\n console.log(\"You already have 6 Pokemon!\");\n }\n}", "addCardsByScore() { \n const score = this.getTotal();\n if (score.strong/score.total >= 0.7) {\n this.addNewCards(score.total);\n }\n }", "function employed(){\nif(hasExperience){\n if(amountOfExperience >5){\n return true;\n }\n}\nif(hasExperience === false || amountOfExperience < 5){\n return false;\n}\n}", "function addPlayer(boolean) {\n if (boolean){\n //check for where to insert the player/score depending on rank\n index = 0;\n while(quizTime<hiscoreList[index]) {\n index++;\n }\n //separate storage for player name and score, a random choice\n playerName.splice(index,0,player);\n hiscoreList.splice(index,0,quizTime);\n }\n}", "function message_string(number_of_users) {\n return number_of_users === 1 ? \"there's 1 participant\" : \"there are \" + number_of_users + \" participants\"\n }", "function addToReputation (userId, value, callback) {\r\n\texports.getReputation(userId, function(error, score) {\r\n\t\tif (error) { \r\n\t\t\tif (callback instanceof Function) callback(error, score); \r\n\t\t}\r\n\t\telse { \r\n\t\t\tvar newScore = score + value;\r\n\t\t\tsetReputation(userId, newScore, function(err, updatedScore) {\r\n\t\t\t\tif (error) { \r\n\t\t\t\t\tif (callback instanceof Function) callback(error, updatedScore);\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t\telse { \r\n\t\t\t\t\tif (callback instanceof Function) callback(null, updatedScore);\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t});\r\n\t\t}\r\n\t});\r\n}", "function morePoints(points, msg) {\n if (!points) {\n points = 200;\n }\n if (minutesfromStart() >= minutesTillNextFunds && stats.score < (points * 2)) {\n stats.score += points;\n if (msg) {\n toast(\"(+ \" + points + \" points)\");\n } else {\n toast(\"+ \" + points + \" points\");\n }\n document.getElementById('score').innerHTML = stats.score;\n storage.setItem('lastUsed', new Date());\n } else if (!msg) {\n toast();\n } else {\n toast(msg);\n }\n\n}", "function getTop5Toxic(message){\n //SELECT amount FROM mytable ORDER BY amount DESC LIMIT 5\n con.query(\"SELECT * FROM user ORDER BY toxic DESC LIMIT 5\", function (err, result) {\n if (err) throw err;\n if (result == null || result.length == 0)\n {\n console.log(\"null in getTop5Toxic\");\n userInfo = null;\n }\n else\n userInfo = result;\n\n if(userInfo == null)\n message.channel.send(\"No results\");\n else{\n var ans = \"Top 5 Toxic Users:\\n\";\n for(var i=0; i<userInfo.length;i++){\n ans+=\"#\"+(i+1)+\" - \"+userInfo[i][\"name\"]+\" Toxic: \"+userInfo[i][\"toxic\"]+\"\\n\";\n }\n message.channel.send(ans);\n }\n });\n}", "function megaFriend(friendList) {\n let bigName = friendList[0];\n for(let i = 0; i < friendList.length; i++) {\n let element = friendList[i];\n if(element.length > bigName.length) {\n bigName = element;\n }\n \n }\n return bigName; \n}", "function updateUsernames() {\n //io.sockets.emit('get users', users);\n\n if (nConnections > 4) {\n \n var nUsersInRoom = nConnections%4;\n var startPos = nConnections - nUsersInRoom;\n var tempUsers = users;\n var subsetOfUsers = tempUsers.splice(startPos, nUsersInRoom);\n io.sockets.in(roomName).emit('get users', subsetOfUsers);\n newRoomFull = false;\n \n } else\n io.sockets.in(roomName).emit('get users', users);\n }", "function perfectFriend(friendsName) {\n for (let friend of friendsName) {\n if (friend.length == 5) {\n return friend;\n break;\n }\n }\n}", "static addUserIdea(user, idea, borrowedFrom) {\n if (!ideas[user]) {\n ideas[user] = [];\n }\n ideas[user].push(idea);\n // todo borrow mark\n this.save();\n return ideas[user].length;\n }", "function q5Function(inlineRadioOptions) {\n q5 = inlineRadioOptions;\n\n if ( q5 === \"five\"){\n userCorrect++;\n }\n else{\n userInCorrect++;\n }\n}", "function findPartner() {\n var users = JSON.parse(localStorage.getItem(\"usersTable\"));\n var values = Object.values(users);\n var keys = Object.keys(users);\n var minVal = Math.min(...values);\n for(let key in users) {\n if((users[keys[keys.length - 1]] === 1 ) || (users[key] > 1)) {\n document.querySelector('.modal-text').textContent = \"You've already connected with everyone! Try lunch instead.\";\n break;\n }\n else if(users[key] === minVal && users[key] < 2) {\n users[key]++;\n document.querySelector('.modal-text').textContent = `Get coffee with ${key}`;\n break;\n } \n }\n localStorage.setItem('usersTable', JSON.stringify(users));\n }", "function userSubmit(){\n let firstQ = parseFloat(document.getElementById('firstQues').value)\n let secQ = parseFloat(document.getElementById('secondQues').value)\n let thirdQ = parseFloat(document.getElementById('thirdQues').value)\n let fourthQ = parseFloat(document.getElementById('fourthQues').value)\n let fifthQ = parseFloat(document.getElementById('fifthQues').value)\n let firstLength = document.getElementById('firstname').value.length\n let secondLength = document.getElementById('lastname').value.length\n let questions = firstQ + secQ + thirdQ + fourthQ + fifthQ\n //pull first name from array\n let genFirst = firstLength + questions - 1\n //pull last name from array\n let genLast = secondLength + questions - 1\n //validate that they inserted a name\n if(firstLength == 0 || secondLength == 0){\n alert(\"Enter your first and last name.\")\n }else{\n //validate that their firstname isn't too long for array\n if(genFirst > first.length - 1){\n genFirst = first.length -1\n }\n //validate that their lastname isn't too long for array\n if(genLast > last.length - 1){\n genLast = last.length -1\n }\n //puts result in the dom\n document.getElementById(\"insertFName\").innerText = (\"Your clan name is: \" + first[genFirst] + \" \" + last[genLast])\n //\n\n }\n}", "function tinyFriend(friends)\n{\n var min= friends[0].length;\nfor(var i=1;i<friends.length; i++)\n{\n if(friends[i].length<min)\n {\n min = friends[i].length;\n var min1=friends[i];\n }\n \n \n}\nreturn min1;\n\n}", "awardPoints(numPoints) {\n this.points += numPoints;\n }", "function addTo(n) {\n\tconsole.log('Very long time')\n\treturn n + 80;\n}", "function addSnippetForUser(msg, done, newSnippet) {\n const userId = getUserId(msg);\n const snippets = robot.brain.get(userId);\n if (!Array.isArray(snippets)) {\n return provideUsername(msg, done);\n }\n\n robot.brain.set(userId, flatten(snippets, newSnippet));\n msg.send(`Added ${newSnippet}!`, done);\n }", "function perfectFriend(name) {\n // error message\n if (typeof name !='object') {\n return 'Give an object';\n }\n for (let i = 0; i < name.length; i++) {\n if (name[i].length == 5) {\n return name[i];\n }\n }\n }", "function getUserFriends() {\n if (loggedUserID) {\n // setTimeout(() => {\n // If the user doesn't have friends, show 5 suggestions\n if (userObject.friends == \"\") {\n document.querySelector(\".friends_current\").style.display = \"none\";\n let num = 5;\n let arraySuggestions = [];\n let userFriends = [\"none\"];\n constructArrUsers(arraySuggestions, num, userFriends);\n } else {\n let userFriends = userObject.friends.split(\",\");\n\n // If the user has friends get them from db\n getFriends(userFriends);\n\n // If the user has more than three friends, show 1 suggestion\n\n if (userFriends.length >= 3) {\n let num = 1;\n let arraySuggestions = [];\n constructArrUsers(arraySuggestions, num, userFriends);\n } else {\n // If the user has less, show 3 suggestions\n let num = 3;\n let arraySuggestions = [];\n constructArrUsers(arraySuggestions, num, userFriends);\n }\n }\n // }, 6500);\n }\n}", "function searchByTrait(people) { // need only 2 but can search up to 5\n let filteredPeople = people;\n\n let heightYesNo = promptFor(\"Do you know the person's height? Yes or No.\", yesNo);\n let weightYesNo = promptFor(\"Do you know the person's weight? Yes or No.\", yesNo);\n let eyeColorsYesNo = promptFor(\"Do you know the person's eye color? Yes or No.\", yesNo);\n let occupationYesNo = promptFor(\"Do you know the person's occupation? Yes or No.\", yesNo)\n let ageYesNo = promptFor(\"Do you know the person's age? Yes or No.\", yesNo);\n\n\n if (eyeColorsYesNo == 'yes') {\n let eyeColor = promptFor(\"What is the person's eye color?\", nonInteger);\n filteredPeople = filteredPeople.filter(function (person) {\n if (person.eyeColor.toLowerCase() == eyeColor.toLowerCase()) {\n return true;\n } else {\n return false;\n }\n });\n }\n\n if (heightYesNo == 'yes') {\n let height = promptFor(\"What is the person's height in inches?\", integer);\n\n filteredPeople = filteredPeople.filter(function (person) {\n if (person.height == height) {\n return true;\n } else {\n return false;\n }\n });\n }\n\n if (weightYesNo == 'yes') {\n let weight = promptFor(\"What is the person's weight in pounds?\", integer);\n\n filteredPeople = filteredPeople.filter(function (person) {\n if (person.weight == weight) {\n return true;\n } else {\n return false;\n }\n });\n }\n\n if (occupationYesNo == 'yes') {\n let occupation = promptFor(\"What is the person's occupation?\", nonInteger);\n\n filteredPeople = filteredPeople.filter(function (person) {\n if (person.occupation.toLowerCase() == occupation.toLowerCase()) {\n return true;\n } else {\n return false;\n }\n });\n }\n\n if (ageYesNo == 'yes') {\n let age = promptFor(\"What is the person's age?\", integer);\n\n filteredPeople = filteredPeople.filter(function (person) {\n if (person.age == age) {\n return true;\n } else {\n return false;\n }\n });\n }\n return filteredPeople;\n}", "isMoreSeniorThan(vampire) {\n if (this.creator === null) {\n return true;\n }\n\n let thisVampire = this;\n let thisVampireRank= 0; // Smaller rank number is more senior\n \n let otherVampire = vampire;\n let otherVampireRank = 0;\n\n while (thisVampire.creator) {\n thisVampire = thisVampire.creator;\n thisVampireRank++;\n }\n \n while (otherVampire.creator) {\n otherVampire = otherVampire.creator;\n otherVampireRank++;\n }\n\n if (thisVampireRank < otherVampireRank) {\n return true;\n } else {\n return false;\n }\n }", "function megaFriend(friendList){\n var largeName = friendList.length;\n \n if(friendList.length == 0){\n return (\"Empty\");\n }\n else{\n for(var i = 0; i < friendList.length; i++){\n var element = friendList[i];\n if(largeName <= element.length){\n largeName = element.length;\n var largeMan = element;\n }\n }\n return largeMan;\n }\n}", "function whosPaying(names) {\n\n var numberOfPeople = names.length;\n var randomPersonPosition = Math.floor(Math.random() * numberOfPeople); \n var randomPerson = names[randomPersonPosition];\n\n return randomPerson + \" is going to buy lunch today!\";\n}", "function newPeople(n, s, c, t, g, d, a) {\n people.push({name: n, address: {street: s, city: c, state: t}, gpa: g, date: d, avgGpa: a});\n return people;\n }", "function weight(number){\r\n\tfor(i=0; i<subjects[number].parties.length; i++){\r\n\t\tif(subjects[number].parties[i].position == answers[number]){\r\n\t\t\tPartyMatches[subjects[number].parties[i].name] = PartyMatches[subjects[number].parties[i].name] + 1;\r\n\t\t}\r\n\t}\r\n}", "function megaFriend(nameList) {\n if (nameList.length == 0){\n return \"Array is empty\";\n } else {\n var max = nameList[0].length;\n var name = nameList[0];\n for( var i=1; i<nameList.length; i++ ){\n var element = nameList[i].length;\n if ( element> max ){\n max = element;\n name = nameList[i];\n }\n }\n return name;\n }\n }", "function rateEvent(event,rate,person) {\n //control rating (It has to be from 1 to 10)\n if(rate>10 || rate <1) console.log(\"Invalid rating. (1-10).\");\n else {\n //variable to specify whether a person was on the list\n var isClientRegistered=false;\n for(var i=0;i<archive[event].Clients.length;i++){\n if((person.fname+person.sname)==(archive[event].Clients[i].fname+archive[event].Clients[i].sname)){\n archive[event].clientsRating.push(rate);\n //if he is on the list, set flag to true\n isClientRegistered=true;\n console.log(\"\\nClient: \"+person.fname+\" \"+person.sname+\" rated \"+archive[event].name+\" with clientsRating: \"+rate) }\n } //if flag is false(client doesnt appear on the list), terminate operation\n if(!isClientRegistered) console.log(\"\\nThis person isn't on the list of registrated clients of this event.\");\n }\n}", "function people10(list, p, valor) {\n var number = tenList(list, p, valor);\n\n if (valor < 0 && p < 0.5) { // loyal bottom\n var listLess10 = list.filter(person => person.votes_with_party_pct <= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.votes_with_party_pct - m2.votes_with_party_pct;\n });\n return listLess10;\n\n } else if (valor < 0 && p > 0.5) { //loyal top\n var listLess10 = list.filter(person => person.votes_with_party_pct >= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.votes_with_party_pct - m2.votes_with_party_pct;\n });\n\n return listLess10.reverse();\n \n } else if (valor > 0 && p < 0.5) { // attendance bottom\n var listLess10 = list.filter(person => person.missed_votes_pct <= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.missed_votes_pct - m2.missed_votes_pct;\n });\n\n return listLess10;\n\n } else if (valor > 0 && p > 0.5) { //attendance top\n var listLess10 = list.filter(person => person.missed_votes_pct >= number);\n listLess10.sort(function compareMember(m1, m2) {\n return m1.missed_votes_pct - m2.missed_votes_pct;\n });\n return listLess10.reverse();\n }\n return listLess10;\n }", "function addData(req, res, userArray, friendArray) {\n\t\tvar surveyData = req.body;\n\t\tuserArray.push(surveyData);\n\t\tfindBestFriend(res, userArray, friendArray, surveyData);\n\t}", "function addMember(){\n // Getting data\n let age = parseInt(document.getElementsByName(\"age\")[0].value, 10);\n let relElem = document.getElementsByName(\"rel\")[0];\n let relationship = relElem.options[relElem.selectedIndex].value;\n let smoker = document.getElementsByName(\"smoker\")[0].checked;\n\n // Checking requirements\n if (age < 0 || Number.isInteger(age) === false) age = null;\n if (relationship === \"\") relationship = null;\n\n // If requirements are fulfilled, add member\n if (age != null && relationship != null) {\n const member = new Member(age, relationship, smoker);\n console.log(\"new member added\");\n householdMembers.unshift(member);\n }\n\n // Reset form and reload household members\n document.getElementsByName(\"age\")[0].value = \"\";\n document.getElementsByName(\"rel\")[0].value = \"\";\n document.getElementsByName(\"smoker\")[0].checked = false;\n reloadMembers();\n}", "function increaseEngineers(name, id, email, github) {\n name = new Engineer(name, id, email, github)\n employees.push(name)\n}", "function xqserver_msgadd_lowerbounduserid(){\r\n\tl_qwUserId=new QWORD(0x00000000,0x00000001);\r\n\tsetup(l_qwUserId);\r\n\tengine.TickleListen(true,g_wPort);\r\n\tengine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(l_qwUserId),1,g_dw0QType,g_bstr0QTypeData,g_dw0QTypeDataSize);\r\n\tWaitForTickle(engine);\r\n\tif (1!=engine.GetTickleElement(\"QLength\")) FAIL();\r\n}//endmethod", "function nbPersMineures (array){\n\t// declaration de la variable personne\t\n\tlet personne = 0;\n\t// pour chaque element au sein du tableau passe en parametre\t\n\tfor (let i =0; i< array.length; i ++){\n\t\t// si l'element < 18 : incrementer personne d'une unite\t\t\n\t\tif (array[i] < 18) {\n\t\t\tpersonne = personne + 1;\n\t\t}\n \n\t} \n\t// sortie de la boucle ...\n\t// on retourne le nb de personnes\n\treturn personne;\n}", "function addToList() {\n\n if ($(\"#chosen\").find('p').length >= 4) {\n alert(\"only four samples currently supported... please remove at least one before adding\");\n } else {\n\n var e = document.getElementById(\"zz\");\n var strUser = e.options[e.selectedIndex].value;\n\n $(\"#chosen\").append(\"<p>\" + strUser + \" <a href=\\\"#\\\" style=\\\"color:red;\\\" onclick=\\\"rem(this)\\\">X</a></p>\");\n\n\n }\n\n}", "function addExistingMember(self) {\n show2ListsMembersContainer(self);\n if (!self.list1) {\n getAllTeamMembers(self);\n } \n }", "function addStudentsLike(mentors) {\n mentors.forEach(mentor => mentor.addStudentLikes())\n}", "function indovinaNumeri(arrayRandom){\n var users = [];\n for (var i = 0; i < 5; i ++){\n var numeroUtente = parseInt(prompt('Digita un numero'));\n\n if(arrayRandom.includes (numeroRandom) && !users.includes(numeroUtente)){\n users.push(numeroUtente);\n }\n\n }\n return users;\n\n}", "function adder2(id){\r\r\n ////obtenemos el numero actual\r\r\n var addItems = $(\"#eitem\"+id).val();\r\r\n if(addItems<50){\r\r\n addItems++;\r\r\n $(\".eitem\"+id).val(addItems);\r\r\n }\r\r\n}", "function addMore(identifier) {\n another = $(identifier).data('type');\n $.when( $.get(elgg.normalize_url('ajax/view/input/' + another), '',\n function(data) {\n $('.gcconnex-' + another + '-all').append(data);\n })).done(function() {\n if (another == \"work-experience\") {\n $temp = $('.gcconnex-work-experience-entry.new').find('.userfind');\n $temp.each(function() {\n user_search_init(this);\n });\n }\n });\n}", "function adder(id){\r\r\r\r\r\r\n ////obtenemos el numero actual\r\r\r\r\r\r\n var addItems = $(\"#eitem\"+id).val();\r\r\r\r\r\r\n if(addItems<50){\r\r\r\r\r\r\n addItems++;\r\r\r\r\r\r\n $(\"#eitem\"+id).val(addItems);\r\r\r\r\r\r\n }\r\r\r\r\r\r\r\r\n}", "function addTeamMembers() {\n inquirer\n .prompt([\n {\n type: 'list',\n name: 'addMembers',\n message: 'please select one of the following options:',\n choices: [\n 'Add an additional Engineer',\n 'Add an Intern',\n \"generate Team!\",\n ],\n },\n ])\n .then(answers => {\n switch (answers.addMembers) {\n case 'Add an additional Engineer': {\n promptEngineer();\n break;\n }\n case 'Add an Intern': {\n promptIntern();\n break;\n }\n case \"generate Team!\": {\n buildTeam();\n break;\n }\n }\n });\n }", "function addParticipants(conversation) {\n const right = document.getElementById(\"right\");\n const section = right.querySelector('section');\n //Selects all participants that are confirmed.\n const elements = section.querySelectorAll('.correct');\n let post = {};\n //Introduces them into the post.\n elements.forEach(function (elem, i) {\n let participant = `participant-${i}`;\n post[participant] = elem.participant;\n });\n //If no participants have been confirmed, the function simply\n //shows an alert telling the user they are only one\n //in the conversation.\n if (Object.keys(post).length !== 0) {\n post.conversation = conversation;\n xhttp(\"POST\", \"add-participants.php\", post, (response) => {\n if (!response) {\n alert(\"There's a problem adding atleast one of these participants.\");\n } else {\n document.getElementById(\"added-friends\").innerHTML = \"\";\n alert(\"Conversation created!\");\n }\n });\n } else {\n alert(\"You are the only user in this conversation.\");\n }\n}", "function createFriendsList(index, pplMax) {\n const maxFriends = (faker.random.number() % 40) + 10\n const ids = new Set()\n for (let i = 0; i < maxFriends; i++) {\n ids.add({\n aId: index,\n bId: faker.random.number() % pplMax\n })\n }\n return [...ids]\n}" ]
[ "0.597787", "0.57473415", "0.5282591", "0.52489483", "0.5223449", "0.5209946", "0.52049685", "0.51731074", "0.51531446", "0.51516247", "0.50568515", "0.50505996", "0.5031463", "0.5000281", "0.49800718", "0.497607", "0.49655685", "0.49582952", "0.4954068", "0.4947687", "0.49411345", "0.49318638", "0.49297628", "0.4927385", "0.49273518", "0.4887478", "0.48854855", "0.48766598", "0.48714814", "0.48505917", "0.48499492", "0.4842742", "0.48426557", "0.4834571", "0.48328397", "0.4828421", "0.48282254", "0.4827491", "0.48207173", "0.48186886", "0.48077017", "0.48011374", "0.47971332", "0.4795712", "0.47922266", "0.47888803", "0.4787992", "0.47842178", "0.47828043", "0.47741148", "0.47686657", "0.47663665", "0.47643334", "0.47560057", "0.47527874", "0.47455722", "0.47438955", "0.47420147", "0.47419718", "0.4740741", "0.47361338", "0.47316882", "0.47261328", "0.47243097", "0.4720924", "0.471942", "0.47184357", "0.47171775", "0.4712063", "0.471172", "0.47097138", "0.4708599", "0.4702405", "0.4701174", "0.46979517", "0.46971765", "0.4694948", "0.46941012", "0.46893114", "0.46881354", "0.4687329", "0.46846566", "0.46838298", "0.46766523", "0.4676223", "0.46755913", "0.46748808", "0.46722835", "0.46657994", "0.4658352", "0.465479", "0.4649959", "0.46433374", "0.46361923", "0.4634848", "0.46291736", "0.46275985", "0.4625729", "0.46251786", "0.46239382" ]
0.58925647
1
Adds 0 when value is <10
function checkTime(i) { if (i < 10) { i = "0" + i; } return i; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addZero(value) {\n if (value < 10) {\n return value = '0' + value;\n } else {\n return value;\n }\n }", "function addzero(i){\n if(i<10){\n i=\"0\"+i;\n}\nreturn i;\n}", "addToValue10(val){\n return val + 10;\n }", "function addTen(value) {\n\treturn value + 10;\n}", "function addZero(i) {\n\t// check if the number is less than 10\n\tif(i < 10) {\n\t\t// add a zero in front if less than 10\n\t\ti = \"0\" + i\n\t}\n\t// send back the new value of i\n\treturn i\n}", "function addZero(number) {\n if (number<10) {\n return '0' + number;\n }\n return number\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(no)\n{\n if(no >= 10){\n return no;\n }else{\n return \"0\".no;\n }\n}", "function ten(arr){\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0;\n }\n }\n return arr; \n}", "function addZeroIfNeeded(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function isLessThanTen(value) {\n if (value < 10) {\n return \"0\" + value;\n } else {\n return value;\n }\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero (val){\n\treturn (val <= 9) ? (\"0\" + val) : val;\n}", "function addZero (val){\n\treturn (val <= 9) ? (\"0\" + val) : val;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(x) {\n if(x < 10 && x[0] !== '0') return '0' + x;\n else return x\n }", "function addZero(i) \n{\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZeroToNumber(number){\n if(number < 10) {\n return '0' + number;\n }\n return number;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n}", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function addZero(i)\n{\n if(i < 10)\n {\n i = \"0\" + i;\n }\n return i;\n}", "function addLeadingZero(i) {\n if (i<10) {\n i = \"0\" + i;\n }\n return i;\n}", "function zerolead(value) {\n\treturn (value < 10) ? '0' + value : value;\n}", "function zerolead(value) {\n\treturn (value < 10) ? '0' + value : value;\n}", "function numberWithLeadingZeros(value) {\n return (value < 10 ? '0' : '') +value;\n}", "function numberWithLeadingZeros(value) {\n return (value < 10 ? '0' : '') +value;\n}", "function zeroCheck(value) {\n return value < 10 ? ('0' + value) : value;\n}", "function addZero(number) {\r\n if(number < 10) {\r\n number = '0' + number;\r\n }\r\n return number;\r\n}", "function addZero(number) {\n if (number < 10) {\n return '0' + number;\n } else {\n return number;\n }\n }", "function addZero(i){\n\tvar text = i;\n\tif(text < 10)\n\t\ttext = \"0\" + text;\n\t\n\treturn text;\n}", "function addZero(i)\n{\n\tif (i < 10)\n\t{\n\t\ti = \"0\" + i;\n\t}\n\treturn i;\n}", "function addZero(num) {\n if (num < 10) {\n return `0${num}`;\n } else {\n return num;\n }\n }", "function addZero(i) {\n\tif (i < 10) {\n\t i = \"0\" + i;\n\t}\n\treturn i;\n}", "function addZero(input) {\n if (input < 10) {\n input = \"0\" + input.toString();\n }\n return input;\n}", "function addZero(i) {\n\t\tif (i < 10) {\n\t\t\ti = '0' + i;\n\t\t}\n\t\treturn i;\n\t}", "function addZero (number) {\r\n if(number < 10) {\r\n return \"0\" + number;\r\n }\r\n}", "function fatebondLimitTen(input) {\n\tvar output = 0;\n\tif(input > 10) {\n\t\toutput = 10;\n\t} else if(input < -10) {\n\t\toutput = -10;\n\t} else {\n\t\toutput = input;\n\t}\n\treturn output;\n}", "function addZero(num) {\n if (num < 10) {\n return `0${num}`\n } else {\n return num;\n }\n }", "function AddTen(value) {\n return value + 10;\n}", "addZero(int){\n return (int < 10) ? `0${int}` : int;\n }", "function addZero(num) {\n if (num >= 0 && num < 10) {\n return `0${num}`;\n }\n return num;\n }", "function add_zero(i) {\n\t\treturn (i < 10) ? (i = \"0\" + i) : i;\n\t}", "function updateScore () {\n if (theScore < 10) {\n score.innerHTML = '0' + theScore\n } else {\n score.innerHTML = theScore\n }\n}", "function addZero(int) {\n if (int < 10) {\n return `0${int}`\n }\n return `${int}`\n }", "function addZero(numero) {\r\n if(numero < 10) {\r\n numero = '0' + numero;\r\n }\r\n return numero;\r\n }", "function fnRelu(value) { return value > 0 ? value : 0 }", "function addZero(number){\r\n return(parseInt(number, 10) < 10 ? '0' : '') + number;\r\n}", "function addZero(tDigit) {\n\tif (tDigit < 10){ \t\t// if the number is less than 10\n\t tDigit = \"0\" + tDigit; // add a string zero (converts number to string)\n\t}\n\treturn tDigit; // pass the value of tDigit back to the statement\n}", "function addZero(time) {\n if (time < 10) {\n time = '0' + time;\n }\n return time;\n}", "function setZeroFirstFormat(value)\n{\n if (value < 10) {\n value = '0' + value;\n }\n return value;\n}", "function addZeroNumber (val) {\n // convert integers to string, to measure their lenght\n let valString = val.toString();\n // if .lenght is less than two, it means the number is in the single digits\n if (valString.length < 2) {\n return \"0\" + valString;\n } else {\n return valString;\n }\n}", "function addZero(n){\n return n<10? '0'+n:''+n;\n}", "function zeroFill(i){\n\n //check if the i is more or equal to than 10, if so just return the same int.\n if(i>=10){\n return i;\n }\n\n //if less than 10, then zero fill.\n if(i<10){\n\n //add a 0 to the string and return it.\n return 0 + i.toString();\n }\n}", "function func10(inputArray){\n for(var i=0; i<inputArray.length; i++){\n if(inputArray[i]<0){\n inputArray[i]=0;\n }\n }\n return inputArray;\n}", "function addZero(n){\n return n < 10 ? '0' + n : n;\n}", "function addZero(n) {\n return (n < 0 || n > 9 ? \"\" : \"0\") + n;\n}", "function addLeadingZeros(number) {\n if (number < 10) {\n return \"0\" + number;\n }\n return number;\n}", "function addZero(num) {\n if (num < 10) {\n num = \"0\" + num;\n }\n return num;\n }", "function aggiungiZero(i) {\n if (i < 10) {\n i = \"0\" + i;\n }\n return i;\n }", "function positiveVal(value){\n if (value >0){return \"+\"+value}\n else return value;\n }", "function addZero(num) {\n if (num < 10) {\n return \"0\" + num;\n } else {\n return num;\n }\n }", "function addZero(e) {\n return (parseInt(e, 10) < 10 ? \"0\" : \"\") + e;\n }", "function addLeadingZero(num) {\n if (num < 10) {\n return \"0\" + num;\n } else {\n return num;\n }\n}", "function addZero(n) {\r\n return (parseInt(n, 10) < 10 ? '0': '') + n;\r\n}", "function prefixUnitZero(val) {\n let newVal = val;\n if(val < 0) {\n newVal = val / -1;\n }\n newVal = newVal < 10 ? `0${newVal}` : newVal;\n if(val < 0) {\n newVal = `-${newVal}`;\n }\n return newVal;\n}", "function addZero(time){\n return (time < 10 ? \"0\" : \"\") + time;\n}", "function addZero(num) {\n return (parseInt(num, 10) < 10 ? '0' : '') + num;\n}", "function addZero(num) {\n if (num <= 9) return `0${num}`;\n return num;\n}", "function zeroPadded(val) {\n if (val >= 10)\n return val;\n else\n return '0' + val;\n }", "function addZero (n) {\n return (parseInt(n, 10) < 10 ? '0' : '') + n\n}", "function change(val){\r\n if(val > 0){\r\n return '' + val + '';\r\n }else if(val < 0){\r\n return '' + val + '';\r\n }\r\n return val;\r\n }", "function change(val){\r\n if(val > 0){\r\n return '' + val + '';\r\n }else if(val < 0){\r\n return '' + val + '';\r\n }\r\n return val;\r\n }", "function change(val){\r\n if(val > 0){\r\n return '' + val + '';\r\n }else if(val < 0){\r\n return '' + val + '';\r\n }\r\n return val;\r\n }", "function change(val){\r\n if(val > 0){\r\n return '' + val + '';\r\n }else if(val < 0){\r\n return '' + val + '';\r\n }\r\n return val;\r\n }", "function change(val){\r\n if(val > 0){\r\n return '' + val + '';\r\n }else if(val < 0){\r\n return '' + val + '';\r\n }\r\n return val;\r\n }", "function change(val){\r\n if(val > 0){\r\n return '' + val + '';\r\n }else if(val < 0){\r\n return '' + val + '';\r\n }\r\n return val;\r\n }", "function zeroIt(a) { return( a < 10 ? \"0\"+a : a ); }", "function AddZero(num) {\n return (num >= 0 && num < 10) ? \"0\" + num : num + \"\";\n }", "function p10(){\n var arr = [-9,-10,12,3,-32,100,-1998]\n for(var i = 0; i < arr.length; i++){\n if(arr[i] < 0){\n arr[i] = 0\n }\n }\n console.log(arr)\n}", "function addZeroBefore(number, digits) {\n\t\tvar numDig = digits-String(number).length;\n\t\tif (numDig<=0) {\n\t\t\treturn String(number);\n\t\t}\n\t\tnumDig = Math.pow(10, numDig);\n\t\tvar stringDig = String(numDig).substring(1);\n\t\treturn stringDig + String(number);\n\t}", "function checkCapValue(obj) {\n if (obj.value > 10) {\n obj.value = 10;\n }\n if (obj.value < 1) {\n obj.value = 1;\n }\n \n}", "function appendZeroes(number) {\n if (number <= 9) {\n return \"0\" + number;\n }\n return number\n}", "function addZero(n) {\n return(parseInt(n, 10) < 10 ? '0' : '') + n;\n}", "function add(num){\n return num<10? \"0\"+num:num;\n }", "function addLeadingZero(num) {\n\treturn (num <= 9) ? (\"0\" + num) : num;\n}", "function incrementValue()\n{\n var value = parseInt(document.getElementById('number').value, 10);\n value = isNaN(value) ? 0 : value;\n if(value<10){\n value++;\n document.getElementById('number').value = value;\n }\n}", "function addZero(n){\n return (parseInt(n,10)< 10 ? '0' : '') +n;\n }", "function multiplyBy10(value) {\n\treturn 10 * value;\n}", "checkGreaterThanTen(cardValue){\n if (cardValue <= 10) {\n return cardValue;\n } else return 10;\n }", "function appendZero(number) {\n\treturn number < 10 ? \"0\" + number : number;\n}", "function log10(v) {\n return v >= 1000000000 ? 9 : v >= 100000000 ? 8 : v >= 10000000 ? 7 : v >= 1000000 ? 6 : v >= 100000 ? 5 : v >= 10000 ? 4 : v >= 1000 ? 3 : v >= 100 ? 2 : v >= 10 ? 1 : 0;\n }" ]
[ "0.74883896", "0.69815964", "0.6892145", "0.6848094", "0.6824816", "0.6799067", "0.679249", "0.6740773", "0.6713084", "0.6698843", "0.66845745", "0.6658378", "0.6633371", "0.6633371", "0.6628248", "0.6608697", "0.6606653", "0.66034716", "0.6554212", "0.6554212", "0.6554212", "0.6554212", "0.65410817", "0.6532948", "0.6532948", "0.6532948", "0.6532948", "0.65196043", "0.65196043", "0.65196043", "0.6496713", "0.64936435", "0.6491655", "0.6491655", "0.64819944", "0.64819944", "0.6475204", "0.6472749", "0.6439551", "0.6424727", "0.64112103", "0.64102477", "0.64081067", "0.639592", "0.63799226", "0.63769424", "0.6373411", "0.6370379", "0.6348996", "0.6331356", "0.63299096", "0.6319654", "0.62991124", "0.62767583", "0.62654126", "0.62543344", "0.62516564", "0.624827", "0.62240565", "0.621793", "0.6194834", "0.6188549", "0.6177", "0.61616385", "0.6159527", "0.61569947", "0.6143986", "0.6141451", "0.61350393", "0.61208093", "0.6108137", "0.6107725", "0.6106671", "0.6097223", "0.6087885", "0.6085805", "0.6068731", "0.60463", "0.6045275", "0.6036136", "0.601353", "0.601353", "0.601353", "0.601353", "0.601353", "0.601353", "0.60122085", "0.5998648", "0.599823", "0.59933156", "0.5992348", "0.59883213", "0.59831274", "0.59458864", "0.5933476", "0.59210885", "0.5920858", "0.5902468", "0.589368", "0.58894116", "0.5889053" ]
0.0
-1
add hillshading to 'outdoors' map style
addHillShading() { this.addLayerStyle(this.hillshade, this.hillshade.index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function hurrLegendStyle(feature) {\r\n if (feature.get('Hurricane') < 10) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Hurricane') < 20) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Hurricane') < 30) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Hurricane') < 40) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function stormLegendStyle(feature) {\r\n if (feature.get('Storm') < 9) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Storm') < 18) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Storm') < 27) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Storm') < 36) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function addEarthquakeMapStyle(feature) {\n\n // Note: feature is a list of dictionaries that has all earthquake coordinates \n\n // Set the boundary & color per Country \n return {\n \n // Opacity\n // Boundary opacity \n opacity: 0.5, \n // Circle marker opacity \n fillOpacity: 0.5,\n\n // Color\n // Boundary color \n color: \"black\",\n // Circle fill Color (based on magnitude of earthquake)\n // Color per country \n fillColor: getEarthquakeCircleColor(feature.properties.mag),\n\n // Size (radius) (based on magnitude of earthquake)\n radius: getEarthquakeCircleRadius(feature.properties.mag),\n\n // Boundary \n weight: 0.75,\n stroke: true\n\n };\n \n}", "function torLegendStyle(feature) {\r\n if (feature.get('Tornado') < 4) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Tornado') < 8) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Tornado') < 12) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Tornado') < 16) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "nightStyle() {\n this.map.setStyle('mapbox://styles/aradimison/cjm8vrk716bnn2rjlv9xba3h1');\n this.load();\n }", "function snowLegendStyle(feature) {\r\n if (feature.get('Snow') < 3) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Snow') < 6) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Snow') < 9) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Snow') < 12) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function initMap() {\n\n var uluru = { lat: 40.674, lng: -73.945 };\n // Styles a map in night mode.\n\n var main_color = '#0E2646', //Main color\n saturation_value = -1, //saturation\n brightness_value = 1; //brightness\n\n //Style for elements on map\n var style = [{\n //Saturation of notation on the map\n elementType: \"labels\",\n stylers: [\n { saturation: saturation_value }\n ]\n },\n { //We hide the signs of metro stations, stations, airports and other transport links on the map\n featureType: \"poi\",\n elementType: \"labels\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the road designation on the map\n featureType: 'road.highway',\n elementType: 'labels',\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the designation of local roads\n featureType: \"road.local\",\n elementType: \"labels.icon\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide the designation of the highway on the map\n featureType: \"road.arterial\",\n elementType: \"labels.icon\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n {\n //Hide road signs on the map\n featureType: \"road\",\n elementType: \"geometry.stroke\",\n stylers: [\n { visibility: \"off\" }\n ]\n },\n //Styles for different elements on the map\n {\n featureType: \"transit\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.government\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.sport_complex\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.attraction\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"poi.business\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"transit\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"transit.station\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"landscape\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n\n },\n {\n featureType: \"road\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"road.highway\",\n elementType: \"geometry.fill\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n },\n {\n featureType: \"water\",\n elementType: \"geometry\",\n stylers: [\n { hue: main_color },\n { visibility: \"on\" },\n { lightness: brightness_value },\n { saturation: saturation_value }\n ]\n }\n ];\n\n // Options map\n var map = new google.maps.Map(document.getElementById('google-map'), {\n center: uluru,\n scrollwheel: false,\n zoom: 15,\n styles: style\n });\n\n // Set marker on map\n var marker = new google.maps.Marker({\n position: uluru,\n map: map\n });\n}", "function style(feature) {\n if (map.getZoom() > 9) {\n return {\n \"color\": \"blue\",\n \"weight\" : \"0\",\n \"fillOpacity\": \"0\"\n }\n } else {\n return {\n \"color\": \"blue\",\n \"fillOpacity\": \"0\"\n }\n }\n }", "function zoneStyle(feature) {\n return {\n \"color\": \"#90ee90\",\n \"weight\": 2\n };\n }", "function zoneStyle(feature) {\n return {\n \"color\": \"#90ee90\",\n \"weight\": 2\n };\n }", "function zoneStyle(feature) {\n return {\n \"color\": \"#90ee90\",\n \"weight\": 2\n };\n }", "function mapstyle (){\n var date = new Date();\n var day_map = [{\"featureType\":\"landscape.natural\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"color\":\"#e0efef\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"visibility\":\"on\"},{\"hue\":\"#1900ff\"},{\"color\":\"#c0e8e8\"}]},{\"featureType\":\"road\",\"elementType\":\"geometry\",\"stylers\":[{\"lightness\":100},{\"visibility\":\"simplified\"}]},{\"featureType\":\"road\",\"elementType\":\"labels\",\"stylers\":[{\"visibility\":\"off\"}]},{\"featureType\":\"transit.line\",\"elementType\":\"geometry\",\"stylers\":[{\"visibility\":\"on\"},{\"lightness\":700}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#7dcdcd\"}]}];\n var night_map = [{\"featureType\":\"all\",\"elementType\":\"labels.text.fill\",\"stylers\":[{\"color\":\"#ffffff\"}]},{\"featureType\":\"all\",\"elementType\":\"labels.text.stroke\",\"stylers\":[{\"color\":\"#000000\"},{\"lightness\":13}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"administrative\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#144b53\"},{\"lightness\":14},{\"weight\":1.4}]},{\"featureType\":\"landscape\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#08304b\"}]},{\"featureType\":\"poi\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#0c4152\"},{\"lightness\":5}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.highway\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b434f\"},{\"lightness\":25}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.fill\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"road.arterial\",\"elementType\":\"geometry.stroke\",\"stylers\":[{\"color\":\"#0b3d51\"},{\"lightness\":16}]},{\"featureType\":\"road.local\",\"elementType\":\"geometry\",\"stylers\":[{\"color\":\"#000000\"}]},{\"featureType\":\"transit\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#146474\"}]},{\"featureType\":\"water\",\"elementType\":\"all\",\"stylers\":[{\"color\":\"#021019\"}]}];\n var breakout_map_2015 = [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#ababab\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.locality\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#404041\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n },\n {\n \"color\": \"#e3e3e3\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#cccccc\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#cccccc\"\n },\n {\n \"weight\": \"0.50\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"saturation\": \"-100\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station.airport\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station.airport\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#b1b1b1\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n }\n];\n // var hour = date.getHours();\n // if(6 < hour && hour < 21) {\n // return night_map;\n // } else { \n // return day_map; \n // }\n return breakout_map_2015;\n}", "function mapStyle(feature) {\n return{\n opacity: 1,\n fillOpacity: 1,\n fillColor: mapColor(feature.properties.mag),\n color: \"#000000\",\n radius: mapRadius(feature.properties.mag),\n stroke: true,\n weight: 0.5\n };\n\n \n }", "function fireLegendStyle(feature) {\r\n if (feature.get('Fire') < 55) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Fire') < 110) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Fire') < 165) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Fire') < 220) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function style_injuired(feature) {\r\n\r\n return {\r\n fillColor: getColor(feature.properties.n_injured_per_mil),\r\n weight: 2,\r\n opacity: 1,\r\n color: 'white',\r\n dashArray: '3',\r\n fillOpacity: 0.7\r\n };\r\n}", "function mapStyle(setting, checks) {\r\n\tvar newStyle = [];\r\n\tvar nextSet = [];\r\n\t\r\n\tif (window.opLayer) {\r\n\t\topLayer.setOptions({fillOpacity: setting.lightness/100}); \r\n\t}\r\n\t\r\n\t//Change the grayscale value\r\n\tif(checks.grayScale === true) {\r\n\t\tsetting.saturation = -100;\r\n\t} else {\r\n\t\tsetting.saturation = 0;\r\n\t}\r\n\t\r\n\t//Add checkbox options\r\n\tfor (var x in checks) {\r\n\t\tnextSet = window[x](checks[x], setting);\r\n\t\tfor (var y in nextSet) {\r\n\t\t\tnewStyle.push(nextSet[y]);\r\n\t\t}\r\n\t}\r\n\t\r\n\t//Set the new style\r\n\tmap.setOptions( {styles: newStyle} );\r\n\t\r\n\t//Return with thew new HSL settings\r\n\treturn setting;\r\n}", "brightStyle() {\n this.map.setStyle('mapbox://styles/mapbox/bright-v9');\n this.load();\n }", "function Start()\n{\n//\tmapName.renderer.material.color = Color(1,1,0,1);\n}", "function styleHomicidios2015(feature) {\n return {\n weight: .75,\n opacity: 0.5,\n color: 'grey',\n dashArray: '0',\n fillOpacity: 0.9,\n fillColor: choroplethizeHomicidios2015(feature.properties.homicidios2015_Grand_Total)\n }\n}", "function style(feature) \r\n\t{\r\n\t\treturn {\r\n \t\t\tweight: 1,\r\n\t\t\topacity: 0.8,\r\n\t\t\tcolor: 'white',\r\n\t\t\tdashArray: '1',\r\n\t\t\tfillOpacity: 0.0\r\n\t\t};\r\n\t}", "function style_killed(feature) {\r\n\r\n return {\r\n fillColor: getColor(feature.properties.n_killed_per_mil),\r\n weight: 2,\r\n opacity: 1,\r\n color: 'white',\r\n dashArray: '3',\r\n fillOpacity: 0.7\r\n };\r\n}", "function amphibianlayeron(){\n\n$(\"#species_richness_scale\").show();\n\nfor (i=0; i <= 600; i++){\n\nif (countrieslayer._layers[i]){\nvar country = countrieslayer._layers[i];\ncountry.setStyle(grey);\n\n}\n}\n\nfor (var polygon in amphibianszones._layers) {\nmap.addLayer(amphibianszones._layers[polygon]);\namphibianszones._layers[polygon].setStyle(none);\nfor (var inner in amphibianszones._layers[polygon]._layers){\nif(inner && amphibianszones._layers[polygon].feature.id){\nif(amphibianszones._layers[polygon].feature.id >= 150){\namphibianszones._layers[polygon].setStyle(one);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 140){\namphibianszones._layers[polygon].setStyle(two);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 120){\namphibianszones._layers[polygon].setStyle(three);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 100){\namphibianszones._layers[polygon].setStyle(four);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 80){\namphibianszones._layers[polygon].setStyle(five);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 60){\namphibianszones._layers[polygon].setStyle(six);\n}\nelse if(amphibianszones._layers[polygon].feature.id >= 40){\namphibianszones._layers[polygon].setStyle(seven);\n}\n}\n}\n} \n}", "function colors() {\n \n\tmap.getLayer('countylayer').style('fill', function(data) {\n\t\tvar ddi = parseFloat(data.ddi);\n\t\tif (ddi <= 38.12357875) { //1st quartile\n\t\t\treturn \"#fef0d9\";\n\t\t} else if (ddi <= 50.8602104) {\n\t\t\treturn \"#fdcc8a\";\n\t\t} else if (ddi <= 64.03133336 ) {\n\t\t\treturn \"#fc8d59\";\n\t\t} else { //4th quartile\n\t\t\treturn \"#d7301f\";\n\t\t}\n\t});\n}", "function _elbow(d) {\n\t return \"M\" + d.source.x + \",\" + d.source.y + \n\t \t\"H\" + (d.source.x + (d.target.x-d.source.x)/2) + \n\t \t\"V\" + d.target.y + \"H\" + d.target.x;\n\t}", "createHeatmapLayers() {\n const properties = [\"deaths\", \"kills\"];\n let heatmapConfig = assign({}, this.state.heatmapConfig);\n let heatmapLayers = {};\n\n heatmapConfig.gradient = { \".3\": \"yellow\", \".4\": \"orange\", \"1\": \"red\" };\n heatmapLayers = h337.create(heatmapConfig);\n\n this.setState({ heatmapLayers });\n }", "function style(feature) {\r\n return {\r\n fillColor: \"#6977A2\",\r\n weight: 1,\r\n opacity: 0.2,\r\n color: 'white',\r\n dashArray: '3',\r\n fillOpacity: 0.2\r\n };\r\n}", "function style0(feature) {\n return {\n fillColor: \"#EAEAE9\",\n weight: 2,\n opacity: 1,\n color: '#575757',\n dashArray: '4',\n fillOpacity: 0.2\n };\n}", "function myStyleLines(feature) {\n switch (feature.properties.agency) {\n case 0:\n return {\n color: \"#fdfe00\",\n weight: 3,\n opacity: 1\n };\n break;\n case 1:\n return {\n color: \"#54ff01\",\n weight: 3,\n opacity: 1\n };\n break;\n case 2:\n return {\n color: \"#005de8\",\n weight: 3,\n opacity: 1\n };\n break;\n case 3:\n return {\n color: \"#8600ac\",\n weight: 3,\n opacity: 1\n };\n break;\n }\n}", "function style(feature) {\n\t\t\t\treturn {\n\t\t\t\t\tfillColor: '#FD8D3C',\n\t\t\t\t\tweight: 2,\n\t\t\t\t\topacity: 1,\n\t\t\t\t\tcolor: 'white',\n\t\t\t\t\tdashArray: '3',\n\t\t\t\t\tfillOpacity: 0.7\n\t\t\t\t};\n\t\t\t}", "function doStylenbo(feature) {\n return {\n color: 'orange',\n fillColor: 'yellow',\n weight: 5,\n dashArray: '9',\n opacity: 1.0,\n fillOpacity: 0.08\n };\n}", "function towerHover(towerMesh){\n\tif(CURRENT_HOVER_MODE == HOVER_ACTIVATE){\n\t\tvar hexColor;\n\t\tif( towerList[towerMesh.towerArrayPosition].onCooldown == 1){hexColor = 0xaa30b5;}\n\t\telse{hexColor = 0xff0000;}\n\t\tfor(var i = 0; i < towerMesh.material.materials.length; i++){\n\t\t\ttowerMesh.material.materials[i].emissive.setHex( hexColor );\n\t\t}\n\t\t//towerMesh.material.emissive.setHex( 0xff0000 );\n\t}\n\telse if(CURRENT_HOVER_MODE == HOVER_DESTROY){\n\t\tfor(var i = 0; i < towerMesh.material.materials.length; i++){\n\t\t\ttowerMesh.material.materials[i].emissive.setHex( 0xae1f1f );\n\t\t}\n\t\t//towerMesh.material.emissive.setHex( 0xae1f1f );\n\t}\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: color,\n\t weight: lnWidth,\n\t opacity: opacity\n\t }\n\t }\n\t }", "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 }", "function setupSightingsLegend(){\n let legend = L.control({position: 'bottomleft'});\n legend.onAdd = function (map) {\n var div = L.DomUtil.create('div', 'info legend'),\n grades = [-100, -50, 0, 50, 100, 150, 200],\n labels = [\"-100%\",\"-50%\",\"0\",\"+50%\",\"+100%\",\"+150%\", \"+200%\"];\n div.innerHTML += '<p>Sichtungen im Vergleich zum Vormonat</p><br>'\n for (var i = 0; i < grades.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + sigthingsColorScale(grades[i]) + '; border: 0.2px solid black\"></i> ' +\n labels[i] + '<br>';\n }\n return div;\n };\n return legend.addTo(map); \n}", "function addEarthquakeColorLegend(map) {\n\n // Legend object (bottom right)\n var legend = L.control({\n position: \"bottomright\"\n });\n\n // Add div for legend\n legend.onAdd = function() { \n var div = L.DomUtil.create(\"div\", \"colorlegend\");\n return div;\n }\n \n // return legend\n map.addControl(legend);\n\n}", "function floodLegendStyle(feature) {\r\n if (feature.get('Flood') < 8) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Flood') < 16) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Flood') < 24) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Flood') < 30) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function style0_2(feature) {\n return {\n fillColor: \"#EAEAE9\",\n weight: 0.5,\n opacity: 1,\n color: '#575757',\n fillOpacity: 0.2\n };\n}", "function hslaify(d) {\n return \"hsla(\" + d.Hue + \",50%,50%,1)\";\n}", "function oldmapStyle(newStyle) {\r\n\t//console.log(newStyle);\r\n\tmap.setOptions( {styles: newStyle} );\r\n}", "update(time) {\n /*light.intensity = (Math.sin(time)+1.5)/1.5;\n light.color.setHSL( Math.sin(time), 0.5, 0.5 );\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 styleVentas2017_03(feature) {\n return {\n weight: .75,\n opacity: 0.5,\n color: 'grey',\n dashArray: '0',\n fillOpacity: 0.9,\n fillColor: choroplethize(feature.properties.ventas2017_03_Monto)\n }\n}", "function highLightTLColor(tlColorTd) {\n tlColorTd.attr(\"style\", \"border:solid 1px #0033ff; background:rgba(1, 149, 194, 0.2);\")\n tlColorTd.attr('class', 'tl_hl_color');\n}", "function style(feature) {\r\n return {\r\n fillColor: '#ffffff00',\r\n weight: 2,\r\n opacity: 1,\r\n color: '#ff0000',\r\n fillOpacity: 0\r\n };\r\n}", "function lightness(light, setting) {\r\n\tif (mapDone == 1) {\r\n\t\tvar newHSL = [\r\n\t\t\t{\r\n\t\t\t\tfeatureType: \"all\",\r\n\t\t\t\telementType: \"all\",\r\n\t\t\t\tstylers: [ \r\n\t\t\t\t\t{hue: setting.saturation},\r\n\t\t\t\t\t{saturation: setting.saturation},\r\n\t\t\t\t\t{lightness: light}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t];\r\n\t\treturn newHSL;\r\n\t\t\r\n\t} else {\r\n\t\treturn;\r\n\t}\r\n}", "function style(feature) {\n return {\n fillColor: '#826600',\n color: \"#d1a917\",\n weight: 0,\n opacity: 1,\n fillOpacity: 0.7\n };\n}", "function changeWatershed(nhid) {\n var layer = getLayer(nhid);\n assignData(layer.feature.properties);\n //$(\".overview\").hide();\n $(\".measure-info\").show();\n updateData(HUCMeta[activeMeasure]);\n highlightSelected(layer);\n hashChange(activeMeasure, activeRecord.id ? activeRecord.id : \"\");\n}", "function buildingStyle(feature){\n\treturn{\n\t\tcolor: '#FFF', // Color of the stroke of the building\n\t\tweight: 1, // Weight of the stroke of the building\n\t\topacity: 0, // Opacity of the stroke of the building \n\t\tfillOpacity: 0, // Fill opacity of the building\n\t\tfillColor: '#FFF' // Fill color of the building\n\t}\n}", "function createMap(earthquakes) {\n\n // set up darkmap layer\n var darkmap = L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: 'Map data &copy; <a href=\"https://www.openstreetmap.org/\">OpenStreetMap</a> contributors, <a href=\"https://creativecommons.org/licenses/by-sa/2.0/\">CC-BY-SA</a>, Imagery © <a href=\"https://www.mapbox.com/\">Mapbox</a>',\n maxZoom: 18,\n id: 'mapbox/dark-v10',\n accessToken: \"pk.eyJ1IjoiYWx4cHJ5IiwiYSI6ImNrYW9saHZjNDA0Z3ozMG82cHZpcm0xbm8ifQ.yM3ZhZhGelQpcJBz0wtaiw\"\n });\n\n // set up baseMaps to store darkmap layer\n var baseMaps = {\n \"Dark Map\": darkmap\n };\n\n // set up overlayMaps \n var overlayMaps = {\n Earthquakes: earthquakes\n };\n\n // set variable to store map where formatting is held\n var myMap = L.map(\"map\", {\n center:[\n 40.09, -110.71\n ],\n zoom: 5,\n layers: [darkmap, earthquakes]\n });\n \n L.control.layers(baseMaps, overlayMaps, {\n collapsed: false\n }).addTo(myMap);\n\n // set up the legend\n var legend = L.control({ position: \"bottomleft\" });\n \n // add legend capabilities where color scole of the earthquake magnitude is shown \n legend.onAdd = function() {\n var div = L.DomUtil.create(\"div\", \"info legend\");\n var magScale = [0, 1, 2, 3, 4, 5]\n\n // loop through our density intervals and generate a label with a colored square for each interval\n for (var i = 0; i < magScale.length; i++) {\n div.innerHTML +=\n '<i style=\"background:' + markerColor(magScale[i]) + '\"></i> ' +\n magScale[i] + (magScale[i + 1] ? '&ndash;' + magScale[i + 1] + '<br>' : '+');\n }\n return div;\n};\n\n // add legend to the map\n legend.addTo(myMap);\n\n }", "function bioLegendStyle(feature) {\r\n if (feature.get('Biological') < 3) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fef0d9' // yellow \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n else if (feature.get('Biological') < 6) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fdcc8a' // light orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Biological') < 9) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#fc8d59' // orange \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n else if (feature.get('Biological') < 12) {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#e34a33' // red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n\r\n // else if ...\r\n else {\r\n return new ol.style.Style({\r\n image: new ol.style.Circle({\r\n radius: 5,\r\n fill: new ol.style.Fill({\r\n color: '#b30000' //dark red \r\n }),\r\n stroke: new ol.style.Stroke({\r\n width: 1,\r\n color: [255, 255, 255],\r\n })\r\n })\r\n });\r\n }\r\n}", "function createMapLegend() {\n\n}", "function mapOptions() {\n var mapStyles = [\n {\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#8ec3b9\"\n }\n ]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1a3646\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#64779e\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.neighborhood\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.province\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#4b6878\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#334e87\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#6f9ba5\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#3C7680\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#304a7d\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#2c6675\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [\n {\n \"color\": \"#255763\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#b0d5ce\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#023e58\"\n }\n ]\n },\n {\n \"featureType\": \"road.local\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#98a5be\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"color\": \"#1d2c4d\"\n }\n ]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#283d6a\"\n }\n ]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#3a4762\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#0e1626\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#4e6d70\"\n }\n ]\n }\n ],\n mapOptions = {\n center: {\n lat: officeLatCoord,\n lng: officeLonCoord\n },\n disableDefaultUI: true,\n mapTypeId: 'roadmap',\n scrollwheel: false,\n styles: mapStyles\n },\n directionsOptions = {\n suppressMarkers: true,\n polylineOptions: {\n strokeColor: mapStroke,\n strokeOpacity: mapStrokeOpacity,\n strokeWeight: mapStrokeWeight\n }\n };\n\n buildMap(mapOptions, directionsOptions);\n}", "highlightWins(wins) {\n\n for (const win of wins) {\n let paylineId = this.entity.attributes.winlineIdMap[win.id];\n let payline = sceneManager.find(paylineId).children[0];\n\n new TWEEN.Tween(payline)\n .to({ fake: 360 }, 100)\n .repeat(6)\n .delay(250)\n .onRepeat(() => {\n payline.style.fill = payline.style.fill === \"red\" ? \"black\" : \"red\";\n })\n .start();\n }\n }", "function templateHighIsland() {\n addStep(\"Hill\", \"1\", \"90-100\", \"65-75\", \"47-53\");\n addStep(\"Add\", 5, \"all\");\n addStep(\"Hill\", \"6\", \"20-23\", \"25-55\", \"45-55\");\n addStep(\"Range\", \"1\", \"40-50\", \"45-55\", \"45-55\");\n addStep(\"Smooth\", 2);\n addStep(\"Trough\", \"2-3\", \"20-30\", \"20-30\", \"20-30\");\n addStep(\"Trough\", \"2-3\", \"20-30\", \"60-80\", \"70-80\");\n addStep(\"Hill\", \"1\", \"10-15\", \"60-60\", \"50-50\");\n addStep(\"Hill\", \"1.5\", \"13-16\", \"15-20\", \"20-75\");\n addStep(\"Multiply\", .8, \"20-100\");\n addStep(\"Range\", \"1.5\", \"30-40\", \"15-85\", \"30-40\");\n addStep(\"Range\", \"1.5\", \"30-40\", \"15-85\", \"60-70\");\n addStep(\"Pit\", \"2-3\", \"10-15\", \"15-85\", \"20-80\");\n }", "function createHiddenLights() {\n const hiddenLight1 = createStreetSpotLight(true);\n hiddenLight1.position.set(7, 4, 3);\n hiddenLight1.target.position.set(7, 0, 3);\n\n const hiddenLight2 = createStreetSpotLight(true);\n hiddenLight2.position.set(7, 4, -3);\n hiddenLight2.target.position.set(7, 0, -3);\n\n const hiddenLight3 = createStreetSpotLight(true);\n hiddenLight3.position.set(-6, 4, 3);\n hiddenLight3.target.position.set(-6, 0, 3);\n\n const hiddenLight4 = createStreetSpotLight(true);\n hiddenLight4.position.set(-6, 4, -3);\n hiddenLight4.target.position.set(-6, 0, -3);\n\n scene.add(hiddenLight1, hiddenLight1.target);\n scene.add(hiddenLight2, hiddenLight2.target);\n scene.add(hiddenLight3, hiddenLight3.target);\n scene.add(hiddenLight4, hiddenLight4.target);\n}", "function updateLightMap(map) {\r\n var raylength = 0.6; // must be positive; keep 1 or below; detail increases at this decreases\r\n var raydensity = 100; // density of rays, as #/per full circle. detail increases as this increases\r\n\r\n var rayangle = 2 * Math.PI / raydensity;\r\n\r\n // clear lightmap\r\n for (var i = 0; i < map.lightmap.length; i++) {\r\n map.lightmap[i] = false;\r\n map.coloroverlay[i] = {r: 0, g: 0, b: 0, n: 0};\r\n map.shadowmap[i] = 0;\r\n }\r\n\r\n // fill the shadowmap\r\n for (var i = 0; i < map.creatureset.length; i++) {\r\n map.shadowmap[map.creatureset[i].x + map.creatureset[i].y * map.width] = map.creatureset[i].size;\r\n }\r\n\r\n // go through each light source, draw rays from each, light up tiles light reaches\r\n for (var l = 0; l < map.lights.length; l++) {\r\n var thislight = map.lights[l];\r\n if (thislight.timing === 0 || getMiliTime() % (thislight.timing * 2) < thislight.timing) {\r\n for (var r = thislight.startrad; r < thislight.startrad + thislight.radlen; r += rayangle) {\r\n // draw rays in segments, adding up to the intensity. light up solid objects, but stop there.\r\n var dx = Math.cos(r) * raylength;\r\n var dy = Math.sin(r) * raylength;\r\n var sx = thislight.x + 0.5;\r\n var sy = thislight.y + 0.5;\r\n \r\n var len = 0;\r\n\r\n // using arctan * 2 / pi gives a decent -1->1 range conversion for distance->intensity values\r\n // we'll never get a negative length, so just do 1 - arctan * 2 / pi for a 0->1 value\r\n\r\n map.lightmap[Math.floor(sx) + map.width * Math.floor(sy)] = true; // always light this tile\r\n map.addColor(Math.floor(sx), Math.floor(sy), thislight.color);\r\n while (len < thislight.intensity \r\n && map.getTile(Math.floor(sx), Math.floor(sy)) \r\n && !map.getTile(Math.floor(sx), Math.floor(sy)).doesBlockLight) {\r\n len += raylength;\r\n sx += dx;\r\n sy += dy;\r\n map.lightmap[Math.floor(sx) + map.width * Math.floor(sy)] = true;\r\n\r\n // if there's a light blocker here, skip some length\r\n len += map.shadowmap[Math.floor(sx) + map.width * Math.floor(sy)];\r\n\r\n map.addColor(Math.floor(sx), Math.floor(sy), thislight.color, (1 - Math.atan(len) / Math.PI * 2));\r\n }\r\n }\r\n }\r\n }\r\n}", "function initMap() {\n // Styles a map\n map = new google.maps.Map(document.getElementById('map'), {\n center: { lat: 41.878, lng: -87.629 },\n zoom: 8,\n styles: [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#523735\"\n }]\n },\n {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#c9b2a6\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#dcd2be\"\n }]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#ae9e90\"\n }]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#93817c\"\n }]\n },\n {\n \"featureType\": \"poi.business\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#a5b076\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text\",\n \"stylers\": [{\n \"visibility\": \"off\"\n }]\n },\n {\n \"featureType\": \"poi.park\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#447530\"\n }]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f5f1e6\"\n }]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#fdfcf8\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#f8c967\"\n }]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#e9bc62\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#e98d58\"\n }]\n },\n {\n \"featureType\": \"road.highway.controlled_access\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\n \"color\": \"#db8555\"\n }]\n },\n {\n \"featureType\": \"road.local\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#806b63\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#8f7d77\"\n }]\n },\n {\n \"featureType\": \"transit.line\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"color\": \"#ebe3cd\"\n }]\n },\n {\n \"featureType\": \"transit.station\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"color\": \"#dfd2ae\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\n \"color\": \"#b9d3c2\"\n }]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"color\": \"#92998d\"\n }]\n }\n ]\n });\n\n var curr_page = 1; //Current page of GET response\n var num_pages = 1; //Initialize number of pages response has\n var url = \"http://api.brewerydb.com/v2/locations/?p=\" + curr_page.toString() + \"&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json\"; //URL to get breweries in Illinois\n\n // Request first page of info\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n var response = JSON.parse(xmlHttp.responseText); //Parse json response\n num_pages = response[\"numberOfPages\"]; //Set number of pages response has\n markbrewery(response); //Mark first page of response\n\n //Request and mark each page of response \n for (curr_page = 2; curr_page <= num_pages; curr_page++) {\n url = \"http://api.brewerydb.com/v2/locations/?p=\" + curr_page.toString() + \"&region=Illinois&key=481d514448fd7365873ba9501d928e10&format=json\";\n httpGetAsync(url);\n }\n }\n }\n xmlHttp.open(\"GET\", url, true); // true for asynchronous \n xmlHttp.send();\n}", "function addHuntsville(sizeIn) {\n var Hunstville = L.circle([34.7, -86.6], sizeIn, {\n color: 'red',\n fillColor: 'blue',\n fillOpacity: 0.5\n }).addTo(map);\n}", "function style(feature) {\n console.log('feature ooo',feature.id);\n return {\n fillColor: getColor(feature.id),\n weight: 1,\n opacity: 0.9,\n color: 'black',\n dashArray: '3',\n fillOpacity: 01\n };\n}", "function districtStyle(feature) {\n return {\n opacity: 1,\n dashArray: '3',\n fillOpacity: 0.7,\n fillColor: getOriginalColor()\n };\n}", "function highLight(div) {\n\n /*if(memEletSelect != div && memEletSelect != undefined && div.getAttribute(\"id\") !=\"g5k.\"){\n \n for( var i = 1; i < div.childNodes.length-1; i++){\n \n //in safari and chrome\n var color =div.childNodes[i].style.fill;\n if(color[0] === \"#\"){\n color = hexToRgb(color);\n color.r -= 50;\n color.g -= 50;\n color.b -= 50;\n div.childNodes[i].style.fill= \"rgb(\"+color.r+\",\"+color.g+\",\"+color.b+\")\";\n }\n //in opera and firefox\n if(color[0]===\"r\"){\n color=color.split(\",\");\n var r = parseInt(color[0].slice(4))-50;\n var g= parseInt(color[1]) -50;\n var b = parseInt(color[2].slice(0,color[2].length-1)) -50;\n div.childNodes[i].style.fill= \"rgb(\"+r+\",\"+g+\",\"+b+\")\";\n \n \n }\n }\n \n div.childNodes[i].style.border=\" solid 1px rgb(230,230,230)\";\n div.childNodes[i].style.backgroundColor=\"rgb(230,230,230)\";\n \n \n }*/\n\n if (memEletSelect === undefined && div.getAttribute(\"id\") != \"g5k.\") {\n\n for (var i = 1; i < (div.childNodes.length - 1) / 2; i++) {\n //in safari and chrome\n var color = div.childNodes[i].style.fill;\n if (color[0] === \"#\") {\n color = hexToRgb(color);\n color.r -= 50;\n color.g -= 50;\n color.b -= 50;\n div.childNodes[i].style.fill = \"rgb(\" + color.r + \",\" + color.g + \",\" + color.b + \")\";\n }\n //in opera and firefox\n if (color[0] === \"r\") {\n color = color.split(\",\");\n var r = parseInt(color[0].slice(4)) - 50;\n var g = parseInt(color[1]) - 50;\n var b = parseInt(color[2].slice(0, color[2].length - 1)) - 50;\n div.childNodes[i].style.fill = \"rgb(\" + r + \",\" + g + \",\" + b + \")\";\n\n\n }\n }\n\n div.style.border = \" solid 1px rgb(230,230,230)\";\n div.style.backgroundColor = \"rgb(230,230,230)\";\n memEletSelect = div;\n }\n}", "greyOut(list) {\r\n list.forEach((item) => {\r\n if (\r\n String(item.color.rgb()) ===\r\n String(chroma(item.div.style.backgroundColor).rgb())\r\n ) {\r\n item.div.style.backgroundColor = chroma(\r\n item.div.style.backgroundColor\r\n ).darken(2);\r\n }\r\n });\r\n }", "function style(feature) {\n return {\n weight: 2,\n opacity: 1,\n color: 'green',\n dashArray: '3',\n fillOpacity: 0.7\n };\n}", "function sunnyjar_theme_googlemap_styles($styles) {\n\t\"use strict\";\n\t// Put here your theme-specific code to add GoogleMap styles\n\t// It will be called before GoogleMap init when page is loaded\n $styles['light'] = [{\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#e9e9e9\"}, {\"lightness\": 17}]\n }, {\n \"featureType\": \"landscape\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#f5f5f5\"}, {\"lightness\": 20}]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\"color\": \"#ffffff\"}, {\"lightness\": 17}]\n }, {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\"color\": \"#ffffff\"}, {\"lightness\": 29}, {\"weight\": 0.2}]\n }, {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#ffffff\"}, {\"lightness\": 18}]\n }, {\n \"featureType\": \"road.local\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#ffffff\"}, {\"lightness\": 16}]\n }, {\n \"featureType\": \"poi\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#f5f5f5\"}, {\"lightness\": 21}]\n }, {\n \"featureType\": \"poi.park\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#dedede\"}, {\"lightness\": 21}]\n }, {\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\"visibility\": \"on\"}, {\"color\": \"#ffffff\"}, {\"lightness\": 16}]\n }, {\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\"saturation\": 36}, {\"color\": \"#333333\"}, {\"lightness\": 40}]\n }, {\"elementType\": \"labels.icon\", \"stylers\": [{\"visibility\": \"off\"}]}, {\n \"featureType\": \"transit\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\"color\": \"#f2f2f2\"}, {\"lightness\": 19}]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [{\"color\": \"#fefefe\"}, {\"lightness\": 20}]\n }, {\n \"featureType\": \"administrative\",\n \"elementType\": \"geometry.stroke\",\n \"stylers\": [{\"color\": \"#fefefe\"}, {\"lightness\": 17}, {\"weight\": 1.2}]\n }\n ];\n\t$styles['greyscale'] = [\n \t{ \"stylers\": [\n \t{ \"saturation\": -100 }\n ]\n }\n\t];\n\t$styles['inverse'] = [\n\t\t{ \"stylers\": [\n\t\t\t{ \"invert_lightness\": true },\n\t\t\t{ \"visibility\": \"on\" }\n\t\t\t]\n\t\t}\n\t];\n\t$styles['simple'] = [\n \t{ stylers: [\n \t{ hue: \"#00ffe6\" },\n { saturation: -20 }\n\t\t\t]\n\t\t},\n\t\t{ featureType: \"road\",\n elementType: \"geometry\",\n stylers: [\n\t\t\t{ lightness: 100 },\n \t{ visibility: \"simplified\" }\n ]\n\t\t},\n\t\t{ featureType: \"road\",\n elementType: \"labels\",\n stylers: [\n \t{ visibility: \"off\" }\n ]\n\t\t}\n\t];\n\treturn $styles;\n}", "function style(feature) {\r\n return {\r\n fillColor: getColor(feature.properties.POP_EST),\r\n weight: 2,\r\n opacity: 1,\r\n color: \"white\",\r\n dashArray: \"1\",\r\n fillOpacity: 0.3,\r\n };\r\n}", "function remove_colour_map(data){\n map.selectAll(\".marker\")\n .style(\"background-color\", function(d){\n if (d.searched_house == true)\n {\n return \"yellow\"\n }\n else if (barchart_data.indexOf(d) !== -1)\n {\n return \"steelblue\"\n }\n })\n}", "function darkenStateOnMapToMatchHighlightOnList(stateAbbreviation) {\n clearDarkenenedState(); //remove current darkenend state before replacing\n\n var svgState = svgObj.contentDocument.getElementById(stateAbbreviation);\n //check if svg element is already bordered:\n var className = svgState.getAttribute('class');\n className = (className.indexOf('bordered') > -1) ? className : className + ' bordered';\n svgState.setAttribute('class', className);\n }", "function style(feature){\n return{\n opacity: 1,\n fillOpacity: 0.5,\n fillColor: color(feature.properties.mag),\n color: \"black\",\n weight: 0.1,\n stroke: true\n \n };\n }", "function updateStyles() {\n\tconsole.log('updateStyles');\n\tvar zoom = rkGlobal.leafletMap.getZoom();\n\tfor(const key of Object.keys(rkGlobal.segments)) {\n\t\tconsole.log(key);\n\t\tvar properties = JSON.parse(key);\n\t\tvar showFull = zoom >= rkGlobal.priorityFullVisibleFromZoom[properties.priority];\n\t\tvar showMinimal = zoom < rkGlobal.priorityFullVisibleFromZoom[properties.priority] && zoom >= rkGlobal.priorityReducedVisibilityFromZoom[properties.priority];\n\n\t\tvar lineStyle;\n\t\tif(showFull) {\n\t\t\tlineStyle = getLineStyle(zoom, properties);\n\t\t} else if(showMinimal) {\n\t\t\tlineStyle = getLineStyleMinimal(properties);\n\t\t}\n\n\t\tvar lines = rkGlobal.segments[key].lines;\n\t\tif(showFull || showMinimal) {\n\t\t\tlines.setStyle(lineStyle);\n\t\t\trkGlobal.leafletMap.addLayer(lines);\n\t\t} else {\n\t\t\trkGlobal.leafletMap.removeLayer(lines);\n\t\t}\n\n\t\t// steep lines are drawn twice, once regular,\n\t\t// a second time as bristles (that's what this copy is for)\n\t\tvar steepLines = rkGlobal.segments[key].steepLines;\n\t\tif(steepLines !== undefined) {\n\t\t\tif(showFull || showMinimal) {\n\t\t\t\tvar steepLineStyle;\n\t\t\t\tif(showFull) {\n\t\t\t\t\tsteepLineStyle = getSteepLineStyle(zoom, properties);\n\t\t\t\t} else {\n\t\t\t\t\tsteepLineStyle = getSteepLineStyleMinimal(properties);\n\t\t\t\t}\n\t\t\t\tsteepLines.setStyle(steepLineStyle);\n\t\t\t\trkGlobal.leafletMap.addLayer(steepLines);\n\t\t\t} else {\n\t\t\t\trkGlobal.leafletMap.removeLayer(steepLines);\n\t\t\t}\n\t\t}\n\n\t\tvar decorators = rkGlobal.segments[key].decorators;\n\t\tif((showFull || showMinimal) && zoom >= rkGlobal.onewayIconThreshold && properties.oneway === 'yes') {\n\t\t\tdecorators.setPatterns(getOnewayArrowPatterns(zoom, properties, lineStyle.weight));\n\t\t\trkGlobal.leafletMap.addLayer(decorators);\n\t\t} else {\n\t\t\trkGlobal.leafletMap.removeLayer(decorators);\n\t\t}\n\t}\n\n\tif(zoom >= rkGlobal.iconZoomThresholds[1]) {\n\t\trkGlobal.leafletMap.removeLayer(rkGlobal.markerLayerLowZoom);\n\t\trkGlobal.leafletMap.addLayer(rkGlobal.markerLayerHighZoom);\n\t} else if(zoom >= rkGlobal.iconZoomThresholds[0]) {\n\t\trkGlobal.leafletMap.removeLayer(rkGlobal.markerLayerHighZoom);\n\t\trkGlobal.leafletMap.addLayer(rkGlobal.markerLayerLowZoom);\n\t} else {\n\t\trkGlobal.leafletMap.removeLayer(rkGlobal.markerLayerHighZoom);\n\t\trkGlobal.leafletMap.removeLayer(rkGlobal.markerLayerLowZoom);\n\t}\n}", "function oldColor() {\n if (ALaxis === 'distanceSpot')\n return '#ff0000';\n else if (ALaxis === 'angleSpot')\n return '#0000ff';\n else if (ALaxis === 'colorRing' || ALaxis === 'lightnessRing')\n return '#888';\n}", "function updateStyle(feature) {\n\t\t// previous segments are changed to duller color\n\t\tif (feature.properties.ID < index){\n\t\t\tvar newColor = '#8b726d';\n\t\t// current segment is changed to bold color\n\t\t} else if (feature.properties.ID == index) {\n\t\t\tvar newColor = '#3f1d17';\n\t\t// segments not yet reached are invisible on map\n\t\t} else if (feature.properties.ID > index) {\n\t\t\tvar newColor = 'transparent';\n\t\t}\n\t\t// return the style\n\t\treturn {\n\t\t\topacity: 1,\n\t\t\tcolor: newColor,\n\t\t\tweight: 3\n\t\t};\n\t}", "function set_map_style(){\n return [\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#444444\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#f2f2f2\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 45\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry.fill\",\n \"stylers\": [\n {\n \"color\": \"#ffffff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#dde6e8\"\n },\n {\n \"visibility\": \"on\"\n }\n ]\n }\n ]\n}", "function highlightParking(e) {\n var layer = e.target;\n if (Temp != null) ClearHighlight();\n Temp = e.target;\n layer.setStyle({color: \"#C9C8C7\", fillOpacity : 0.7});\n if (!L.Browser.ie && !L.Browser.opera) { layer.bringToFront(); }\n}", "function onHover(div) {\n\n unHighLight(div);\n highLight(div);\n\n\n}", "darker(){\n\t\tthis.addColorValue(\"red\", -30);\n\t\tthis.addColorValue(\"green\", -30);\n\t\tthis.addColorValue(\"blue\", -30);\n\t}", "function setupBirdsPane(map){\n map.createPane('birds') //create custom pane for birds\n map.getPane('birds').style.zIndex = 650; //put pane on top of sightings-map\n map.getPane('birds').style.pointerEvents = 'none';\n return L.svg({pane: 'birds'}).addTo(map);\n}", "function setAllLandColor() {\n for (const code in States) {\n {\n if (States[code].is_owned) {\n States[code].fillKey = broughtByPlayer;\n } else {\n States[code].fillKey = \"defaultFill\";\n }\n }\n map.updateChoropleth(States, { reset: true });\n }\n}", "function mammallayeron(){\n\n$(\"#species_richness_scale\").show();\n\nfor (i=0; i <= 600; i++){\n\nif (countrieslayer._layers[i]){\nvar country = countrieslayer._layers[i];\ncountry.setStyle(grey);\n\n}\n}\n\nfor (var polygon in mammalszones._layers) {\nmap.addLayer(mammalszones._layers[polygon]);\nmammalszones._layers[polygon].setStyle(none);\nfor (var inner in mammalszones._layers[polygon]._layers){\nif(inner && mammalszones._layers[polygon].feature.id){\nif(mammalszones._layers[polygon].feature.id >= 150){\nmammalszones._layers[polygon].setStyle(one);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 140){\nmammalszones._layers[polygon].setStyle(two);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 120){\nmammalszones._layers[polygon].setStyle(three);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 100){\nmammalszones._layers[polygon].setStyle(four);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 80){\nmammalszones._layers[polygon].setStyle(five);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 60){\nmammalszones._layers[polygon].setStyle(six);\n}\nelse if(mammalszones._layers[polygon].feature.id >= 40){\nmammalszones._layers[polygon].setStyle(seven);\n}\n}\n}\n} \n}", "function styleOtherStates(feature) {\n return {\n fillColor: \"gray\",\n weight: 2,\n opacity: 1,\n color: \"white\", //Outline color\n fillOpacity: 0.7\n };\n}", "function townStyle(feature) {\n\tif (feature.properties.change == 1)\n\t\treturn {\n\t\t\t\"fillColor\": \"black\",\n\t\t\t\"fillOpacity\": 0.3,\n\t\t\t\"weight\": 1,\n\t\t\t\"color\": \"blue\"\n\t\t};\n\t\telse if (feature.properties.change == 2)\n\t\t\treturn {\n\t\t\t\t\"fillColor\": \"black\",\n\t\t\t\t\"fillOpacity\": 0.6,\n\t\t\t\t\"weight\": 1,\n\t\t\t\t\"color\": \"blue\"\n\t\t\t};\n\t\t\telse if (feature.properties.change == 0)\n\t\t\t\treturn {\n\t\t\t\t\t\"fillColor\": \"gold\",\n\t\t\t\t\t\"fillOpacity\": 0,\n\t\t\t\t\t\"weight\": 0.5,\n\t\t\t\t\t\"color\": \"red\"\n\t\t\t\t};\n\t\t\t}", "function style(feature) {\n\t\t\treturn {\n\t\t\t\tweight: 0.5,\n\t\t\t\topacity: 1,\n\t\t\t\tcolor: 'black',\n\t\t\t\tfillOpacity: 0,\n\t\t\t\tfillColor: 'orange'\n\t\t\t};\n\t\t}", "function myStyleDistPoly(feature) {\n switch (feature.properties.agency) {\n case 0:\n return {\n color: \"#fdfe00\",\n fillColor: \"#fdfe00\"\n };\n break;\n case 1:\n return {\n color: \"#54ff01\",\n fillColor: \"#54ff01\"\n };\n break;\n case 2:\n return {\n color: \"#005de8\",\n fillColor: \"#005de8\"\n };\n break;\n case 3:\n return {\n color: \"#8600ac\",\n fillColor: \"#8600ac\"\n };\n break;\n }\n}", "function addLayersOnMap(){\n\n var layers = map.getStyle().layers;\n // Find the index of the first symbol layer in the map style\n var firstSymbolId;\n for (var i = 0; i < layers.length; i++) {\n if (layers[i].type === 'symbol') {\n firstSymbolId = layers[i].id;\n console.log(firstSymbolId);\n break;\n }\n }\n\n // 3d extruded buildings\n // apartments from json\n map.addLayer({\n 'id': 'extrusion',\n 'type': 'fill-extrusion',\n \"source\": {\n \"type\": \"geojson\",\n \"data\": \"https://denyskononenko.github.io/maprebuild/buildigs_appartments.geojson\"\n },\n 'paint': {\n 'fill-extrusion-color': '#696969',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': 1.0\n }\n }, firstSymbolId);\n\n // all buildings excepts hospitals and apartments\n map.addLayer({\n 'id': '3d-buildings',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['!=', 'type', 'hospital'], ['!=', 'type' ,'apartments']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#dedede',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .4\n }\n }, firstSymbolId);\n\n // hospitals\n map.addLayer({\n 'id': '3d-buildings-hospitals',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'hospital']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#A52A2A',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .2\n }\n }, firstSymbolId);\n\n // universities\n map.addLayer({\n 'id': '3d-buildings-university',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'university']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // schools\n map.addLayer({\n 'id': '3d-buildings-school',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'school']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // kindergarten\n map.addLayer({\n 'id': '3d-buildings-kindergarten',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'kindergarten']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n // use an 'interpolate' expression to add a smooth transition effect to the\n // buildings as the user zooms in\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n}", "initMap() {\n let self = this;\n \tlet styles = [\n {\n \"featureType\": \"all\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"hue\": \"#ff00d8\"\n },\n {\n \"saturation\": \"0\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"administrative\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#f9b8ea\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.country\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"administrative.land_parcel\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#4e113b\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"landscape\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#ca2992\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#2e093b\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#9e1010\"\n },\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural.landcover\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#58176e\"\n }\n ]\n },\n {\n \"featureType\": \"landscape.natural.landcover\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"poi\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"poi.business\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"saturation\": -100\n },\n {\n \"lightness\": 45\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#a02aca\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#d180ee\"\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#a02aca\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n },\n {\n \"color\": \"#ff0000\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text\",\n \"stylers\": [\n {\n \"color\": \"#a02aca\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#cc81e7\"\n },\n {\n \"visibility\": \"simplified\"\n }\n ]\n },\n {\n \"featureType\": \"road.highway\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"hue\": \"#f200ff\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#882375\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [\n {\n \"color\": \"#e36cd9\"\n }\n ]\n },\n {\n \"featureType\": \"road.arterial\",\n \"elementType\": \"labels.icon\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"transit\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"visibility\": \"off\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"all\",\n \"stylers\": [\n {\n \"color\": \"#b7918f\"\n },\n {\n \"visibility\": \"on\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"geometry\",\n \"stylers\": [\n {\n \"color\": \"#280b33\"\n }\n ]\n },\n {\n \"featureType\": \"water\",\n \"elementType\": \"labels\",\n \"stylers\": [\n {\n \"visibility\": \"simplified\"\n },\n {\n \"color\": \"#ca2994\"\n }\n ]\n }\n]\n\n let mapview = document.getElementById('map');\n mapview.style.height = window.innerHeight + \"px\";\n let map = new window.google.maps.Map(mapview, {\n center: {lat: 38.961914, lng:-101.004839},\n zoom: 5,\n mapTypeControl: false,\n styles:styles\n });\n\n let InfoWindow = new window.google.maps.InfoWindow({});\n\n window.google.maps.event.addListener(InfoWindow, 'closeclick', function () {\n self.closeInfoWindow();\n });\n\n this.setState({\n 'map': map,\n 'infowindow': InfoWindow\n });\n\n window.google.maps.event.addDomListener(window, \"resize\", function () {\n let center = map.getCenter();\n window.google.maps.event.trigger(map, \"resize\");\n self.state.map.setCenter(center);\n });\n\n window.google.maps.event.addListener(map, 'click', function () {\n self.closeInfoWindow();\n });\n\n let ourLocations = [];\n this.state.ourLocations.forEach(function (location) {\n let longName = location.name + ' - ' + location.type;\n let marker = new window.google.maps.Marker({\n position: new window.google.maps.LatLng(location.latitude, location.longitude),\n animation: window.google.maps.Animation.BOUNCE,\n map: map,\n title: location.significance,\n \ticon: heart\n });\n\n marker.addListener('click', function () {\n self.openInfoWindow(marker, longName);\n });\n\n location.longName = longName;\n location.marker = marker;\n location.display = true;\n ourLocations.push(location);\n });\n this.setState({\n 'ourLocations': ourLocations\n });\n }", "function animation_flag_with_saturation (direction){\n var index = '#filaIndice'+direction;\n $(index).html(\"<img src='js/css/cross.png' border='0' />\");\n $(index).effect(\"pulsate\",{times:3},500);\t\n}", "function D3PedalMap_brake_svelte_add_css() {\n\tvar style = (0,internal/* element */.bG)(\"style\");\n\tstyle.id = \"svelte-xp8anw-style\";\n\tstyle.textContent = \".svelte-xp8anw .line{stroke-width:2;fill:none}.svelte-xp8anw .axis path{stroke:black}.svelte-xp8anw .text{font-size:12px}.svelte-xp8anw .title-text{font-size:12px}.svelte-xp8anw .grid line{stroke:lightgrey;stroke-opacity:0.7;shape-rendering:crispEdges}\";\n\t(0,internal/* append */.R3)(document.head, style);\n}", "function style(feature) {\n\t\t//var speedlevelarray=feature.properties.speedarray.replace(/[{()}]/g, '').split(',');\n\t\t//var currentspeedlevel=parseInt(speedlevelarray[index]);\n\t\tvar tt_array=feature.properties.f2;\n\t\tvar current_tt=parseInt(tt_array[index]);\n\t\treturn {\n\t\t\tcolor: getColorV2(current_tt),\n\t\t\tweight: 5,\n\t\t\topacity: 1,\n\t\t\tdashArray: '1',\n\t\t};\n\t}", "function animate_direction_area_saturation (delta){\n arrow_show_overflow_area (delta);\n}", "function setHeightColor(color, z) {\n // if below zMid, fade blue into white\n // if above zMid, fade white into red\n if (z < zMid) {\n color.setHSL(0.66, 1, 1 - 0.5*(zMid - z) / (zRange/2.0));\n } else {\n // dont get too dark\n var lightness = Math.max(0.3, 1 - 0.5*(z - zMid) / (zRange/2.0));\n color.setHSL(0, 1, lightness);\n }\n}", "function Rainbow2(HueAng,PosAng,Sat,Brightness,HowBig,Rad) {\n\t\n var Xpos = Cx + Rad*sin(PosAng); \n\tvar Ypos = Cy + Rad*cos(PosAng);\n\tfill(HueAng,Sat,Brightness); \n\tnoStroke();\n\tellipse(Xpos,Ypos, HowBig,HowBig);\n}", "function shadeSwitch(shade) {\n if (shade == \"Light\") {\n return 'light';\n }\n else if (shade == \"Fair\") {\n return 'fair';\n }\n else if (shade == \"Heavy\") {\n return 'heavy'\n }\n return 'unlabeled';\n}", "function initMap() {\n // Create a styles array to use with the map(Attribution to snazzymaps.com)\n var styles = [{\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"hue\": \"#ff4400\"\n },\n {\n \"saturation\": -68\n },\n {\n \"lightness\": -4\n },\n {\n \"gamma\": 0.72\n }\n ]\n },\n {\n \"featureType\": \"road\",\n \"elementType\": \"labels.icon\"\n },\n {\n \"featureType\": \"landscape.man_made\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"hue\": \"#0077ff\"\n }, {\n \"gamma\": 3.1\n }]\n }, {\n \"featureType\": \"water\",\n \"stylers\": [{\n \"hue\": \"#00ccff\"\n }, {\n \"gamma\": 0.44\n }, {\n \"saturation\": -33\n }]\n }, {\n \"featureType\": \"poi.park\",\n \"stylers\": [{\n \"hue\": \"#44ff00\"\n }, {\n \"saturation\": -23\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.fill\",\n \"stylers\": [{\n \"hue\": \"#007fff\"\n }, {\n \"gamma\": 0.77\n }, {\n \"saturation\": 65\n }, {\n \"lightness\": 99\n }]\n }, {\n \"featureType\": \"water\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"gamma\": 0.11\n }, {\n \"weight\": 5.6\n }, {\n \"saturation\": 99\n }, {\n \"hue\": \"#0091ff\"\n }, {\n \"lightness\": -86\n }]\n }, {\n \"featureType\": \"transit.line\",\n \"elementType\": \"geometry\",\n \"stylers\": [{\n \"lightness\": -48\n }, {\n \"hue\": \"#ff5e00\"\n }, {\n \"gamma\": 1.2\n }, {\n \"saturation\": -23\n }]\n }, {\n \"featureType\": \"transit\",\n \"elementType\": \"labels.text.stroke\",\n \"stylers\": [{\n \"saturation\": -64\n }, {\n \"hue\": \"#ff9100\"\n }, {\n \"lightness\": 16\n }, {\n \"gamma\": 0.47\n }, {\n \"weight\": 2.7\n }]\n }\n ];\n\n // Center of the map\n var center = {lat: 30.1147939, lng: -95.2307214};\n\n var defaultIcon = 'img/default-icon.png';\n // Icon when mouse over\n var icon = 'img/icon.png';\n\n // To show info when markers are selected\n infoWindow = new google.maps.InfoWindow();\n\n // Create a map using Google Maps API.\n map = new google.maps.Map(document.getElementById('map'), {\n \tcenter: center,\n zoom: 14,\n styles: styles\n });\n\n // Listen for the map-container resize event & trigger Google Maps to update too,\n // so the map take all the space\n $('.map-container').bind('resize', function() {\n google.maps.event.trigger(map, \"resize\");\n });\n\n // Create the markers base on locations\n for (var i = 0; i < locations.length; i++) {\n \tvar marker = new google.maps.Marker({\n \t\tposition: locations[i].location,\n \t\ttitle: locations[i].title,\n \t\tvisible: true,\n \t\ticon: defaultIcon,\n \t\tid: locations[i].id\n \t});\n \tmarkers.push(marker);\n\n \t// Change the icon when mouse over\n \tmarker.addListener('mouseover', function() {\n \t\tthis.setIcon(icon);\n \t});\n \tmarker.addListener('mouseout', function() {\n \t\tthis.setIcon(defaultIcon);\n });\n\n \t// Open the infowindow when click on the marker\n marker.addListener('click', function(){\n \tpopulateInfoWindow(this, infoWindow);\n map.panTo(this.getPosition());\n });\n };\n\n}", "function onExit() {\r\n this.style.fill=\"#CCCCCC\";\r\n}", "function doStyletracts20(feature) {\r\n if (feature.properties.ipd >= 0.0 &&\r\n feature.properties.ipd <= 1.0) {\r\n\r\n return {\r\n color: '#000000',\r\n weight: '0.2',\r\n dashArray: '',\r\n lineCap: 'butt',\r\n lineJoin: 'miter',\r\n fillColor: '#FFFFFF',\r\n opacity: '0.9',\r\n fillOpacity: '0.9',\r\n }\r\n }\r\n if (feature.properties.ipd >= 1.0 &&\r\n feature.properties.ipd <= 3.0) {\r\n\r\n return {\r\n color: '#000000',\r\n weight: '0.2',\r\n dashArray: '',\r\n lineCap: 'butt',\r\n lineJoin: 'miter',\r\n fillColor: '#B3D5D9',\r\n opacity: '0.9',\r\n fillOpacity: '0.9',\r\n }\r\n }\r\n if (feature.properties.ipd >= 3.0 &&\r\n feature.properties.ipd <= 5.0) {\r\n\r\n return {\r\n color: '#000000',\r\n weight: '0.2',\r\n dashArray: '',\r\n lineCap: 'butt',\r\n lineJoin: 'miter',\r\n fillColor: '#7BA0AE',\r\n opacity: '0.9',\r\n fillOpacity: '0.9',\r\n }\r\n }\r\n if (feature.properties.ipd >= 5.0 &&\r\n feature.properties.ipd <= 6.0) {\r\n\r\n return {\r\n color: '#000000',\r\n weight: '0.2',\r\n dashArray: '',\r\n lineCap: 'butt',\r\n lineJoin: 'miter',\r\n fillColor: '#6C7E83',\r\n opacity: '0.9',\r\n fillOpacity: '0.9',\r\n }\r\n }\r\n if (feature.properties.ipd >= 6.0 &&\r\n feature.properties.ipd <= 8.0) {\r\n\r\n return {\r\n color: '#000000',\r\n weight: '0.2',\r\n dashArray: '',\r\n lineCap: 'butt',\r\n lineJoin: 'miter',\r\n fillColor: '#274355',\r\n opacity: '0.9',\r\n fillOpacity: '0.9',\r\n }\r\n }\r\n}", "function markerStyle(feature) {\n return {\n opacity: 1,\n fillOpacity: 1,\n fillColor: magnitudeColor(feature.properties.mag),\n color: \"#000000\",\n radius: magnitudeSize(feature.properties.mag),\n stroke: true,\n weight: 0.75\n };\n }", "function setBaseMapPolygonsBiomassStyle(Layer, analysis_params){\n if (analysis_params.vizSelection == 'biomass'){\n vis_biomass = true\n }\n else {\n vis_biomass = false\n }\n Layer.setStyle(function(feature) {\n if (analysis_params.energy == '_dry'){\n moisture = ''\n }\n else{\n moisture = analysis_params.moisture\n }\n column_year = 'county_total' + moisture + analysis_params.energy + analysis_params.content + '_' + analysis_params.year + analysis_params.potential\n if (feature.getProperty(column_year) > 1000000){\n color = '#165906';\n }\n if (feature.getProperty(column_year) > 100000 && feature.getProperty(column_year) < 1000000){\n color = '#219904';\n }\n if (feature.getProperty(column_year) > 1000 && feature.getProperty(column_year) < 100000) {\n color = '#9df28a';\n }\n if (feature.getProperty(column_year) < 1000){\n color = '#ffe554';\n }\n return ({visible: vis_biomass,\n fillColor: color,\n fillOpacity: 0.5,\n strokeWeight: 0.3,\n cursor: 'auto'})\n })\n }", "function puntDorpStyle(feature) {\n if (feature.get('juridical') == 'secondary agglomeration') {\n return [new Style({\n image: new CircleStyle({\n radius: 3,\n fill: new Fill({ color: \"grey\" }),\n stroke: new Stroke({\n color: \"black\",\n width: 2,\n }),\n }),\n })];\n }\n}", "function style(feature) {\n if (typeof feature.properties.JD_NAME === 'undefined'){\n return {\n weight: 1,\n opacity: 1,\n color: 'white',\n fillOpacity: 0,\n fillColor: 'black'\n };\n } else {\n return {\n weight: .25,\n opacity: 1,\n color: 'tomato',\n //this fill opacity will need to be set based on a function that determines opacity by returning a number between 1 and 0\n fillOpacity: parseFloat(applyCheckboxFilters(feature.properties.cases).length / (max/2)),\n fillColor: 'tomato'\n };\n }\n }", "function color() {\n var map = {\n \"black\" : [ 0/255,0/255,0/255 ],\n \"silver\": [ 192/255,192/255,192/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"maroon\": [ 128/255,0/255,0/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"purple\": [ 128/255,0/255,128/255 ],\n \"fuchsia\": [ 255/255,0/255,255/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"yellow\": [ 255/255,255/255,0/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aliceblue\" : [ 240/255,248/255,255/255 ],\n \"antiquewhite\" : [ 250/255,235/255,215/255 ],\n \"aqua\" : [ 0/255,255/255,255/255 ],\n \"aquamarine\" : [ 127/255,255/255,212/255 ],\n \"azure\" : [ 240/255,255/255,255/255 ],\n \"beige\" : [ 245/255,245/255,220/255 ],\n \"bisque\" : [ 255/255,228/255,196/255 ],\n \"black\" : [ 0/255,0/255,0/255 ],\n \"blanchedalmond\" : [ 255/255,235/255,205/255 ],\n \"blue\" : [ 0/255,0/255,255/255 ],\n \"blueviolet\" : [ 138/255,43/255,226/255 ],\n \"brown\" : [ 165/255,42/255,42/255 ],\n \"burlywood\" : [ 222/255,184/255,135/255 ],\n \"cadetblue\" : [ 95/255,158/255,160/255 ],\n \"chartreuse\" : [ 127/255,255/255,0/255 ],\n \"chocolate\" : [ 210/255,105/255,30/255 ],\n \"coral\" : [ 255/255,127/255,80/255 ],\n \"cornflowerblue\" : [ 100/255,149/255,237/255 ],\n \"cornsilk\" : [ 255/255,248/255,220/255 ],\n \"crimson\" : [ 220/255,20/255,60/255 ],\n \"cyan\" : [ 0/255,255/255,255/255 ],\n \"darkblue\" : [ 0/255,0/255,139/255 ],\n \"darkcyan\" : [ 0/255,139/255,139/255 ],\n \"darkgoldenrod\" : [ 184/255,134/255,11/255 ],\n \"darkgray\" : [ 169/255,169/255,169/255 ],\n \"darkgreen\" : [ 0/255,100/255,0/255 ],\n \"darkgrey\" : [ 169/255,169/255,169/255 ],\n \"darkkhaki\" : [ 189/255,183/255,107/255 ],\n \"darkmagenta\" : [ 139/255,0/255,139/255 ],\n \"darkolivegreen\" : [ 85/255,107/255,47/255 ],\n \"darkorange\" : [ 255/255,140/255,0/255 ],\n \"darkorchid\" : [ 153/255,50/255,204/255 ],\n \"darkred\" : [ 139/255,0/255,0/255 ],\n \"darksalmon\" : [ 233/255,150/255,122/255 ],\n \"darkseagreen\" : [ 143/255,188/255,143/255 ],\n \"darkslateblue\" : [ 72/255,61/255,139/255 ],\n \"darkslategray\" : [ 47/255,79/255,79/255 ],\n \"darkslategrey\" : [ 47/255,79/255,79/255 ],\n \"darkturquoise\" : [ 0/255,206/255,209/255 ],\n \"darkviolet\" : [ 148/255,0/255,211/255 ],\n \"deeppink\" : [ 255/255,20/255,147/255 ],\n \"deepskyblue\" : [ 0/255,191/255,255/255 ],\n \"dimgray\" : [ 105/255,105/255,105/255 ],\n \"dimgrey\" : [ 105/255,105/255,105/255 ],\n \"dodgerblue\" : [ 30/255,144/255,255/255 ],\n \"firebrick\" : [ 178/255,34/255,34/255 ],\n \"floralwhite\" : [ 255/255,250/255,240/255 ],\n \"forestgreen\" : [ 34/255,139/255,34/255 ],\n \"fuchsia\" : [ 255/255,0/255,255/255 ],\n \"gainsboro\" : [ 220/255,220/255,220/255 ],\n \"ghostwhite\" : [ 248/255,248/255,255/255 ],\n \"gold\" : [ 255/255,215/255,0/255 ],\n \"goldenrod\" : [ 218/255,165/255,32/255 ],\n \"gray\" : [ 128/255,128/255,128/255 ],\n \"green\" : [ 0/255,128/255,0/255 ],\n \"greenyellow\" : [ 173/255,255/255,47/255 ],\n \"grey\" : [ 128/255,128/255,128/255 ],\n \"honeydew\" : [ 240/255,255/255,240/255 ],\n \"hotpink\" : [ 255/255,105/255,180/255 ],\n \"indianred\" : [ 205/255,92/255,92/255 ],\n \"indigo\" : [ 75/255,0/255,130/255 ],\n \"ivory\" : [ 255/255,255/255,240/255 ],\n \"khaki\" : [ 240/255,230/255,140/255 ],\n \"lavender\" : [ 230/255,230/255,250/255 ],\n \"lavenderblush\" : [ 255/255,240/255,245/255 ],\n \"lawngreen\" : [ 124/255,252/255,0/255 ],\n \"lemonchiffon\" : [ 255/255,250/255,205/255 ],\n \"lightblue\" : [ 173/255,216/255,230/255 ],\n \"lightcoral\" : [ 240/255,128/255,128/255 ],\n \"lightcyan\" : [ 224/255,255/255,255/255 ],\n \"lightgoldenrodyellow\" : [ 250/255,250/255,210/255 ],\n \"lightgray\" : [ 211/255,211/255,211/255 ],\n \"lightgreen\" : [ 144/255,238/255,144/255 ],\n \"lightgrey\" : [ 211/255,211/255,211/255 ],\n \"lightpink\" : [ 255/255,182/255,193/255 ],\n \"lightsalmon\" : [ 255/255,160/255,122/255 ],\n \"lightseagreen\" : [ 32/255,178/255,170/255 ],\n \"lightskyblue\" : [ 135/255,206/255,250/255 ],\n \"lightslategray\" : [ 119/255,136/255,153/255 ],\n \"lightslategrey\" : [ 119/255,136/255,153/255 ],\n \"lightsteelblue\" : [ 176/255,196/255,222/255 ],\n \"lightyellow\" : [ 255/255,255/255,224/255 ],\n \"lime\" : [ 0/255,255/255,0/255 ],\n \"limegreen\" : [ 50/255,205/255,50/255 ],\n \"linen\" : [ 250/255,240/255,230/255 ],\n \"magenta\" : [ 255/255,0/255,255/255 ],\n \"maroon\" : [ 128/255,0/255,0/255 ],\n \"mediumaquamarine\" : [ 102/255,205/255,170/255 ],\n \"mediumblue\" : [ 0/255,0/255,205/255 ],\n \"mediumorchid\" : [ 186/255,85/255,211/255 ],\n \"mediumpurple\" : [ 147/255,112/255,219/255 ],\n \"mediumseagreen\" : [ 60/255,179/255,113/255 ],\n \"mediumslateblue\" : [ 123/255,104/255,238/255 ],\n \"mediumspringgreen\" : [ 0/255,250/255,154/255 ],\n \"mediumturquoise\" : [ 72/255,209/255,204/255 ],\n \"mediumvioletred\" : [ 199/255,21/255,133/255 ],\n \"midnightblue\" : [ 25/255,25/255,112/255 ],\n \"mintcream\" : [ 245/255,255/255,250/255 ],\n \"mistyrose\" : [ 255/255,228/255,225/255 ],\n \"moccasin\" : [ 255/255,228/255,181/255 ],\n \"navajowhite\" : [ 255/255,222/255,173/255 ],\n \"navy\" : [ 0/255,0/255,128/255 ],\n \"oldlace\" : [ 253/255,245/255,230/255 ],\n \"olive\" : [ 128/255,128/255,0/255 ],\n \"olivedrab\" : [ 107/255,142/255,35/255 ],\n \"orange\" : [ 255/255,165/255,0/255 ],\n \"orangered\" : [ 255/255,69/255,0/255 ],\n \"orchid\" : [ 218/255,112/255,214/255 ],\n \"palegoldenrod\" : [ 238/255,232/255,170/255 ],\n \"palegreen\" : [ 152/255,251/255,152/255 ],\n \"paleturquoise\" : [ 175/255,238/255,238/255 ],\n \"palevioletred\" : [ 219/255,112/255,147/255 ],\n \"papayawhip\" : [ 255/255,239/255,213/255 ],\n \"peachpuff\" : [ 255/255,218/255,185/255 ],\n \"peru\" : [ 205/255,133/255,63/255 ],\n \"pink\" : [ 255/255,192/255,203/255 ],\n \"plum\" : [ 221/255,160/255,221/255 ],\n \"powderblue\" : [ 176/255,224/255,230/255 ],\n \"purple\" : [ 128/255,0/255,128/255 ],\n \"red\" : [ 255/255,0/255,0/255 ],\n \"rosybrown\" : [ 188/255,143/255,143/255 ],\n \"royalblue\" : [ 65/255,105/255,225/255 ],\n \"saddlebrown\" : [ 139/255,69/255,19/255 ],\n \"salmon\" : [ 250/255,128/255,114/255 ],\n \"sandybrown\" : [ 244/255,164/255,96/255 ],\n \"seagreen\" : [ 46/255,139/255,87/255 ],\n \"seashell\" : [ 255/255,245/255,238/255 ],\n \"sienna\" : [ 160/255,82/255,45/255 ],\n \"silver\" : [ 192/255,192/255,192/255 ],\n \"skyblue\" : [ 135/255,206/255,235/255 ],\n \"slateblue\" : [ 106/255,90/255,205/255 ],\n \"slategray\" : [ 112/255,128/255,144/255 ],\n \"slategrey\" : [ 112/255,128/255,144/255 ],\n \"snow\" : [ 255/255,250/255,250/255 ],\n \"springgreen\" : [ 0/255,255/255,127/255 ],\n \"steelblue\" : [ 70/255,130/255,180/255 ],\n \"tan\" : [ 210/255,180/255,140/255 ],\n \"teal\" : [ 0/255,128/255,128/255 ],\n \"thistle\" : [ 216/255,191/255,216/255 ],\n \"tomato\" : [ 255/255,99/255,71/255 ],\n \"turquoise\" : [ 64/255,224/255,208/255 ],\n \"violet\" : [ 238/255,130/255,238/255 ],\n \"wheat\" : [ 245/255,222/255,179/255 ],\n \"white\" : [ 255/255,255/255,255/255 ],\n \"whitesmoke\" : [ 245/255,245/255,245/255 ],\n \"yellow\" : [ 255/255,255/255,0/255 ],\n \"yellowgreen\" : [ 154/255,205/255,50/255 ] };\n\n var o, i = 1, a = arguments, c = a[0], alpha;\n\n if(a[0].length<4 && (a[i]*1-0)==a[i]) { alpha = a[i++]; } // first argument rgb (no a), and next one is numeric?\n if(a[i].length) { a = a[i], i = 0; } // next arg an array, make it our main array to walk through\n if(typeof c == 'string')\n c = map[c.toLowerCase()];\n if(alpha!==undefined)\n c = c.concat(alpha);\n for(o=a[i++]; i<a.length; i++) {\n o = o.union(a[i]);\n }\n return o.setColor(c);\n}" ]
[ "0.6446102", "0.6318324", "0.5976814", "0.58865374", "0.58139014", "0.578251", "0.5725646", "0.5659158", "0.5650597", "0.5650597", "0.5650597", "0.55795115", "0.55690634", "0.5568911", "0.54990286", "0.54790443", "0.54388386", "0.5400335", "0.5386327", "0.5383769", "0.5380575", "0.53779316", "0.5370863", "0.5361422", "0.53578097", "0.5350131", "0.5347951", "0.53423786", "0.5338888", "0.53387487", "0.53019917", "0.5292034", "0.52886915", "0.52878654", "0.52878165", "0.5274188", "0.5271453", "0.5236411", "0.5219801", "0.5214646", "0.5206901", "0.5206813", "0.52048266", "0.5200283", "0.51877666", "0.5183955", "0.51788706", "0.5169822", "0.51686555", "0.5164098", "0.5163375", "0.51632226", "0.5159158", "0.5149563", "0.51495236", "0.5141282", "0.5138742", "0.51348853", "0.5130089", "0.5128806", "0.5121811", "0.5120281", "0.5110659", "0.51056737", "0.5103932", "0.5095273", "0.5084365", "0.5081659", "0.50801593", "0.5078161", "0.50759476", "0.50752616", "0.5074239", "0.5073302", "0.5070696", "0.50584215", "0.5053946", "0.5047715", "0.5047665", "0.50476426", "0.50458103", "0.5039824", "0.5037565", "0.5031277", "0.5026043", "0.50220615", "0.50199586", "0.5016813", "0.50111043", "0.50108683", "0.5010617", "0.5009037", "0.50041324", "0.50023896", "0.49973854", "0.4995453", "0.49947056", "0.4993453", "0.49909857" ]
0.7535632
1
AJAX POST reuqest to get news
function getNews(startWith, newsPerPage, lang, callback) { var xhr = new XMLHttpRequest(); var body = 'start=' + startWith + '&perPage=' + newsPerPage + '&lang=' + lang; xhr.open("POST", '/get_news.php', true); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function() { if (xhr.readyState==4 && xhr.status==200){ callback(xhr.responseText); } } xhr.send(body); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sendnews() {\n console.info(\"Avvio del processo d'invio notizie.\");\n\n // imposta tipo di notizia per la servlet\n var formtype = \"news\"\n\n // recupera i contenuti dei campi per titolo e corpo notizia\n var newstitle = encode_utf8($(\"#newstitle\").val());\n//\talert(\"Titolo notizia: \" + newstitle);\n var newsbody = encode_utf8($(\"#newsbody\").val());\n\n // invia la notizia\n console.log(\"Invio in corso...\");\n $.post('dataload',\n {\"formtype\": formtype, \"newstitle\": newstitle, \"newsbody\": newsbody},\n function () {\n $(\"#newstitle\").val(\"\");\n $(\"#newsbody\").empty();\n })\n .done(successfullysent)\n .fail(failedsent)\n .always(sent);\n}", "function addNews(){\n \n title=$(\"#news-title\").val();\n content=$(\"#news-editor\").val();\n \n \n sendob=JSON.stringify({'title':title,'desc':content});\n \n $.ajax({\n type:'POST',\n url:globalroot+\"addNews\",\n contentType: \"application/json\",\n data:sendob,\n encode:true\n }).done(function(data){\n console.log(data);\n $('#addNewsForm')[0].reset();\n getNews();\n $.snackbar({content:\"News added successfully!\", timeout: 2000,id:\"mysnack\"});\n }).fail(function(data){\n console.log(data);\n $.snackbar({content:\"Addition of news failed!\", timeout: 2000,id:\"mysnack\"});\n });\n \n\n \n\n}", "function newsInit() {\n function reloadNews() {\n // Get current news messages\n $.ajax({\n type: \"POST\",\n url: \"m/ajax/news_list.php\",\n cache: false,\n success: function(data,Status) {\n $(\"#newsList\").empty().append(data);\n },\n error: onError\n });\n return false;\n }\n\n $('#newsPost').click( function () {\n var formData = $(\"#newsForm\").serialize();\n $.ajax({\n type: \"POST\",\n url: \"m/ajax/news_list.php\",\n cache: false,\n data: formData,\n error: onError,\n success: function(data,Status) {\n $('#newsList').empty().append(data);\n $('#newsMessage').val('');\n },\n });\n return false;\n });\n\n $(\"#newsOlder\").click(function(){\n $.ajax({\n type: \"POST\",\n url: \"m/ajax/news_list.php\",\n cache: false,\n data: 'news_older=yes',\n success: function(data,Status) {\n $(\"#newsList\").empty().append(data);\n },\n error: onError\n });\n return false;\n });\n\n $(\"#newsNewer\").click(function(){\n $.ajax({\n type: \"POST\",\n url: \"m/ajax/news_list.php\",\n cache: false,\n data: \"news_newer=yes\",\n success: function(data,Status) {\n $(\"#newsList\").empty().append(data);\n },\n error: onError\n });\n return false;\n });\n\n reloadNews();\n}", "function getNewsData () {\n return $.ajax({\n url: \"https://json-data.herokuapp.com/restaurant/news/1\",\n });\n}", "function saveNews(){\n\t\t\n\t\tvar name = $(\"#title_news\").val();\n\t\tvar text = $(\"#txt_news\").html();\n\t\t\n\t\t//récupère les valeurs des checkbox \"about\"\n\t\t/*var about = new Array();\n\t\tfor(var i=1;i<21;i++){\n\t\t\tif($(\"#chk_about_\"+i).is(':checked'))\n\t\t\t\tabout.push($(\"#chk_about_\"+i).val());\n\t\t}*/\n\t\t\n\t\t\n\t\t//récupère la valeur du genre (radio btn) (free_msg, idea, true_information, rumor, question, help)\n\t\tvar genre = genreSelected; \n\t\t\n\t\tvar news = { \"name\" : name,\n\t\t\t\t\t \"text\" : text,\n\t\t\t\t\t \"genre\" : genre,\n\t\t\t\t\t \"about\" : aboutList,\n\t\t\t\t\t \"scope\" : HASHTAGS_LIST\n\t\t\t\t\t};\n\t\t//alert(JSON.stringify(news));\n\t\tajaxPost(\"\", baseUrl + \"/\" + moduleId + '/news/saveNews', \"json=\"+JSON.stringify(news), //ShowMapByOrigine', params,\n\t\t\tfunction (data){ \n\t\t\t\t$(\"#hashtags_list_json\").html(\"VOTRE MESSAGE A BIEN ÉTÉ PUBLIÉ</br>\");// + JSON.stringify(data));\n\t\t\t\t\n\t\t\t});\n\t}", "function display_posts() {\n\t\tconsole.log(\"display_posts\");\n\t\t$.ajax({\n\t\t\turl: '/api/index.php',\n\t\t\ttype: \"GET\",\n\t\t\tdata: \"controller=post&action=createPost&title=website&message=adhabdkhajbdhjkasd\",\n\t\t\tcache: false,\n\t\t\tsuccess: function(responseText){\n\t\t\t\t//alert('new post added !!');\n\t\t\t\t$('#container').fadeIn().load(\"viewPosts.php\");\n\t\t\t}\n\t\t});\n\t}", "function news() {\n var api_key = \"b7864e77cbca46e68dae6627855def48\";\n var q = \"autism spectrum\";\n var date = \"1990-01-01\";\n var sort = \"relevancy\";\n var lang = \"en\";\n var page = \"8\";\n var queryURL = \"https://newsapi.org/v2/everything?q=\" + q + \"&from\" + date + \"&sortBy=\" + sort + \"&apiKey=\" + api_key + \"&language=\" + lang + \"&pagesize=\" + page;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n dataType: \"json\"\n }).then(function (response) {\n for (var i = 0; i < response.articles.length; i++) {\n // console.log(response.articles.length);\n var displaySourceTitle = response.articles[i].title;\n var displaySourceSite = response.articles[i].url\n var displayContent = response.articles[i].content\n //var displaySourceSiteImg = response.articles[i].urlToImage;\n\n var html = `\n <li>\n <div class=\"collapsible-header\"><i class=\"material-icons\">filter_drama</i>${displaySourceTitle}</div>\n <div class=\"collapsible-body\"><a href=\"${displaySourceSite}\">${displayContent}</a></div>\n </li>\n `\n $(\".collapsible\").append(html);\n };\n\n });\n}", "function recentpost() {\n\n // title = document.getElementById(\"title\").value;\n\n newpost.push({\n title: document.getElementById(\"title\").value,\n post: document.getElementById(\"post\").value\n });\n\n for (var i = 0; i < newpost.length; i++) {\n document.getElementById(\"heading\").innerHTML = newpost[i].title;\n document.getElementById(\"recent-post\").innerHTML = newpost[i].post;\n }\n\n const Http = new XMLHttpRequest();\n\n Http.open(\"POST\", url + \"/index\");\n Http.setRequestHeader(\"Content-Type\", \"application/json\");\n Http.send(JSON.stringify(newpost));\n Http.onreadystatechange = (e) => {\n // JSON.parse(Http.responseText);\n console.log(Http.responseText)\n // alert(JsonResp.message);\n\n }\n return false\n}", "function globalSearch()\n{\n var request;\n\n if(window.XMLHttpRequest)\n {\n request=new XMLHttpRequest();\n }\n else{\n request= new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n\n var url=`https://newsapi.org/v2/everything?q=`+term+`&from=2019-09-08&sortBy=publishedAt&apiKey=36a39b9f650a45ff98da020117684bab`;\n request.open(\"GET\",url);\n request.onreadystatechange = function()\n {\n if(request.status == 200 && request.readyState == 4)\n {\n news=JSON.parse(request.response);\n news=news.articles;\n displayNews();\n\n //read More\n $(\".button\").click(function(){\n $(this).siblings($(\".header\"),$(\".text\")).toggleClass(\"editHeight\");\n }); \n }\n }\n request.send();\n}", "function queryNews(name) {\n $.ajax({\n url:'https://gnews.io/api/v4/top-headlines?token=41781c49fe723df3a38e0aaa430ef5db' + name ,\n mwthod: 'GET'\n }).then(function(response) {\n $('#news-header').text(\"Here is\" + response.totalArticles + 'news related to ' + name);\n\n if(response.totalArticles > 0) {\n ///Loop through all the articles that are given\n for(let i = 0; i < response.totalArticles; i++) {\n //populoate the news results using semantic UI\n let newItem = $('<div class= \"item\">');\n let itemImage = $('div class= \"image\">');\n $(itemImage).append('<img src=\"' + response.totalArticles[i].urlToImage + '\">');\n newItem.append(itemImage);\n\n let itemContent = $('<div class=\"content\">');\n let itemHeader = $('<div class=\"header\">').text(response.totalArticles[i].title);\n itemContent.append(itemHeader);\n\n let description = $('<div class=\"description\"');\n $(description).appned($('<p>').text('Published by ' + response.totalArticles[i].source.name + ' at ' + response.totalArticles[i].publishedAt));\n $(description).appedn($('<p>').text(response.articles[i].description))\n itemContent.append(description);\n }\n }\n })\n}", "function goToNewNewsForm() {\n\tvar targetUrl = $(\"#newNewsLink a\").attr(\"href\");\n\n\t// $.get() does not work. I do not know why.\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : targetUrl,\n\t\tdata : {},\n\t\tsuccess : function(response) {\n\t\t\tsetDefaultsToInputFields();\n\t\t\tsetSendNotification(response.sendNotification);\n\t\t\tsetFormAction(response.formAction);\n\t\t\tsetTitleOfSubmitButton(response.localizedTitleOfSubmit);\n\t\t\tshowNewsForm();\n\t\t},\n\t\terror : function(e) {\n\t\t\t// Debug method \"toSource()\"\n\t\t\talert(\"Error: \" + e.toSource());\n\t\t}\n\t});\n}", "function getNEWSAPI() {\n\nvar url1 = 'https://newsapi.org/v2/top-headlines?' +\n 'country=us&' +\n 'apiKey=baddbb89804b4323b1bbb96a1c3f8b4e';\n\nvar art;\n\n$.ajax({\n \n url:url1,\n type:\"get\",\n\n success:function(data){\n\n \n \n art = data.articles;\n console.log(art);\n\n\n\n art.forEach((t ,i) => {\n i= i+20;\n let date = t.publishedAt.toString().substring(5, 10)\n \n $(\"#main\").append(`\n <article class=\"article\">\n <section class=\"featuredImage\">\n <img src=\"${t.urlToImage}\" alt=\"\" />\n </section>\n <section class=\"articleContent\">\n <a id=\"article_${i}\" href=\"#\"><h3>${t.title}</h3></a>\n <h6>${t.author}</h6>\n </section>\n <section class=\"impressions\">\n ${date}\n </section>\n <div class=\"clearfix\"></div>\n </article>\n `)\n\n\n });\n art.forEach((t ,i) => {\n i= i+20;\n $(`#article_${i}`).on(\"click\", function () {\n pupUp(t.title, t.content,t.author,t.urlToImage,t.url);\n });\n });\n\n\n \n },error:function(a,b,c){\n console.error(a,b,c);\n } \n});\n \n}", "function handleGetData(event) {\n event.preventDefault();\n $main.empty();\n let searchText = $(\"input#inputBtn\").val();\n\n $.ajax(`https://gnews.io/api/v4/search?q=${searchText}&token=c4c8a4cebef621ab5eafecf6b7a504ea`)\n .then(function (data) {\n eachNews = data.articles;\n\n for (i = 0; i < 10; i++) {\n let newsArray = eachNews[i];\n let content = newsArray.content;\n $main.append(`\n \n <article>\n <h3>${newsArray.title}</h3>\n <p>${newsArray.description}</p>\n </article>\n `)\n\n }\n },\n function (error) {\n console.log(\"Bad request: \", error);\n }\n\n )\n}", "function handleNewsForm(event){\n event.preventDefault()\n let query = document.querySelector(\"#news-input\").value\n fetchNews(query)\n .then(data => displayArticles(data.articles))\n}", "function sendTheAJAX() {\nvar url = \"http://linuxfr.org/news.atom\";\nvar req = new XMLHttpRequest();\n\nreq.open(\"GET\", url, true);\n\nreq.onerror = function() { console.log(\"Échec de chargement \"+req.status+\" \"+url); };\n\nreq.onload = function() {\n if (req.status === 200 || req.status === 304) {\n console.log(req.responseXML);\n document.getElementById('article_content').textContent = req.responseText;\n }};\n\nreq.send();\n}", "function getNewsFeeds() {\n\n $.ajax({\n \n url: server_url,\n dataType: \"json\",\n type: \"get\",\n data: { \n newsQuery: currSymbol\n },\n \n success: function(news){\n // console.log(news.d.results);\n \n renderNews(news.d.results);\n\n },\n \n });\n\n function renderNews(newsData) {\n var newsDataParsed = \"\";\n for (var i = 0; i < newsData.length; i++) {\n newsDataParsed += \"<div class=\\\"well\\\">\";\n newsDataParsed += \"<div class=\\\"text-primary news_feed_title\\\"><a href=\\\"\" + newsData[i].Url + \"\\\">\" + newsData[i].Title + \"</a></div>\";\n newsDataParsed += \"<div class=\\\"news_feed_des\\\">\" + newsData[i].Description + \"</div>\";\n newsDataParsed += \"<div class=\\\"news_feed_pub\\\"><b>Publisher: \" + newsData[i].Source + \"</b></div>\";\n newsDataParsed += \"<div class=\\\"news_feed_date\\\"><b>Date: \" + moment(newsData[i].Date).format('DD MMM YYYY HH:mm:ss') + \"</b></div>\";\n newsDataParsed += \"</div>\";\n };\n var strReplace = \"<strong>\" + currSymbol + \"</strong>\";\n var res = newsDataParsed.replace(new RegExp(currSymbol, \"g\"), strReplace);\n $(\"#news\").html(res);\n };\n }", "function getPosts() {\n $.ajax({\n url: \"/forum/getPosts\",\n context: document.body,\n success: function (data) {\n buildStream(data);\n }\n });\n}", "function buildNewsInfo() {\n //URL for calling the news API\n var newsCompany =\n \"https://api.nytimes.com/svc/search/v2/articlesearch.json?q=\" +\n currentCompany +\n \"&api-key=\" +\n newsApiKey;\n\n $.ajax({\n url: newsCompany,\n method: \"GET\",\n }).then(function (response) {\n // return response;\n var headLine = response.response.docs[0].headline.main;\n var snippet = response.response.docs[0].snippet;\n var timesUrl = response.response.docs[0].web_url;\n\n newsAppended();\n function newsAppended() {\n $(\"#newsHeadLine\").text(headLine);\n $(\"#newsSnippet\").text(snippet);\n $(\"#newsUrl\").attr(\"href\", timesUrl).text(\"Read Full Article Here\");\n }\n }); //end of NEWS API stuff\n} // end of buildNewsInfo", "function showArticles (event) {\n event.preventDefault();\n var url = \"https://accesscontrolalloworiginall.herokuapp.com/http://digg.com/api/news/popular.json\";\n jQuery.getJSON(url, appendArticles);\n}", "function Post(yourUrl, postArticle) {\n var xhr = new XMLHttpRequest(); \n xhr.open(\"POST\", yourUrl, true);\n xhr.setRequestHeader(\"Content-Type\", \"application/json\")\n xhr.setRequestHeader(\"Accept\", \"application/json\")\n xhr.send(postArticle);\n}", "function createArticle() {\n $.ajax({\n type: \"POST\",\n url: URL_ARTICLES,\n data: JSON.stringify(getArticleRequestJson()),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data) {\n window.location.href = URL_INDEX;\n },\n error: function(error) {\n processError(error);\n }\n });\n}", "function prep() {\n $.ajax({\n url: '/api/news/',\n method: 'GET',\n success: function (feed) {\n //$('#newsfeedPost').html(\"\");\n\n if (feed.length === 0) {\n $('#nothingHereFeed').css(\"display\", \"block\")\n }\n\n for (var i = 0; i < feed.length; i++) {\n var length = 50;\n var text = feed[i].post_text.split(\" \");\n var short = \"\";\n var rest = \"\";\n for (var j = 0; j < length && j < text.length; j++) {\n short += text[j] + \" \";\n }\n for (var k = j; k < text.length; k++) {\n rest += text[k] + \" \";\n }\n a = new Date(feed[i].posted_datetime);\n testy = a.toDateString();\n $('#newsfeedPost').append(homeFeedPost({\n name: feed[i].forename + (feed[i].middlename ? ' ' + feed[i].middlename : '') + ' ' + feed[i].lastname,\n payload: ((feed[i].attachment_type === 1) ? '/api/news/data/' + feed[i].post_id : ''),\n groupname: feed[i].group_name,\n text: short,\n rest_text: rest,\n image_url: '/api/user/' + feed[i].person_id + '/picture_tiny',\n data: 'data-id=\"' + feed[i].post_id + '\"',\n datetime: testy,\n lang_read_more: \"Read more...\"\n }));\n\n if(k <= length) {\n $(\"#newsfeedPost div[data-id=\" + feed[i].post_id + \"] a\").hide();\n } else {\n $(\"#newsfeedPost div[data-id=\" + feed[i].post_id + \"] a\").click(function(){\n\n $(this).closest(\"div\").find(\"span\").show();\n $(this).remove();\n });\n }\n\n }\n }\n });\n}", "function createListings() {\n $.ajax({\n url: '/public_html/post.html',\n method: 'GET'\n })\n}", "function loadNews() {\n\tsetLoadingAnimation();\n\n\t$.ajax({ \n url: 'getNewsLength' \n\t})\n\t.done(function(data) {\n\t // parse response\n\t newsCount = parseInt(data.count);\n\n\t pagesCount = Math.ceil(newsCount / 5);\n\n\t // set pagination if the count of news is more than 5\n\t if (newsCount > 5) {\n\t\t $('.content').after(setPagination(newsCount));\n\t\t setHandlersOnPagination();\n\t\t}\n\t\t// first load the first 5 news (or less)\n\t\tloadNewsByPage(1);\n\t})\n\t.fail(function() {\n\t\tconsole.log('error in loadNews');\n\t closeLoadingAnimation();\n\t});\n}", "function loadNews(){\n\tshowLoading();\n\t$.ajax({\n\t\t type: \"get\",\n\t\t async: true,\n\t\t url: domain+\"/index.ashx?c=ajaxnews&a=detail&id=\"+id+\"&catid=\"+catid,\n\t\t dataType: \"json\",\n\t\t success: function(data){\n\t\t\t if(data.state==\"success\"){\n\t\t\t\t handlerNewsDetail(data.data);\n\t\t\t }\n\t\t\t hideLoading();\n\t\t },\n\t\t error: function(){ \n\t\t\t hideLoading();\n\t\t }\n\t });\n}", "function newsClick(){\r\n\r\n\tvar news = \"<div class='newsPopup'><div><p class='closeP'><i class='popupContent_close fa fa-times fa-2x'></i></p></div>\";\r\n\tmyXHR('get',{'path':'/news'},'none').done(function(json){\r\n\t\t\r\n\t\tvar temp;\r\n\t\tnews += \"<ul style='list-style:none;'>\";\r\n\t\t/*get current year news*/\r\n\t\t$.each(json.year, function(i, item){\r\n\t\t\tif(item.description != null && item.description != \"\"){\r\n\t\t\t\tnews += \"<li><h3 style='font-size: x-large;'>\"+item.title+\"</h3>\";\r\n\t\t\t\ttemp = item.date.split(\" \");\r\n\t\t\t\tnews += \"<p style='font-style:italic'>\"+temp[0]+\"</p>\";\r\n\t\t\t\tnews += \"<p style='font-size: small;'>\"+item.description+\"</p></li>\";\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t/*get older news*/\r\n\t\t$.each(json.older, function(i, item){\r\n\t\t\tif(item.description != null && item.description != \"\"){\r\n\t\t\t\tnews += \"<li><h3 style='font-size: x-large;'>\"+item.title+\"</h3>\";\r\n\t\t\t\ttemp = item.date.split(\" \");\r\n\t\t\t\tnews += \"<p style='font-style:italic'>\"+temp[0]+\"</p>\";\r\n\t\t\t\tnews += \"<p style='font-size: small;'>\"+item.description+\"</p></li>\";\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\tnews += \"</ul></div>\";\r\n\t\t$(\"#popupContent\").html(news);\r\n\t});\r\n}", "function load() {\n $.ajax({\n url: url + lastId\n }\n ).done(oncompleteGetNews);\n}", "function functionCreate()\n{\n\tif(window.XMLHttpRequest)\n\t{\n\t\tg.ajaxObject = new XMLHttpRequest();\n\t}\n\n\telse if(window.ActiveXObject)\n\t{ \n\t\tg.ajaxObject = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\n\tvar art = document.getElementsByTagName(\"article\");\n\tvar username = art[0].innerHTML;\n\n\tg.ajaxObject.open(\"POST\", \"JSONcreate.php\", true);\t\n\tg.ajaxObject.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); \n\tg.ajaxObject.onreadystatechange = functionCheckNewlyCreated;\n\tg.ajaxObject.send(\"username=\" + username);\t\t\t\t\t\t\t\t\t\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 }", "_initCreateNews() {\n selectors.$document.on('click', \"li#createNews\", (e) => {\n selectors.$content.empty();\n selectors.$content.append(`\n <h2 class=\"text-center\">Cadastrar Notícia</h2>\n <form action=\"https://tiagoifsp.ddns.net/noticias/noticias/cadastrar.php\" method=\"POST\" id=\"createNews\">\n <div class=\"form-group\">\n <label for=\"category\">Categoria</label>\n <select class=\"form-control\" id=\"category\" name=\"idCategoria\" required></select>\n <span style=\"color: red; display: none\" error-message>Esse campo é obrigatório</span>\n </div>\n \n <div class=\"form-group\">\n <label for=\"titulo\">Título da notícia</label>\n <input placeholder=\"Título\" type=\"text\" class=\"form-control\" id=\"titulo\" name=\"titulo\" required />\n <span style=\"color: red; display: none\" error-message>Esse campo é obrigatório</span>\n </div>\n \n <div class=\"form-group\">\n <label for=\"subtitle\">Subtitulo da notícia</label>\n <input placeholder=\"Subtitulo\" type=\"text\" class=\"form-control\" id=\"subtitle\" name=\"subtitulo\" required />\n <span style=\"color: red; display: none\" error-message>Esse campo é obrigatório</span>\n </div>\n \n <div class=\"form-group\">\n <label for=\"textContent\">Conteúdo</label>\n <textarea class=\"form-control\" id=\"textContent\" rows=\"3\" name=\"conteudo\" required></textarea>\n <span style=\"color: red; display: none\" error-message>Esse campo é obrigatório</span>\n </div>\n \n <button type=\"button\" class=\"btn btn-primary\" id=\"lala\">\n Cadastrar\n </button>\n </form>\n `)\n\n categories.forEach(category => {\n $(\"#category\").append(`\n <option id=\"${category.id}\" value=\"${category.id}\">${category.nome}</option>\n `)\n })\n\n $(\"button[type='button']\").on(\"click\", (e) => {\n $(\"form#createNews\").find(\"[error-message]\").toArray().forEach(el => $(el).css(\"display\", \"none\"));\n let send = true;\n\n // check fields\n selectors.$content.find(\"form#createNews\").find(\"[required]\").toArray().forEach(field => {\n if ($(field).val() == \"\") {\n $(field).parent().find(\"[error-message]\").css(\"display\", \"inline-block\");\n send = false;\n }\n })\n\n if (send) {\n $.ajax({\n url: 'https://tiagoifsp.ddns.net/noticias/noticias/cadastrar.php',\n type: 'POST',\n dataType: 'JSON',\n data: $(\"form#createNews\").serialize(),\n success: () => {\n $(\"form\")[0].reset();\n },\n error: (err) => {\n console.log(err.responseJSON)\n }\n })\n }\n\n })\n })\n }", "postNewArticle(newArticleToSave) {\n return fetch(\"http://localhost:8088/news\", {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify(newArticleToSave)\n })\n }", "function saveNews(id){\n\timageURL = $('#ne-img-preview').css('background-image');\n\tvar formData = new FormData($('#ne-side')[0]);\n\n\turl = '/addNews';\n\tif(id != -1)\n\t\turl = '/editNews/' + id;\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: url,\n\t\tdata: formData,\n contentType: false,\n processData: false,\n cache: false,\n success: function(result) {\n \tjsonObj = $.parseJSON(result);\n \thideEditForm(function(){ (id == -1) ? addNewsContainer(jsonObj.news, imageURL) : updateNewsContainer(jsonObj.news, imageURL); });\n },\n error: function(data, textStatus, jqXHR){\n \tif ('image')\n \talert(\"Unable to save the news article. Please try again later.\");\n \tconsole.log(data.responseText + \", \" + textStatus + \", \" + jqXHR);\n }\n\t})\n}", "function gestionArticulo() {\n borrarMarca();\n borrarMarcaCalendario();\n crearTablasArticulos();\n\n let httpRequest = new XMLHttpRequest();\n httpRequest.open('POST', '../consultas_ajax.php', true);\n httpRequest.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n httpRequest.onreadystatechange = function () {\n if (httpRequest.readyState === 4) {\n if (httpRequest.status === 200) {\n document.getElementById('dataTable').innerHTML = httpRequest.responseText;\n }\n }\n };\n httpRequest.send('articles=');\n}", "function getNews(searchTerm) {\n xhr.open('GET', `${BASE_URL}${searchTerm}`);\n xhr.send();\n xhr.onload = onSuccess;\n xhr.onerror = onError;\n}", "function retrieve_articles(e) {\n document.querySelector(\".loader\").removeAttribute('id');\n\n var inputElementValue;\n\n e.preventDefault();// PREVENT DEFAULT POST METHOD\n inputElementValue = form.searchBox.value;// GET SEARCH TEXT\n\n $.ajax({\n url: URL,\n data: {\n access_key: APIkey,\n languages: 'en',\n countries: 'au,us,gb,nz',\n keywords: inputElementValue,\n limit: 20,\n offset: 0,\n sort:'popularity'\n }\n }).done(function (data) {\n articles = data.data;\n\n storeData(articles,inputElementValue);\n });\n \n}", "function getJSON(){\n $.ajax({\n url: \"http://localhost:5000/articles\",\n //force to handle it as text\n dataType: \"text\",\n success: function(data) {\n // store the parsed json as a variable\n json = $.parseJSON(data);\n // get data for next story based on value of storyCounter. storyCounter = 0 is the [0] array in the JSON object; the storyCounter grows by 1 each time it is clicked, returning the next value in the object each time.\n $('.byline').html(\"By \" + json[storyCounter].author);\n $('.articleHeadline').html(json[storyCounter].headline);\n $('.articleText').html(json[storyCounter].copy);\n // change value of story counter\n storyCounter++;\n }\n });\n\n}", "function getTodayPres(){\n $.ajax({\n url:\"../handlers/prescriptionHandler.php\",\n method:\"POST\",\n data:{type:'getTodayPres'},\n dataType:\"json\",\n success:function(data){\n $(\"#presInfo\").html(data[0]);\n $(\"#itemCount\").html(data[1]);\n $(\".viewPres\").click(function(){ \n putPresData($(this));\n });\n } \n });\n}", "function getNews()\n{\nconst RSS_URL = `https://cors-anywhere.herokuapp.com/https://www.wmur.com/topstories-rss`;\n\t\t\tfetch(RSS_URL)\n\t\t\t.then(response => response.text())\n\t\t\t.then(str => {\n\t\t\t\treturn new window.DOMParser().parseFromString(str, \"text/xml\");\n\t\t\t})\n\t\t\t.then(data => { console.log(data);\n\t\t\t\t\t\tlet items = data.querySelectorAll(\"item\"); //gets item tags from rss feed\n\t\t\t\t\t\tlet newTd; //holds td element\n\t\t\t\t\t\tlet newContent; //holds textnode for title\n\t\t\t\t\t\tlet newLink; //holds link element\n\t\t\t\t\t\tlet link; //holds link to each news article\n\t\t\t\t\t\tlet title; //holds news title\n\t\t\t\t\t\titems.forEach(el =>\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//set as title from news article\n\t\t\t\t\t\t\ttitle = el.querySelector(\"title\").innerHTML;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//set as link from article \n\t\t\t\t\t\t\tlink = el.querySelector(\"link\").innerHTML;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//create a <a> element to link to article\n\t\t\t\t\t\t\tnewLink = document.createElement(\"a\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//create a <td> element to hold link\n\t\t\t\t\t\t\tnewTd = document.createElement(\"td\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//create a textnode to display title\n\t\t\t\t\t\t\tnewContent = document.createTextNode(title);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//set the href attribue to the link of the article\n\t\t\t\t\t\t\tnewLink.href = link;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//makes link open in new page\n\t\t\t\t\t\t\tnewLink.target = \"_blank\"\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//puts text node in <a> element\n\t\t\t\t\t\t\tnewLink.appendChild(newContent);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//puts link in <td> element\n\t\t\t\t\t\t\tnewTd.appendChild(newLink);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//appends each <td> element into a table element with the id \"marquee\"\n\t\t\t\t\t\t\tdocument.getElementById(\"marquee\").appendChild(newTd);\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\n}", "function fetchArticles() {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n let respuesta = JSON.parse(this.responseText);\n let template = \"\";\n\n respuesta.forEach(articulo => {\n //Crear template para introducirlo en el HTML\n\n template += `\n <article class=\"articulo\">\n <h3 class=\"titulo\">${articulo.titulo}</h3>\n <img src=\"img/img_blog/${articulo.url_imagen}\" alt=\"Imagen del artículo\">\n <p>${articulo.texto}</p>\n <div class=\"info-articulo\">\n <p class=\"fecha\">Fecha: ${articulo.fecha}</p>\n <p class=\"autor\">Autor: ${articulo.autor}</p>\n </div>\n </article>\n `;\n });\n \n articulos.innerHTML = template;\n console.log(template);\n }\n };\n xhr.open(\"POST\", \"php/modelo-articulos.php\", true);\n xhr.send();\n }", "function startUp(sourceIndex) {\n \"use strict\";\n xhr.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n var newsObject = JSON.parse(xhr.responseText);\n $(\"header h1\").html(newsObject.source.toUpperCase() + \" - \" + today);\n newsObject.articles.forEach(addNews);\n $(\".card-notes\").hide();\n $(\".save-button\").hide();\n\n // take notes and show the note-pad\n $(\".note-button\").on(\"click\", function (event) {\n var $this = $(this);\n var newPositonX = (event.pageX + 30);\n $this.next().fadeToggle(1000).css(\"left\", newPositonX);\n $this.fadeOut(400);\n $this.prev().delay(400).fadeIn(400);\n });\n\n $(\".save-button\").on(\"click\", function () {\n // save notes\n var $this = $(this);\n var index = $(\".save-button\").index(this);\n var styling = \"\\n - anteckningar - \" + today + \"\\n\\n\";\n var localNotes = newsObject.source + \"\\n\" + newsObject.articles[index].title + \"\\n\" + newsObject.articles[index].description + styling + $(this).parent().find(\"textarea\").val();\n newsObject.articles[index].notes = localNotes;\n items.push(newsObject.articles[index]);\n\n //save to local storage\n localStorage.items = JSON.stringify(items);\n\n $this.parent().find(\"textarea\").fadeOut(500);\n $this.delay(500).fadeOut(500);\n $this.next().delay(1100).fadeIn();\n $this.next().addClass(\"saved\");\n });\n }\n };\n var newsSourceChoice = newsSource[sourceIndex].source;\n xhr.open(\"GET\", newsSourceChoice, true);\n xhr.send(null);\n}", "function kardashAjax() {\n $.ajax({\n type: \"GET\",\n url: \"https://newsapi.org/v2/top-headlines?country=us&category=entertainment&q=Kardashian&apiKey=7767c5512ac3478ab4cbb281d64f75bd\",\n // url: \"https://newsapi.org/v2/top-headlines?country=us&category=entertainment&apiKey=7767c5512ac3478ab4cbb281d64f75bd\",\n\n dataType : 'json',\n success: function(result) {\n if(result.articles.length===0) {\n buildHtmlNone();\n } \n else {\n for (var i = 0; i < result.articles.length; i++) {\n image = result.articles[i].urlToImage; \n title = result.articles[i].title; \n link = result.articles[i].url; \n source = result.articles[i].source.name; \n buildHtml();\n }\n }\n },\n error: function(XMLHttpRequest, textStatus, errorThrown) { \n alert(\"Status: \" + textStatus); alert(\"Error: \" + errorThrown); \n location.reload(true);\n } \n });\n}", "function getLiveFeed(){\t\t\t\t\n\t\t$('#liveFeedWait').show();\n\t\t$.ajax({\n\t\t\turl: liveFeedUpdateUrl,\n\t context: document.body,\n\t method: \"POST\",\n\t success: function(response){\n\t $('#liveFeedWait').hide();\n\t $('.live_feeds').html(response);\n\t }\n\t\t});\n\t}", "async function postRequest(id) {\n fetch(`https://thecrew.cc/news/create.php`, {\n method: 'POST',\n body: JSON.stringify({\n UUID: id\n })\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n console.log(data);\n onLoad();\n });\n\n}", "function exportArticle(article_sn){\n $.ajax({\n url: \"/ajax/export\",\n type: \"GET\",\n dataType: \"json\",\n data: {\"article\": article_sn},\n success: function(data){\n alert(\"hahah\");\n }\n })\n}", "function saveArticles() {\n var httpRequest = new XMLHttpRequest();\n if (!httpRequest) {\n console.log(`Error. Cannot create a new XMLHTTP instance`);\n return false\n }\n httpRequest.open('POST', '/saved', true);\n //Set JSON header\n httpRequest.setRequestHeader('Content-Type', 'application/json; charset=utf-8');\n //We want to format data into a JSON and send the request\n httpRequest.responseType = 'json';\n httpRequest.send(this.parentElement.getElementsbyClassName(\"panel\").setAttribute(\"data\", scraper._id));\n httpRequest.onload = () => {\n console.log(this);\n if (this.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n console.log(`request successfully handled`);\n }\n else {\n console.log(`There was a problem with the request.`);\n console.log(httpRequest.status);\n }\n }\n }\n}", "async updateNews() {\n //fetch json\n const link =\n newsApiUrl +\n \"?q=bitcoin&from=\" +\n new Date(Date.now() - 12096e5).toISOString() +\n \"&sortBy=publishedAt&apiKey=\" +\n newsApiKey;\n let response = await fetch(link);\n var articles = await response.json();\n articles = articles.articles;\n\n //set up html and add it to DOM\n var newsContainer = document.getElementById(\"newsContainer\");\n newsContainer.innerHTML = \"<strong>News</strong><br />\";\n for (var i = 0; i < articles.length; i++) {\n newsContainer.innerHTML += this.articleMaker(\n articles[i].title,\n articles[i].urlToImage,\n articles[i].author,\n articles[i].publishedAt,\n articles[i].description,\n articles[i].url\n );\n if (i == 4) {\n break;\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 getNews(feedUrl){\n $.ajax({\n url: document.location.protocol + '//ajax.googleapis.com/ajax/services/feed/load?v=1.0&output=xml&num=10&callback=?&q=' + encodeURIComponent(feedUrl),\n dataType : 'json',\n success : function (data) {\n if (data.responseStatus == 200) {\n var xmlDoc = $.parseXML(data.responseData.xmlString);\n var $xml = $(xmlDoc);\n $xml.find('item').each(function(i,p) {\n $(\"#footermessage\").append($(p).find('title').text()+\" - \"+$(p).find('description').text()+\" \");\n });\n }\n }\n });\n }", "async news() {\n\n const consulta = await fetch(`${this.url}/user/news`, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n 'x-access-token': sessionStorage.getItem('__token')\n }\n });\n const res = await consulta.json();\n return res\n }", "function displayNewsApi() {\n event.preventDefault();\n $(\"#newsResultsDiv\").empty();\n $(\".city-news\").empty();\n console.log(\"display news api\");\n // Update this later\n var city = $(\"#city\")\n .val()\n .trim();\n\n var city_second_part = city.slice(1);\n\n city = city.charAt(0).toUpperCase() + city_second_part;\n\n // $(\".city-news\").title\n $(\".city-news\").append(city + \" \");\n\n var noSpacesCity = city.replace(\" \", \"%20\");\n\n console.log(\"city is \" + noSpacesCity);\n\n // Update the URL\n var googleURL =\n \"https://newsapi.org/v2/everything?q=\" +\n noSpacesCity +\n \"&sources=cnn,reuters,abc-news,the-wall-street-journal,usa-today&sortBy=relevancy&apiKey=963471a1dfbe44c6a4c1fa29c815655b\";\n\n console.log(\"google news URL is \" + googleURL);\n\n $.ajax({\n url: googleURL,\n method: \"GET\"\n }).then(function(result) {\n \n for (var i = 0; i < 20; i += 3) {\n var title = result.articles[i].title;\n var newDateFormat = result.articles[i].publishedAt.substring(0, 10);\n var date = moment(newDateFormat, \"YYYY-MM-DD\").format(\"LL\");\n var source = result.articles[i].source.name;\n console.log(source);\n var description = result.articles[i].description;\n var url = result.articles[i].url;\n\n console.log($(result.articles[0].source.name));\n console.log(title);\n console.log(date);\n console.log(description);\n console.log(url);\n\n // div with News card\n var newsDiv = $(\"#newsResultsDiv\");\n\n var newItemCard = $(\"<div class='card news-card'></div>\");\n\n var titleHeader = $(\"<h5>\" + title + \"</h5>\");\n\n var articleSource = $(\"<p class=source>\" + source + \"</p>\");\n\n var articleDate = $(\"<p class=news-date>\" + date + \"</p>\");\n\n var articleDesc = $(\"<p class=news-desc>\" + description + \"</p>\");\n\n var urlButton = $(\n \"<a href='\" +\n url +\n \"' target='_blank' class='article-btn btn btn-outline-primary btn-sm'>\" +\n \"Read Article\" +\n \"</a>\"\n );\n\n newItemCard.append(titleHeader);\n newItemCard.append(articleSource);\n newItemCard.append(articleDate);\n newItemCard.append(articleDesc);\n newItemCard.append(urlButton);\n newsDiv.append(newItemCard);\n \n } // end of for loop\n }); // end of then function for news api\n }", "function getNY() {\n $(\"article\").hide();\n var url2 = 'https://api.nytimes.com/svc/news/v3/content/all/all.json?api-key=GJlAIjuyZ00wUOIGmCZeWDbuEtuCnUuK' ;\n \n \n var art2;\n $.ajax({\n \n url:url2,\n type:\"get\",\n data: { api_key : \"GJlAIjuyZ00wUOIGmCZeWDbuEtuCnUuK\"},\n success:function(data2){\n\n \n // console.log(data2.results);\n art2 = data2.results;\n console.log(art2);\n\n\n\n art2.forEach((t ,i) => {\n let date = t.created_date.toString().substring(2, 7)\n \n $(\"#main\").append(`\n <article class=\"article\">\n <section class=\"featuredImage\">\n <img src=\"${t.thumbnail_standard}\" alt=\"\" />\n </section>\n <section class=\"articleContent\">\n <a id=\"article_${i}\" href=\"#\"><h3>${t.title}</h3></a>\n <h6>${t.byline}</h6>\n </section>\n <section class=\"impressions\">\n ${date}\n </section>\n <div class=\"clearfix\"></div>\n </article>\n `)\n\n\n });\n art2.forEach((t ,i) => {\n $(`#article_${i}`).on(\"click\", function () {\n pupUp(t.title, t.abstract,t.byline,t.multimedia[3].url,t.url);\n });\n });\n\n // function pupUp(title,abstract,byline,thumbnail_standard,url){\n // $(\"#popUp\").removeClass(\"hidden\").removeClass(\"loader\")\n // $(\"article\").hide();\n // $(\"#title\").h(title)\n // $(\"#aouther\").text(byline)\n // $(\"#cont\").text(abstract)\n // $(\".popUpAction\").attr('href', url)\n // $(\"#imgurl\").attr('src',thumbnail_standard)\n // } \n\n },error:function(a,b,c){\n console.error(a,b,c);\n } \n });\n}", "function post_message(id_sujet, user_id, date, content){\n var request = new XMLHttpRequest();\n //alert('https://os-vps418.infomaniak.ch/etu_info/amsb1/DEV/index.php/api?action=send_message&subject_id=' + id_sujet+'&user_id=' + user_id+'&date=' + date+'&content=' + content);\n request.open('GET', 'https://os-vps418.infomaniak.ch/etu_info/amsb1/DEV/index.php/api?action=send_message&subject_id=' + id_sujet+'&user_id=' + user_id+'&date=' + date+'&content=' + content, false);\n request.send(null);\n if (request.status ===200) {\n return JSON.parse(request.responseText);\n }\n}", "function alerta_restablecer(depto){\n $.ajax({\n url:\"models/alerta_restablecer.php\",\n type:\"POST\",\n dataType:\"html\",\n data:{depto:depto},\n success: function(datos){\n\n }\n })\n}", "function getDatos(ev) {\n /** Seguimos los pasos de los apuntes */\n\n \n let metodo = 'GET' \n let url = ''\n\n if(ev.target.id == 'btnAjax')\n {\n url = 'http://localhost:3000/posts'\n }else{//ev.target.id == 'btnAjaxItem'\n let item = document.querySelector('#item').value // Cojo el valor de item (boton numerico)\n if(item)\n {\n url = 'http://localhost:3000/posts/'+item\n }else{\n return // Si el usuario no selecciona el item y se pulsa el boton --> Salgo y no hago nada --> No ejecuto Ajax\n }\n }\n\n connect(metodo,url,null)\n\n \n }", "function initializePage() {\n\tconsole.log(\"Javascript connected!\");\n\n\t//const url = \"https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=bebd5673446e40c0a0613cd3ea327a8d\";\n\tconst $articles = $('#articles');\n\n\t$('#refreshFeed').click(function(e) {\n\t\te.preventDefault();\n\t\tconsole.log('button clicked');\n\n\t\tvar url = \"https://api.nytimes.com/svc/search/v2/articlesearch.json\";\n\t\turl += '?' + $.param({\n\t\t 'api-key': \"bebd5673446e40c0a0613cd3ea327a8d\",\n\t\t 'q': \"edwin, Lee, ed\"\n\t\t});\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: url,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(articles) {\n\t\t\t\t$.each(articles.response.docs, function(i, article){\n\t\t\t\t\t$articles.append(`<li><b>NY Times: <b>${articles.response.docs[i].headline.main}</b></li>`);\n\t\t\t\t\tconsole.log(articles.response.docs[i]);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\t/*\n\t\t$.ajax({\n\t\t\ttype: 'GET',\n\t\t\turl: 'https://newsapi.org/v2/top-headlines?country=us&category=business&apiKey=4ee54ee8064c4fc4af6a51b03fe81d17',\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(articles) {\n\t\t\t\t$.each(articles.articles, function(i, article){\n\t\t\t\t\t$articles.append(`<li><b>News API: ${articles.articles[i].title} </b>, image: <img id='articleImg' src='${articles.articles[i].urlToImage}'</li>`);\n\t\t\t\t\tconsole.log(articles.articles[i]);\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\t*/\n\t});\n\n\tconsole.log('test');\n\t//$('.clickMe').click(gotData);\n\n $('#chatsend').find('.send').click(sendText);\n\tconsole.log(\"send clicked\");\n $(\"#chatbox\").on('keydown', function(e){\n if(e.keyCode === 13)\n sendText(e);\n });\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 fetchTheData() {\r\n let baseURL = \"https://newsapi.org/v2/top-headlines\";\r\n deleteOld();\r\n let search = \"?q=\" + id(\"search\").value;\r\n id(\"searchTerm\").textContent = id(\"search\").value;\r\n let apiKey = \"&apiKey=c1c6c8286a5449b7a7fcc01deb46437c\";\r\n fetch(baseURL + search + apiKey)\r\n .then(checkStatus)\r\n .then(response => response.json()) // if json\r\n .then(processResponse)\r\n .catch(handleError);\r\n }", "function getData () {\n $.get(\"/get-articles\", function(data, status){\n return recievedData = JSON.parse(data);\n });\n}", "function _initAddToNewsfeed() {\n\n $addPostButton.click(function() {\n var button = $(this);\n var humanapiId = $(this).data('humanapi-id');\n var activity = _humanapiStorage[humanapiId];\n var data = {\n entityId: mov.service.member.getId(),\n entityType: 0,\n moveData: {\n moveTypeName: activity['type'],\n value: activity['duration'] / 60,\n useMinutes: true\n }\n };\n\n mov.helper.overlay.showGlobalLoading();\n\n mov.helper.api.post('newsfeed', JSON.stringify(data), {\n done: function(response) {\n button.text('Done!');\n }, fail: function(response) {\n //...\n }, always: function(response) {\n mov.helper.overlay.hideGlobalLoading();\n }\n });\n });\n }", "function privlyPostContent(data_to_send, successCallback, errorCallback) {\n \n var url = window.location.protocol + \"//\" + window.location.host + \"/posts\";\n \n $.ajax({\n data: data_to_send,\n type: \"POST\",\n url: url,\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\n dataType: \"json\",\n accepts: \"json\",\n success: successCallback,\n error: errorCallback\n });\n}", "function ajaxFeed() {\r\n $.ajax ({\r\n type: \"GET\",\r\n url: \"/feed\",\r\n success: data => {\r\n console.log(data);\r\n },\r\n error: data => {\r\n console.log(data);\r\n }\r\n });\r\n}", "function scrapeArticles() {\n $.ajax({\n method: \"GET\",\n url: \"/scrape/\"\n })\n .then(getArticles);\n }", "function getDetails() {\n var req = new XMLHttpRequest();\n req.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // return details\n }\n else {\n console.log(\"ready state \" + this.readyState);\n }\n req.open(\"POST\", \"/\", true);\n req.setRequestHeader(\n \"content-type\",\n \"application/x-www-form-urlencoded;charset=UTF-8\"\n );\n \n req.send(\n \"item_id=\" +\n // TODO: get the movie/show id when show more button is clicked\n // document.getElementById(\"keyword\").value\n );\n }\n\n}", "function getPost(){\n var settings = {\n \"url\": \"http://127.0.0.1:3000/videos\",\n \"method\": \"GET\"\n };\n $.ajax(settings).done(function (response) {\n showText(response);\n });\n}", "function postToDo(list){\r\n let xml = new XMLHttpRequest();\r\n xml.open(\"POST\", \"/todo\");\r\n xml.setRequestHeader(\"Content-type\", \"application/json\");\r\n let listJSON = {list: list.innerHTML};\r\n xml.send(JSON.stringify(listJSON), true);\r\n}", "function getArticles() {\n $.getJSON(\"/articles\", function (data) {\n for (var i = 0; i < data.length; i++) {\n $(\"#articles\").append(\"<p data-id='\" + data[i]._id + \"'><b>\" + data[i].title + \"</b><br />\" + data[i].summary + \"<br />\" + data[i].byline + \"<br /><a href=\" + data[i].link + \">View Article </a>\" + \"|\" + \"<a class=\" + \"save-article\" + \"> Save Article</a></p>\");\n }\n });\n }", "function newRequest(section, newCategory) {\n\n if (section == null) {\n section = 'top-stories';\n }\n\n if (newCategory == null) {\n newCategory = '';\n }\n\n const newsSection = document.querySelectorAll('#' + section + ' ' + '.section_card_container .card');\n const titleSection = document.querySelectorAll('#' + section + ' ' + '.section_card_container .card .card_title_container');\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url + 'category=' + newCategory, true);\n xhr.onload = function () {\n var data = JSON.parse(xhr.responseText);\n for (var i = 0; i < 7; i++) {\n let date = new Date(data.articles[i].publishedAt);\n let dateString = (date.getMonth() + 1) + '/' + date.getDate() + '/' + date.getFullYear();\n newsSection[i].children[0].innerHTML = section;\n if (data.articles[i].urlToImage != null) {\n newsSection[i].children[1].src = data.articles[i].urlToImage;\n }else {\n newsSection[i].children[1].src = 'no-image.jpg';\n }\n\n titleSection[i].children[0].innerHTML = data.articles[i].title;\n titleSection[i].children[0].href = data.articles[i].url;\n titleSection[i].children[1].innerHTML = data.articles[i].description;\n titleSection[i].children[2].children[0].innerHTML = dateString;\n titleSection[i].children[2].children[1].innerHTML = data.articles[i].source.name;\n }\n };\n\n xhr.send();\n}", "function getAllNews(page,record,charsearch) {\n\t\n // $(\".listlct tbody\").html(\"<img src='img/loading.gif' width='20px' height='20px'/>\");\n var dataSend={\n\t page:page,\n\t record:record,\n\t charsearch:charsearch\n\t \n }\n $(\".addnewsdetail\").html(\"<img src='./img/loading.gif' width='20px' height='20px'/>\");\n queryData(\"news/getnews\",dataSend,function (res) {\n // console.log(res);\n if(res.code==1000){\n\t\t//console.log(res);\n \n buildHTMLAllNewsData(res);\n \n }else{\n\t\t\t $(\".addnewsdetail\").html(\"Tìm không thấy\");\n }\n });\n}", "function sendData() {\n const noteObj = document.getElementById('todolist');\n console.log(listToJSON(noteObj));\n $.ajax({\n url: '/lists', \n type: 'POST',\n data: listToJSON(noteObj),\n success: function(data) {\n window.location.replace(\"/\");\n },\n error: function(xhr, str){\n alert('Возникла ошибка: ' + xhr.responseCode);\n }\n }); \n}", "async function onLoad() {\n\n let result = await sendRequest();\n articles = result.news;\n console.log(articles);\n\n createHTML();\n}", "function doPost(url, data, success) {\n $.ajax({\n type: \"POST\",\n url: url,\n data: JSON.stringify(data),\n contentType:\"application/json; charset=utf-8\",\n dataType:\"json\",\n success: success, // Referencing the function, newItemCreated, to run through after it finishes ajax\n });\n}", "function showData() {\n $.post(jersey_path + \"/getTodo\", function(offerte, status) {\n stampaRisultati(offerte);\n });\n}", "function uSearch(totalArticles) {\n $.ajax({\n url: \"https://gnews.io/api/v4/top-headlines?token=41781c49fe723df3a38e0aaa430ef5db\" + totalArticles,\n method: 'GET'\n }).then(function(response) {\n for (var i = 0; i < response.totalArticles; i++)\n {\n populateNewsSearchCards(response.totalArticles[i]);\n }\n });\n}", "function addArticlePosts() {\r\n const JSON_SRC = 'MasterPage/json/article_list.json';\r\n const GROUP_SIZE = 6;\r\n let xmlhttp = new XMLHttpRequest();\r\n let current = currentPage();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let articleList = JSON.parse(this.responseText);\r\n articleList.reverse();\r\n let len = articleList.length;\r\n let next = current + 1;\r\n let htmlContents = '';\r\n for (let i = 0; i < len; i++) {\r\n if (i == GROUP_SIZE * next) {\r\n break;\r\n }\r\n\telse {\r\n if (parseInt(i/GROUP_SIZE) == current) {\r\n let title = articleList[i].articles;\r\n let url = articleList[i].url;\r\n let date = articleList[i].date;\r\n let typeGroup = articleList[i].type_group;\r\n let abstracts = articleList[i].abstracts;\r\n let img = articleList[i].img;\r\n htmlContents += addBlogPost(title, url, date, typeGroup\r\n\t\t\t , abstracts, img);\r\n } \r\n\t}\r\n }\r\n htmlContents += addPage('index.html?page=',current-1,next,len,GROUP_SIZE);\r\n\t\t\t\r\n if (document.getElementById) {\r\n let articlePost = document.getElementById ('article_post');\r\n if (articlePost) {\r\n placeInOuterHtml (articlePost, htmlContents);\r\n\t}\r\n }\r\n }\r\n };\r\n xmlhttp.open(\"GET\", JSON_SRC, true);\r\n xmlhttp.send();\r\n}", "function getMyPosts() {\n var element = document.getElementById(\"display-container\");\n xmlRequest(\"GET\", \"myposts.php\", element);\n}", "function functionLoadAllStickys()\n{\n\tif(window.XMLHttpRequest)\n\t{\n\t\tg.ajaxObject = new XMLHttpRequest();\n\t}\n\n\telse if(window.ActiveXObject)\n\t{ \n\t\tg.ajaxObject = new ActiveXObject(\"Microsoft.XMLHTTP\");\n\t}\n\n\tvar art = document.getElementsByTagName(\"article\");\n\tvar username = art[0].innerHTML;\n\n\tg.ajaxObject.open(\"POST\", \"JSONload.php\", true);\t\n\tg.ajaxObject.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\"); \n\tg.ajaxObject.onreadystatechange = functionSetUpUserStickyes;\n\tg.ajaxObject.send(\"username=\" + username);\t\n}", "function processData(data) {\n\n //Logging the data so that you can always see what de request is providing\n console.log(data);\n\n for (i = 0; i < data.newsposts.length; i++) {\n\n var postcontainer = document.getElementById('news-updates');\n\n var fullpost = document.createElement('a');\n fullpost.setAttribute('href', 'http://localhost/Redcraft/php/fullpost.php?id=' + data.newsposts[i].id);\n\n var post = document.createElement('div');\n post.setAttribute('class', 'news-updates-post');\n post.setAttribute('id', 'news-updates-post');\n\n var postdate = document.createElement('div');\n postdate.setAttribute('class', 'news-updates-post-date');\n postdate.setAttribute('id', 'news-updates-post-date');\n postdate.innerHTML = data.newsposts[i].date;\n\n var posttitle = document.createElement('div');\n posttitle.setAttribute('class', 'news-updates-post-title');\n posttitle.setAttribute('id', 'news-updates-post-title');\n posttitle.innerHTML = data.newsposts[i].title;\n\n var postcontent = document.createElement('div');\n postcontent.setAttribute('class', 'news-updates-post-content');\n postcontent.setAttribute('id', 'news-updates-post-content');\n postcontent.innerHTML = data.newsposts[i].content;\n\n postcontainer.appendChild(fullpost);\n fullpost.appendChild(post);\n post.appendChild(postdate);\n post.appendChild(posttitle);\n post.appendChild(postcontent);\n\n }\n}", "function publishArticle(fd) {\n $.ajax({\n method: \"POST\",\n url: \"/my/article/add\",\n data: fd,\n //Need to ass contentType and processData when post data is in FormData fromat\n contentType: false,\n processData: false,\n success: function(res) {\n if (res.status !== 0) {\n return layer.msg(\"Post article failed :(\")\n }\n layer.msg(\"Article posted! \")\n\n //jump to article list page\n location.href = \"/article/art_list.html\"\n }\n })\n }", "function fetch() {\n $.ajax({\n url: window.silvupleOptions.jsonContentLister,\n dataType: 'json',\n data: null,\n success: success,\n error : fail\n });\n }", "function displayNews(newsArr) {\n const htmlString = getAllHtmlContent(newsArr); //generate html encoded string with needed values\n $('#newsContent').html(htmlString) //set as news content\n $(\"html, body\").animate({ scrollTop: 0 }); //scroll to top of page\n successMsg(\"Number of records: \" + newsArr.length); //display number of records\n}", "refresh(){\n\n console.log('PAGE: refresh')\n\n $.ajax({\n url: 'https://api.nytimes.com/svc/archive/v1/'+$('#msg').val()+'/'+$('#msg1').val()+'.json?api-key=d4235d9ad3454af58c5afd2951fa7b03',\n success: this.onSuccess\n })\n }", "function getTodosAJAX(){\n console.log(\"Get all the todos\");\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"/api/todos\", true);\n xhr.onreadystatechange = function(){\n if(xhr.readyState === RESPONSE_DONE){\n if(xhr.status === STATUS_OK){\n add_todo_elements(TODO_LIST_ID, xhr.responseText);\n }\n }\n }; // end of callback\n xhr.send(data = null);\n}", "function demoAjax() {\n var xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n currentArticle = \"article-button-demo\";\n demo = this.responseText;\n }\n };\n xhttp.open(\"GET\", \"/demo-speedreader\", true);\n xhttp.send();\n}", "function getsAllPosts() {\n let ajax = new XMLHttpRequest();\n\n ajax.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n let posts = JSON.parse(this.responseText);\n for (let i = 0; i < posts.length; i++) {\n document.getElementById(\"posts\").innerHTML += `<h1>${posts[i].id} - ${posts[i].title}</h1><p>${posts[i].body}</p>`;\n }\n }\n }\n\n ajax.open(\"GET\", \"https://jsonplaceholder.typicode.com/posts\", true);\n ajax.setRequestHeader(\"Content-Type\", \"application/json\");\n ajax.send();\n}", "function LoadContentNews(id, productID) {\n $.ajax({\n type: \"POST\",\n url: \"Tracuutin.asmx/GetContentNewsByID\",\n data: \"{Ticket:'\" + _Ticket + \"',ProductID:'\" + productID + \"',ID:'\" + id + \"'}\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (msg) {\n var data = msg.d; //eval(msg.d);\n var content = decodeURIComponent(data.Content);\n if (_check == 'pc')\n window.opener.InsertImage(ck_id, content);\n else\n window.opener.InsertRadEditer(ck_id, content);\n //INSERT LOG\n InsertLog(data.Title, id);\n window.close();\n },\n error: function (msg) {\n }\n });\n}", "function postNote(event) {\n event.preventDefault();\n var note = {};\n\n $.each($('#todoForm').serializeArray(), function (i, field) {\n note[field.name] = field.value;\n });\n console.log(note);\n $.ajax({\n type: 'POST',\n url: '/notes',\n data: note,\n success: function (data) {\n getNotes();\n }\n });\n}", "handleEvent(e) { \n let firstName= document.getElementById(\"firstName\").value;\n let lastName= document.getElementById(\"lastName\").value;\n let body={firstName,lastName};\n ajax\n .post('http://localhost:3000/posts', body)\n .then(response => {\n console.log(`POST successful: ${response.status} ${response.statusText}`);\n })\n .catch(error => {\n console.log(error);\n });\n }", "function agregarRegistro(registro) {\r\n $.ajax({\r\n type: 'POST',\r\n url: 'datoseventos.php?accion=agregar',\r\n data: registro,\r\n success: function(msg) {\r\n calendario1.refetchEvents();\r\n },\r\n error: function(error) {\r\n alert(\"Hay un problema:\" + error);\r\n }\r\n });\r\n }", "function addLastArticles() {\r\n const JSON_SRC = 'MasterPage/json/article_list.json';\r\n const PATH_PREFIX = relativePath();\r\n const NUM_LAST = 2;\r\n let xmlhttp = new XMLHttpRequest();\t\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n let articleList = JSON.parse(this.responseText);\r\n articleList.reverse();\r\n let htmlContents = '';\r\n for (let i = 0; i < NUM_LAST; i++) {\r\n let title = articleList[i].articles;\r\n let img = articleList[i].img;\r\n let url = articleList[i].url;\r\n htmlContents += addNews(url, title, img, i);\r\n }\r\n\t \r\n if (document.getElementById) {\r\n let news = document.getElementById('news');\r\n if (news) {\r\n placeInOuterHtml(news, htmlContents);\r\n }\r\n }\r\n }\r\n };\r\n xmlhttp.open(\"GET\", PATH_PREFIX + JSON_SRC, true);\r\n xmlhttp.send();\r\n}", "function getNewArticles() {\n\n // update table to notify we are loading new items\n $(\"#articleList\").html(processingArticlesHTML)\n\n // scrape for new stories\n $.get(\"/api/scrapeNotSaved\")\n .then(function (data) {\n console.log(data)\n if (data.length > 0) {\n console.log(\"I have data! Will call update list function!\")\n updateArticleList(data)\n } else {\n console.log(\"I do not have data! will call no New articles function!\")\n noNewArticles()\n }\n })\n}", "function getPres(){\n $.ajax({\n url:\"../handlers/prescriptionHandler.php\",\n method:\"POST\",\n data:{type:'getPresInfo'},\n dataType:\"json\",\n success:function(data){\n $(\"#presData\").html(data[0]);\n $(\"#dataCount\").html(data[1]);\n $(\".viewPres\").click(function(){ \n putPresData($(this));\n });\n } \n });\n}", "function loadData() {\r\n var $nytHeaderElem = $('#nytimes-header');\r\n var $nytElem = $('#nytimes-articles');\r\n var nytimesUrl = 'http://api.nytimes.com/svc/search/v2/articlesearch.json?q=Concord&nbsp;NC&api-key=a400bf2ed23d16e7545072692eb6ac92%3A15%3A72063925';\r\n\r\n $.ajax({\r\n url: nytimesUrl,\r\n dataType: \"json\",\r\n success: function(data) {\r\n\r\n $nytHeaderElem.text('New York Times Articles About ' + 'Concord, NC');\r\n\r\n articles = data.response.docs;\r\n for (var i = 0; i < articles.length; i++) {\r\n var article = articles[i];\r\n $nytElem.append('<li class=\"article\">' + '<a href=\" ' + article.web_url + '\">'+article.headline.main+ ' </a>'+'<p>' + article.snippet + '</p > '+' </li>');\r\n\r\n }\r\n },\r\n error: function(e) {\r\n $nytHeaderElem.text('New York Times Article Could Not Be Loaded!');\r\n },\r\n return :false,\r\n });\r\n }", "function onGetResponse(err, res) {\n removePreloader();\n\n if(err) {\n showAlert(err, 'error-msg');\n return;\n }\n\n if(!res.articles.length) {\n // show empty message\n return;\n }\n renderNews(res.articles);\n}", "function filtra_listado()\n{\n\tvar url='inc/datos_gestion.php'\n\tpars='opcion=14&tipo='+$('tipo_cliente').value\n\tvar myAjax = new Ajax.Request(url,\n\t\t{\n\t\tmethod:'post',\n\t\tparameters: pars,\n\t\tonComplete:function gen(respuesta)\n\t\t\t{\n\t\t\t$('listado_copias').innerHTML = respuesta.responseText\n\t\t\t},\n\t\tonCreate:$('listado_copias').innerHTML = \"Generando listado\"\n\t});\n}", "function loadPost() {\n\n const newxmlHttpRequest = new XMLHttpRequest();\n newxmlHttpRequest.open('GET' , '/jsondata.json' , true);\n newxmlHttpRequest.onload = function() {\n if (this.status === 200) //check the status \n {\n const post = JSON.parse(this.responseText);\n console.log(post);\n let output = `\n <div class=\"item\">\n <div class=\"image\"> <img src=\"${post.image}\"> </div>\n <div class=\"content\">\n <a class=\"header\" href=\"#\" id=\"bTitle\"> ${post.postTitle} </a>\n <div class=\"meta\">\n <span id=\"bDate\">${post.date} </span>\n <span>By: <a href=\"#\" id=\"bAuthor\"> ${post.name}</a></span>\n </div>\n <div class=\"description\"> <p id=\"bDesc\"> ${post.postText} </p> </div>\n <div class=\"extra\"> <a class=\"ui floated basic violet button\" href=\"#\">Read Mores</a> </div>\n </div>\n </div> `;\n postDiv.innerHTML = output;\n }\n }\n\n \n\n newxmlHttpRequest.send();\n\n\n\n}", "function listerFilmsCards()\n{\n\tvar action = 'action=listerCards';\t\n\t$.ajax({\n\t\tmethod: \"POST\", \n\t\turl:\"../../controller/filmController.php\",\n\t\tdata: action\t\n\t}).done((jsonString)=>{\n\t\t//alert(jsonString);\n\t\t$.ajax({\n\t\t\tmethod: \"POST\", \n\t\t\turl:\"../film/template/card-film.php\",\n\t\t\tdata: \"chaine=\"+jsonString\n\t\t}).done((template)=>{\n\t\t\t$(\"#contenu\").html(template);\n\t\t})\n\t});\n}", "function sendTimeFn() {\n if ($('.date-from').val() && $('.date-to').val()) {\n // get array dates\n $.ajax({\n url: 'ajax/posts.json',\n dataType: 'json',\n success: function (data) {\n alert('success');\n\n let postsArray = data.posts;\n let posts_out = '';\n let post_class = '';\n\n $.each(postsArray, function () {\n if (this['type'] == \"video\") {\n post_class = ' video';\n }\n posts_out += '<div class=\"content__item' + post_class + '\">' +\n '<img src=\"' + this['image'] + '\" alt=\"\" />' +\n '<span>лайков: ' + this['likes1'] + '</span></div>';\n });\n\n $('.content').html(posts_out);\n }\n });\n }\n}", "function sendRequest () {\n var url = 'https://www.federalregister.gov/api/v1/articles.json';\n $.ajax({\n url: url,\n data: {\n per_page: 1000,\n order: 'newest',\n conditions: {\n term: scientific\n }\n },\n dataType: 'jsonp',\n success: function( response ) {\n var formatted = formatDates(response);\n $registerItems.append( template(formatted) );\n }\n });\n }", "function getSource(){\r\n let xml = new XMLHttpRequest();\r\n xml.onreadystatechange = function(){\r\n //Retrieves news information\r\n if(xml.status == 200 && xml.readyState == 4){\r\n source = xml.responseText;\r\n getNews();\r\n }\r\n // If we don't get any items, inform the user.\r\n else if (xml.status == 404 && xml.readyState == 4){\r\n }\r\n };\r\n xml.open(\"GET\", \"/newssource\", true);\r\n xml.send();\r\n }", "function getData (){\n $.ajax({\n type: \"GET\",\n url: \"/things\",\n success: function(data){\n console.log(data);\n postToDOM(data);\n }\n });\n}" ]
[ "0.6957251", "0.6804377", "0.6586956", "0.6585765", "0.655429", "0.6373717", "0.63655", "0.63572353", "0.63223904", "0.6260317", "0.6258732", "0.621557", "0.6198414", "0.6197101", "0.6193509", "0.6169285", "0.6100322", "0.6094796", "0.6023054", "0.6022231", "0.6006042", "0.5998284", "0.5969", "0.5963746", "0.593879", "0.59272975", "0.5926522", "0.5926344", "0.5902689", "0.58918506", "0.5888176", "0.58659714", "0.5865046", "0.585972", "0.5837678", "0.58245134", "0.58173513", "0.58132446", "0.5809847", "0.5801538", "0.57972455", "0.5785799", "0.5778611", "0.57644933", "0.5750968", "0.57394445", "0.57372403", "0.5728456", "0.5727943", "0.57097864", "0.5705192", "0.5695973", "0.56903285", "0.5684492", "0.566756", "0.5655751", "0.5653926", "0.5652731", "0.5644271", "0.5633451", "0.5632364", "0.5616282", "0.5609612", "0.5596678", "0.5589227", "0.55849135", "0.55814624", "0.5580624", "0.5577779", "0.55764985", "0.55718446", "0.5566028", "0.55533165", "0.5545615", "0.5543621", "0.55401963", "0.5538081", "0.5536947", "0.5534458", "0.5534131", "0.5533325", "0.5527117", "0.5524211", "0.55141324", "0.5498028", "0.5483773", "0.5471579", "0.5469545", "0.5468469", "0.546707", "0.5465454", "0.54652935", "0.5464368", "0.5462005", "0.546194", "0.54617083", "0.5457487", "0.5451069", "0.5440901", "0.54406863" ]
0.6562662
4
Markup for one single news item
function createOneNewsItemMarkup(news) { // determine language if(window.location.pathname.search(/ru/) !== -1) { //console.log(lang); return '<li class="news__list-item">' + '<a href="'+ news.news_code +'/">' + '<div class="news__list-item-top">' + '<div data-name='+ news.news_code + ' class="news__list-item-image" style="background-image: url(' + news.img_path + '/' + news.img_name + ')"></div>' + // '<div class="news__list-item-date_1">' + formatDate1(news[2]) + '</div>' + '<h4 class="news__list-item-heading">' + news.name_news_ru + '</h4>' + '</div>' + '<div class="news__list-item-description">' + '<p>' + news.min_text_ru + '</p>' + '</div>' + '<div class="news__list-item-bottom">' + '<div class="news__list-item-date_2">' + '<span class="news__list-item-calendar">' + '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 488.152 488.152"><path d="M177.854 269.311c0-6.115-4.96-11.069-11.08-11.069h-38.665c-6.113 0-11.074 4.954-11.074 11.069v38.66c0 6.123 4.961 11.079 11.074 11.079h38.665c6.12 0 11.08-4.956 11.08-11.079v-38.66zM274.483 269.311c0-6.115-4.961-11.069-11.069-11.069h-38.67c-6.113 0-11.074 4.954-11.074 11.069v38.66c0 6.123 4.961 11.079 11.074 11.079h38.67c6.108 0 11.069-4.956 11.069-11.079v-38.66zM371.117 269.311c0-6.115-4.961-11.069-11.074-11.069h-38.665c-6.12 0-11.08 4.954-11.08 11.069v38.66c0 6.123 4.96 11.079 11.08 11.079h38.665c6.113 0 11.074-4.956 11.074-11.079v-38.66zM177.854 365.95c0-6.125-4.96-11.075-11.08-11.075h-38.665c-6.113 0-11.074 4.95-11.074 11.075v38.653c0 6.119 4.961 11.074 11.074 11.074h38.665c6.12 0 11.08-4.956 11.08-11.074V365.95zM274.483 365.95c0-6.125-4.961-11.075-11.069-11.075h-38.67c-6.113 0-11.074 4.95-11.074 11.075v38.653c0 6.119 4.961 11.074 11.074 11.074h38.67c6.108 0 11.069-4.956 11.069-11.074V365.95zM371.117 365.95c0-6.125-4.961-11.075-11.069-11.075h-38.67c-6.12 0-11.08 4.95-11.08 11.075v38.653c0 6.119 4.96 11.074 11.08 11.074h38.67c6.108 0 11.069-4.956 11.069-11.074V365.95z"/><path d="M440.254 54.354v59.05c0 26.69-21.652 48.198-48.338 48.198h-30.493c-26.688 0-48.627-21.508-48.627-48.198V54.142h-137.44v59.262c0 26.69-21.938 48.198-48.622 48.198H96.235c-26.685 0-48.336-21.508-48.336-48.198v-59.05c-23.323.703-42.488 20.002-42.488 43.723v346.061c0 24.167 19.588 44.015 43.755 44.015h389.82c24.131 0 43.755-19.889 43.755-44.015V98.077c0-23.721-19.164-43.02-42.487-43.723zm-14.163 368.234c0 10.444-8.468 18.917-18.916 18.917H80.144c-10.448 0-18.916-8.473-18.916-18.917V243.835c0-10.448 8.467-18.921 18.916-18.921h327.03c10.448 0 18.916 8.473 18.916 18.921l.001 178.753z"/><path d="M96.128 129.945h30.162c9.155 0 16.578-7.412 16.578-16.567V16.573C142.868 7.417 135.445 0 126.29 0H96.128C86.972 0 79.55 7.417 79.55 16.573v96.805c0 9.155 7.422 16.567 16.578 16.567zM361.035 129.945h30.162c9.149 0 16.572-7.412 16.572-16.567V16.573C407.77 7.417 400.347 0 391.197 0h-30.162c-9.154 0-16.577 7.417-16.577 16.573v96.805c0 9.155 7.423 16.567 16.577 16.567z"/></svg>' + '</span>' + '<span>' + formatDate2(news.date) + '</span>' + '</div>' + '<sapn class="news__list-item-read-more-btn">' + text.readMore[lang] + '</span>' + '</div>' + '</a>' + '</li>'; } else if(window.location.pathname.search(/en/) !== -1){ //console.log(lang); return '<li class="news__list-item">' + '<a href="'+ news.news_code +'/">' + '<div class="news__list-item-top">' + '<div data-name='+ news.news_code + ' class="news__list-item-image" style="background-image: url(' + news.img_path + '/' + news.img_name + ')"></div>' + // '<div class="news__list-item-date_1">' + formatDate1(news[2]) + '</div>' + '<h4 class="news__list-item-heading">' + news.name_news_en + '</h4>' + '</div>' + '<div class="news__list-item-description">' + '<p>' + news.min_text_en + '</p>' + '</div>' + '<div class="news__list-item-bottom">' + '<div class="news__list-item-date_2">' + '<span class="news__list-item-calendar">' + '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 488.152 488.152"><path d="M177.854 269.311c0-6.115-4.96-11.069-11.08-11.069h-38.665c-6.113 0-11.074 4.954-11.074 11.069v38.66c0 6.123 4.961 11.079 11.074 11.079h38.665c6.12 0 11.08-4.956 11.08-11.079v-38.66zM274.483 269.311c0-6.115-4.961-11.069-11.069-11.069h-38.67c-6.113 0-11.074 4.954-11.074 11.069v38.66c0 6.123 4.961 11.079 11.074 11.079h38.67c6.108 0 11.069-4.956 11.069-11.079v-38.66zM371.117 269.311c0-6.115-4.961-11.069-11.074-11.069h-38.665c-6.12 0-11.08 4.954-11.08 11.069v38.66c0 6.123 4.96 11.079 11.08 11.079h38.665c6.113 0 11.074-4.956 11.074-11.079v-38.66zM177.854 365.95c0-6.125-4.96-11.075-11.08-11.075h-38.665c-6.113 0-11.074 4.95-11.074 11.075v38.653c0 6.119 4.961 11.074 11.074 11.074h38.665c6.12 0 11.08-4.956 11.08-11.074V365.95zM274.483 365.95c0-6.125-4.961-11.075-11.069-11.075h-38.67c-6.113 0-11.074 4.95-11.074 11.075v38.653c0 6.119 4.961 11.074 11.074 11.074h38.67c6.108 0 11.069-4.956 11.069-11.074V365.95zM371.117 365.95c0-6.125-4.961-11.075-11.069-11.075h-38.67c-6.12 0-11.08 4.95-11.08 11.075v38.653c0 6.119 4.96 11.074 11.08 11.074h38.67c6.108 0 11.069-4.956 11.069-11.074V365.95z"/><path d="M440.254 54.354v59.05c0 26.69-21.652 48.198-48.338 48.198h-30.493c-26.688 0-48.627-21.508-48.627-48.198V54.142h-137.44v59.262c0 26.69-21.938 48.198-48.622 48.198H96.235c-26.685 0-48.336-21.508-48.336-48.198v-59.05c-23.323.703-42.488 20.002-42.488 43.723v346.061c0 24.167 19.588 44.015 43.755 44.015h389.82c24.131 0 43.755-19.889 43.755-44.015V98.077c0-23.721-19.164-43.02-42.487-43.723zm-14.163 368.234c0 10.444-8.468 18.917-18.916 18.917H80.144c-10.448 0-18.916-8.473-18.916-18.917V243.835c0-10.448 8.467-18.921 18.916-18.921h327.03c10.448 0 18.916 8.473 18.916 18.921l.001 178.753z"/><path d="M96.128 129.945h30.162c9.155 0 16.578-7.412 16.578-16.567V16.573C142.868 7.417 135.445 0 126.29 0H96.128C86.972 0 79.55 7.417 79.55 16.573v96.805c0 9.155 7.422 16.567 16.578 16.567zM361.035 129.945h30.162c9.149 0 16.572-7.412 16.572-16.567V16.573C407.77 7.417 400.347 0 391.197 0h-30.162c-9.154 0-16.577 7.417-16.577 16.573v96.805c0 9.155 7.423 16.567 16.577 16.567z"/></svg>' + '</span>' + '<span>' + formatDate2(news.date) + '</span>' + '</div>' + '<sapn class="news__list-item-read-more-btn">' + text.readMore[lang] + '</span>' + '</div>' + '</a>' + '</li>'; } else { //console.log(lang); return '<li class="news__list-item">' + '<a href="'+ news.news_code +'/">' + '<div class="news__list-item-top">' + '<div data-name='+ news.news_code + ' class="news__list-item-image" style="background-image: url(' + news.img_path + '/' + news.img_name + ')"></div>' + // '<div class="news__list-item-date_1">' + formatDate1(news[2]) + '</div>' + '<h4 class="news__list-item-heading">' + news.name_news_ua + '</h4>' + '</div>' + '<div class="news__list-item-description">' + '<p>' + news.min_text_ua + '</p>' + '</div>' + '<div class="news__list-item-bottom">' + '<div class="news__list-item-date_2">' + '<span class="news__list-item-calendar">' + '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 488.152 488.152"><path d="M177.854 269.311c0-6.115-4.96-11.069-11.08-11.069h-38.665c-6.113 0-11.074 4.954-11.074 11.069v38.66c0 6.123 4.961 11.079 11.074 11.079h38.665c6.12 0 11.08-4.956 11.08-11.079v-38.66zM274.483 269.311c0-6.115-4.961-11.069-11.069-11.069h-38.67c-6.113 0-11.074 4.954-11.074 11.069v38.66c0 6.123 4.961 11.079 11.074 11.079h38.67c6.108 0 11.069-4.956 11.069-11.079v-38.66zM371.117 269.311c0-6.115-4.961-11.069-11.074-11.069h-38.665c-6.12 0-11.08 4.954-11.08 11.069v38.66c0 6.123 4.96 11.079 11.08 11.079h38.665c6.113 0 11.074-4.956 11.074-11.079v-38.66zM177.854 365.95c0-6.125-4.96-11.075-11.08-11.075h-38.665c-6.113 0-11.074 4.95-11.074 11.075v38.653c0 6.119 4.961 11.074 11.074 11.074h38.665c6.12 0 11.08-4.956 11.08-11.074V365.95zM274.483 365.95c0-6.125-4.961-11.075-11.069-11.075h-38.67c-6.113 0-11.074 4.95-11.074 11.075v38.653c0 6.119 4.961 11.074 11.074 11.074h38.67c6.108 0 11.069-4.956 11.069-11.074V365.95zM371.117 365.95c0-6.125-4.961-11.075-11.069-11.075h-38.67c-6.12 0-11.08 4.95-11.08 11.075v38.653c0 6.119 4.96 11.074 11.08 11.074h38.67c6.108 0 11.069-4.956 11.069-11.074V365.95z"/><path d="M440.254 54.354v59.05c0 26.69-21.652 48.198-48.338 48.198h-30.493c-26.688 0-48.627-21.508-48.627-48.198V54.142h-137.44v59.262c0 26.69-21.938 48.198-48.622 48.198H96.235c-26.685 0-48.336-21.508-48.336-48.198v-59.05c-23.323.703-42.488 20.002-42.488 43.723v346.061c0 24.167 19.588 44.015 43.755 44.015h389.82c24.131 0 43.755-19.889 43.755-44.015V98.077c0-23.721-19.164-43.02-42.487-43.723zm-14.163 368.234c0 10.444-8.468 18.917-18.916 18.917H80.144c-10.448 0-18.916-8.473-18.916-18.917V243.835c0-10.448 8.467-18.921 18.916-18.921h327.03c10.448 0 18.916 8.473 18.916 18.921l.001 178.753z"/><path d="M96.128 129.945h30.162c9.155 0 16.578-7.412 16.578-16.567V16.573C142.868 7.417 135.445 0 126.29 0H96.128C86.972 0 79.55 7.417 79.55 16.573v96.805c0 9.155 7.422 16.567 16.578 16.567zM361.035 129.945h30.162c9.149 0 16.572-7.412 16.572-16.567V16.573C407.77 7.417 400.347 0 391.197 0h-30.162c-9.154 0-16.577 7.417-16.577 16.573v96.805c0 9.155 7.423 16.567 16.577 16.567z"/></svg>' + '</span>' + '<span>' + formatDate2(news.date) + '</span>' + '</div>' + '<sapn class="news__list-item-read-more-btn">' + text.readMore[lang] + '</span>' + '</div>' + '</a>' + '</li>'; }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNewsInfo(news) {\n const newsContainer = document.querySelector(\"#news\")\n const newsInfo = `\n <a href =${news[0].url} class='news1'>${news[0].title, news[0].description}</a>\n <a href =${news[1].url} class='news2'>${news[1].title, news[1].description}</a>\n <a href =${news[2].url} class='news3'>${news[2].title, news[2].description}</a>\n `\n newsContainer.insertAdjacentHTML('beforeend', newsInfo)\n }", "function returnHtml(item){\n var output = `<div class=\"newsitem\"><div class=\"itemleft\"><div class=\"itemimg\"><img src=\"`+item.thumbnail+`\"></div></div>`\n + `<div class=\"itemright\"><div class=\"itemtitle\">`+item.title+`</div>`\n +`<div class=\"itemabstract\">`+item.abstract+`</div>`\n +`<div class=\"itemdate\">`+item.published_date+`</div>`\n +`<div class=\"itemlink\"><a target=\"_blank\" href=\"`+item.url+`\">Open in new tab</a></div></div></div>`\n ;\n return output;\n }", "function newsTemplate({ urlToImage, title, url, description }) {\n return `\n <div class=\"col s12\">\n <div class=\"card\">\n <div class=\"card-image\">\n <img src=\"${urlToImage}\">\n <span class =\"card-title\">${title || ''}</span>\n </div>\n <div class=\"card-content\">\n <p>${description || ''}</p>\n </div>\n <div class=\"card-action\">\n <a href=\"${url}\">Read more</a>\n </div>\n </div>\n </div>\n `;\n}", "function viewArticle() {\n\t\t//set the content of the elements using the list items' attributes\n\t\t$(\"article h1\").html($(this).attr(\"title\"));\n\t\t$(\"article img\").attr(\"src\", $(this).attr(\"backgr\"));\n\t\t$(\"article h4\").html($(this).attr(\"author\") + \" - \" + $(this).attr(\"date\"));\n\t\t$(\"article .content\").html($(this).attr(\"description\"));\n\t}", "function getNews(news) {\r\n let output = \"\";\r\n if (news.totalResults > 0) {\r\n news.articles.forEach((ind) => {\r\n output += `<section class=\"container\">\r\n <li class=\"article\"><a class=\"article-link\" href=\"${\r\n ind.url\r\n }\" target=\"_blank\">\r\n <div class=\"img-area\">\r\n <img src=\"${ind.urlToImage}\" class=\"article-img\" alt=\"${\r\n ind.title\r\n }\"></img>\r\n </div>\r\n <p style=\"color:#FEE715FF;\" class=\"article-description\">${\r\n ind.description || \"Description not available\"\r\n }</p> <br>\r\n <h2 class=\"article-title\">${ind.title}</h2>\r\n <span class=\"article-author\">-${\r\n ind.author ? ind.author : \"Anon\"\r\n }</span><br>\r\n </a>\r\n </li>\r\n </section>`;\r\n });\r\n article_area.innerHTML = output;\r\n } else {\r\n article_area.innerHTML =\r\n '<li> <h3 class=\"not-found\">No article was found based on the search.</h3</li>';\r\n }\r\n}", "function handlerNewsDetail(data){\n\tif(data!=null){\n\t\tsetOriginal(data.is_original);\n\t\tif(is_original==\"1\"){\n\t\t\t$(\"#lblTime\").hide();\n\t\t}\n\t\t\n\t\tshare_title=data.title;\n\t\t$(document).attr(\"title\",data.title);\n\t\t$(\"#lblTitle\").html(data.title);\n\t\t$(\"#lblCopyFrom\").html(data.copyfrom);\n\t\t$(\"#lblTime\").html(data.time);\n\t\t$(\".contentline\").html(data.content.replace(/动图/g, ''));\n\t\tformateStyle();\n\t}\n}", "articleMaker(title, imageLink, author, date, text, url) {\n author = author ? author : \"Anonymous\";\n return (\n '<div class=\"box\"><article class=\"media\"><div class=\"media-left\"><a href=\"' +\n url +\n '\"><figure class=\"image is-64x64\"><img src=\"' +\n imageLink +\n '\" alt=\"No Image\"/></figure></a></div><div class=\"media-content\"><div class=\"content\"><p><a href=\"' +\n url +\n '\"><strong>' +\n title +\n \"</strong></a> <small>\" +\n author +\n \"</small> <small>\" +\n date +\n \"</small><br />\" +\n text +\n \"</p></div></div></article></div>\"\n );\n }", "function renderNews(news) {\n const newsContainer = document.querySelector('.news-container .row');\n if(newsContainer.children.length) {\n clearContainer(newsContainer);\n }\n let fragment = '';\n\n news.forEach(newsItem => {\n const el = newsTemplate(newsItem);\n fragment += el;\n });\n\n newsContainer.insertAdjacentHTML('afterbegin', fragment);\n}", "function templateItem (movie) {\n return `<li class='playlist-item' data-title=\"${movie.title}\">${movie.title}</li>`\n }", "function render(item) {\n let html = ` \n <div class=\"item\">\n <div class=\"item--content\">\n <div class=\"content__avatar\">\n <img\n src=${item.imageUrl}\n alt=\"\"\n />\n </div>\n <div class=\"content__description\">\n <h3>messi</h3>\n <p>${item.description}</p>\n <span style=\"font-size: 2rem\">${item.type}</span>\n </div>\n <div class=\"content__reaction\">\n <div class=\"content__reaction--time\">\n <span>20 hours</span>\n </div>\n <div class=\"content__reaction--interative\">\n <span class=\"heart\" data-id=\"${item.id}\">\n <i class=\"fas fa-heart\"></i>\n <span class=\"counter__heart\">${item.totalHeart}</span>\n </span>\n <span style=\"margin-left:0.5rem\">\n <i class=\"fas fa-comment\"></i>\n <span class=\"counter__comment\">${item.totalComment}</span>\n </span>\n </div>\n </div>\n </div>\n </div>`;\n return html;\n }", "function prepare_static_news_items(){\r\n\t\tvar news = $('.news');\r\n\t\tvar news_links = $('.news-link');\r\n\t\t\r\n\t\tfor(var i = 0 ; i < news.length ; i++) {\r\n\t\t\tnews[i].innerHTML = truncate_to_600(news[i].innerHTML);\r\n\t\t\tvar temp_link = document.createElement(\"a\");\r\n\t\t\ttemp_link.href = news_links[i].href;\r\n\t\t\ttemp_link.innerHTML = \"Read More\";\r\n\t\t\tnews[i].appendChild(temp_link);\r\n\t\t}\r\n\t\treturn;\r\n\t}", "render() {\n return (\n <div>\n { news.map(item => {\n return (\n <div class=\"box\">\n <article class=\"media\">\n <div class=\"media-content\">\n <div class=\"content\">\n <p>\n <strong>{item.title}</strong>\n <div>{item.description}</div>\n <div>Writtern By - <strong>{item.user}</strong></div>\n </p>\n </div>\n </div>\n </article>\n </div>\n )\n })}\n <button class=\"button\" onClick={this.addNewsHandler}>Add A News Article</button>\n </div>\n )\n }", "static get tag(){return\"rss-items\"}", "render() {\n\t\tvar article = this.props.article;\n\t\tvar title = article.getElementsByTagName(\"title\")[0].textContent;\n\t\tvar link = article.getElementsByTagName(\"link\")[0].textContent;\n\t\tvar date, description, descriptionArr;\n\n\t\t// Handling the different RSS feed formatting\n\t\tswitch(this.props.currentSourceName) {\n\n\t\t\tcase \"Straits Times\":\n\t\t\t\tlet dateAndDescription = article.getElementsByTagName(\"description\")[0];\n\t\t\t\tif(dateAndDescription != null) {\n\n\t\t\t\t\tdate = dateAndDescription.textContent.split(\"<br /><br />\")[0];\n\t\t\t\t\tdescription = dateAndDescription.textContent.split(\"<br /><br />\")[1];\n\t\t\t\t\tdescriptionArr = this.escapeLinks(description);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase \"Channel News Asia\":\n\t\t\t\tdate = article.getElementsByTagName(\"pubDate\")[0].textContent;\n\t\t\t\tif(article.getElementsByTagName(\"description\")[0] != null) {\n\n\t\t\t\t\tdescription = article.getElementsByTagName(\"description\")[0].textContent;\n\t\t\t\t\tdescriptionArr = this.escapeLinks(description);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tbreak;\n\n\t\t}\n\n\t\treturn (\n\t\t\t<div className=\"article\">\n\t\t\t\t<a href={link} target=\"_blank\" rel=\"noopener noreferrer\">\n\t\t\t\t\t<h2>{title}</h2>\n\t\t\t\t</a>\n\t\t\t\t<p><small>{date}</small></p>\n\t\t\t\t<p>{descriptionArr}</p>\n\t\t\t</div>\n\t\t);\n\t}", "function EditorialesItemTemplate(editorial){\n return `<div style=\"margin-bottom:25px;\" class=\"card\">\n <a style=\"color: black; text-decoration: none; cursor: pointer;\" href=\"editorial.html\">\n <img src=\"../img/Zona Norte blanco.jpg\" class=\"card-img-top\" alt=\"...\">\n <div class=\"card-body\">\n <div class=\"title\">\n <h6 style=\"color: #C21812; font-weight: bold;\">${editorial.titulo}</h6> \n </div>\n <p class=\"card-text\">${editorial.descripcion.substr(0,100)} <a href=\"#\">Ver mas ...</a></p>\n </div>\n\n </a>\n </div>`;\n }", "function createHTMLString(item) {\n return `\n <li class=\"content\">\n <img src=\"${item.image}\" alt=\"${item.type}\" class=\"item__thumbnail>\n <p class=\"item_description>${item.gender}, ${item.size} size</p>\n `;\n}", "function showNews(data) {\r\n console.log(data);\r\n var json = data;\r\n let newsLayout = \"\";\r\n let count = 0;\r\n const addNews = news => {\r\n newsLayout +=\r\n \"<td>\" +\r\n \"<img class=newsImg src=\" + news.enclosureField.urlField + \">\" +\r\n \"</td>\" +\r\n \"<td>\" +\r\n \"<a href=\" + news.linkField + \">\" +\r\n \"<b>\" + news.titleField + \"</b>\" + \r\n \"</a>\" +\r\n \"<br>\" +\r\n \"<p>\" + news.descriptionField + \"</p>\" +\r\n \"<b>Date Published: \" + news.pubDateField.substring(0, 16) + \"</b>\";\r\n count += 1;\r\n\r\n if (count >= 1) {\r\n newsLayout += \"</tr>\\n\"\r\n count = 0;\r\n }\r\n }\r\n json.forEach(addNews);\r\n document.querySelector(\"#newsTable\").innerHTML = newsLayout;\r\n}", "function placeMetadata(item) {\n\tvar news_data = document.getElementById(\"news-data\");\n\n\tnews_data.innerHTML = \"\";\n\tvar entities = item[\"ents\"];\n\tvar relationships = item[\"rels\"];\n\n\tif( entities.length > 0 ) {\n\t\tnews_data.appendChild(createHeadlineElement(\"ENTITIES\"));\n\t\tnews_data.appendChild(generateEntityTable(entities));\n\t}\n\tif ( relationships.length > 0 ) {\n\t\tnews_data.appendChild(createHeadlineElement(\"RELATIONSHIPS\"));\n\t\tnews_data.appendChild(generateRelationshipTable(relationships));\n\t}\n}", "function renderLeftNews(data) {\n const firstArticleElement = document.getElementsByClassName(\"left\"); // Cai nay return ve 1 array chua' nhung element co class la left\n firstArticleElement[0].innerHTML = `\n <div class=\"posts\">\n <a href=\"#\"><p class=\"title\" style ='color: white;'>${data.title}</p></a>\n <p class=\"author\">${data.by}</p>\n <p>I think your best bet would be to start or join a startup. That's been a reliable way to get rich\n for hundreds of years.The word \"startup\" dates from the 1960s, but what happens in one is very\n similar.</p>\n </div>\n `;\n}", "function News() {\n \n return (\n <div>\n news\n </div>\n );\n}", "function displayDataOnPage(topNews, counter){\n // console.log(topNews);\n topNews.articles.forEach(content => {\n const spanNode = document.createElement(\"li\"); // make fresh <li>\n spanNode.innerHTML = // news contents\n `<a href=\"${content.url}\">\n <img src=\"${content.urlToImage}\" alt=\"news image\">\n <h3>${content.source.name}</h3>\n <h2>${content.title}</h2>\n <p>${content.description}</p></a>`;\n parentNode.appendChild(spanNode); // pushing to the <ul>\n });\n }", "static get tag(){return\"simple-blog-listing\"}", "render(isSingle) {\n const containerPost = document.createElement('div');\n containerPost.classList.add('post')\n\n const linkHTMLString = isSingle ?\n `<a href=\"./edit-post.html?id=${this.id}\">Edit</a>`\n : `<a href=\"./view-post.html?id=${this.id}\">View</a>`\n\n containerPost.innerHTML = `\n <h1>${this.title}</h1>\n <p> ${this.text}</p>\n ${linkHTMLString}\n `\n return containerPost;\n }", "function showNews(responseXML, index) {\n\t//alert(index);\n\tvar entries = responseXML.querySelectorAll('item');\n\tvar entry = entries[index];\n\tvar pubDate = entry.querySelector('pubDate');\n\tvar content = entry.getElementsByTagNameNS(\"http://purl.org/rss/1.0/modules/content/\", \"encoded\");\n\tvar description = entry.querySelector('description');\n\tvar vignete = entry.querySelector('enclosure');\n\n\tdocument.getElementById('articleTitle').innerHTML = entry.querySelector('title').textContent;\n\n\tvar container = document.getElementById('articleContent');\n\tcontainer.innerHTML = \"\";\n\n\tif(vignete) {\n\t\tvar img = document.createElement(\"img\");\n\t\timg.setAttribute('src', vignete.getAttribute('url'));\n\t\tcontainer.appendChild(img);\n\t}\n\n\tvar div = document.createElement('div');\n\tdiv.setAttribute(\"id\", \"description\");\n\tdiv.appendChild(document.createTextNode(description.textContent));\n\tcontainer.appendChild(div);\n\tpar = document.createElement(\"p\");\n\tpar.innerHTML = content[0].textContent;\n\tcontainer.appendChild(par);\n\n\tdocument.getElementById('portada').classList.add('hide');\n\tdocument.getElementById('footer').classList.add('hide');\n\tdocument.getElementById('article').classList.remove('hide');\n\tdocument.getElementById('sections').classList.add('hide');\n}", "function ItemArticle(section, item) {\n const { id, price, desc, info } = getPropertiesForItem(section, item);\n const itemArticle = document.createElement(\"div\");\n itemArticle.classList.add(\"item-article\", \"flex-column\", `${item}`);\n itemArticle.innerHTML = `<h3 class=\"item-id ${item}\">${id}</h3>\n <p class=\"item-price\">${price}</p>\n <p class=\"item-desc\">${desc}</p>\n <p class=\"item-info\">${info}</p>`;\n return itemArticle;\n }", "function zoto_widget_news(options) {\n\tthis.$uber(options);\n\tthis.type = 'zoto_widget_news';\n\tthis.set_title(\"welcome to zoto\");\n}", "function NewsArticle (props) {\n return (\n <div className=\"newsArticle-container\">\n <div className =\"article-card\">\n <h2 className=\"heading\">{props.headline}</h2>\n <img src={props.img} alt={props.headline}/>\n <p>{props.description}</p>\n <a href={props.url}>Link to the Full Article</a>\n </div>\n </div>\n );\n}", "function displayNews(newsObj, newsPaper) {\n var card;\n card = app.cardTemplate.cloneNode(true);\n card.classList.remove('card-template');\n card.removeAttribute('hidden');\n\n card.querySelector('.card-title').textContent = newsObj.title;\n card.querySelector('.card-content p').textContent = newsObj.description;\n card.querySelector('.card-action a').setAttribute('href', newsObj.url);\n card.querySelector('.card-action a').textContent = newsPaper;\n card.querySelector('.card-image img').setAttribute('src', newsObj.urlToImage);\n app.container.appendChild(card);\n card.querySelector('.card-action div').addEventListener('click', addFavoriteStories);\n document.querySelector('.btn-home').classList.add('active');\n document.querySelector('.btn-follow').classList.remove('active');\n document.querySelector('.btn-favorite-stories').classList.remove('active');\n}", "function addNews(data) {\n const humidi = data.daily.data; \n // console.log(humidi);\n $('.item0').text('Monday: ' + data.currently.summary);\n $('.item1').text('Tuesday:' + data.daily.data[0].summary + '*' + data.daily.data[0].humidity);\n $('.item2').text('Wednesday: ' + data.daily.data[1].summary + '*' + data.daily.data[1].humidity);\n $('.item3').text('Thursday: ' + data.daily.data[2].summary + '*' + data.daily.data[2].humidity);\n $('.item4').text('Friday: ' + data.daily.data[3].summary + '*' + data.daily.data[3].humidity);\n $('.item5').text('Saturday:' + data.daily.data[4].summary + '*' + data.daily.data[4].humidity);\n $('.item6').text('Sunday:' + data.daily.data[5].summary + '*' + data.daily.data[5].humidity);\n }", "function generateSingleFeedHTML(itemToUseContent) {\n\n\t\t\tvar tAuthorFullName = itemToUseContent.targetAuthor.eventDestActorFullName(true),\n\t\t\t\ttAuthorProfileUrl = itemToUseContent.targetAuthor.eventDestActorProfileUrl(true),\n\t\t\t\ttAuthorProfilePic = itemToUseContent.targetAuthor.eventDestActorProfilePic(true),\n\t\t\t\ttAuthorProfileId = itemToUseContent.targetAuthor.eventDestActorProfileId(true),\n\t\t\t\tmainActorVCard = generateVCard(tAuthorFullName, tAuthorProfileId, tAuthorProfileUrl, tAuthorProfilePic, true, false, false),\n\t\t\t\ttoAdd,\n\t\t\t\texpandedObject,\n\t\t\t\tembeddedActor = {\n\t\t\t\t\tvCard: \"\",\n\t\t\t\t\tid: -1\n\t\t\t\t},\n\t\t\t\tembeddedContent = \"\",\n\t\t\t\tnTitle = itemToUseContent.mainObject.Title || \"\",\n\t\t\t\teventDateHTML = \"\",\n\t\t\t\ttTitleToComp,\n\t\t\t\tCcontentToComp,\n\n\t\t\t\tnCreatedDateDisplay = itemToUseContent.eventCreatedDateDisplay || \"\",\n\t\t\t\tnCreatedFullDate = itemToUseContent.eventCreatedDateFull,\n\n\t\t\t\tnTargetUrl = itemToUseContent.mainObject.Url,\n\t\t\t\tnRollUpId = itemToUseContent.originalFeed.connections.rollupid || \"\",\n\t\t\t\tnIsSaved = itemToUseContent.bools.IsSaved,\n\t\t\t\tnIsLiked = itemToUseContent.bools.IsLiked,\n\t\t\t\tnIsFollowed = itemToUseContent.bools.IsFollowed,\n\t\t\t\tnDataId = itemToUseContent.mainObject.ID,\n\t\t\t\tnVerb = itemToUseContent.mainObject.Verb || \"\",\n\t\t\t\tnPublishingDate = itemToUseContent.mainObject.PublishingDate || \"\",\n\n\t\t\t\tnEventOf = itemToUseContent.eventOfType || \"\",\n\n\t\t\t\tnObjectType = itemToUseContent.mainObject.Type,\n\t\t\t\tnContent = itemToUseContent.mainObject.Content,\n\t\t\t\tnFirstLevelContentAttribute = assertChain(itemToUseContent, \"originalFeed.content\") ? itemToUseContent.originalFeed.content : \"\",\n\t\t\t\tpostObject = \"\",\n\t\t\t\tinsideActorHTML = '<li class=\"postObject-inside-actor\">$MAIN_ACTOR_VCARD</li>',\n\t\t\t\tinsideEmbedded$ = $('<ul/>').addClass('postObject-inside-embedded')\n\t\t\t\t\t.append($('<li/>').addClass('postObject-inside-embedded-actor').text('$EMBEDDED_ACTOR'),\n\t\t\t\t\t\t$('<li/>').addClass('postObject-inside-embedded-eventContent').text('$EMBEDDED_CONTENT')),\n\n\t\t\t\tinsideMain$ = $('<ul/>').addClass('postObject-inside-main')\n\t\t\t\t\t.append($('<li/>').addClass('postObject-inside-eventContent').text('$MAIN_CONTENT'),\n\t\t\t\t\t\t$('<li/>').addClass('postObject-inside-eventAttachments').text('$EVENT_ATTACHMENTS')),\n\n\t\t\t\tpostObjectHtmlTemplate = '<li class=\"normalPostEntryItem\" tabindex=\"$TAB_INDEX\" data-index=\"$DATA_INDEX\">' +\n\t\t\t\t\t'<div class=\"activityStreamNewsItemContainer ActivityStreamWidgetPost\" data-targetURL=\"$DATA_TARGETURL\" ' +\n\t\t\t\t\t'data-rollupid=\"$DATA_ROLLUPID\" saved=\"$DATA_SAVED\" liked=\"$DATA_LIKED\" followed=\"$DATA_FOLLOWED\" data-verb=\"$DATA_VERB\" data-objectType=\"$DATA_OBJECTTYPE\" data-id=\"$DATA_ID\" data-date=\"$DATA_DATE\">';\n\n\t\t\tpostObjectHtmlTemplate += '<ul class=\"ASWidgetPostUL\">' +\n\n\t\t\t\t(savedSettings.useDefaultStyle ? '' : insideActorHTML) +\n\t\t\t\t'<li class=\"normalPostEntryItemexpand\"><div class=\"postActionBox\"><i class=\"fa fa-angle-double-' + (X.L.isRTL ? 'left' : 'right') + '\" aria-hidden=\"true\"></i></div></li>';\n\n\n\t\t\teventDateHTML = '<div class=\"panel panel-default ASWidgetDatePanel\">' +\n\t\t\t\t'<div class=\"panel-body\">' +\n\t\t\t\t'<span>' +\n\t\t\t\t'<abbr data-toggle=\"ASWidget-Post-Date\" title=\"$CREATION_DATEFULL\" data-placement=\"left\" data-parseddatefull=\"$CREATION_DATEPARSEDFULL\">$EVENT_CREATEDDATE</abbr>' +\n\t\t\t\t'<span title=\"' + localizeString(\"ASWidget-event-from\", \"Event from $1\", nEventOf) + '\">$EVENT_ICON' + '</span>' +\n\t\t\t\t'</span>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</div>';\n\t\t\tpostObjectHtmlTemplate += '<li class=\"postObject\">' +\n\n\t\t\t\t'<ul class=\"postObject-inside\">' +\n\t\t\t\t'<ul class=\"postObject-inside-header\">' +\n\t\t\t\t(savedSettings.useDefaultStyle ? insideActorHTML : '') +\n\t\t\t\t'<li class=\"postObject-inside-eventTitle\">$EVENT_TITLE</li>' +\n\t\t\t\t'<li class=\"postObject-inside-time\">' +\n\t\t\t\t'<ul class=\"postObject-inside-time-ul\">' +\n\t\t\t\t'<li class=\"postObject-inside-date\">' + eventDateHTML + '</li>' +\n\t\t\t\t'</ul>' +\n\t\t\t\t'</li>' +\n\t\t\t\t'</ul>' +\n\t\t\t\t'</ul>';\n\n\t\t\tpostObjectHtmlTemplate +=\n\t\t\t\t'<ul class=\"postObject-inside-firstLevelContentAttribute\">' +\n\t\t\t\t'<li class=\"postObject-inside-firstLevelContentAttribute-eventContent\">$FIRSTLEVE_CONTENT_ATTRIBUTE</li>' +\n\t\t\t\t'</ul>' +\n\n\t\t\t\t(savedSettings.useDefaultStyle ? insideEmbedded$[0].outerHTML : '') +\n\n\t\t\t\t(savedSettings.useDefaultStyle ? insideMain$[0].outerHTML : '') +\n\n\t\t\t\t'</ul>' +\n\n\t\t\t\t(!savedSettings.useDefaultStyle ? insideEmbedded$[0].outerHTML : '') +\n\n\t\t\t\t(!savedSettings.useDefaultStyle ? insideMain$[0].outerHTML : '') +\n\n\t\t\t\t'</ul>' +\n\t\t\t\t'</div>' +\n\t\t\t\t'</li>';\n\n\t\t\t(function checkSpecialItemCases() {\n\t\t\t\tvar baseItm = itemToUseContent.originalFeed,\n\t\t\t\t\tobjectSum = (true === assertChain(baseItm, \"object.summary\")),\n\t\t\t\t\tobjectIsPerson = (\"person\" === baseItm.object.objectType),\n\t\t\t\t\ttargetIsPerson = (assertChain(baseItm, \"object.objectType\") && (\"person\" === baseItm.object.objectType)),\n\n\t\t\t\t\tallFourExisting = baseItm.actor && baseItm.object && baseItm.target && assertChain(baseItm, \"object.author\");\n\n\t\t\t\tif (allFourExisting && objectSum && (\"person\" !== baseItm.object.objectType) && (\"comment\" !== baseItm.object.objectType)) {\n\t\t\t\t\tnContent = baseItm.object.summary;\n\n\t\t\t\t\tif (objectIsPerson) {\n\t\t\t\t\t\tembeddedActor.id = baseItm.target.author.id;\n\t\t\t\t\t\tembeddedActor.vCard = generateVCard(baseItm.target.author.displayName, baseItm.target.author.id,\n\t\t\t\t\t\t\tgetspecifiedURL(baseItm.target.author.id, \"profile\"), getspecifiedURL(baseItm.target.author.id, \"picture\"), true, true, false);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tembeddedActor.id = baseItm.object.author.id;\n\t\t\t\t\t\tembeddedActor.vCard = generateVCard(baseItm.object.author.displayName, baseItm.object.author.id,\n\t\t\t\t\t\t\tgetspecifiedURL(baseItm.object.author.id, \"profile\"), getspecifiedURL(baseItm.object.author.id, \"picture\"), true, true, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\n\t\t\t\tif (allFourExisting && (\"comment\" === baseItm.object.objectType) && !targetIsPerson) {\n\t\t\t\t\tnContent = baseItm.target.summary || \"\";\n\t\t\t\t\tif (assertChain(baseItm, \"target.author\") && (baseItm.target.author.id !== baseItm.object.author.id)) {\n\t\t\t\t\t\tembeddedActor.id = baseItm.target.author.id;\n\t\t\t\t\t\tembeddedActor.vCard = generateVCard(baseItm.target.author.displayName, baseItm.target.author.id,\n\t\t\t\t\t\t\tgetspecifiedURL(baseItm.target.author.id, \"profile\"), getspecifiedURL(baseItm.target.author.id, \"picture\"), true, true, false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (assertChain(baseItm, \"actor.id\") && assertChain(baseItm, \"object.author.id\") && (baseItm.actor.id === baseItm.object.author.id) && !(assertChain(baseItm, \"target.author\"))) {\n\t\t\t\t\tembeddedActor.vCard = \"\";\n\t\t\t\t\tembeddedActor.id = 0;\n\t\t\t\t}\n\n\t\t\t\tif (assertChain(baseItm, \"actor.id\") && assertChain(baseItm, \"target.author.id\") && (baseItm.target.author.id === baseItm.actor.id)) {\n\t\t\t\t\tembeddedActor.vCard = \"\";\n\t\t\t\t\tembeddedActor.id = \"\";\n\t\t\t\t}\n\n\t\t\t\tif (\"todo\" === itemToUseContent.mainObject.Type) {\n\t\t\t\t\t//embeddedActor.vCard = \"\";\n\t\t\t\t\t//embeddedActor.id = 0;\n\t\t\t\t}\n\n\n\t\t\t\tif ((\"question\" === itemToUseContent.mainObject.Type) || (\"todo\" === itemToUseContent.mainObject.Type)) {\n\t\t\t\t\tif ((assertChain(itemToUseContent, \"mainObject.Actor.ProfileId\") && assertChain(itemToUseContent, \"mainObject.Author.ProfileId\") &&\n\t\t\t\t\t\titemToUseContent.mainObject.Actor.ProfileId === itemToUseContent.mainObject.Author.ProfileId) || ($(nContent).first().text().length <= 10)) {\n\t\t\t\t\t\tembeddedActor.vCard = \"\";\n\t\t\t\t\t\tembeddedActor.id = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\tif (nFirstLevelContentAttribute === nContent) {\n\t\t\t\t\tnFirstLevelContentAttribute = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t());\n\n\n\t\t\tpostObject = replaceIt(postObjectHtmlTemplate, \"$TAB_INDEX\", lastItemDataRefId.toString());\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_INDEX\", lastItemDataRefId.toString());\n\t\t\tlastItemDataRefId += 1;\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_TARGETURL\", nTargetUrl);\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_ROLLUPID\", nRollUpId);\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_SAVED\", nIsSaved.toString());\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_LIKED\", nIsLiked.toString());\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_FOLLOWED\", nIsFollowed.toString());\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_ID\", nDataId);\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_DATE\", nPublishingDate);\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_VERB\", nVerb);\n\t\t\tpostObject = replaceIt(postObject, \"$CREATION_DATEFULL\", nCreatedFullDate);\n\t\t\tpostObject = replaceIt(postObject, \"$CREATION_DATEPARSEDFULL\", nCreatedDateDisplay);\n\t\t\tpostObject = replaceIt(postObject, \"$EVENT_CREATEDDATE\", nCreatedDateDisplay);\n\n\t\t\tpostObject = replaceIt(postObject, \"$EMBEDDED_ACTOR\", embeddedActor.vCard);\n\t\t\tpostObject = replaceIt(postObject, \"$EMBEDDED_CONTENT\", embeddedContent);\n\t\t\tpostObject = replaceIt(postObject, \"$MAIN_ACTOR_VCARD\", mainActorVCard);\n\n\t\t\ttTitleToComp = startsWith(nTitle, \"<\", 0) ? $($(nTitle)[2]).text() : nTitle;\n\t\t\tCcontentToComp = $(\"<span/>\").append(nContent).text();\n\n\t\t\tif (tTitleToComp && CcontentToComp && (tTitleToComp === CcontentToComp)) {\n\t\t\t\tnContent = \"\";\n\t\t\t}\n\n\t\t\tpostObject = replaceIt(postObject, \"$EVENT_TITLE\", nTitle);\n\n\t\t\tpostObject = replaceIt(postObject, \"$FIRSTLEVE_CONTENT_ATTRIBUTE\", nFirstLevelContentAttribute);\n\n\t\t\tpostObject = replaceIt(postObject, \"$DATA_OBJECTTYPE\", nObjectType);\n\n\t\t\tif (nContent === \"[object Object]\") {\n\t\t\t\tnContent = \"\";\n\t\t\t}\n\t\t\tpostObject = replaceIt(postObject, \"$MAIN_CONTENT\", nContent);\n\n\t\t\ttoAdd = '<img src=\"' + itemToUseContent.mainObject.IconUrl + '\" alt=\"' + localizeString(\"ASWidget-event-from\", \"Event from $1\", nEventOf) + ' \">';\n\t\t\tif (!(itemToUseContent.mainObject.IconUrl && itemToUseContent.mainObject.IconUrl.length && (-1 === itemToUseContent.mainObject.IconUrl.indexOf(\"thumbnail\")))) {\n\t\t\t\ttoAdd = '<i class=\"fa fa-square\" aria-hidden=\"true\" alt=\"' + localizeString(\"ASWidget-event-from\", \"Event from $1\", nEventOf) + '\"></i>';\n\t\t\t}\n\t\t\tpostObject = replaceIt(postObject, \"$EVENT_ICON\", toAdd);\n\n\n\t\t\tif (assertChain(itemToUseContent, \"mainObject.attachmentsHTML\") && (itemToUseContent.mainObject.Attachments.length) && (itemToUseContent.mainObject.attachmentsHTML.length)) {\n\t\t\t\tpostObject = replaceIt(postObject, \"$EVENT_ATTACHMENTS\", itemToUseContent.mainObject.attachmentsHTML);\n\t\t\t}\n\n\t\t\tif (assertChain(itemToUseContent, \"targetObject.attachmentsHTML\") && (itemToUseContent.targetObject.Attachments.length) && (itemToUseContent.targetObject.attachmentsHTML.length)) {\n\t\t\t\tpostObject = replaceIt(postObject, \"$EVENT_ATTACHMENTS\", itemToUseContent.targetObject.attachmentsHTML);\n\t\t\t}\n\n\t\t\tif (-1 !== postObject.indexOf(\"$EVENT_ATTACHMENTS\")) {\n\t\t\t\tpostObject = replaceIt(postObject, \"$EVENT_ATTACHMENTS\", \"\");\n\t\t\t}\n\n\t\t\texpandedObject = {\n\t\t\t\toriginalDataObject: itemToUseContent.originalFeed,\n\t\t\t\tpregeneratedHTML: postObject,\n\t\t\t\tLiked: itemToUseContent.bools.IsLiked,\n\t\t\t\tGrabbedFeedObject: itemToUseContent\n\t\t\t};\n\t\t\tpostObject = modifyItem(expandedObject); // Add some needed HTML\n\t\t\tpostObject = createActionMenu({\n\t\t\t\toriginalDataObject: itemToUseContent.originalFeed,\n\t\t\t\tpregeneratedHTML: postObject,\n\t\t\t\tLiked: itemToUseContent.bools.IsLiked,\n\t\t\t\tGrabbedFeedObject: itemToUseContent\n\t\t\t});\n\n\n\t\t\t(function AddFinalHTMLAttribute() {\n\t\t\t\tvar ind = itemToUseContent.mainObject.ID || 0,\n\t\t\t\t\tobj = dataArray[ind];\n\t\t\t\tif (obj) {\n\t\t\t\t\tobj.finalHTML = '<ul class=\"ASWidgetLightBoxUL\">' + postObject + '</ul>';\n\t\t\t\t\tdataArray[ind] = obj;\n\t\t\t\t}\n\t\t\t}()); // Here the final HTML will be stored in an attribute. This is used later on to show content in the lightbox (fallback for the EE)\n\t\t\treturn postObject;\n\t\t}", "function itemBlockHtml(item, key){\n\titemBlock = '';\n\tlistType = 'list'; // default list\n\n\tif(!item){\n\t\tgetItemById(key);\n\t\titem = $.fn.itemDetail;\n\t\tlistType = 'detail'; // populate modal\n\t}\n\t\n\tif(listType == 'list'){\n\t\titemBlock += '<a class=\"item\" href=\"#itemDetail\" rel=\"leanModal\" id=\"itemDetailLink\" data-item=\"' + item.id + '\">';\n\t} else {\n\t\titemBlock += '<div class=\"itemDetail\">';\n\t}\n\t\n\tif(listType == 'list'){\n\t\titemBlock += \t'<img class=\"lazy\" data-original=\"covers/' + item.image + '\" src=\"images/loading.gif\" alt=\"' + item.title + '\" />';\n\t} else {\n\t\titemBlock += \t'<img src=\"covers/' + item.image + '\" alt=\"' + item.title + '\" />';\n\t}\n\t\n\titemBlock += \t'<div class=\"info\">';\n\titemBlock += \t\t'<div class=\"title\">' + item.title + '</div>';\n\t\n\tif(item.creator != ''){\n\t\tif(listType == 'list' && item.creator.length > 25){\n\t\t\titem.creator = item.creator.substring(0,25) + listType + '...';\n\t\t}\n\t\titemBlock += \t'<div class=\"creator\">' + item.creator + '</div>';\n\t}\n\t\n\tif(item.type != '' && listType != 'detail'){\n\t\titemBlock += \t'<div class=\"type\"><b>Type:</b><br />' + item.type + '</div>';\n\t}\n\t\n\t/* \n\t// descriptions don't really fit well\n\tif(listType == 'detail'){\n\t\titemBlock += \t\t'<div class=\"description\">' + item.description + '</div>';\n\t}\n\t*/\n\t\n\titemBlock += \t'</div>';\n\t\n\tif(listType == 'list'){\n\t\titemBlock += '</a>';\n\t} else {\n\t\titemBlock += '</div>';\n\t}\n\t\n\treturn itemBlock;\n}", "function createHTML(item) {\n return '<li class=\"item\" >\\n' +\n ' <img src=\"'+item.image+'\" alt=\"image\" class=\"itemPoint\" data-key=\"image\" data-value=\"'+item.image+'\">' +\n ' <span class=\"itemDetail\">'\n +item.gender+' / '+item.size+' / '+item.color+\n '</span>\\n' +\n ' </li>';\n}", "function displayItem(item) {\n // details will be details#error or details#warning\n const details = document.getElementById(item.type);\n const section = document.createElement('section');\n const h2 = document.createElement('h2');\n h2.innerHTML = item.title;\n section.appendChild(h2);\n const detailsDiv = document.createElement('div');\n detailsDiv.classList.add('details');\n detailsDiv.innerHTML = item.details;\n section.appendChild(detailsDiv);\n const learnMoreDiv = document.createElement('div');\n learnMoreDiv.classList.add('learn-more');\n learnMoreDiv.innerHTML = item.learnMore;\n section.appendChild(learnMoreDiv);\n details.appendChild(section);\n}", "function createMarkup() {\n if (episode.summary) {\n let newSummary = episode.summary; //Convert response for summary to Markup.\n let newLength = episode.summary.length;\n let regex = /[.,]/g;\n if (newLength > 100) {\n newSummary = newSummary.slice(3, newSummary.search(regex)).concat('...'); // WIll cut the string for summary if it's longer than 100 without removing the markup tag\n }\n return { __html: newSummary }; // (Dangerously) going to set html.\n }\n }", "render() {\n return html`\n <article>\n ${this.label}\n </article>`;\n }", "function parseFeed(feed) {\r\n var content = document.getElementById('_content');\r\n insertTemplate(content, 'news-items', feed.responseData.feed);\r\n}", "function displayDataOnHead(topNews){\n // console.log(topNews);\n\n topNews.articles.forEach(content => {\n const spanNode2 = document.createElement(\"li\"); // make fresh <li>\n spanNode2.innerHTML = // news contents\n `<a href=\"${content.url}\">\n <img src=\"${content.urlToImage}\" alt=\"news image\">\n <h2>${content.title}</h2></a>`;\n \n parentNode2.appendChild(spanNode2); // pushing to the <ul>\n });\n}", "function displayNews(responseJson){\r\n $('#results-list').empty();\r\n if (responseJson.data.length === 0){\r\n $('#js-news-error-message').text(`We can't find any news for this ticker!`);\r\n } else {\r\n \r\n $('#js-news-error-message').empty();\r\n //loop throur news articles and show the title and description\r\n // provide title as a hyperlink\r\n for (let i = 0; i < responseJson.data.length; i++){\r\n const currentItem = responseJson.data[i];\r\n \r\n $('#results-list').append(\r\n `<li>\r\n <h3><a href=\"${currentItem.news_url}\" target=\"_blank\">${currentItem.title}</a></h3>\r\n <img src=\"${currentItem.image_url}\">\r\n </li>\r\n `\r\n )\r\n }\r\n $('#results').removeClass('hidden');\r\n\r\n } \r\n}", "function news() {\n var api_key = \"b7864e77cbca46e68dae6627855def48\";\n var q = \"autism spectrum\";\n var date = \"1990-01-01\";\n var sort = \"relevancy\";\n var lang = \"en\";\n var page = \"8\";\n var queryURL = \"https://newsapi.org/v2/everything?q=\" + q + \"&from\" + date + \"&sortBy=\" + sort + \"&apiKey=\" + api_key + \"&language=\" + lang + \"&pagesize=\" + page;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n dataType: \"json\"\n }).then(function (response) {\n for (var i = 0; i < response.articles.length; i++) {\n // console.log(response.articles.length);\n var displaySourceTitle = response.articles[i].title;\n var displaySourceSite = response.articles[i].url\n var displayContent = response.articles[i].content\n //var displaySourceSiteImg = response.articles[i].urlToImage;\n\n var html = `\n <li>\n <div class=\"collapsible-header\"><i class=\"material-icons\">filter_drama</i>${displaySourceTitle}</div>\n <div class=\"collapsible-body\"><a href=\"${displaySourceSite}\">${displayContent}</a></div>\n </li>\n `\n $(\".collapsible\").append(html);\n };\n\n });\n}", "function projectHtmlFromJournal(key, journal){\n return'<div class=\"timeline-item\">'\n + '<p class=\"item-description\">'\n +journal.jentry\n\t \n +'</div>';\n}", "function displayNotesDetails(note){\n return `<p>title: ${note.title}</p><p style=\"display:block\">note: ${note.body}</p>`\n }", "function createHTMLString(item) {\r\n return `\r\n <li class=\"item\">\r\n <img src=\"${item.image}\" alt=\"${item.type}\" class=\"item__thumbnnail\">\r\n <span class=\"item__desctiption\">${item.gender}, ${item.size}</span>\r\n </li>\r\n `;\r\n}", "function generateStoryMarkup(story) {\n // console.debug(\"generateStoryMarkup\");\n let starStatus;\n if(currentUser){ \n const isStoryFavorite = User.checkIfFavorite(story)\n if (isStoryFavorite){\n starStatus = 'fas';\n } else if (!isStoryFavorite){\n starStatus = 'far';\n }\n const hostName = story.getHostName();\n return $(`\n <li id=\"${story.storyId}\">\n <i class=\"${starStatus} fa-star star-button\"></i>\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n } else {\n const hostName = story.getHostName();\n return $(`\n <li id=\"${story.storyId}\">\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n}}", "createHTML(){\n return '<li class=\"ListItem\">' + '<h2>' + this.name + '</h2>' + '<span class=\"venueType\" id=\"venueType1\">' + this.type + '</span>' + '</li>'\n }", "function myListTemplate(title) {\n return (\n `<li class=\"myPlaylist-item\">\n <a href=\"#\">\n <span>\n ${title}\n </span>\n </a>\n </li>`\n );\n }", "function getTemplate(id, title, cover){\n var template = '<li><div style=\"text-align: center\">'\n template += '<img src='+cover+' onclick=\"openLink('+id+')\" />'\n template += '<span class=\"title\">'+title+'</span>'\n template += '</div></li>'\n\n return template\n}", "function generateStoryMarkup(story) {\n // console.debug(\"generateStoryMarkup\", story);\n\n const hostName = story.getHostName();\n return $(`\n <li id=\"${story.storyId}\">\n <span id=\"favoriteStarOutline\"><i class=\"far fa-star\"></i></span>\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n \n </li>\n `);\n}", "printNews(newsObj) {\n if (newsObj.userId === activeUser.info().id){\n new comp.section({className: \"news\", id: `${newsObj.id}`},\n new comp.anchor({href: `${newsObj.url}`, target: \"_blank\"}, new comp.image({src: `${newsObj.articleImage}`, alt: \"Article Image\", height: \"120\"})),\n new comp.div({className: \"news-info\"},\n new comp.title(\"h2\", {}, `${newsObj.articleName}`),\n new comp.title(\"h4\", {}, `Saved by: ${newsObj.user.firstName} | Date Saved: ${formatDate.getCorrectDate(newsObj.dateSaved)}`),\n new comp.par({}, newsObj.about)),\n new comp.btn(\"Delete Article\")).render(\".display--news\")\n } else {\n new comp.section({className: \"news friendsNews\", id: `${newsObj.id}`},\n new comp.anchor({href: `${newsObj.url}`, target: \"_blank\"}, new comp.image({src: `${newsObj.articleImage}`, alt: \"Article Image\", height: \"120\"})),\n new comp.div({className: \"news-info\"},\n new comp.title(\"h2\", {}, `${newsObj.articleName}`),\n new comp.title(\"h4\", {}, `Saved by: ${newsObj.user.firstName} | Date Saved: ${formatDate.getCorrectDate(newsObj.dateSaved)}`),\n new comp.par({}, newsObj.about))).render(\".display--news\")\n\n }}", "function news() {\n\t// member varables\n\tthis.m_isCampusClosed = false;\n}", "function articleTemplateCard(article) {\n\n return `\n <div>\n\n <div class=\"card\">\n <div class=\"card-header\">\n ${article.what}\n </div>\n <div class=\"card-body\">\n ${article.text}\n </div>\n <div class=\"card-footer\">\n <small>\n <i class=\"icon-user\"></i>\n ${article.who}\n </small>\n <small>\n <i class=\"icon-home\"></i>\n ${article.virksomhet}\n </small>\n </div>\n\n </div>\n\n </div>\n\n `;\n\n}", "function populateArticle(html, article) {\n if (html.length > 1) {\n html = $(html[0]);\n }\n if (!article.seen) {\n html.find(\".breaking-news\").removeClass(\"hidden\");\n } else {\n html.find(\".breaking-news\").addClass(\"hidden\");\n }\n article.seen = true;\n html.find(\".network-icon\").attr(\"src\", article.network_image);\n html.find(\".network-icon\").attr(\"alt\", article.network_short);\n html.find(\".network-name\").text(article.network_full);\n html.find(\".title\").text(article.title);\n html.find(\".author\").text(\"By \" + article.author);\n html.find(\".image\").attr(\"src\", article.img_url);\n html.find(\".article-text\").text(article.article_body);\n}", "function generateStoryHTML(story) {\n let hostName = getHostName(story.url);\n let iconClass = \"far fa-star\";\n if (currentUser) {\n let favIds = currentUser.favorites.map((fav) => fav.storyId);\n if (favIds.includes(story.storyId)) {\n iconClass = \"fas fa-star\";\n }\n }\n // render story markup\n const storyMarkup = $(`\n <li id=\"${story.storyId}\">\n <i class=\"${iconClass}\"></i>\n <a class=\"article-link\" href=\"${story.url}\" target=\"a_blank\">\n <strong>${story.title}</strong>\n </a>\n <small class=\"article-author\">by ${story.author}</small>\n <small class=\"article-hostname ${hostName}\">(${hostName})</small>\n <small class=\"article-username\">posted by ${story.username}</small>\n </li>\n `);\n\n return storyMarkup;\n }", "function setInfoPage(feed)\n{\n var contentTemplate = \"\";\n var updated = dateFormat(new Date(feed.updated), \"dd/mm/yyyy, hh:MM:ss\");\n var created = dateFormat(new Date(feed.created), \"dd/mm/yyyy, hh:MM:ss\");\n\n contentTemplate = \"<li>Feed Id: <b>\" + feed.id + \"</b></li>\" +\n \"<li>Title: <b>\" + feed.title + \"</b></li>\" +\n \"<li>Status: <b>\" + feed.status + \"</b></li>\" +\n \"<li>Creator: <b>\" + feed.creator + \"</b></li>\" +\n \"<li>Created: <b>\" + created + \"</b></li>\" +\n \"<li>Updated: <b>\" + updated + \"</b></li>\" +\n \"<li>Tags: \" + showAlltags(feed.tags) + \"</li>\";\n $('#sensorInfo').html(contentTemplate);\n \n}", "function showDetailNews(posnews){\n\t//console.log(posnews);\n\tif(posnews==-1){\n\t}else{\n\tvar html='';\n\tif(lang==\"vi\"){\n\t\t$(\".class_newss\").html(\"Chi tiết Tin tức\");\n\thtml=html+'<div class=\"col-lg-12 md-12\"style=\"padding-top: 10px;\">'+\n\t\t\t\t'<div class=\"alert alert-dark\" role=\"alert\">'+\n\t\t\t\t\t'<h4 >'+resallnews[posnews].title_vi+'</h4>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'<div class=\"media\">'+\n\t\t\t\t\t\n\t\t\t\t\t\t'<div class=\"media-body\" align=\"justify\">'+resallnews[posnews].content_vi+'</div>'+\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t'</div>'+\n\t\t\t\t'<div class=\"col-lg-12 col-md-12\" style=\"padding-top: 10px;\">'+\n\t\t\t\t\t\t'<div class=\"alert alert-dark\" role=\"alert\">'+\n\t\t\t\t\t'<h4 class=\"relativenews\">Các tin tức liên quan</h4>'+\n\t\t\t\t\t\n\t\t\t\t'</div>'+\n\t\t\t\t'</div>'+\n\t\t\t'</div>';\n\t}else{\n\t\t$(\".class_newss\").html(\"Detail News\");\n\t\thtml=html+'<div class=\"col-lg-12 md-12\"style=\"padding-top: 10px;\">'+\n\t\t\t\t'<div class=\"alert alert-dark\" role=\"alert\">'+\n\t\t\t\t\t'<h4 >'+resallnews[posnews].title_en+'</h4>'+\n\t\t\t\t'</div>'+\n\t\t\t\t'<div class=\"media\">'+\n\t\t\t\t\t\n\t\t\t\t\t\t'<div class=\"media-body\" align=\"justify\">'+resallnews[posnews].content_en+'</div>'+\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t'</div>'+\n\t\t\t\t'<div class=\"col-lg-12 col-md-12\" style=\"padding-top: 10px;\">'+\n\t\t\t\t'<div class=\"alert alert-dark\" role=\"alert\">'+\n\t\t\t\t\t'<h4 class=\"relativenews\">Relative News</h4>'+\n\t\t\t\t\t\n\t\t\t\t'</div>'+\n\t\t\t\t'</div>'+\n\t\t\t'</div>';\n\t}\n $(\".addcontentnews\").html(html);\n\t}\n}", "function movie_item(title, poster_path, release_date, popularity, vote_average, vote_count) {\n return \"\" +\n \"<li class=\\\"movies__item\\\">\" +\n \" <a class=\\\"movies__link\\\" href=\\\"https://www.themoviedb.org/search?language=fr&query=\" + title + \"\\\" target='_blank'>\" +\n \" <div class=\\\"movies__infos\\\">\" +\n \" <div class=\\\"movies__release_date\\\">Sortie il y a \" + formatDistance(new Date(release_date), new Date(), {locale: fr}) + \"</div>\" +\n \" <div class=\\\"movies__popularity\\\">Popularité de <b>\" + popularity + \"</b></div>\" +\n \" <div class=\\\"movies__votes\\\">\" +\n \" <div class=\\\"movies__vote_average\\\">Moyenne de <b>\" + vote_average + \"</b></div>\" +\n \" <div class=\\\"movies__vote_count\\\">avec <b>\" + vote_count + \"</b> votes</div>\" +\n \" </div>\" +\n \" </div>\"\n + \"<figure class='movies__figure'>\" +\n \" <img src=\\\"http://image.tmdb.org/t/p/w500\" + poster_path + \"\\\"\" +\n \" alt=\\\"Elephant at sunset\\\"\" +\n \" class='movies__img'>\" +\n \" <figcaption class='movies__caption'>\" + title + \"</figcaption>\" +\n \" </figure>\"\n +\"</a>\"\n +\"</li>\";\n}", "function FeatureTitle({item}) {\n if(item && item.title) {\n return <h3 class=\"has-text-centered\">{item.title}</h3>\n } else {\n return null\n }\n}", "render() {\n return html`\n <lif-document .log=\"${this.log}\" path=\"/resources/${this.state}/article/${this.articleId}\" @data-changed=\"${e => {this.article = e.detail.value;}}\"></lif-document>\n <lif-document .log=\"${this.log}\" path=\"/locale/${this.state}/article/${this.articleId}/${this.language}\" @data-changed=\"${e => {this.localeArticle = e.detail.value;}}\"></lif-document>\n \n ${this.article && this.article.hero ? html `<img class=\"hero\" src=\"${this.article && this.article.hero.url}\" alt='${this.localeArticle && this.localeArticle.heroAlt}'>` : ''} \n <article class=\"main\">\n \n <nav>\n <bs-breadcrumb>\n <bs-breadcrumb-item title=\"Home\" href=\"/\"></bs-breadcrumb-item>\n <bs-breadcrumb-item title=\"All articles\" href=\"${window.location.href}/../../articles\" ></bs-breadcrumb-item>\n </bs-breadcrumb>\n </nav>\n\n ${this.localeArticle ?\n html `\n <h1 class=\"title\">${this.localeArticle.title}</h1>\n <h3 class=\"summary\">${parse(this.localeArticle.summary)}</h3>\n <pblog-article-author .articleId=\"${this.articleId}\"></pblog-article-author>\n <div class=\"content\">${parse(this.localeArticle.content)}</div>\n ` :\n html `<h3>Loading article ...</h3>`\n }\n </article>\n\n `;\n }", "function addNewsContainer(news, imgURL){\n\tn = $('<div\tclass=\"ne-news-container\">');\n\tn.data('title', news.headline);\n\tn.data('intro', news.intro);\n\tn.data('id', news.id);\n\tn.data('article', news.article);\n\tn.data('start', news.start_date);\n\tn.data('end', news.end_date);\n\tn.data('img-id', news.image_id);\n\tn.data('img-url', imgURL);\n\t$('#ne-list').prepend(n.append($('<div class=\"ne-container-title\">').text(news.headline)));\n\t$('#ne-list .ne-news-container').first().click();\n}", "static get tag() {\n return \"rss-items\";\n }", "function generateStoryMarkup(story) {\n // console.debug(\"generateStoryMarkup\", story);\n\n const hostName = story.getHostName();\n return $(`\n <li id=\"${story.storyId}\">\n <div class='deletefav' style =\"display: none\">\n <i class=\"fas fa-edit\"></i>\n <i class=\"fas fa-trash-alt\"></i>\n <i class=\"far fa-bookmark\"></i>\n </div>\n\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n}", "function generateStoryMarkup(story) {\n let trash=\"\";\n let starType=\"\";\n //assign class appropriately to User's own story, Favorite Story or regular story\n if(currentUser){\n if(currentUser.favorites.some(fav=>fav.storyId===story.storyId)){\n starType=\"fas fa-star\";\n }\n else{\n starType=\"far fa-star\";\n }\n\n if(currentUser.ownStories.some(fav=>fav.storyId===story.storyId)){\n trash=\"fas fa-trash\";\n }\n }\n const hostName = story.getHostName();\n return $(`\n <li id=\"${story.storyId}\">\n <i class=\"${trash}\" id=\"to-remove\"></i>\n <i class=\"${starType}\" id=\"to-fav\"></i>\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n}", "function generateStoryMarkup(story) {\n console.debug(\"generateStoryMarkup\", story);\n\n const hostName = story.getHostName();\n let starHTML = checkFavorites(story);\n console.log(\"generateStoryMarkup starHTML\", starHTML)\n return $(`\n <li data-story-id=\"${story.storyId}\">\n ${starHTML}\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n}", "function queryNews(name) {\n $.ajax({\n url:'https://gnews.io/api/v4/top-headlines?token=41781c49fe723df3a38e0aaa430ef5db' + name ,\n mwthod: 'GET'\n }).then(function(response) {\n $('#news-header').text(\"Here is\" + response.totalArticles + 'news related to ' + name);\n\n if(response.totalArticles > 0) {\n ///Loop through all the articles that are given\n for(let i = 0; i < response.totalArticles; i++) {\n //populoate the news results using semantic UI\n let newItem = $('<div class= \"item\">');\n let itemImage = $('div class= \"image\">');\n $(itemImage).append('<img src=\"' + response.totalArticles[i].urlToImage + '\">');\n newItem.append(itemImage);\n\n let itemContent = $('<div class=\"content\">');\n let itemHeader = $('<div class=\"header\">').text(response.totalArticles[i].title);\n itemContent.append(itemHeader);\n\n let description = $('<div class=\"description\"');\n $(description).appned($('<p>').text('Published by ' + response.totalArticles[i].source.name + ' at ' + response.totalArticles[i].publishedAt));\n $(description).appedn($('<p>').text(response.articles[i].description))\n itemContent.append(description);\n }\n }\n })\n}", "function condenseNews(news) {\n return {\n title: news.title,\n abstract: news.abstract,\n image: _.get(_.last(news.multimedia), 'url', null)\n };\n}", "function getStoryHTML(story) {\r\n return '<p class=\"story-text\">' + story.text + \"</p>\";\r\n }", "function movieItemTemplate(movie, category) {\n return `<div class=\"primaryPlaylistItem\" data-id=\"${movie.id}\" data-category=\"${category}\">\n <div class=\"primaryPlaylistItem-image\">\n <img src=\"${movie.medium_cover_image}\">\n </div>\n <h4 class=\"primaryPlaylistItem-title\">\n ${movie.title}\n </h4>\n <div class=\"primaryPlaylistItem-subtitle\">\n <div class=\"primaryPlaylistItem-subtitle-year\">\n ${movie.year}\n </div> \n <div class=\"primaryPlaylistItem-subtitle-rating\">\n ⭐${movie.rating}\n </div> \n </div>\n </div>`;\n }", "function generateStoryMarkup(story) {\n let hiddenToggle = \"hidden\";\n let starToggle;\n \n if (currentUser) {\n starToggle = checkFavorite(story) ? \"fas\" : \"far\"\n hiddenToggle = \"\";\n }\n \n const hostName = story.getHostName();\n // always star, but hidden if user doesn't exist\n return $(`\n <li id=\"${story.storyId}\">\n <span class=\"trash hidden\"><i class=\"fas fa-trash-alt\"></i></span>\n <span class=\"star ${hiddenToggle}\"><i class=\"fa-star ${starToggle}\"></i></span>\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n}", "create($parent) {\n $(`<article id=${this.idDOM} class=\"article-small\">\n <div class=\"article-small-article\">\n <h6 class=\"article-small-category\">${this.config['category']}</h6>\n <h5 class=\"article-small-title\">${this.config['title']}</h5>\n <h6 class=\"article-small-author\">By ${this.config['author']}</h6>\n </div>\n <div class=\"article-small-noise-count\">🎺 ${this.config['noise']}</div>\n </article>`).appendTo($parent);\n }", "function renderArticle(articleData) {\n return `\n <article data-articleid=\"${articleData.id}\">\n <h1>${articleData.title}</h1>\n <img src=\"${articleData.imageUrl}\" alt=\"${articleData.title} image\" />\n <p>${articleData.intro}</p>\n </article>\n `;\n}", "function projectHtmlFromObject(key, project){\n return '<div class=\"item\">'\n +' <div class=\"blog-card\">'\n + '<div class=\"media-block\">'\n + ' <a href=\"blog/blog-post.html?pagekey='+project.id+'\">'\n + ' <img class=\"post-image img-responsive\" src=\"'+project.blogimg+'\" alt=\"blog-post\" />'\n + '<div class=\"mask\"></div>'\n + '<div class=\"post-date\"><span class=\"month\">'+project.date+'</span></div>'\n +'</a>'\n +'</div>'\n +'<div class=\"post-info\">'\n + ' <ul class=\"category'\n + ' <li><a href=\"#\">'+project.subject+'</a></li>'\n + '</ul>'\n + '<a href=\"blog/blog-post.html?pagekey='+project.id+'\"><h4 class=\"blog-item-title\">'+project.title+'</h4></a>'\n +'</div>'\n +'</div>'\n +'</div>'\n \n}", "displayArticle(selector) {\r\n\t\tthis.updateTemplate();\r\n\t\t$(selector).append(this._template);\r\n\t}", "function displayMainNews(){\r\n\r\n let theImg = document.getElementById('jumboImgUrl');\r\n let theTitle = document.getElementById('jumboTitle');\r\n let theDescription = document.getElementById('jumboDescription');\r\n\r\n for(let i = 0; i < newsArr.length; i ++){\r\n currentNews = newsArr[i];\r\n }\r\n theImg.src = currentNews.image;\r\n theTitle.innerHTML = currentNews.title;\r\n theDescription.innerText = currentNews.description;\r\n\r\n}", "function displayDataOnInfo(newsSource){\nnewsSource.articles.forEach(content => {\n const spanNode3 = document.createElement(\"li\");\n spanNode3.attribute \n \n\n\n parentNode3.appendChild(spanNode3); \n\n});\n}", "function displayProduct(item){\r\n if(item.id == 1\r\n || item.id == 2 \r\n || item.id == 3\r\n || item.id == 4\r\n || item.id == 5\r\n || item.id == 6){\r\n return `\r\n <div class = \"product\">\r\n <img src = ${item.img_url}></img>\r\n \r\n <div class = product-top>\r\n <h4>${item.title}</h4>\r\n <h6>$${item.price}</h6>\r\n </div>\r\n\r\n <p>${item.text}</p>\r\n\r\n <div class = product-bottom>\r\n <h6>Rating: ${item.rating} out of 5</h6>\r\n <a href = \"#\"><span>Reviews (${item.reviews})</span></a>\r\n </div>\r\n </div>\r\n `\r\n }\r\n}", "function News(props) {\n return (\n <Container>\n <h2>News</h2>\n </Container>\n );\n}", "render(){\r\n var item = document.createElement('li')\r\n var a = document.createElement('a')\r\n a.href = this.url\r\n a.innerText = this.text\r\n item.appendChild(a)\r\n // realizati aici structura HTML:\r\n /**\r\n * <li>\r\n * <a href=\"url\">text</a>\r\n * </li>\r\n */\r\n return item;\r\n }", "showHTML() { \n return `\n <div class='showRecipes'>\n <div>\n <h3>${this.recipeTitle}</h3> \n </div> \n <div>\n ${'Time: ' + this.recipeTime}\n </div>\n <div>\n ${this.recipeIngredients}\n </div>\n <div>\n ${this.recipeAllergies}</li>\n </div>\n </div>`\n }", "function showArticle(i) {\n\n currentArticle = i;\n var article = articles[i];\n\n if (article) {\n $('.article .title h1 a').html(article.title);\n $('.article .title h1 a').attr('href', article.alternate[0].href);\n $('.article .title h2 a').attr('href', article.origin.htmlUrl);\n\n // Show human date\n var date = new Date(0);\n date.setUTCSeconds(article.published);\n $('.article .title h2 .date').html(humaneDate(date));\n\n var faviconURL = article.origin.htmlUrl.replace(\"http://\", \"\");\n\n if (faviconURL !== lastFaviconURL) {\n $('.article .title h2 a').css(\"background\", 'url(http://getfavicon.org/?url='+encodeURIComponent(faviconURL)+') 0 0 no-repeat');\n lastFaviconURL = faviconURL;\n }\n\n $('.article .title h2 a').html(article.origin.title);\n $('.article .content').text(\"\");\n\n if (article.content) {\n $('.article .content').append(article.content.content);\n } else if (article.summary) {\n $('.article .content').append('<p>'+article.summary.content+'</p><p><a href=\"'+article.alternate[0].href+'\">Read more</a></p>');\n }\n cleanArticle();\n }\n}", "function displayNotes(note){\n return `<p>title: ${note.title}</p><p style=\"display:none\">note: ${note.body}</p>`\n }", "function videoItemTemmplate (movie, category) {\n return (\n `<div class=\"primaryPlaylistItem\" data-id=\"${movie.id}\" data-category=\"${category}\">\n <div class=\"primaryPlaylistItem-image\">\n <img src=\"${movie.medium_cover_image}\">\n </div>\n <h4 class=\"primaryPlaylistItem-title\">\n ${movie.title}\n </h4>\n </div>`\n )\n }", "function format(mail) {\n\t\t\treturn \"<a href='\"+mail.permalink+\"'><img src='\" + mail.image + \"' /><span class='title'>\" + mail.title +\"</span></a>\";\t\t\t\n\t\t}", "function buildItem (post, ul) {\n var data = postInfo(post);\n var header = headerItem(data);\n var content = contentRow(data);\n var itemFrag = document.createRange().createContextualFragment(\n '<li class=\"activity-type-discussion rda-entry\">' +\n header +\n '<table class=\"wallfeed\">' +\n '<tbody>' +\n content +\n '</tbody>' +\n '</table>' +\n '</li>'\n );\n var li = itemFrag.firstChild;\n var tbody = li.getElementsByTagName('tbody')[0];\n // Functions that will add extra rows if needed\n imageRow(data.image, tbody);\n openGraphRow(data.openGraph, tbody);\n statusRow(data, tbody);\n // Appends the element to the list\n ul.appendChild(itemFrag);\n }", "_generateListPreviewMarkup(data) {\n return `<div class=\"list-element\" data-listID=\"${data.id}\">\n <div class=\"colour-line\" ></div>\n <h2>${data.listTitle} </h2>\n </div>`;\n }", "async updateNews() {\n //fetch json\n const link =\n newsApiUrl +\n \"?q=bitcoin&from=\" +\n new Date(Date.now() - 12096e5).toISOString() +\n \"&sortBy=publishedAt&apiKey=\" +\n newsApiKey;\n let response = await fetch(link);\n var articles = await response.json();\n articles = articles.articles;\n\n //set up html and add it to DOM\n var newsContainer = document.getElementById(\"newsContainer\");\n newsContainer.innerHTML = \"<strong>News</strong><br />\";\n for (var i = 0; i < articles.length; i++) {\n newsContainer.innerHTML += this.articleMaker(\n articles[i].title,\n articles[i].urlToImage,\n articles[i].author,\n articles[i].publishedAt,\n articles[i].description,\n articles[i].url\n );\n if (i == 4) {\n break;\n }\n }\n }", "function generateStoryHTML(story, isFav) {\n let hostName = getHostName(story.url);\n let iconClass = \"far\";\n if (isFav){iconClass = \"fas\"}\n // render story markup\n const storyMarkup = $(`\n <li id=\"${story.storyId}\">\n <span class=\"star\">\n <i class=\"${iconClass} fa-star\"></i>\n </span>\n <a class=\"article-link\" href=\"${story.url}\" target=\"a_blank\">\n <strong>${story.title}</strong>\n </a>\n <small class=\"article-author\">by ${story.author}</small>\n <small class=\"article-hostname ${hostName}\">(${hostName})</small>\n <small class=\"article-username\">posted by ${story.username}</small>\n </li>\n `);\n\n return storyMarkup;\n }", "function NewsDirective() {\n return {\n restrict: 'E',\n replace: true,\n templateUrl: 'js/directives/news.dir.html',\n scope: {\n id: '=',\n title: '=',\n subtext: '=',\n date: '=',\n thumbnail: '=',\n url: '='\n },\n link: function(scope, element, attrs) {\n var subText = angular.element(element.find('p')[0]);\n subText.html(scope.subtext); // Find and convert trail text to html (Text comes with tags)\n }\n };\n}", "function createMarkUp() {\n\t\t\treturn { __html: a.content }\n\t\t}", "function generateStoryHTML(story, flag) {\n let hostName = getHostName(story.url),\n color = '',\n edit = '',\n dlt = '',\n star ='';\n if(currentUser){\n /// TODO ///\n if(setStories(currentUser.favorites).has(story.storyId)){\n color='text-warning';\n }\n star = `fas fa-star ${color}`;\n if(setStories(currentUser.ownStories).has(story.storyId) || flag){\n edit = '<i class=\"fas fa-pencil-alt d-inline\"></i>';\n dlt = '<i class=\"far fa-trash-alt d-inline pr-2\"></i>';\n }\n }\n // render story markup\n const storyMarkup = $(`\n <li id=\"${story.storyId}\">\n <i class=\"${star}\"></i>\n <a class=\"article-link\" href=\"${story.url}\" target=\"a_blank\">\n <strong>${story.title}</strong>\n </a>\n <small class=\"article-author\">by ${story.author}</small>\n <small class=\"article-hostname ${hostName}\">(${hostName})</small>\n <a class=\"remove text-dark trash-can\">${dlt}</a>\n <a class=\"edit text-dark\">${edit}</a>\n <small class=\"article-username\">posted by ${story.username}</small>\n </li>\n `);\n\n return storyMarkup;\n }", "function item_html(role){\n var html = '';\n return html;\n }", "function displayItem(item) {\n let { id, image, title, status, relaseDate, rating, desc } = item;\n image = (image) ? image : \"https://picsum.photos/350/550/\";\n\n let output = `<div class=\"item\" data-series=\"${id}\">`;\n output += `<div class=\"item__image\"><img src=\"${image}\" role=\"presentation\" /></div>`;\n output += `<div class=\"item__status ${(status == 'Running') ? 'item__status--is-active' : ''}\"><span>${status}</span></div>`;\n output += `<div class=\"item__rating\"><span>${rating}</span></div>`;\n output += `<div class=\"item__title\"><h2>${title}</h2></div>`;\n output += `<div class=\"item__desc\"><p>${getDescription(desc)}</p></div>`;\n output += `<div class=\"item__relase\"><span>${getYear(relaseDate)}</span></div>`;\n output += '</div>';\n seriesContainer.innerHTML += output;\n}", "getHtmlItem(media) {\n\t\tlet htmlToInsert = \"\"\n\t\thtmlToInsert += `\n\t\t\t<section class=\"blockList\">\n\t\t\t\t<div class=\" light-shadow relative parent-hover columnItem `\n\t\t//si c'esst pour une selection on affiche aussi le tooltip et la classe\n\t\thtmlToInsert += this.onlyForPickUp ? \"pickUpImageToUglyForm tooltipped\\\" data-position=\\\"bottom\\\" data-delay=\\\"350\\\" data-tooltip=\\\"Choisir cette image\\\"\" : \"\"\n\t\thtmlToInsert += `\"\n\t\t\t\t style=\"background-color: rgb(255,255,255) !important;\">\n\t\t\t\t\t<i class=\"absolute white-text\" style=\"margin:20px 0 0 10px; font-size: small\">` + media.size + `</i>\n\t\t\t\t\t<img class=\"responsive-img\" src=\"` + media.url + `\" alt=\"` + media.label + `\">\n\t\t\t\t\t<a href=\"#!\" id=\"admin/edit/delete-media?id=` + media.id + `&CSRFToken=`+CSRFToken+`\" class=\"children-hover btn-floating waves-effect waves-light lightButton absolute tooltipped removeMediaFromLibrary\" data-position=\"top\"\n\t\t\t\t\t\t\t\t data-delay=\"350\" data-tooltip=\"Supprimer l'image de votre bibliothèque\" \n\t\t\t\t\t\t\t\t style=\"top: 10px ; right: 10px\">\n\t\t\t\t\t\t<i class=\"material-icons \" >clear</i>\n\t\t\t\t\t</a>\n\t\t\t\t\t<div class=\"absolute children-hover\" style=\"bottom: 0; width: 100%; background-color: rgba(0,0,0,0.52)\">\n\t\t\t\t\t\t<form method=\"post\" action=\"admin/edit/edit-media-info\" class=\"editMediaInfo\" style=\"margin: 0 10px 0 10px !important;\">\n\t\t\t\t\t\t<input type=\"text\" name=\"id\" value=\"` + media.id + `\" class=\"displaynone\">\n\t\t\t\t\t\t<input type=\"text\" class=\"displaynone\" name=\"CSRFToken\" value=\"`+CSRFToken+`\">\n\t\t\t\t\t\t\t<input name=\"label\" type=\"text\" `\n\t\t//form de la valeur \"alt\"\n\t\thtmlToInsert += media.label ? 'value=\"' + media.label + '\"' : \"\";\n\t\thtmlToInsert += ` placeholder=\"Donner un titre a votre image\" class=\"tooltipped white-text\" data-position=\"bottom\"\n\t\t\t\t\t\tdata-delay=\"350\" data-tooltip=\"Editer le nom de votre image, utile pour l'accessibilité de votre site et son référencent\" style=\"width: 100%; margin-bottom: 10px!important; \">\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t<button class=\" btn-floating waves-effect waves-light lightButton absolute tooltipped\" data-position=\"top\"\n\t\t\t\t\t\t\t\t\t data-delay=\"350\" data-tooltip=\"Editer\" \n\t\t\t\t\t\t\t\t\t style=\"top: -10px ; right: 10px\">\n\t\t\t\t\t\t\t\t<i class=\"material-icons \" >edit</i>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</section>`\n\t\t//et on renvoie le template\n\t\treturn htmlToInsert\n\t}", "function replaceNewsfeedArticle(el, data) {\n var imageLink = el.querySelector('.image-link'),\n headline = el.querySelector('.headline'),\n headlineLink = el.querySelector('.headline-link'),\n readMore = el.querySelector('.read-more'),\n byAuthors = el.querySelector('.by-authors'),\n time = el.querySelector('time'),\n rubric = el.querySelector('.rubric'),\n playImage = document.createElement('img'),\n teaser = el.querySelector('.teaser');\n el.classList.remove('img-small');\n el.classList.add('img-large');\n imageLink.style.backgroundImage = 'url(' + data.imgUrl + ')';\n imageLink.href = data.articleUrl;\n imageLink.setAttribute('target', '_blank');\n headline.innerHTML = data.articleHeadline;\n headlineLink.href = data.articleUrl;\n headlineLink.setAttribute('target', '_blank');\n readMore.href = data.articleUrl;\n readMore.setAttribute('target', '_blank');\n readMore.innerHTML = 'Watch Video';\n playImage.src = 'https://pixel.nymag.com/imgs/daily/other/2016/11/guinness/play.png';\n imageLink.appendChild(playImage);\n teaser.innerHTML = \"We teamed up with game show contestant extraordinaire Ken Jennings and Guinness to experiment with liquid nitrogen. Why? Well, because science is awesome, and GUINNESS STOUT just so happens to be brewed with nitrogen gas.<br/><br/>In this episode, watch Ken make ice cream with GUINNESS STOUT and liquid nitrogen, because if anything's better than ice cream, it’s ice cream in the name of science.\";\n byAuthors.style.display = 'none';\n time.style.display = 'none';\n\n if (rubric) {\n rubric.style.display = 'none';\n }\n } // modify top stories according to takeover", "function projectHtmlFromWorkshop(key, workshop){\n return'<div class=\"timeline-item\">'\n + '<p class=\"item-description\">'\n +workshop.wentry + '</p>'\n +'</div>';\n}", "function displayEntry(idx) { \n var entry = \"<div class=\\\"todo_title\\\">\" + this.title + \"</div>\\n\"\n + \"<div class=\\\"todo_date\\\">\" + this.date + \"</div>\\n\";\n // TODO: display category\n \n var content = \"<div class=\\\"todo_content\\\">\" + this.content + \"</div>\\n\";\n // TODO: display the different elements in the content list as unordered list.\n\n return entry + content;\n}", "render() {\n const singleStory =\n this.state.isLoading || !this.state.storyData ? (\n \"Fetching story...\"\n ) : (\n <div className=\"post-block\">\n <a href={this.state.storyData.url} className=\"link\">\n <h4>{this.state.storyData.title}</h4>\n </a>\n <p className=\"text-gray\">\n by {this.state.storyData.by} {this.state.storyData.time} | hide |\n comments\n </p>\n </div>\n );\n return singleStory;\n }", "function activityDetails(memberInfo) {\n let htmlContent = '<div class=\"post container\">';\n\n htmlContent += '<div class=\"container\">';\n\n htmlContent += '<div>';\n htmlContent += '<img src=\"images/' +\n memberInfo.imageFile +\n '\" alt=\"' +\n memberInfo.memberName +\n '\">';\n htmlContent += '</div>';\n\n htmlContent += '<div>';\n htmlContent += '<p>' +\n memberInfo.recentActivity +\n '</p>';\n htmlContent += '<p>' +\n memberInfo.activityTime +\n '</p>';\n htmlContent += '</div>';\n\n htmlContent += '</div>';\n\n htmlContent += '<div>';\n\n htmlContent += '<p class=\"link\">&gt;</p>';\n htmlContent += '</div>';\n\n htmlContent += '</div>';\n\n htmlContent += '</div>';\n\n return htmlContent;\n}", "function renderOnePost(todoItems) {\n // const sortedData = todoItems.sortby(['id'])\n const mainContainer = document.querySelector('.js-to-hide');\n mainContainer.style.display = \"none\";\n\n\n const postContainer = document.querySelector('.js-one-post');\n postContainer.style.display = \"block\";\n\n postContainer.innerHTML = '';\n // const todoItemsReverse = todoItems.reverse();\n // for (const todoItem of sortedData) {\n for (const todoItem of todoItems) {\n // const div = document.createElement('div');\n postContainer.innerHTML = `\n <a href=\"../index.html\">Back to home</a>\n\n <header>\n <h2>${todoItem.data.title}</h2>\n <p>${todoItem.data.todo}</p>\n </header>\n <section>\n <hr />\n <header>\n <p>${todoItem.data.when}</p>\n </header>\n </section>\n `;\n // container.appendChild(div);\n };\n }", "_generateListTitleMarkup(data) {\n return `\n <div class=\"form hidden\">\n <form class=\"change-list-title-form\">\n <input class=\"input-list-title\" required type=\"text\" maxlength=\"20\" placeholder=\"(max 20 characters)\" name=\"list-title\" >\n <input class=\"input-list-title-btn\" type=\"submit\" value=\"Done\">\n </form>\n </div>\n \n <div class=\"no-form \">\n <h1 class=\"unique-heading\">${data.listTitle}</h1>\n <button class=\"edit-title-btn\">\n <ion-icon name=\"create-outline\"></ion-icon>\n </button>\n </div>\n `;\n }", "First() {\n const url = this.hrefToken ? 'href=\"' + this.hrefToken.replace(\"{PAGE}\", 1) + '\"' : \"\";\n const value = this.showValue ? 'value=\"' + 1 + '\"' : \"\";\n const hoverElement = this.hover\n ? \"<span class='tooltip top'>\" + this.hover.replace(\"{PAGE}\", 1) + \"</span>\" : \"\";\n this.code += '<li data-first ' + this.itemClassName + '><' + this.tagName + ' ' + this.submitFromAttributes + ' ' + url + ' ' + value + ' ' + this.attribute + ' data-value=1>1</' + this.tagName + '>' + hoverElement + '</li><i>...</i>';\n }", "function generateStoryMarkup(story, showDelBtn = false) {\n // console.debug(\"generateStoryMarkup\", story);\n\n const hostName = story.getHostName();\n\n // show star when a user is logged in\n const showStar = Boolean(currentUser);\n\n return $(`\n <li id=\"${story.storyId}\">\n ${showDelBtn ? makeDelBtn() : \"\"}\n ${showStar ? makeStar(story, currentUser) : \"\"}\n <a href=\"${story.url}\" target=\"a_blank\" class=\"story-link\">\n ${story.title}\n </a>\n <small class=\"story-hostname\">(${hostName})</small>\n <small class=\"story-author\">by ${story.author}</small>\n <small class=\"story-user\">posted by ${story.username}</small>\n </li>\n `);\n}" ]
[ "0.6701376", "0.6414517", "0.6276932", "0.6184199", "0.615131", "0.61452675", "0.6124586", "0.6119642", "0.60793144", "0.5966407", "0.5944778", "0.5904068", "0.58890134", "0.588806", "0.58861256", "0.5882913", "0.58765125", "0.58367985", "0.58307964", "0.5804032", "0.5778944", "0.57733905", "0.5768668", "0.575294", "0.5746941", "0.574008", "0.57172865", "0.57129186", "0.56867987", "0.5659327", "0.565642", "0.5641724", "0.56382465", "0.561508", "0.56145746", "0.5604269", "0.5601359", "0.5585104", "0.5581268", "0.557165", "0.55686706", "0.5559247", "0.55553544", "0.5551256", "0.5547503", "0.55405736", "0.5540246", "0.5540203", "0.5533785", "0.55299896", "0.5529635", "0.5524896", "0.5518836", "0.55163026", "0.5509948", "0.5509496", "0.5507747", "0.5506574", "0.5495573", "0.5493044", "0.54894686", "0.54860955", "0.5479831", "0.5467118", "0.5459951", "0.5459206", "0.54462117", "0.5442613", "0.54372525", "0.5436432", "0.54237723", "0.5422189", "0.5418106", "0.5416254", "0.54084086", "0.53983223", "0.5397196", "0.53894925", "0.53890514", "0.53886133", "0.53872794", "0.5386994", "0.53868985", "0.53791875", "0.53754956", "0.536498", "0.5358352", "0.5356156", "0.5353991", "0.5345291", "0.534176", "0.5338681", "0.53359467", "0.5334499", "0.53276825", "0.5323292", "0.530578", "0.530253", "0.5296235", "0.5293247" ]
0.7270428
0